vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Hook Location?? (https://vborg.vbsupport.ru/showthread.php?t=106330)

Oreamnos 01-25-2006 11:16 PM

Hook Location??
 
I am trying to create a tiny plugin that gets evaluated for each post in a thread.

This code should be executed for each post:
PHP Code:

if ($post['userid'] == 1) {
    
$admin_has_posted++;


I want to access the $admin_has_posted variable in the postbit template for the following conditional statement.

Code:

<if condition="$admin_has_posted == 1">
do this...
<else />
do that...
</if>

Where should I put this hook so that it is executed properly?

thanks
eric

Andreas 01-25-2006 11:19 PM

postbit_display_complete
Though, it won't work this way.

Oreamnos 01-25-2006 11:20 PM

Quote:

Originally Posted by Andreas
postbit_display_complete
Though, it won't work this way.

thanks Andreas, but what am i doing wrong?

harmor19 01-26-2006 12:41 AM

I want to do the same thing but I get an error when I use

PHP Code:

$gethostforum $db->query_read("SELECT * FROM " TABLE_PREFIX "hosting_options WHERE optionid='1'");
    
$hf $db->fetch_array($gethostforum); 

Here's the conditional I have in the postbit template.
<if condition="$thread[forumid] == $hf[new_request]">

"new_request" has the id of the forum I want to use the conditional on.
I doubt the conditional is causing the problem though


Here's the error
Fatal error: Call to a member function on a non-object in c:\apache\htdocs\forum\forums\includes\class_postb it.php(279) : eval()'d code on line 1


All times are GMT. The time now is 11:48 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.00974 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
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_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