vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Getting the sub forum name from url (https://vborg.vbsupport.ru/showthread.php?t=281014)

runnerjp 04-05-2012 08:57 AM

I cant find parse_templates in hooks :S

Lynne 04-05-2012 04:04 PM

Quote:

Originally Posted by runnerjp (Post 2316929)
I cant find parse_templates in hooks :S

It's definitely there in my 4.1.11 install.

kh99 04-05-2012 04:13 PM

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.

runnerjp 04-06-2012 08:11 AM

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

Pandemikk 04-06-2012 10:07 AM

...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?!

runnerjp 04-06-2012 09:03 PM

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?

Pandemikk 04-07-2012 12:06 AM

Quote:

Originally Posted by runnerjp (Post 2317505)
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


All times are GMT. The time now is 06:12 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.01676 seconds
  • Memory Usage 1,729KB
  • 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_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete