vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How Best to Code This? (https://vborg.vbsupport.ru/showthread.php?t=161535)

toucan42 10-30-2007 05:15 PM

How Best to Code This?
 
I have been trying to figure out how to code something and hope I can get some guidance on where things should go and how they should be treated.

Basically I need someone who can say "this should be in X file and that should be a new plugin and yada yada"

Here goes:

I need to add a button to showthread on posts for users of a particular secondary usergroup. This button will make an AJAX call to update a new table. Normally I would place the code for this added button into Postbit, but here's the rub - the button should only appear under conditions which are more complex than the secondary usergroup membership and as such are not covered by vB variables.

If I need to create a new variable that will be available to postbit and it contains information for each post in a thread (maybe an array?) where should the query go that gets that information and where should the variable be declared?

The information used to determine the existence of this button all exists in a new table. I can store thread id and user id and post id in the new table for every instance of where a button should go, but I need to know where to place the query such that when viewthread is called it can be aware (and make <if> conditional branches in postbit) of what posts need the button.


All times are GMT. The time now is 08:49 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.01022 seconds
  • Memory Usage 1,700KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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