Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 03-01-2009, 06:46 PM
ButtKrust ButtKrust is offline
 
Join Date: Feb 2009
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It was your code that made me realize that $forumid was in fact working in that php file ;-)

--------------- Added [DATE]1235944263[/DATE] at [TIME]1235944263[/TIME] ---------------

I've actually got another problem now. When i use the part of your code like if(forumid=5) then do this, it works fine. AFTER this part of the code, then i can get "echo $forumid" to display something. However, If i simply try to use "echo $forumdisplay" WITHOUT any other code (such as the if statement), it doesn't display anything or work. Any reason why this happens? It seems that if($forumid = 5) is assigning the value of 5 to $forumid, rather than giving me the actual forumid. Since if i view this on a page where forum id is actually 6, it still displays 5 because that is what $forumid was assigned. I guess i'm back to my starting problem of pulling the actual forum id. I was fooled earlier.
Reply With Quote
  #12  
Old 03-01-2009, 07:59 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't understand the full problem (probably partly because I am totally unfamiliar with vbadvanced), but you are using php and thus the condition should be if($forumid == '1') - a double equal, not a single one.
Reply With Quote
  #13  
Old 03-01-2009, 08:03 PM
ButtKrust ButtKrust is offline
 
Join Date: Feb 2009
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm just back at stage one it seems, i need to be able to recognize the current forum id with some sort of function. To keep it very simple, how would i output the current forum id with ECHO? In such a way that when i am at ForumA with the ID of 5, it will echo '5'. But when i go on over to forumB with ID of 6, it will echo '6'. This is what i'm really getting at.
Reply With Quote
  #14  
Old 03-01-2009, 08:21 PM
Mr-Moo Mr-Moo is offline
 
Join Date: Sep 2007
Location: Chicago, IL.
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Should be as simple as:

PHP Code:
echo $forumid
And thank you for that correction Lynne, you are correct. It was an operation being compared.
Reply With Quote
  #15  
Old 03-01-2009, 08:23 PM
ButtKrust ButtKrust is offline
 
Join Date: Feb 2009
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mr-Moo View Post
Should be as simple as:

PHP Code:
echo $forumid
And thank you for that correction Lynne, you are correct. It was an operation being compared.
Is there a specific outside php file i need to "Include" at the top of my current php file in order for $forumid to actually work properly?
Reply With Quote
  #16  
Old 03-01-2009, 08:25 PM
Mr-Moo Mr-Moo is offline
 
Join Date: Sep 2007
Location: Chicago, IL.
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, but then again I do not know where you are placing this at. What file are you editing? The global.php may need to be included.
Reply With Quote
  #17  
Old 03-01-2009, 08:26 PM
ButtKrust ButtKrust is offline
 
Join Date: Feb 2009
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mr-Moo View Post
No, but then again I do not know where you are placing this at. What file are you editing? The global.php may need to be included.
in a separate php file all by itself. I guess that's my problem, i'll try including the global.

--------------- Added [DATE]1235946568[/DATE] at [TIME]1235946568[/TIME] ---------------

Including global.php didn't work.. it must be that i have to include a file. I'll try to find the right one.

--------------- Added [DATE]1235948936[/DATE] at [TIME]1235948936[/TIME] ---------------

If i include global.php and then use "Echo $foruminfo", it echoes "array" and if i use "Echo $foruminfo[forumid]" nothing comes out. I think i'm on to something by getting "array" to display, is there a way i can go about analyzing the array and extracting the forum id from it?
Reply With Quote
  #18  
Old 03-02-2009, 05:02 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
print_r($foruminfo); 
Reply With Quote
  #19  
Old 03-02-2009, 05:11 AM
ButtKrust ButtKrust is offline
 
Join Date: Feb 2009
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The only two things i've managed to have output anything while having global.php included are "Echo $foruminfo" which outputs the word "Array" and what you just posted, print_r($foruminfo) which outputs "Array ( )" So apparently it knows that $foruminfo is an array... how do i go about grabbing the forumid part of that array? No form of "$foruminfo['forumid']" seems to work. In fact when i use that, it outputs nothing rather than even the word array.

Keep in mind this is a separate php file so i know there's got to be some trick to grabbing the forum id from the separate php file, but i just can't figure out how. Am i missing some include files that need to be included?
Reply With Quote
  #20  
Old 03-02-2009, 05:18 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Using the code I posted will allow you to see what is contained inside the array...
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 07:52 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.05903 seconds
  • Memory Usage 2,260KB
  • 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
  • (3)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
  • (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_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