The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
...Last5posts instead of Lastpost, in Forumdisplay !
(a screenshot is attached at the end from a commercial site running vb)
Motivation: In newly created communities you have not many posts. So insted of demonstrating the number of posts, threads, and the lastpost for each forum, why not just serving the last 5 posts ? It gives the feeling that your board is active and the user is tempted to follow some links, so he will probably stay in the board for a while. :bunny: Imagine a board with only 1000 posts ... with the number of posts beside the forums it seems almost empty. Using the last5posts bit, the user is not informed about the number of the posts, instead he is being served with some interesting links/threads to follow! The stuff: Let me describe what I have achieved so far about this.. clarifying that I have no knowledge of php or sql (however, I am fluent in some OOP). :alien: Normally, in forumdisplay>forumbit_level1/2_post templates, the variable $forum[lastpostinfo] is called. This variable is evaluated in forumdisplay.php inside a while loop that generates all the info needed to display each row for the catecorized forums when foromdisplay is called. So, inside this loop you have $forum[forumid] stating the current forum proccessed in cache. My idea was to nest another variable inside this loop that would run a query (Zzed helped me with this in this thread ) and get the last 5 posts for the currently proccessed forum. The difficult part is that you don't have one thing to show but 5. The way I went was to make a function (assigned to our $last5posts) that would manage to parse the lastposts table and display the results with html links. However, I found that "functions inside functions" (the main loop) is not a good idea in php, so I had to place my function outside the makeforumbit function that manages the loop for the displayed forums. PHP Code:
PHP Code:
Code:
<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr align="right"> <td nowrap><smallfont> <a href=\"$forumspath/showthread.php?s=&threadid=$tid\">$ttitle</a> </smallfont> </td></tr></table> <br> The bad news : This crap does not show anything. The good news: If you replace the "eval" with an echo ... :knockedout: PHP Code:
here comes... The request: Could someone of you, the php/sql/vb-mods experts, take a look at forumdisplay code and find the magick trick that would enbody the functionality the screenshot describes ? :lick: many thanks ! (honestly) |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|