• Resolved Adrian Verstuyft

    (@adrian-verstuyft)


    Hi,

    since the last update there are a few php code “rests” to be seen on all single event pages:
    '; }?> '; }?> '; }?>

    I use the following code to format my page:

    #_EVENTNOTES
    <table cellpadding="0" cellspacing="0" class="events-table" >
        <tbody>
    	<tr>
    		<td style="width: 8em"><strong>Datum: </strong></td>
    		<td>#l, #d.#m.#Y - #@l,  #@d.#m.#Y</td>
    	</tr>
    	<tr>
    		<td><strong>Zeit: </strong></td>
    		<td>#H:#i Uhr  - #@H:#i Uhr</td>
    	</tr>
    {has_location}
    	<tr>
    		<td><strong>Ort: </strong></td>
    		<td>#_LOCATION</td>
    	</tr>
    {/has_location}
    	<tr>
    		<td><strong>Dozent(in): </strong></td>
    		<td>#_ATT{Dozent(in)}</td>
    	</tr>
    <?php if(isset($attr['Preis']) && !empty($attr['Preis'])){
        echo '<tr><td><strong>Preis: </strong></td><td>#_ATT{Preis}</td></tr>';
    }?>
    <?php if(isset($attr['Anmeldungbis']) && !empty($attr['Anmeldungbis'])){
        echo '<tr><td><strong>Anmeldung bis: </strong></td><td>#_ATT{Anmeldungbis}</td></tr>';
    }?>
    <?php if(isset($attr['Anmerkung']) && !empty($attr['Anmerkung'])){
        echo '<tr><td><strong>Anmerkung</strong></td><td>#_ATT{Anmerkung}</td></tr>';
    }?>
     </tbody>
    </table>
    <div class="eventmap">#_MAP</div>

    The output obviously comes from the php conditional statements, but I can´t find any php error in my code.
    My domain host has the latest php version (> 5.3)

    Are there any changes in the update which could trigger the output?

    https://wordpress.org/plugins/events-manager/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi,

    There’s no change that I know of that would cause that, and I’ve not seen it elsewhere.

    Where are you using the formatting you posted? If it’s in the admin area, I’m guessing you’re using a plugin to run the PHP code. If that’s the case, it’s possible the plugin doesn’t like the newlines towards the end of the code.

    Try putting the end of the echo statement and the closing bracket on the same line:

    <?php if(isset($attr['Preis']) && !empty($attr['Preis'])){
        echo '<tr><td><strong>Preis: </strong></td><td>#_ATT{Preis}</td></tr>';}?>
    Thread Starter Adrian Verstuyft

    (@adrian-verstuyft)

    No, I don’t use a plugin. The code is entered in Event Manager
    “Settings/Formatting/Events/Default single event format”
    and has worked as it should until the last update.

    Thanks for your help, but I’ve already tried your suggestion without success.

    Plugin Support angelo_nwl

    (@angelo_nwl)

    sorry not getting this issue, do you have sample link to your site for us to see ?

    Thread Starter Adrian Verstuyft

    (@adrian-verstuyft)

    The project isn’t yet published so my client won’t be willing to show.
    Here I link to a screenshot to demonstrate the problem.

    I don’t understand, why it was functioning before, if it is not allowed to use php in the settings input.

    PHP code is not run in those fields. Without a plugin or custom code running it will never have been working.

    I think the non-functioning code was just being hidden until the recent update when (perhaps) a change to the way linebreaks are used made the end characters appear.

    Instead of using PHP in that field, try displaying custom attributes as described here:
    http://wp-events-plugin.com/documentation/event-attributes/

    Thread Starter Adrian Verstuyft

    (@adrian-verstuyft)

    Because it WAS running before without errors on frontend pages I switched back to an older version of your plugin…
    The code fragments were gone, BUT the intended functionality also.
    I must have looked on a wrong page… sorry.

    So I have to filter my own attributes with some code in functions.php
    like the one I found here.

    Or is there an easier solution (besides unsing a template)?
    Thanks for your help!

    Plugin Support angelo_nwl

    (@angelo_nwl)

    maybe using pastebin.com (share the link here) – you can paste the actual snippet you are using for us to see and try?

    Thread Starter Adrian Verstuyft

    (@adrian-verstuyft)

    Ok, here it is on pastebin.

    I used “yournewattribute” as name placeholder for any custom attribute.
    You can add more atrributes with their conditions in the same snippet.
    I already tried it and it works like a charm.

    Again, wouldn’t it be great to implement “custom conditions for custom attributes” in your plugin?
    As a suggestion:
    parallel to the existing ones like “has_location” the user would have the possibility to use “has_mycustomattribute”

    Plugin Support angelo_nwl

    (@angelo_nwl)

    the pastebin link seems okay; can you try to remove placeholder #_EVENTNOTES and see if this will make a difference ?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Single Event Page shows php code since last update (5.5.3)’ is closed to new replies.