Ahsen can you try the code on your vld personal, se if its workes
php code:
<?
$data = array(
'name' => 'Show latest events',
'about' => 'This extension allows you to display latest events.',
'author' => 'UnoAmigo',
'email' => 'kontakt@unoamigo.de',
'help' => 'NA',
'website' => 'www.unoamigo.de',
);
function vldext_new_events ($params = array())
{
global $DB, $SESSION, $PREFS,$TEMPLATE,$CACHE;
$limit = isset($params['limit']) ? $params['limit'] : '4';
$cache_time = isset($params['cache_time']) && $params['cache_time'] ? intval($params['cache_time']) :0;
$fields = array();
if ( ($fields = $CACHE->get("ext", "new_events".$cache_name)) === false )
{
$result = $DB->query("SELECT e.*, d.*, m.username, m.screenname FROM "
. DB_PREFIX . "events AS e, "
. DB_PREFIX . "members AS m, "
. DB_PREFIX . "events_data as d
WHERE e.member_id=m.member_id
AND e.event_id=d.data_id
ORDER BY e.event_id DESC LIMIT $limit");
if ( $DB->num_rows($result) )
{
$i = 0;
while( $profile_obj = $DB->fetch_object($result) )
{
$fields[$i]['event_id'] = $profile_obj->event_id;
$fields[$i]['event_name'] = $profile_obj->name;
$fields[$i]['event_description'] = $profile_obj->field2;
$fields[$i]['member_screenname'] = htmlentities2utf8($profile_obj->screenname);
$fields[$i]['pic_link'] = $profile_obj->field_4 ? $PREFS->conf['thumbnail_prefix'].$profile_obj->field_4 : "";
$fields[$i]['event_link'] = $PREFS->conf['fancy_urls'] ? ($PREFS->conf['fancy_homepages'] ? $profile_obj->username : "member/".$profile_obj->event_id."/") : "index.php?m=events&p=details&id=" . $profile_obj->event_id;
$i++;
}
}
$CACHE->put("ext", "new_events".$cache_name, $cache_time, $fields);
}
$TEMPLATE->assign("ext_new_events", $fields);
$TEMPLATE->output('ext.new_events.tpl');
}
?>
tpl file:
<div class="ext_thumbnails">
<div class="flatgrid1">
<div class="single1">
<table cellpadding="0" cellspacing="0" class="flatgrid1">
<tr>
<!-- BEGIN ext_new_events -->
<td class="item" align="center">
<div class="image">
<a href="{top.virtual_path}{event_link}">
<img src="{top.virtual_pic_path}{pic_link}" alt="{event_name}" border="70" width=70" height="75"/><br /></a>
<B><h3></a></h3><B>
</div>
</td>
<!-- END ext_new_events -->
</tr>
</table>
<div class="clear"></div>
</div>
</div>
<div class="clear"></div>
</div>
and the code that bring the events: {new_events:events=4}
Last edited by nasim___ (2008-02-29 14:45:45)