inksprite
Member
Posted 1 year ago #
I just updated a couple of my wordpress sites with version 3.0.3. I believe I was using the latest 2.x version before. On one of the sites I had the "dbem_get_events_list" function generate an event list on the homepage and another in the sidebar on the subpages. I utilized the "format" argument to list the events in a table format.
It seems the "dbem_get_events_list" function is being phased out since it won't process any of the arguments anymore. I'm now using the events widget to list the events on the homepage and sidebar, but without the ability to add a header or footer to the events loop I can't add the table tags. I tried making a widget space exclusively for the events so that I can hardcode the table tags around the widget space but the events widget still adds ul and li tags so that by table gets jumbled up with list tags inside of it.
Any solutions?
http://wordpress.org/extend/plugins/events-manager/
nutsmuggler
Member
Posted 1 year ago #
Hello inksprite.
The dbem_get_events_list isn't being phased out at all: it's in our 'deprecated' file, for we mean to provide a better alternative soonish, but it's still there for backward compatibility, and we're not going to remove it.
In short, it is supposed to work as it did before.
Can you paste the code you are using to generate the events list?
Also, just for debug purposes, have you tried deactivating other plugins?
Cheers,
Davide of EM
socialmediatrends
Member
Posted 1 year ago #
hi inksprite,
try using
<?php
echo EM_Events::get(array('scope'=>'future','format'=>'yourhtmlhere');
?>
inksprite
Member
Posted 1 year ago #
Hi,
My code is
<?php
dbem_get_events_list("limit=3&format=<tr><td><span class=\"small_gray\">#M #j, #Y</span></td><td><span class=\"large_bold\">#_NAME</span></td><td><a href=\"#_EVENTPAGEURL\">More Details</a></td></tr>");
?>
socialmediatrends, I'll try and see if your method works.
inksprite
Member
Posted 1 year ago #
socialmediatrends, your code doesn't seem to work for me.
And yes, I have tried deactivating all the other plugins.
Let me know if my code is off. It hasn't changed since before the upgrade and it worked fine then.
@inksprite,
do you get any php errors? what do you mean by not working?
inksprite
Member
Posted 1 year ago #
Well, for socialmediatrends' code I used to get a syntax error and figured out it was missing a closing parenthesis. Now it just prints "Array" for which I suppose I could write a function to display it properly, but I'd rather the original function work.
As for the original dbem_get_events_list function -- I don't get en error. It just ignores all the arguments and prints all the events with the default format defined on the events manager settings page.
I see what's wrong, you want is this actually:
<?php echo EM_Events::output(array('scope'=>'future', 'limit'=>3,'format'=>'<tr><td><span class=\"small_gray\">#M #j, #Y</span></td><td><span class=\"large_bold\">#_NAME</span></td><td><a href=\"#_EVENTPAGEURL\">More Details</a></td></tr>')); ?>
*edit the old function is being phased out anyway so it's best you use this, the above does the same thing anyway. You might want to strip the slashes in the html too.
inksprite
Member
Posted 1 year ago #
Great, that worked. It looks like I need to use "output" instead of "get".
Thanks!
yup, exactly. get returns an arrray of events, output calls get within it and also outputs. It'll all be in the new docs, which is coming v.soon!