The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Improved Thread Preview Hack Details »» | |||||||||||||||||||||||||
The idea for this hack was originally that of Parker Clack, a regular here on vBulletin.org.
What this hack does: Basically, this hack pops up a little box/window when the mouse is run over a thread title that shows the first three hundred characters of the first post in the thread (that is, the post that started the thread). Improvements to Parker Clack's hack:
Versions: 3.0: Overgrow's search page thread preview instructions. 2.1: Added some necessary instructions. 2.0 Reduced MySQL queries significantly. 1.0 Initial release. Comments appreciated... A version for vbHacker is available here - note: some files may need fixing afterward if they present parse errors! How to Censor Previews (by nakkid) See page seven of this thread. A very important security fix is available here - I have not updated the ZIP, so install it after you install the hack Show Your Support
|
Comments |
#22
|
|||
|
|||
i have an idea...overgrow, post your forumdisplay.php as an attachment and i'll look at that part...
you and freddie will get credit now as well, of course |
#23
|
||||
|
||||
>>overgrow, post your forumdisplay.php as an attachment
Sorry, can't post whole vB files as it violates the license. Freddie made this super easy though.. I see no reason why this wasn't suggested as the first way to code the hack. Here is the important part of forumdisplay.. add the first part and modify the query by including $previewselect and $previewjoin. PHP Code:
One of my users asked why this didn't work for search results, so that is pretty easy to move over. Search.php find: PHP Code:
PHP Code:
find user.userid AS postuserid, replace with user.userid AS postuserid, $previewselect find LEFT JOIN icon AS threadicon ON thread.iconid=threadicon.iconid $dotjoin replace with LEFT JOIN icon AS threadicon ON thread.iconid=threadicon.iconid $dotjoin $previewjoin find PHP Code:
PHP Code:
I noticed this was your first project so I hope you write this all up into a new hack so it's not confusing for the other users. thanks~ |
#24
|
|||
|
|||
ouch...forgot about the license... :O
okay...well this is the error i get (again, i'm not sure whether it's related to this 'dotqueries' thing ): Code:
Database error in vBulletin 2.2.2: Invalid SQL: SELECT DISTINCT post.userid, post2.pagetext as pagetext, icon.title as icontitle,icon.iconpath, thread.threadid,thread.title,lastpost, forumid,pollid,open,replycount,postusername,postuserid, lastposter,thread.dateline,views,thread.iconid,notes,thread.visible,sticky,votetotal,attach FROM thread LEFT JOIN icon ON (icon.iconid = thread.iconid) LEFT JOIN post ON (thread.threadid = post.threadid AND post.userid = '1') LEFT JOIN post AS post2 ON (thread.firstpostid = post2.postid) WHERE thread.threadid IN (0,8,17,1,15,7) ORDER BY sticky DESC, lastpost DESC mysql error: Unknown column 'thread.firstpostid' in 'on clause' mysql error number: 1054 Date: Sunday 03rd of March 2002 05:43:42 PM Script: http://www.60schevytrucks.com/forums...p?s=&forumid=4 Referer: http://www.60schevytrucks.com/forums/ |
#25
|
||||
|
||||
Not sure what to tell you.. this is right out of my forumdisplay.php and it works. I just turned on "Use Dot Icons" in the Cpanel, which affects this query, and they both worked at the same time.. which was the main goal. The second join slowed it down, too much for my site, but probably OK for others.
|
#26
|
||||
|
||||
PHP Code:
|
#27
|
||||
|
||||
'thread.firstpostid' isn't a default field in vBulletin. It makes the hack easy as you know what to join on but you have to make other modifications to newthread to save the first postid when the thread is created. I saw it in the queries you guys posted but I don't see it in the hack instructions so I was wondering how you were making this work without creating that field.
|
#28
|
||||
|
||||
If it is slowing you down, make sure you have put an index on "thread.firstpostid" otherwise you are going to have a full thread table scan which is bad(tm).
|
#29
|
|||
|
|||
i made it work...i even made an install script to add and populate the extra field works like a charm, expect an update tonight
|
#30
|
|||
|
|||
update released!
thread previews on searches will be in the next update |
#31
|
||||
|
||||
I'm using Parker's fantastic hack with no problems. How much does this hack improve on Parker's? I'm just wondering whether it is worth the changeover...
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|