Events Made Easy Forums Generic Error with Conditional Tags

Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #43342
    Anonymous
    Inactive

    Franky,

    I’ve just encountered an error with the conditional tags.

    Following the information here: http://www.e-dynamics.be/wordpress/?cat=24 I came up with the following to show a FEATURED box for events in the ‘Featured’ category:

    [events_if tag='#_CATEGORIES' contains='Featured']<span class=”pstv-cl-featured”>FEATURED</span>[events_if]

    The trouble is it only appears on events NOT in that category.

    I also tried with with notcontains but I’m getting the same.

    Any ideas?

    Thanks

    Tom

    #48160
    Franky
    Keymaster

    Your events_if tag is not closing, maybe that’s an issue? Also (I need to rectify the doc), try using ESC_CATEGORIES in the equation:

    [events_if tag='#ESC_CATEGORIES' contains='Featured']<span class="pstv-cl-featured">FEATURED</span>[/events_if]

    #48161
    Franky
    Keymaster

    Also, try this change in the code, it might help:

    http://plugins.trac.wordpress.org/changeset/417159

    #48162
    Anonymous
    Inactive

    Ok, I’ve done that and added the closing tag but now notcontains works as expected but contains isn’t working

    #48163
    Franky
    Keymaster

    It is case sensitive of course …

    #48164
    Anonymous
    Inactive

    Checked that – and that wouldn’t explain why it works when using notcontains which does work but is the opposite of what I want

    #48165
    Franky
    Keymaster

    Yes it would explain that: the code for contains and notcontains is practically identical:

    } elseif (is_numeric($contains) || !empty($contains)) {
    if (strpos($tag,"$contains")!== false) return do_shortcode($content);
    } elseif (is_numeric($notcontains) || !empty($notcontains)) {
    if (strpos($tag,"$notcontains")===false) return do_shortcode($content);

    so if notcontains works, contains should as well …

    I just checked it here, and it seems to be working just fine using contains. If you just print out #_CATEGORIES, what do you get as a result? It might be that some strange character is interfering with php quotes here (although I escape using mysql_real_escape_string, but that might not be sufficient)

    #48166
    Anonymous
    Inactive

    Ok – I did some playing around and this seems to be a problem related to the use of more than one category. For any with a single category it works fine.

    I assign several categories to my events and want to highlight those in a ‘Featured’ category.

    Can you think of a way that I can do this, please?

    #48167
    Franky
    Keymaster

    I tried with different categories without problems. Please see my question in my previous post.

    #48168
    Anonymous
    Inactive

    I tried that but it prints out what I would expect.

    On the test page here: http://www.tomchubb.com/developer/wordpress/club-listings/

    the bottom line on each event prints out the categories as the styles, eg: Style: Techno, Tech House, Featured

    For testing I’ve changed the category search for the term ‘Tech’ which is used in two styles; “Techno” and “Tech House”.

    The code I’m using is: [events_if tag='#ESC_CATEGORIES' contains='Tech']<span class=”pstv-cl-featured”>FEATURED</span>[/events_if]

    This is showing on some but not all of them.

    For completeness, here is my Events code:

    <div class=”pstv-cl-eventHolder”>

    <div class=”pstv-cl-event”>

    <div class=”pstv-cl-calendar”>

    <div class=”pstv-cl-day”>#l</div>

    <div class=”pstv-cl-date”>#d</div>

    <div class=”pstv-cl-month”>#F</div>

    </div> <!– end pstv-cl-calendar –>

    <div class=”pstv-cl-eventInformation”>

    <div class=”pstv-cl-description”>#_LINKEDNAME</div>

    <div class=”pstv-cl-locationPrice”>#_LOCATION – #_TOWN – Price £#_ATT{Price}{?}</div>

    <div class=”pstv-cl-more”>#_NOTES</div>

    <div class=”pstv-cl-bottomLine”><span class=”pstv-cl-style”>Style: #_CATEGORIES</span><span class=”pstv-cl-time”>#_24HSTARTTIME – #_24HENDTIME</span>[events_if tag='#ESC_CATEGORIES' contains='Tech']<span class=”pstv-cl-featured”>FEATURED</span>[/events_if]</div>

    </div> <!– end pstv-cl-eventInformation –>

    </div> <!– end pstv-cl-event –>

    </div> <!– end pstv-cl-enventHolder –>

    I made the changes you explained in eme_functions.php and I’m baffled as to what’s stopping it from working!

    #48169
    Franky
    Keymaster

    Very weird … would you be interested in testing the trunk version?

    #48170
    Anonymous
    Inactive

    Of course. Will install now…

    #48171
    Anonymous
    Inactive

    Still the same. Will try doing it a different way. Thanks for your help

    #48172
    Anonymous
    Inactive

    Been digging around on php.net and found this but can’t figure out if that would apply:

    atomkirk at hotmail dot com 23-Oct-2008 01:19

    careful that when you put a strpos in an if statement that you take note that if the string is in the 0 position it will return false, causing your control structure to think its not in the string.

    It’s about half way down the page at: http://php.net/strpos

    I know you’ve changed it to strstr() now but just thought I’d see if it sheds any light

    #48173
    Franky
    Keymaster

    No, I use strpos again but I compare the result binary: 0 is not false then. So that’s not the issue.

    Would you give me a temporary admin account so I can snoop around?

    #48174
    Anonymous
    Inactive

    Login info sent to liedekef email

    Thanks

    #48175
    Franky
    Keymaster

    The code works just fine, but sometimes your “Featured”-span doesn’t show, I’m guessing because the div is too small or so (look via firebug, you’ll see the “Featured” is there in html).

    #48176
    Anonymous
    Inactive

    Oh no – sorry for time-wasting!

Viewing 18 posts - 1 through 18 (of 18 total)
  • The forum ‘Generic’ is closed to new topics and replies.
Scroll to Top