Adding Comments in EVENTS MANAGER
-
I am working on adding Comments to the Events pages in Events manager. Because I cannot use ‘echo’ within a variable function, I cannot do anything like
$replace = $comments();
within the EM_EVENTS.php file in the ‘classes’ folder. I am now trying to simply add the function to the event_single.php file in the ‘templates’ folder, but am unsure how to access the ‘event_id’ corresponding to the event.
Here is the function that I am trying to add:
function comment(){ global $commentid; $q=mysql_query("SELECT name, dtl,dt FROM cmt_post WHERE event_id= '$commentid' and status='apv' order by dt "); echo "<table width='400' border='0' cellspacing='1' cellpadding='0'>"; while($nt=mysql_fetch_array($q)){ $dtl=nl2br($nt['dtl']); echo "<tr bgcolor='#f1f1f1'><td>$nt[name]</td><td align=right>".date("d-m-Y",strtotime($nt['dt']))."</td></tr>"; echo "<tr ><td colspan=2>$dtl</td></tr>"; } echo "</table>"; }
I have
$commentid = $this->id;
within the em_events.php file, but that is not helping. I just need to know how to get the event_id from the current event to add to the mysql_query…Thanks in advance for any help that anyone can offer, I have been banging my head against a wall for a while on this one.
- The topic ‘Adding Comments in EVENTS MANAGER’ is closed to new replies.