PDA

View Full Version : How do I get thread title in a plugin?


TheBest1111
05-13-2010, 02:30 PM
Hi, I want to have access to the thread title in a plugin, how do I proceed?

I am running 3.8.3

Regards.

Lynne
05-13-2010, 02:36 PM
For what page? For what template? We need information before we can give an answer.

TheBest1111
05-13-2010, 03:11 PM
For what page? For what template? We need information before we can give an answer.

Sorry I am new to all this. Page and Template?

I am not too happy with the inbuilt Related Threads feature.. so I am building my custom one.

My requirement is: To show related threads on Showthread template just above the footer.

In the plugin code I need Title of the current thread, so that it could match the other threads' titles in the database using my custom mysql query (in the plugin).

Lynne
05-14-2010, 02:58 AM
Well, you haven't mentioned with hook location you are going to use, but I would imagine the variable for the thread title would be something like $thread['title'] or $threadinfo['title']

TheBest1111
05-14-2010, 07:33 AM
Well, you haven't mentioned with hook location you are going to use, but I would imagine the variable for the thread title would be something like $thread['title'] or $threadinfo['title']

Hook, as in Global_Start?

The plugin is just a workaround because vBulletin doesn't let add php to templates.

My problem can be solved if you could just tell me how to print thread title using php. Something like:

ob_start();

[echo thread title]

$includedphp = ob_get_contents();
ob_end_clean();

It is the plugin code. With Global_Start.

--------------- Added 1273843421 at 1273843421 ---------------

:)

echo $threadinfo['title'];

Works!

Thanks a lot.