Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
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-07-2001 Last Update: Never Installs: 0
 
No support by the author.

I am wanting to call up the first post in a thread using the pagetext information in the post table. What would I use as a database query so that I get the pagetext associated with the first post in a thread?

I am wanting to use this in the forumdisplay.php file right before the call to the forumdisplaybit template.

I have tried using:

$post=$DB_site->query_first("SELECT pagetext FROM post WHERE threadid=$thread[threadid]");
$page=post[pagetext];

But I get varied results and it is is not the first post associated with the threadid.

Any ideas?

Thanks,
Parker

Show Your Support

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

Comments
  #12  
Old 12-08-2001, 11:29 PM
Parker Clack Parker Clack is offline
 
Join Date: Oct 2001
Posts: 351
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Chen:

I got that code to work too. Thanks so much.

Here is what I am trying to do and maybe you have some thoughts on this.

First off. The "title" tag can be used in a hyperlink so that it is a mouseover pop up box. So whatever you put in that title="your tex here" will get put in a little box when a person puts their mouse on the hyperlink.

The HMTL code would look like
< a href="http://www.yourplace.com" title="This is a test to show you what I am talking about" >Testing< /a >

and you just put that in the forumdisplaybit template as

<a href="showthread.php?s=$session[sessionhash]&threadid=$thread[threadid]" title="$page">$thread[title]</a>

At any rate I am wanting to put the $page output from the code used here but a lot of cases when a member posts a large font or they use some kind of extra html code or vB code that code shows up in the actual hyperlink itself. So instead of just the title of the thread the pagetext code shows up in the hyperlink text too. The majority of the time this works great. It is just those cases where the code is off. So, play around with this for a bit and see what you can come up with if you want.

Some members of mine have seen this used on another site, using a cold fusion type BB, and it works fine there.

Thanks for all the help with everything.

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

Chen:

I was noticing in the functions.php file using the bbcodeparse2 there are a bunch of replacement variables that are set up.

What I was thinking was you could write a bbcodeparse3 and have the script look at anything that had a [ ] or < > and replace it and everything that is in those brackets with "" instead.

This would make me think that it would strip out anything that is within any of those types of brackets, whether vB code or HTML.
All you would be left with is the text. Which is what you want anyway.

Any ideas on how to write that code for the bbcodeparse3?

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

I tried using:

$page=wordsonly($page)

and that worked to some degree but it still stripped out some of the hyperlink text itself and then butchered the actual text taking out the I's, Its, on, any, etc. but left other words alone. Very strange.

Any ideas on what I could use in the functions.php that would only put text and nothing between the [ ] and < >?

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

Parker, do this:

after

$page=bbcodeparse2($page,1,1,1,1);
(this will give you the text with the bbcodes turned html)

Do

$page=strip_tags($page);
(This will give you the text without the html codes).

Cheers,

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

Thanks Bira:

That worked great.

Parker
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 02:50 PM.


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.04129 seconds
  • Memory Usage 2,246KB
  • Queries Executed 22 (?)
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
  • (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
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (6)postbit_onlinestatus
  • (6)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_postinfo_query
  • fetch_postinfo
  • 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