Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 04-05-2012, 08:57 AM
runnerjp runnerjp is offline
 
Join Date: Mar 2012
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I cant find parse_templates in hooks :S
Reply With Quote
  #12  
Old 04-05-2012, 04:04 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by runnerjp View Post
I cant find parse_templates in hooks :S
It's definitely there in my 4.1.11 install.
Reply With Quote
  #13  
Old 04-05-2012, 04:13 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you're not familiar with creating a plugin, you can search for "Adding or Editing a Plugin" in the vbulletin manual: https://www.vbulletin.com/docs/html?...rsion=40111601 . In case there's any confusion, I was talking about the "Hook Location" drop-down menu when you're creating a plugin.

Also, I edited my post above - I forgot to mention above that 'ad_location_above_footer' was just an example template name.
Reply With Quote
  #14  
Old 04-06-2012, 08:11 AM
runnerjp runnerjp is offline
 
Join Date: Mar 2012
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok i have got the forum name issue is i have written my code in php and dont nknow how to get it to work within a template.

foruminfo.title could really be the id so foruminfo.threadid but that does not seem to work

PHP Code:
include_once "../shared/ez_sql_core.php";
include_once "ez_sql_mysql.php";
$db = new ezSQL_mysql('db_user','db_password','db_name','db_host');

$results = $db->get_results("SELECT name, email FROM users");

foreach ( $results as $user ) {
    If ($user->name == {vb:raw foruminfo.title})
{
?>
<iframe width="800" frameborder="0" height="110" src="http://www.clubmonza.com/forums/<?php echo {vb:raw foruminfo.title?> "></iframe>
<?
}

}
?>
The way the code works is if in the database someone has selected to show a special banner on a forum page then it shows. Issue is i have no idea where to add it within the plugins or templates
Reply With Quote
  #15  
Old 04-06-2012, 10:07 AM
Pandemikk Pandemikk is offline
 
Join Date: Jul 2009
Posts: 292
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

...What are you doing?

Why are you trying to connect to ezSQL_mysql? Get rid of that junk and use the normal database abstraction layer!

Secondly, you're comparing a username to a forum's title and you wonder why you're not getting results?

Thirdly, you're using template syntax within a PHP file?!
Reply With Quote
  #16  
Old 04-06-2012, 09:03 PM
runnerjp runnerjp is offline
 
Join Date: Mar 2012
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the username was incorrect it was just an example.

Thirdly, you're using template syntax within a PHP file?! < this is what i dont understand how do i split the two up?
Reply With Quote
  #17  
Old 04-07-2012, 12:06 AM
Pandemikk Pandemikk is offline
 
Join Date: Jul 2009
Posts: 292
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by runnerjp View Post
the username was incorrect it was just an example.

Thirdly, you're using template syntax within a PHP file?! < this is what i dont understand how do i split the two up?
You have to use template syntax within a template.

There's plenty of articles on this here: https://vborg.vbsupport.ru/forumdisplay.php?f=242
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:06 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07326 seconds
  • Memory Usage 2,225KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete