Forum

Thread tagged as: Error, Events

Converting old events coding to newest version - error Fatal error: Call to unde...

Newest install with newest events app error Fatal error: Call to undefined function perch_events_custom() in /home/xyz/public_html/execcommittee.php on line 57 I do not see a current version of this code for the new events app Obviously this is the line that is messing up perch_events_custom($opts); ~~ <?php $opts = array( 'filter'=>'eventDateTime', 'match'=>'gte', 'value'=>date('Y-m-d'), 'count'=>'15', 'sort'=>'eventDateTime', 'sort-order'=>'desc', 'past-events'=> false, 'category'=>'exec',
'template'=>'events/filtered-listing2.html' ); perch_events_custom($opts); This is line 57

?> ~~ Tried again with this code ~~ <?php perch_events_listing(array( 'past-events' => false, 'filter'=>'eventDateTime', 'match'=>'gte', 'value'=>date('Y-m-d'), 'count'=>'15', 'sort'=>'eventDateTime', 'sort-order'=>'desc', 'category' => 'exec', 'template'=>'events/filtered-listing2.html'

)); ?> ~~ Line 46 the perch_events_listing(array( code messed up) what am I doing wrong.

Carol Swinehart

Carol Swinehart 0 points

  • 2 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Check that perch_events appears in your config/apps.php file.

Yes, it was missing. So should the second set of code work?

<?php 
perch_events_listing(array( 
'past-events' => false, 
'filter'=>'eventDateTime', 
'match'=>'gte', 
'value'=>date('Y-m-d'), 
'count'=>'15', 
'sort'=>'eventDateTime', 
'sort-order'=>'desc', 
'category' => 'exec', 
'template'=>'events/filtered-listing2.html'
)); 
?>
Drew McLellan

Drew McLellan 2638 points
Perch Support

I think so - what problem are you seeing with it?

Perch_events and blog will not stay in the apps.php config file. I have added them twice now and each time they go away.

Fatal error: Call to undefined function perch_events_listing() in /home/aipgohio/public_html/testindex2019.php on line 154

Finally got the apps.php config file to hold the conf files, but there is still a problem

The template that I am using is not the one that is being shown on the page. I am seeing a choice of a calendar month at the top of the listing and choices of months. That is not on my listings template.
~~ 'template'=>'events/filtered-listing2.html' ~~ must be wrong what did I do wrong here that additional information is sneaking in?

This is the template - ~~ <perch:before><ul></perch:before> <li style="list-style: none;">

<div class="date"><perch:events id="eventDateTime" format="l, M d, Y " /></div> <br /><br /> <h3 style="margin-top: -1em;"><perch:events id="eventTitle" /></h3> <perch:events id="eventDescHTML" encode="false" /> <hr style="margin: auto; width: 55%;color: #cccccc;" /> </li>

<perch:after></ul></perch:after> ~~ There is no call for a October listing with choose Sept or Nov under it.

Alll is working I was using the wrong code should have been perch_events_custom(array(