Events Made Easy › Forums › Bug fixed or feature request implemented › Private Locations
- This topic has 8 replies, 2 voices, and was last updated 13 years, 10 months ago by Franky.
-
AuthorPosts
-
Wed 12 Jan 2011 at 16:09 #42403AnonymousInactive
In lieu of an entire event being private vs. public, I have a feature request for private locations. So the event can be public, but you must be logged in to see the location data for the event. Since the location data is a separate data set, this doesn’t appear too difficult to implement; however, I could be wrong.
Tue 18 Jan 2011 at 14:03 #46151FrankyKeymasterUsing conditional tags in the next version, this can be achieved. See for examples here on the way it works:
http://www.e-dynamics.be/bbpress/topic.php?id=416
Also, I implemented WP filters on the locations info (for a single location and for the list of locations) so it’s all possible now 🙂
Tue 18 Jan 2011 at 22:14 #46152AnonymousInactiveI’ve been trying to get this to work for quite some time today with minimal luck. So I have a category labeled “Login to see address” -> this will hide the location unless logged in.
[events_if tag='#ESC_CATEGORIES' value='Login to see address' && tag='#_IS_LOGGED_IN' value='0'] #_CATEGORIES [/events_if]
This next line will display the location for any categorized or uncategorized event as long as the user is logged in. This works well.
[events_if tag='#_IS_LOGGED_IN' value='1']
- #_LOCATION
- #_ADDRESS
- #_TOWN
[/events_if]
I’m having trouble writing a condition that will display the location to all other events (categorized or uncategorized) if the user is not logged in.
Tue 18 Jan 2011 at 22:41 #46153FrankyKeymasterThis you call minimal luck? It seems to me the conditional tags do what they’re supposed to do …
You do realize that you can override any *event* format also per event?
Tue 18 Jan 2011 at 23:06 #46154AnonymousInactive“minimal luck” was certainly an understatement. We have some less technical people that will be adding events. Trying to make it simple for them and complicated for me. Is there a was I can write a “NOT EQUAL” if condition.
…tag=’#ESC_CATEGORIES’ value != ‘Login to see address’ …
OR
…tag=’#ESC_CATEGORIES’ value <> ‘Login to see address’ …
Thanks for your hard work.
Wed 19 Jan 2011 at 01:21 #46155AnonymousInactiveThis is what I have come up with so far:
[events_if tag='#ESC_CATEGORIES' value='Login to see address' && tag='#_IS_LOGGED_IN' value='0'] #_CATEGORIES [/events_if]
[events_if tag='#_IS_LOGGED_IN' value='0' && (!(tag='#ESC_CATEGORIES' value='Login to see address'))]
- #_LOCATION
- #_ADDRESS
- #_TOWN
[/events_if]
[events_if tag='#_IS_LOGGED_IN' value='1' && (!(tag='#ESC_CATEGORIES' value='Login to see address'))]
- #_LOCATION
- #_ADDRESS
- #_TOWN
[/events_if]
No matter what I have the #ESC_CATEGORIES value equal, the conditional statements will always display the address if the user is logged in. Also, if the user is logged out, only the “Login to see address” categories will display the address. This is pretty much the opposite of what I am looking for. I must have my ! (NOT) operator wrong, or I have something wrong with the #ESC_CATEGORIES’ value=”to the wrong thing’
Wed 19 Jan 2011 at 10:15 #46156FrankyKeymasterI never said anywhere something about using “!” and “&&” and stuff like that.
This is what you can use (values are examples):
[events_if tag='#ESC_BLABLA'] (checks if not empty)
[events_if tag='#ESC_BLABLA' value='1'] (compares with value 1)
[events_if tag='#ESC_BLABLA' notvalue='1'] (must be different than value 1)
[events_if tag='#ESC_BLABLA' lt='1' ] (must be smaller than 1)
[events_if tag='#ESC_BLABLA' gt='1'] (must be bigger than 1)
For multiple levels of shortcodes, use [events_if2] and [events_if3] (see http://codex.wordpress.org/Shortcode_API, wordpress doesn’t like a shortcode with the same name enclosed in another one):
[events_if] ...
[events_if2] ...
[/events_if2]
[/events_if]Wed 19 Jan 2011 at 21:03 #46157AnonymousInactiveNestled shortcodes don’t seem to be working.
It tests the condition of the first argument then spits out the nestled shortcode name values and terminator
Nestled argument:
[events_if tag='#ESC_CATEGORIES' value='1']
[events_if2 tag='#_IS_LOGGED_IN' value='1'] do something [/events_if2]
[/events_if]
Resulting data on the events page only for categories=1:
[events_if2 tag='1' value='1'] do something [/events_if2] // if logged in
[events_if2 tag='0' value='1'] do something [/events_if2] // if logged out
Thu 20 Jan 2011 at 08:33 #46158FrankyKeymasterShould be ok in trunk now, I forgot to do shortcode recursion …
-
AuthorPosts
- The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.