inherit
190024
0
Nov 6, 2015 21:17:35 GMT -8
Ace Of Charts
136
February 2013
aceofcharts
|
Post by Ace Of Charts on Feb 21, 2014 15:24:23 GMT -8
I've checked the variable list in the layout template for the Post List, and though there are quite a number of variables, the list appears to be missing any kind of variable combination for "post was made by the current user." I'd like to be able to use if-else statements for some stuff that would regard whether the current user made a particular post or not, and the seeming absence of such a variable takes away from my ability to do so. If there's already some way to do this, could someone in the know tell me how it can be done? I suppose that if it's not the case, either there's a reason it's not in there, or it can be requested as a feature.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,986
December 2005
horace
Wormo's Mini-Profile
|
Post by Chris on Feb 21, 2014 15:58:47 GMT -8
I would think comparing $[current_user.id] against $[post.created_by.id] would tell you if the post currently being processed was created by the current user.
|
|
inherit
190024
0
Nov 6, 2015 21:17:35 GMT -8
Ace Of Charts
136
February 2013
aceofcharts
|
Post by Ace Of Charts on Feb 21, 2014 16:30:02 GMT -8
An {if $[current_user.id] = $[post.created_by.id]} statement does not seem to work. Have I done something wrong in that statement?
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,986
December 2005
horace
Wormo's Mini-Profile
|
Post by Chris on Feb 21, 2014 16:43:13 GMT -8
An {if $[current_user.id] = $[post.created_by.id]} statement does not seem to work. Have I done something wrong in that statement? equality testing is done using a double equal sign ("==")
|
|
inherit
190024
0
Nov 6, 2015 21:17:35 GMT -8
Ace Of Charts
136
February 2013
aceofcharts
|
Post by Ace Of Charts on Feb 21, 2014 16:52:26 GMT -8
Ah, did not know that. XD Thanks for the heads-up. Hopefully now I won't get it wrong.
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,986
December 2005
horace
Wormo's Mini-Profile
|
Post by Chris on Feb 21, 2014 17:21:11 GMT -8
Ah, did not know that. XD Thanks for the heads-up. Hopefully now I won't get it wrong. There's a wizard-like if/else button you can click that will guide you through making that if/else statement if not too well versed in the language.
|
|
inherit
190024
0
Nov 6, 2015 21:17:35 GMT -8
Ace Of Charts
136
February 2013
aceofcharts
|
Post by Ace Of Charts on Feb 22, 2014 10:38:03 GMT -8
Naw, I understood perfectly when you said what you did.
I remembered that several elements use if-not statements that use !=, and from what you said, figured that == was equivalent to "is exactly equal to" in that regard.
By the way, naturally, once I got it right, it worked. Thanks!
|
|