![]() |
first post
is there away to pull the first post from using a plugin hook?
|
the first post on the whole forum? or from one particular user? or from one section
|
And to use where? Which hook location? Just the post id or the actual text or ?? Your question is waaaaay too general unless you just want an answer like "yes, probably".
|
oh sorry... i want to get the text from the first post in a thread and store it to a value.
$first_post = not sure if i can use showthread_start or if there's already something like $threadinfo[title] i could use that. thanks for your replies! --------------- Added [DATE]1251639047[/DATE] at [TIME]1251639047[/TIME] --------------- Quote:
just the first post of every thread regardless of user or forum. |
So, you want to grab the text of the first post in every thread and put it where? We need to know where you are going to display it in order to figure out the variable name. (You know the first text (a set amount of it) is already displayed if you hover over the thread title in the forumdisplay.php page, right?)
|
i know if i tell you where i'm going to put it you're just going to tell me to buy vbseo. i don't want that junk. lol
i'm putting it in the head description. |
Since I am barely familiar with vbseo (I know what it is, but that's all), I would never suggest to someone to buy it.
The $header is evaled before the SHOWTHREAD template is. You will have to write a query in the global_start location (perhaps) to grab the text from the first post of the thread and then do something with it. |
thanks as always Lynne. that makes sense. time to brush up on proper vbulletin queries. :)
--------------- Added [DATE]1251722183[/DATE] at [TIME]1251722183[/TIME] --------------- of course i'm back. :( not only does my code suck but i also don't know the db structure. i don't have phpmyadmin installed or anything so digging through tables and stuff via command line seems like a lot of work. what jumps out at you when you look at the following. i know this is wrong but this is what i have so far: Code:
$thread_id_inj = $_GET['t']; Code:
|
Quote:
|
So you are passing both the threadid and styleid in the url? If so, you need to clean them prior to using them. example:
PHP Code:
PHP Code:
And don't echo. Assign the result to a variable and then insert the variable into the template where you want it. You may have issues just using the pagetext as is (I can't remember). Perhaps use stripslashes or similar after you get it from the database. |
Why not just add a plugin in postbit_display_start to save $post[message] from the first instance, and then use it in the showthread template?
|
That won't allow him to use it in the $header. The header is evaled long before you get to eval the postbit_display_start hook.
|
Quote:
Quote:
the echo thing was just to see some quick output before putting it in a variable for real testing. i think i was staring at the screen too when i posted that too so that didn't help. lol anyway, thanks to your help, i finally got it done. it went from a quick query to adding a bunch of little things to make it work good. like limiting it to 30 words, removing line breaks, quotes and all that other stuff. i'll test this for a bit to make sure it's working well and then i'll post it so if someone else wants to do the same they can. thanks again! |
All times are GMT. The time now is 11:10 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|