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

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
  #2  
Old 12-09-2001, 12:20 PM
Parker Clack Parker Clack is offline
 
Join Date: Oct 2001
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Note:

I have found that if the post has quotes in it that it will affect the display of the hyperlink on the forumdisplay. You have to change this to single quotes instead of double quotes.

Any work around for that?

Parker
Reply With Quote
  #3  
Old 12-09-2001, 01:11 PM
Wayne Luke's Avatar
Wayne Luke Wayne Luke is offline
Senior Member
 
Join Date: Jan 2002
Location: Southern California
Posts: 1,694
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Doesn't this add one query for every thread shown in forumdisplay. At the default that is 15 new queries shown for every forumdisplay page which can add up a to a lot of resources.

A better solution would be to:

1) Add a new "preview" field to the thread table.
2) Move the code that generates the snippet to the newthread.php file.
PHP Code:
    $page=iif(strlen($message>500,substr($message,0,500)."...",$message); 
Place that above the line that begins:
PHP Code:
      $DB_site->query("INSERT INTO thread 
Alter that same INSERT query to insert the preview as well.

4) Alter the statement that begins with:
PHP Code:
$threads=$DB_site->query(
so that is pulls the preview from the database as well.

5) Finally in forumdisplay.php you add the other two lines where you had them to begin with:
PHP Code:
    $page=bbcodeparse2($page,1,1,1,1); 
    
$page=strip_tags($page); 
This will give you now new queries while pulling the thread information.

If you have dot folders turned on you can edit the $dotuserid string to pull the message information and get by with less coding and still not have any new queries at display time.
Reply With Quote
  #4  
Old 12-09-2001, 07:17 PM
Symbian.info Symbian.info is offline
 
Join Date: Nov 2001
Location: Netherlands
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

??? What is the good en complete hack? I am lost now..
Reply With Quote
  #5  
Old 12-09-2001, 08:00 PM
TheComputerGuy's Avatar
TheComputerGuy TheComputerGuy is offline
 
Join Date: Oct 2001
Location: TX
Posts: 580
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well I think the orginal hack is a great thing, and I think wLuke is saying that for larger boards this would be a good thing to modify...I have it on my test board, and Its going to be included on the new new board for the new year at hand
Reply With Quote
  #6  
Old 12-09-2001, 08:02 PM
Wayne Luke's Avatar
Wayne Luke Wayne Luke is offline
Senior Member
 
Join Date: Jan 2002
Location: Southern California
Posts: 1,694
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That is correct. The original as posted will work fine but if you start running into resource limitations, it can be improved for larger boards. That was my original intent.
Reply With Quote
  #7  
Old 12-09-2001, 10:24 PM
Parker Clack Parker Clack is offline
 
Join Date: Oct 2001
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wluke:

Great suggestion. I am a poor coder so could you post examples of what you are talking about. The ones you suggested I am afraid I would screw up.

Parker
Reply With Quote
  #8  
Old 12-09-2001, 10:43 PM
Parker Clack Parker Clack is offline
 
Join Date: Oct 2001
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wluke:

I created a table preview with setting of mediumtext not null in
the database

Then I used:

$page=iif(strlen($message>500,substr($message,0,50 0)."...",$message);

$DB_site->query("INSERT INTO thread (.....,preview) VALUES (..................,'".addslashes(htmlspecialchars ($page))."')");

in the newthread.php file

and

$threads=$DB_site->query("SELECT .....,preview FROM thread..

from forumdisplay.php

and took out the

$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);

and replaced it with:

$page=bbcodeparse2($page,1,1,1,1);
$page=strip_tags($page);

Should that do it?

Parker
Reply With Quote
  #9  
Old 12-10-2001, 02:43 AM
Wayne Luke's Avatar
Wayne Luke Wayne Luke is offline
Senior Member
 
Join Date: Jan 2002
Location: Southern California
Posts: 1,694
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It looks like it. Can't tell until I try it.

I will be finally getting the chance to upgrade SPF to 2.2.1 in the next couple of days. My changelog of modifications I have made is 50K for the user front end alone. I haven't even started applying my changes to the moderators control panel yet.

Once I finish that project, I will probably implement this as well and have the code I write for you to compare with.
Reply With Quote
  #10  
Old 12-10-2001, 03:40 AM
Parker Clack Parker Clack is offline
 
Join Date: Oct 2001
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wluke:

I look forward to this. One thing though. When I put

$page=iif(strlen($message>500,substr($message,0,50 0)."...",$message);

into the newthread.php I get a parse error at the line it is on.

I will wait and see what you come up with.

While you are at it see if you can get it to pass quotes in the information that is passed because if they are used in the message of the first post it the text for the hyperlink is not displayed.

Parker
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 11:59 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.04685 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
  • (4)bbcode_code
  • (4)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
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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