The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
how did they manage to do this...
---> Elite Trader
I am talking about the multiple "lastpost" for a specific forum. I want to put such a "Last 10 posts/threads" in my forumdisplay template to be shown at the right of each forum categorized in my board, as a collumn next to Threads and Posts...instead of the single Last Post collumn. Is there any known hack that manages such a thing ? If I use includes pointing to posted php hacks, I wouldnt be able to dynamically specify which forum's last posts I want to show. It must be a way to associate the last posts with the forum's id, using the variables already loaded in forumdisplay, but I dont know php to add such functionality... any help is much appreciated ! (yes... that link demonstrates a modified vb !!!) |
#2
|
||||
|
||||
Use the following query:
Code:
select threadid, title from thread where forumid=XX order by lastpost desc limit 10; And you can use the threadid to create the link to the actual thread. |
#3
|
|||
|
|||
Unfortunately my knowledge of php/sql is very limited. However, I managed to found the following related information...
in forumdisplay_forumbit_level2_post template I can see: <td bgcolor="{secondaltcolor}"><normalfont>$forum[replycount]</normalfont></td> <td bgcolor="{firstaltcolor}"><normalfont>$forum[threadcount]</normalfont></td> <td bgcolor="{secondaltcolor}"><smallfont>$forum[lastpostinfo]</smallfont></td> <td bgcolor="{firstaltcolor}"><smallfont>$forum[moderators]</smallfont></td> so I am looking to modify the "lastpostinfo" variable .. which is defined in forumdisplay.php : // dates if ($forum['lastpost']>0) { $forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']); $forum['lastposttime']=vbdate($timeformat,$forum['lastpost']); eval("\$forum['lastpostinfo'] = \"".gettemplate('forumhome_lastpostby')."\";"); } else { $forum['lastpostinfo']='Never'; } But how exactly should I place the query here ? Could you help me with this please ? many thanks ! (PS. Is it possible to modify the query to be applied for all the childforums of the specified forumid ??? ) |
#4
|
|||
|
|||
Ok, what I have done so far is to place this code in forumdisplay.php, inside makeforumbit function ..
PHP Code:
However, there are two issues: 1) I don't know what variable to use to apply this code dynamically to each forum that is categorized in forumslist. Above, I have placed forumid=6 temporarily. I tried the variable $forum[forumid] but it doesn't bring me the right forum. What I want is to place a variable that in each cycle of the makeforumbit WHILE statement (that calculates the code for each single categorized forum in forumdisplay), that variable will get the specific forum and all it's childforums (subforums, subcategories). 2)my second problem is that the code above displays only the last result of the table generated. I tried to parse the results table with the while statement I have placed in the code, but it does not work. The "forumhome_lastmsgstemp" that you can see simply contains: Code:
<a href="showthread.php?s=$session[sessionhash]&threadid=$lastmsgsid">$lastmsgstitle</a> I desperately need your expertise :cross-eyed: |
#5
|
|||
|
|||
for those that didn't follow the link, here is a screenshot of the functionality I am trying to describe...
|
#6
|
||||
|
||||
I had a long discussion with some people in the vBulletin.org chat room about displaying the last x posts for each forum instead of only one. If anyone actually codes this and has it working i'd be most curious to see how they went about it
- miSt |
#7
|
|||
|
|||
No insights at all ?
I am sure that there exist at least 5 hackers here in vb.org for whom this functionality achievement is a matter of minutes! And the good news is that this hack has already been coded in elitetrader.com/vb , so it is technically possible. The problem is that we can't get it from them since they are a commercial site. Any willing experts ? thank you sooo much |
#8
|
|||
|
|||
I have made a Hack Request in this thread , posting some code that would achieve the core part of the discussed functionality.
The problem that remains is how to store the results for the last5posts in a table and show them alltogether in html format when the variable is triggered by templates in forumdisplay section. The code is working when just using an echo function, but we need to find a trick to have the results in a html table. I don't believe that there are no php coders here that could manage to do this! Please, take a look at the thread stated above and share your wiseness, to embody this valuable functionality in vb many thanks for any insights |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|