Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Beta Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by Parker Clack Parker Clack is offline
Developer Last Online: Nov 2013 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 12-08-2001 Last Update: Never Installs: 0
Is in Beta Stage  
No support by the author.

One of the things that will happen when you put your mouse pointer on to a hyperlink is put text in a popup box if you put this information into a title line.

For example:

< a href="http://www.yourplace.com" title="your text here">Here ya go< /a >

(the above is just an example to play with without the spaces in the brakets to see how this works)

At any rate. In your forumdisplay.php file right above:

Code:
eval("\$forumdisplaybits .= \"".gettemplate('forumdisplaybit')."\";");
put

Code:
$post=$DB_site->query_first("SELECT pagetext FROM post WHERE threadid=$thread[threadid] ORDER BY postid");
    $page=iif(strlen($post[pagetext])>500,substr($post[pagetext],0,500)."...",$post[pagetext]);
    $page=bbcodeparse2($page,1,1,1,1); 
    $page=strip_tags($page);
Then in your forumdisplaybit template

look for

Code:
<a href="showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]">$thread[title]</a>
and replace this with:

Code:
<a href="showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]" title="$page">$thread[title]</a>
The next time you get on your board and open the forumdisplay.php file and list the thread titles in your forums if you put your mouse pointer on the hyperlink to the post you will get a brief display of the first post in the thread to use as a preview.

You can play around with the order size of the pagetext from 500 to whatever you want to have displayed.

If anyone can think of anything to add to this please do. I guarantee I am a very limited coder.

Many thanks go to Chen and Bira for helping me with the coding.

Parker

Show Your Support

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

Comments
  #12  
Old 12-10-2001, 03:52 AM
Freddie Bingham's Avatar
Freddie Bingham Freddie Bingham is offline
 
Join Date: Oct 2001
Posts: 506
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$page iifstrlen($message>500),substr($message,0,500).'...',$message); 
Reply With Quote
  #13  
Old 12-10-2001, 05:01 AM
Parker Clack Parker Clack is offline
 
Join Date: Oct 2001
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

freddie:

Thanks. But I still get the parse error at the line it is on.

BTW, will this way show old text messages that have already been written or only new posts that have been written since putting this in?

Parker
Reply With Quote
  #14  
Old 12-10-2001, 06:10 AM
freakyshiat freakyshiat is offline
 
Join Date: Nov 2001
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

so is there a more efficeint way of doing this?
Reply With Quote
  #15  
Old 12-10-2001, 11:17 PM
Parker Clack Parker Clack is offline
 
Join Date: Oct 2001
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well:

As stated this was too much of a demand on my server so if you have a large board I would not use this.

Anyone have a way to doing this more efficiently?

Parker
Reply With Quote
  #16  
Old 12-17-2001, 03:21 AM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Parker a couple more comments:

1) "$page = $thread[preview];" is redundent. place title="$thread[preview]" in your template.


2) you didn't strip out the bbcodes first, before doing strip_tags.

this:

Code:
$page = iif(strlen($message)>500,substr($message,0,500).'...',$message);
$page=strip_tags($page);
Should be:

Code:
$page = iif(strlen($message)>500,substr($message,0,500).'...',$message);
[high]$page=bbcodepase($page);[/high]
$page=strip_tags($page);
Reply With Quote
  #17  
Old 12-17-2001, 03:35 AM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah. Small problem that needs to be looked at.

1) If, for example, the first 500 characters of the opening post include something that you as an admin edit out - they will continue to appear in the preview.

2) If, for example, you split a thread then
---> a) the newly created thread will not have a preview; and
---> b) if you, for example, split the thread so as to remove the first post (say, to your trashcan forum), the that post will continue to exist in the 'preview'.


What needs to be done, is adding an additional hack code to the editpost script and the splitting action script. In both cases, when a thread is updated, the 'preview' must be updated as well.

I'm off to sleep now. I'll see if I can help you when I wake up, if that will be needed
Reply With Quote
  #18  
Old 12-17-2001, 04:44 AM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, the necessary add-ons

1) Open root/editpost.php, find:

Code:
  if ($isfirst and $title!="" and $postinfo[dateline]+$editthreadtitlelimit*60>time()) {
    $DB_site->query("UPDATE thread SET title='".addslashes(htmlspecialchars($title))."' WHERE threadid=$threadinfo[threadid]");
    //$title="";
  }
AFTER it ADD:

