Create "Latest Threads" Custom Page
by
23 Feb 2006
A simple [HOWTO] to display latest threads on a custom page. If you don't have http://www.vbulletin.org/forum/showthread.php?threadid=108583 installed .. go download and upload product via Plugin Manager. You need GTCUSTOM PAGES to follow this article. LETS GET STARTED INSTRUCTIONS:
1)__ CREATE 2 TEMPLATES Create "custom_thread" template: HTML Code:
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%"> <tbody> <tr> <td class="tcat" colspan="5"><a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('gtcthreads')"><img id="collapseimg_gtcthreads" src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_gtcthreads].gif" alt="" border="0" /></a>$vbphrase[header_title]</td> </tr> <tr class="thead"> <td> </td> <td class="smallfont" align="$stylevar[left]" width="100%">$vbphrase[thread] / $vbphrase[thread_starter]</td> <td class="smallfont" align="center" style="white-space:nowrap">$vbphrase[last_post]</td> <td class="smallfont" align="center">$vbphrase[replies]</td> <td class="smallfont" align="center">$vbphrase[views]</td> </tr> </tbody> <tbody id="collapseobj_gtcthreads" style="$vbcollapse[collapseobj_gtcthreads]"> $threadrows </tbody> </table> <br /> HTML Code:
<tr> <td class="alt2" align="center"><if condition="$show['threadicon']"><img class="inlineimg" src="$thread[iconpath]" alt="" border="0" title="" /> <else /> </if></td> <td class="alt1"><a href="showthread.php?t=$thread[threadid]"><strong>$thread[title]</strong></a> <div class="smallfont"> - by $thread[postusername]</div></td> <td class="alt2" align="center"><div class="smallfont time" style="white-space:nowrap">$thread[lastpostdate] $thread[lastposttime]<br />by $thread[lastposter]</div></td> <td class="alt1" align="center">$thread[replycount]</td> <td class="alt2" align="center">$thread[views]</td> </tr> Phrase Type: GTCustom Pages Product: GTCustom Pages Varname: gtcustom_newthreads_header Text: Latest Threads 3)__ ADD FUNCTION TO functions_gtcustom.php Copy the following function to functions_gtcustom.php (functions_gtcustom.php is included in GTCUSTOM PAGES product) PHP Code:
/* ==========[ PRINT LATEST THREAD ]===================================== */
FIND IN goto.php: PHP Code:
default;
PHP Code:
case 'newthreads';
PHP Code:
if ($_REQUEST['section']=='sitemap')
PHP Code:
switch($_REQUEST['section'])
Now, go visit the page that you just created: $vboptions[bburl]/goto.php?section=newthreads Need any help? Contact me personally via private message. NOTE:
|