Hi everyone, hope you guys are well,
I have recently bought GARS and I tried to make a little addon for it, however, no matter what I do, I can't get to display it.
Basically I'm trying to display the first attachment of the first post only, however, the addon that I have got seems to work in vb's default showthread template, but it does not work in any of GARS templates,
PHP Code:
# First Attachment of the First Post
$firstattach = $db->query_read("
SELECT attachmentid, dateline, postid FROM " . TABLE_PREFIX . "attachment
WHERE postid=$FIRSTPOSTID
ORDER BY attachmentid ASC
LIMIT 1
");
while($row = $db->fetch_array($firstattach))
{
$attachdateline= $row['dateline'];
$attachid= $row['attachmentid'];
$att = "<img src='attachment.php?$session[sessionurl]attachmentid=$attachid&d=$attachdateline' border='0'>";
eval('$tested .= "' . fetch_template('tested') . '";');
}
I added the code above as a plugin in vbulletin, under the hook location "showthread_complete".
then I put $tested in my GARS_pb, however, nothing shows up and sometimes I just see "null", but when I put $tested in a SHOWTHREAD template, it seems to show up just fine,
Any kind of help would be appreciated.