Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 04-20-2009, 12:49 AM
ScottC2105 ScottC2105 is offline
 
Join Date: Dec 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

"spot prior to the header being evaled" - Which template bit would that be?
Reply With Quote
  #12  
Old 04-20-2009, 03:02 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You don't put php code in templates. So, you would have to copy the code that creates $notifications_total into a plugin, or into the actual page (if you can't find a good hook location) to a spot that is prior to the header template being evaled. I believe the $notifications_total is defined in global.php, so you can copy the code from there.
Reply With Quote
  #13  
Old 04-20-2009, 10:43 AM
ScottC2105 ScottC2105 is offline
 
Join Date: Dec 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
You don't put php code in templates. So, you would have to copy the code that creates $notifications_total into a plugin, or into the actual page (if you can't find a good hook location) to a spot that is prior to the header template being evaled. I believe the $notifications_total is defined in global.php, so you can copy the code from there.
I've copied the code (not sure if I an post it here) and made ther hook global_start and it still isn't working. What am I doing wrong?
Reply With Quote
  #14  
Old 04-20-2009, 02:06 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In looking at global.php, you shouldn't have even had to copy the code. It looks like the header template is evaled right after the code (just a few lines later). If it isn't showing up, then there is something else going on. Either there are no notifications, or some other error is causing problems. Check your error_logs and see if anything is showing up there. Otherwise, I'm not sure what else to suggest.
Reply With Quote
  #15  
Old 04-20-2009, 07:26 PM
ScottC2105 ScottC2105 is offline
 
Join Date: Dec 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
In looking at global.php, you shouldn't have even had to copy the code. It looks like the header template is evaled right after the code (just a few lines later). If it isn't showing up, then there is something else going on. Either there are no notifications, or some other error is causing problems. Check your error_logs and see if anything is showing up there. Otherwise, I'm not sure what else to suggest.
I see what you mean, it does work. I am using the plugin system to include a custom login box .php file I have made and inserting it in the header. Now, if this file is on any other page but a vBulletin one it shows $notifications_total fine. If it is included using the plugin system into my vbulletin skin $notifications_total doesn't work in my php file but it does in the template header.

I am using global_start hook for the plugin. Am I doing something wrong?
Reply With Quote
  #16  
Old 04-20-2009, 07:32 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

We went through a strange issue a week or so ago where plugins weren't getting parsed on external pages. The solution for that was here. I'm not sure if that would help out here cuz I never did go research exactly what was going on, but at this point it might be worth a shot.
Reply With Quote
  #17  
Old 04-20-2009, 08:22 PM
ScottC2105 ScottC2105 is offline
 
Join Date: Dec 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
We went through a strange issue a week or so ago where plugins weren't getting parsed on external pages. The solution for that was here. I'm not sure if that would help out here cuz I never did go research exactly what was going on, but at this point it might be worth a shot.
If I add that code to my plugin or php file I get:

Warning: mysql_query(): 7 is not a valid MySQL-Link resource in [path]/includes/class_core.php on line 408 . I'm not trying to run a plugin on an external page I 'm trying to include my php file in the header template of vbulletin which contains $notifications_total in it. It works outside vB but in vB it doesn't work.
Reply With Quote
  #18  
Old 04-20-2009, 08:39 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, I'm not understanding something.... when you talk about the header template, you are talking about the regular vb header template, right? Not a special header template you wrote for another page. And in the header template, you have written the word "$notifications_total" that is giving the total in your vb pages but not your external page, right? Are you evaling the header template yourself, or is it getting evaled in the global.php file like normal?

And it sounds like you *are* trying to use a plugin to include your stuff. You said you were using the global_start plugin for your code. Is that not right? So, that is running the global_start plugin on your external page.

Perhaps you need to start posting your code, cuz I'm getting confused now with what you are doing.
Reply With Quote
  #19  
Old 04-20-2009, 09:23 PM
ScottC2105 ScottC2105 is offline
 
Join Date: Dec 2008
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
OK, I'm not understanding something.... when you talk about the header template, you are talking about the regular vb header template, right? Not a special header template you wrote for another page. And in the header template, you have written the word "$notifications_total" that is giving the total in your vb pages but not your external page, right? Are you evaling the header template yourself, or is it getting evaled in the global.php file like normal?

And it sounds like you *are* trying to use a plugin to include your stuff. You said you were using the global_start plugin for your code. Is that not right? So, that is running the global_start plugin on your external page.

Perhaps you need to start posting your code, cuz I'm getting confused now with what you are doing.
Sorry Lynne. I have managed to get it to work by recoding my php file inside the vB header template using vBs if conditions and else etc. What was happening was, my login php file that is on all my pages shows a login box if you are not logged in. If you are logged in, it says hello and tells you if you have any current norifications. Now, this was working fine on all other pages EXCEPT for vBulletin. I used a plugin to include my login php file and the php file uses $notifications_total but for some reason, the included php file ON vBulletin pages was showing $notifications_total as "" (blank). So, I have rewritten the php file inside the header for my vBulletin template and $notifications_total works fine. The only thing is I now have a php file for my website and the same code in my header on vbulletin so if I ever want to change it I have to change my code in two places.

Thank you for all you help, much appreciated.
Reply With Quote
  #20  
Old 04-20-2009, 10:01 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad you got it working.
Reply With Quote
Reply

Thread Tools
Display Modes

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 10:50 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.04579 seconds
  • Memory Usage 2,251KB
  • Queries Executed 11 (?)
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
  • (4)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
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_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