Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Improved Thread Preview Hack Details »»
Improved Thread Preview Hack
Version: 1.00, by N!ck N!ck is offline
Developer Last Online: Oct 2008 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 03-02-2002 Last Update: Never Installs: 88
 
No support by the author.

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:
  • Far, far less code...
  • Easier installation (one file edit, one template edit)...
  • Less space usage...the beginning of the first post in each thread is not stored twice - only once now!...

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #142  
Old 01-21-2003, 01:46 PM
Tungsten's Avatar
Tungsten Tungsten is offline
 
Join Date: Jan 2002
Location: Nashville, TN
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Aside from rolling back the PHP file and template changes, what else do I need to do to uninstall this hack? It was causing MySQL errors.

I did drop the 'firstpostid' field from the forum db table, but I see that it appended that field into the index as well. How do I revert that change?
Reply With Quote
  #143  
Old 02-14-2003, 01:46 PM
wooolF[RM]'s Avatar
wooolF[RM] wooolF[RM] is offline
 
Join Date: Jan 2002
Posts: 524
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

]nice hack... just installed it
there's only one "problem" > it shows the first 300 characters of the first post in the thread ( nomatter how many replies there were done )...

I have a code that will show u the LATEST post in the thread without opening it... just with hovering mouse over it will show 300 characters from *latest* post in the given thread...

Code is atathced here and "kinda" buggy cause it adds 1 query per each thread shown at the forum... I share cause I have it and I really would like to mix this great hack made by nicksaunders ant the others with the code I made here... I know it's possible but my knowledge in vBB is not that big that I can do it myself...

Anyway, here's the code:
PHP Code:
$intrid $thread[threadid];
    
$intrinfo $DB_site->fetch_array($DB_site->query("SELECT pagetext FROM post WHERE threadid = '$intrid' ORDER BY dateline DESC LIMIT 1"));
    if (
strlen($intrinfo[pagetext]) > 100) {
     
$intrpreview substr($intrinfo[pagetext], 0100) . "...";
    } else {
     
$intrpreview $intrinfo[pagetext];
    }
    
$intrpreview htmlspecialchars($intrpreview);
    
$intrpreview preg_replace("/(\[quote])(.*)(\[\/quote])/siU"""$intrpreview); 
This code should go right after
PHP Code:
while ($thread=$DB_site->fetch_array($threads)) { // and $counter++<$perpage) { 
in forumdisplay.php and then u can use $intrpreview anywhere as your table attribute (same as in this original hack)

If anyone can help me, please do so I would really appreciate it Thanx again!
Reply With Quote
  #144  
Old 02-19-2003, 12:14 PM
maxxxxxx maxxxxxx is offline
 
Join Date: Feb 2003
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I want also this nice hack, but nothing works...

I have all installed and also run the install file from the forum directory not from admin directory.

I have the 2.3.0 if vb

cu and thx
maxxxxxx
Reply With Quote
  #145  
Old 02-20-2003, 01:36 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The hack works just fine. One hint, if a bunch of people have installed it and run it and it doesn't work for you, the problem isn't with the hack, it's with your installation.

Amy
Reply With Quote
  #146  
Old 02-22-2003, 02:57 AM
Silenced Soul's Avatar
Silenced Soul Silenced Soul is offline
 
Join Date: Apr 2002
Location: holdin' it down for tha 303
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

beautiful hack, my only thing was that in the threadpreview-search it says to replace:
PHP Code:
In searchresultbit_threadonly

Find
:
<
a href="showthread.php?s=$session[sessionhash]&threadid=$searchresult[threadid]$highlightwords">$searchresult[threadtitle]</a>

Replace with:
<
a href="showthread.php?s=$session[sessionhash]&threadid=$searchresult[threadid]$highlightwordstitle="fppreview">$searchresult[threadtitle]</a
when you should replace it with
PHP Code:
<a href="showthread.php?s=$session[sessionhash]&threadid=$searchresult[threadid]$highlightwordstitle="$fppreview">$searchresult[threadtitle]</a
By the way, this'll fix those people having problems with the search threadpreview not working, assuming all that is showing up is the fppreview.
Reply With Quote
  #147  
Old 02-22-2003, 03:18 AM
N!ck N!ck is offline
 
Join Date: Mar 2002
Location: Lake Havasu City, AZ
Posts: 886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah, that's been like taht forever, but I'm too lazy to fix it.
Reply With Quote
  #148  
Old 02-22-2003, 05:08 AM
Silenced Soul's Avatar
Silenced Soul Silenced Soul is offline
 
Join Date: Apr 2002
Location: holdin' it down for tha 303
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

lol, I know all about that...

But, very nice hack, I was trying to do something like this awhile back, but, it wasn't working, could take random posts from a thread and display those instead of the first post, that was annoying.. lol

Nice work.
Reply With Quote
  #149  
Old 03-18-2003, 01:19 PM
drumsy's Avatar
drumsy drumsy is offline
 
Join Date: Nov 2001
Location: Charlotte, NC
Posts: 292
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've encountered a very nasty problem that a member discovered, and exploited. It allows a member to post any image whatsoever on the forumhome (in our case it was a highly disturbing one) and I would like to know how to fix it. If someone can help me with a fix, I will share the code with you. I've disabled thread preview in the meantime.
Reply With Quote
  #150  
Old 03-19-2003, 02:57 AM
N!ck N!ck is offline
 
Join Date: Mar 2002
Location: Lake Havasu City, AZ
Posts: 886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

:-/ Could you PM me with more details? I'd like to help fix it.
Reply With Quote
  #151  
Old 03-27-2003, 01:15 PM
drumsy's Avatar
drumsy drumsy is offline
 
Join Date: Nov 2001
Location: Charlotte, NC
Posts: 292
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
03-18-03 at 10:19 AM drumsy said this in Post #148
I've encountered a very nasty problem that a member discovered, and exploited. It allows a member to post any image whatsoever on the forumhome (in our case it was a highly disturbing one) and I would like to know how to fix it. If someone can help me with a fix, I will share the code with you. I've disabled thread preview in the meantime.
Thanks to N!ck for the support and the solution. The following is the fix for this bug as related by N!ck via PM:

In forumdisplay.php, find:
Code:
    $fppreview=preg_replace("/\[[^\]]*\]/","",$fppreview); 
    $fppreview=str_replace("\"","",$fppreview);
and add this after it:
Code:
    $fppreview=str_replace("<","&lt;",$fppreview);
    $fppreview=str_replace(">","&gt;",$fppreview);
Again, thanks to N!ck for this support!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:49 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04545 seconds
  • Memory Usage 2,325KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete