vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   variables in a while loop (https://vborg.vbsupport.ru/showthread.php?t=39871)

Jakeman 06-15-2002 08:23 AM

variables in a while loop
 
1 Attachment(s)
my objective: to duplicate a forum in my forumbits so it is displayed twice on my forumhome, at two different spots.

problem i'm having: the variables i am putting the forum values into are not being passed into the next loop when the while loop repeats itself. the result is a duplicate forum without any values for variables in the forumbit template (basically a blank row in my forumhome forum listing).

fyi: i have copied the function i am modifying from the forum/index.php file for vB 2.2.6 (see attached file). my code additions are marked with comments. there are two sections of my code. the top section assigns variable values during a certain loop, the bottom section uses those values in a later loop.

question: how do i pass on the variable values so they can be used in a later instance of the while loop? or am i wrong about the problem and is this not the right question? ;)

thx for any help :)

Admin 06-15-2002 04:45 PM

Not sure what you're trying to do, but add $gameforum to the list of global variables in makeforumbit().

Logician 06-15-2002 06:55 PM

Your problem might be related to this line:

if ($forum[forumid]==19) {

I assume you have 18 forums and you want to assign the saved one as 19th. If this is the fact you are missing the point that since you have 18 forums this conditional will be never be TRUE so will not be parsed.

If this is the problem set it to 18. The better is put a
$i++;
echo $i;

debug line inside while and see what will be $i get at the end of while.

Or put line
echo "came here";

after
if ($forum[forumid]==19) {

and see if conditional is parsed.

Jakeman 06-15-2002 07:22 PM

that worked firefly. see the end result here: http://www.macsubculture.com/forum/

notice my MSC clan forum and Games forum. the Games forum isn't really a forum, just a duplicate of the MSC clan forum with a different name that links to the MSC clan forum and mirrors all its forumhome stats.


All times are GMT. The time now is 10:05 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.01050 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)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