The vB Geek

Go Back   The vB Geek > vB Geek Products > Geek Article and Review System

Geek Article and Review System GARS is the mega popular system for turning forums into articles, tutorials, or even reviews.

Advertisement
  Learn how to remove ads

Reply
 
Thread Tools Display Modes
  #1  
Old 12-22-2006, 07:00 PM
Sean Sean is offline
Junior Member
 
Join Date: Sep 2006
Posts: 1
Geek Article and Review System License Holder 
Default Displaying first Attachment

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&amp;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.

Last edited by Sean; 12-22-2006 at 07:20 PM..
Reply With Quote
  #2  
Old 12-23-2006, 07:23 AM
The Geek's Avatar
The Geek The Geek is offline
Senior Member
 
Join Date: Aug 2005
Posts: 6,717
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

Thats because the postbits will have been constructed by the time showthread_completed gets called. If you want to do that in a postbit (i.e. GARS_pb or postbit) then you will want to call it in postbit_completed (or slightly earlier).

HTHs
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying all banners attroll Geek Advertising Banner System 1 10-03-2008 12:39 AM
Better displaying of the tools module Alfa1 Geek Article and Review System 1 01-19-2008 04:10 PM
Modules not displaying - I'm frustrated. ant0nio Geek Gazette 6 07-09-2007 11:13 PM
Displaying author ratings Lionel Geek Article and Review System 1 02-16-2007 04:58 PM
Banners not displaying wez Geek Advertising Banner System 1 12-11-2006 09:04 PM


All times are GMT. The time now is 01:52 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.