vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How do I get thread title in a plugin? (https://vborg.vbsupport.ru/showthread.php?t=242433)

TheBest1111 05-13-2010 02:30 PM

How do I get thread title in a plugin?
 
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

Quote:

Originally Posted by Lynne (Post 2036418)
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

Quote:

Originally Posted by Lynne (Post 2036723)
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:

Code:

ob_start();

[echo thread title]

$includedphp = ob_get_contents();
ob_end_clean();

It is the plugin code. With Global_Start.

--------------- Added [DATE]1273843421[/DATE] at [TIME]1273843421[/TIME] ---------------

:)

Code:

echo $threadinfo['title'];
Works!

Thanks a lot.


All times are GMT. The time now is 11:51 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
  • Page Generation 0.00983 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete