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 |
#12
|
|||
|
|||
hmmm. k thanks
|
#13
|
||||
|
||||
Also you might want to use this regular expression to modify the pagetext-- it will remove the vBCode for a cleaner display:
PHP Code:
$thread[pagetext]=preg_replace("/\[[^\]]*\]/","",$thread[pagetext]); (notice the slashes) |
#14
|
||||
|
||||
Quotes also screw up the preview.. so I'm using these two lines to clean up the display:
$thread[pagetext]=preg_replace("/\[[^\]]*\]/","",$thread[pagetext]); $thread[pagetext]=str_replace("\"","",$thread[pagetext]); |
#15
|
|||
|
|||
nick:
I had tried to use something like this originally when I wrote this but the extra queries to the database on my large board just about brought it to its knees. So Bira, Chen and wluke came up with the coding to use, as is included with the original hack I wrote, so that it doesn't take up some much in the way of system resources. Either way will work. Thanks for posting another way of doing this. You might want to have Chen, Bira or wluke to look over the code this code too to see what they think. Parker |
#16
|
|||
|
|||
Overgrow:
Those two lines didn't remove any of the quotes from the text preview. The UBB code is removed though now. Parker |
#17
|
||||
|
||||
Hi Parker, great idea for a hack.
I do believe that the JOIN is the way this should be done. It may never work properly with dot-icons since they both want to join the same query, but this is definitely the most efficient way-- there is no duplicate DB data in the thread table and it does not add 50 extra queries with each forumdisplay. re: quotes... those two lines I put up above, the preg_replace and str_replace do work for me. The first removes vBCode and the second removes quotes. The second is very simple.. replace a quote with nothing, it works for me just fine. |
#18
|
||||
|
||||
Maybe this will help you out a bit
Code:
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,13,16) ORDER BY sticky DESC, lastpost DESC |
#19
|
||||
|
||||
BRILLIANT. I had no idea you could do that
nick, this is definitely possible to do with a JOIN and not have redundant info in the DB and not add any more queries and have it work with doticons. Yell if you want ideas on putting it all together. |
#20
|
||||
|
||||
ps. this would be a great feature for v3. I expect it to actually cut bandwidth as people stop clicking on posts that don't really interest them.
|
#21
|
|||
|
|||
this has gotten over my head
i get errors with freddie's ('cause of the dotqueries thing?)...and the guy that hosts my site doesn't know what dotqueries are...and i'm not sure exactly what to tell him. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|