OK solved
Create a plugin and hook it to global_start (i wanted my ads to appear at the top of every forum),
Insert the following code
Code:
$newads_get = $vbulletin->db->query_read("
SELECT classified.classifiedid AS classifiedid, classified.categoryid AS categoryid, classified.userid AS userid,
classified.dateline AS dateline, classified.timeframe AS timeframe, classified.title AS title, classified.price AS price,
classified.type AS type, user.*,
upload.classifiedid, upload.image AS image
FROM " . TABLE_PREFIX . "sr_classifieds AS classified
LEFT JOIN " . TABLE_PREFIX . "sr_classifieds_uploads AS upload ON (upload.classifiedid=classified.classifiedid)
LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.userid=classified.userid)
ORDER BY dateline DESC
LIMIT 7
");
while($newad = $vbulletin->db->fetch_array($newads_get)){
$newad[dateline] = vbdate($vbulletin->options['dateformat'], $newad['dateline'], '', '');
eval('$newadbit .= "' . fetch_template('sr_classifieds_newadbit') . '";');
}
The
RED is how many new Adverts you wish to list.
The add in your NAVBAR template (At the bottom)
Code:
<table cellpadding="5" cellspacing="$stylevar[sellcellspacing]" width="100%" >
<tr><td colspan="7" class="thead">Latest Classified Ads</td></tr>
<tr>
$newadbit</tr>
</table>
Hope that helps somebody.
EDIT. I changed mine to display in just
FORUMHOME (paste the last bit of Code under $navbar in
FORUMHOME) and modify the hook on the first to
forumhome_start). Seems better