Code:
  if ($isfirst) {
	$page = iif(strlen($message)>500,substr($message,0,500).'...',$message);
	$page = bbcodeparse($page);
	$page = strip_tags($page);
    $DB_site->query("UPDATE thread SET preview='".addslashes(htmlspecialchars($page))."' WHERE threadid=$threadinfo[threadid]");
  }
Save and upload. This will ensure the 'preview' is also updated when the first post is edited.


2) open root/postings.php.

a) find:

Code:
  $DB_site->query("UPDATE thread SET title='".addslashes(htmlspecialchars($title))."',notes='".addslashes($threadinfo[notes])."'$pollcode WHERE threadid='$threadid'");
Replace is with (changes marked in high):

Code:
[high]  $getfirstpost=$DB_site->query_first("SELECT pagetext FROM post WHERE threadid=$threadid ORDER BY dateline LIMIT 1");
  $page = iif(strlen($getfirstpost[pagetext])>500,substr($getfirstpost[pagetext],0,500).'...',$getfirstpost[pagetext]);
  $page = bbcodeparse($page);
  $page = strip_tags($page);[/high]
  $DB_site->query("UPDATE thread SET title='".addslashes(htmlspecialchars($title))."',notes='".addslashes($threadinfo[notes])."'[high],preview='".addslashes(htmlspecialchars($page))."'[/high]$pollcode WHERE threadid='$threadid'");
This will ensure the 'preview' is updated when a thread is merged, to correctly reflect the new 1st post.

b) find:

Code:
  // Update first post in each thread as title information in relation to the sames words being in the first post may have changed now.
  $getfirstpost=$DB_site->query_first("SELECT postid FROM post WHERE threadid=$threadid ORDER BY dateline LIMIT 1");
  $DB_site->query("DELETE FROM searchindex WHERE postid=$getfirstpost[postid]");
  indexpost($getfirstpost[postid]);

  $getfirstpost=$DB_site->query_first("SELECT postid FROM post WHERE threadid=$newthreadid ORDER BY dateline LIMIT 1");
  $DB_site->query("DELETE FROM searchindex WHERE postid=$getfirstpost[postid]");
  indexpost($getfirstpost[postid]);
Replace it with (changes marked in high):

Code:
  // Update first post in each thread as title information in relation to the sames words being in the first post may have changed now.
  $getfirstpost=$DB_site->query_first("SELECT postid,[high]pagetext[/high] FROM post WHERE threadid=$threadid ORDER BY dateline LIMIT 1");
  $DB_site->query("DELETE FROM searchindex WHERE postid=$getfirstpost[postid]");
  indexpost($getfirstpost[postid]);
[high]  $page = iif(strlen($getfirstpost[pagetext])>500,substr($getfirstpost[pagetext],0,500).'...',$getfirstpost[pagetext]);
  $page = bbcodeparse($page);
  $page = strip_tags($page);
  $DB_site->query("UPDATE thread SET preview='".addslashes(htmlspecialchars($page))."' WHERE threadid='$threadid'");
  unset($page);[/high]

  $getfirstpost=$DB_site->query_first("SELECT postid,[high]pagetext[/high] FROM post WHERE threadid=$newthreadid ORDER BY dateline LIMIT 1");
  $DB_site->query("DELETE FROM searchindex WHERE postid=$getfirstpost[postid]");
  indexpost($getfirstpost[postid]);
[high]  $page = iif(strlen($getfirstpost[pagetext])>500,substr($getfirstpost[pagetext],0,500).'...',$getfirstpost[pagetext]);
  $page = bbcodeparse($page);
  $page = strip_tags($page);
  $DB_site->query("UPDATE thread SET preview='".addslashes(htmlspecialchars($page))."' WHERE threadid='$newthreadid'");
  unset($page);[/high]
This will ensure the 'preview' is updated for both threads, old and new, after splitting a thread in two.

Very nice hack Parker - I personally will use it a lot!!!

Thanks,

Bira
Reply With Quote
  #19  
Old 12-22-2001, 03:17 PM
bira's Avatar
bira bira is offline
 
Join Date: Nov 2001
Posts: 387
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This hack was released in full and can be found here. Don't use instructions in this thread - go to the 'Full Release' one.

Thanks
Reply With Quote
Reply


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 10:31 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04770 seconds
  • Memory Usage 2,298KB
  • Queries Executed 23 (?)
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
  • (12)bbcode_code
  • (1)bbcode_php
  • (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
  • (1)pagenav_pagelink
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)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