The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
first post
is there away to pull the first post from using a plugin hook?
|
#2
|
||||
|
||||
the first post on the whole forum? or from one particular user? or from one section
|
#3
|
||||
|
||||
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".
|
#4
|
|||
|
|||
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. |
#5
|
||||
|
||||
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?)
|
#6
|
|||
|
|||
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. |
#7
|
||||
|
||||
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. |
#8
|
|||
|
|||
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']; if ($thread_id_inj != '' && $_GET['styleid']==9){ //global $db $vbulletin; //$get_first_post_inj = $db->query_read(); $get_first_post_inj = $vbulletin->db->query_read("SELECT pagetext FROM " . TABLE_PREFIX . "post WHERE threadid = $thread_id_inj LIMIT 1"); } echo $get_first_post_inj; Code:
Database error in vBulletin 3.8.4: Invalid SQL: ; MySQL Error : Error Number : 0 |
#9
|
|||
|
|||
You mean similar to what RaGEZONE has (or had)? where it shows the beginning of a thread in the description of that forum?
|
#10
|
||||
|
||||
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. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|