vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   read field value for current thread via plugin to feed info into template (https://vborg.vbsupport.ru/showthread.php?t=262894)

Lestat_ 04-30-2011 12:00 PM

read field value for current thread via plugin to feed info into template
 
I'm not sure if I use the correct terminologie so I'm going to try explain what I would like to achieve :

I have written a vb.net application which extracts downloadlinks from my vbulletin threads and then verifies if the links are stil valid. The app sends back the result (dead, alive) to a varchar field (linkresult) I added to the vb_thread table.

Then, I would like to display this info in showthread, so I would add this code to the showthread template (because I only want to display the info in de first post which contains the download links, i added a if condition to check this):

Code:

<vb:if condition="!$GLOBALS['FIRSTPOSTID']">
{vb:raw template_hook.thiswouldbemyplugin}
</vb:if>

So, to get the info from mysql when showthread is opened, I'm guessing I would have to add a new plugin, which contains the php to access the database and passing the current threadid variable, retuning the info for that thread in field linkresult which will then be displayed within the template hook.
I'm new to vbulletin and after looking at some mods which I downloaded here, this is what I think should be the procedure to do this.
Therefor I would like to ask the experts if what I described above is the correct way to do this ?

thanks in advance for a reply :)

Lynne 04-30-2011 04:19 PM

This is info in the thread table and the template_hook is in SHOWTHREAD? Probably use the hook location showthread_query to add in your field.

Lestat_ 04-30-2011 04:22 PM

thanks i'll look into that :)

Lestat_ 05-13-2011 03:45 AM

yes Lynne, you definitely showed me the way :D
As a vbulletin newbie but with developing skills (formerly phpbb but also .net & especially sql ) I must say vbulletin is heaven compared to phpbb :) the plugin system in combination with the template variables is such a great help to make custom modifications which improves user experience.
Vbulletin rulez ! :)
this thread can be closed, thank you very much for your help


All times are GMT. The time now is 02:11 AM.

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.01116 seconds
  • Memory Usage 1,711KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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