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 |
#102
|
|||
|
|||
Quote:
|
#103
|
||||
|
||||
hmmm... i didnt actually look at the search file made by nick, only at the the code i inserted in forumdispaly.php first.
i tested the code listed below in search.php and it worked perfectly for me. here it is what i did... Find: Code:
$sql=" SELECT $dotuserid $distinct thread.threadid,thread.threadid AS postid,thread.title AS threadtitle,thread.iconid AS threadiconid,thread.replycount, thread.views,thread.pollid,thread.open,thread.lastpost AS postdateline,thread.lastpost,thread.lastposter, forum.forumid,forum.title AS forumtitle,forum.allowicons,attach, thread.postusername AS usrname, user.userid AS postuserid, threadicon.iconpath AS threadiconpath,threadicon.title AS threadicontitle FROM thread,forum".iif(strpos($search[query],"searchindex")>0,",searchindex","")." LEFT JOIN user ON user.username=thread.postusername LEFT JOIN icon AS threadicon ON thread.iconid=threadicon.iconid $dotjoin Code:
$sql=" SELECT $dotuserid $distinct thread.threadid,thread.threadid AS postid,thread.title AS threadtitle,thread.iconid AS threadiconid,thread.replycount, thread.views,thread.pollid,thread.open,thread.lastpost AS postdateline,thread.lastpost,thread.lastposter, forum.forumid,forum.title AS forumtitle,forum.allowicons,attach, thread.postusername AS usrname, user.userid AS postuserid, threadicon.iconpath AS threadiconpath,threadicon.title AS threadicontitle, post2.pagetext as pagetext FROM thread,forum".iif(strpos($search[query],"searchindex")>0,",searchindex","")." LEFT JOIN user ON user.username=thread.postusername LEFT JOIN icon AS threadicon ON thread.iconid=threadicon.iconid LEFT JOIN post AS post2 ON thread.firstpostid=post2.postid $dotjoin Code:
// get first 30 chars of post title if (trim($searchresult[posttitle])=="") { $searchresult[posttitle]=substr($searchresult[pagetext],0,50); if (strlen($searchresult[posttitle])>50) { $spacepos=strpos($searchresult[posttitle]." "," ",50); if ($spacepos!=0) { $searchresult[posttitle]=substr($searchresult[posttitle],0,$spacepos)."..."; } } } Code:
// get first 100 chars of post message if (strlen($searchresult[pagetext])>100) { $searchresult[message]=censortext(substr($searchresult[pagetext],0,97).'...'); } else { $searchresult[message]=censortext(searchresult[pagetext]); } $searchresult[message]=preg_replace("/\[[^\]]\]/","",$searchresult[message]); $searchresult[message]=str_replace("\"","",$searchresult[message]); Code:
<a href="showthread.php?s=$session[sessionhash]&threadid=$searchresult[threadid]$highlightwords">$searchresult[threadtitle]</a> Code:
<a href="showthread.php?s=$session[sessionhash]&threadid=$searchresult[threadid]$highlightwords" title="$searchresult[message]">$searchresult[threadtitle]</a> |
#104
|
||||
|
||||
this was tested in VB225.
i think where most of the people make the mistake is the query change. thare are 2 queries that look almost identical there, in search.php... btw, there is nothing wrong with nick's file. |
#105
|
|||
|
|||
Quote:
|
#106
|
||||
|
||||
you are correct. sorry, i didnt realised.
in other order, you think was a good idea that i added the censortext function? thanks for the input. |
#107
|
|||
|
|||
it's definitely something i didn't think of
|
#108
|
||||
|
||||
i'm glad you like it.
|
#109
|
|||
|
|||
i'll put this information on post #1
|
#110
|
|||
|
|||
when i inserted
Code:
// get first 100 chars of post message if (strlen($searchresult[pagetext])>100) { $searchresult[message]=censortext(substr($searchresult[pagetext],0,97).'...'); } else { $searchresult[message]=censortext(searchresult[pagetext]); } $searchresult[message]=preg_replace("/\[[^\]]\]/","",$searchresult[message]); $searchresult[message]=str_replace("\"","",$searchresult[message]); |
#111
|
|||
|
|||
yeah?
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|