Go Back   United Bimmer Community - BMW Forum > UnitedBimmer- Off Topic > United Off Topic  **FOR MEMBERS ONLY** > Geek Chat
FAQ Members List Calendar Advertise With Us Mark Forums Read

Geek Chat Ask computer questions or just engage in general geek talk on here

Reply
 
Thread Tools
Old 03-08-2006, 11:49 PM   #1
komodo
 
komodo's Avatar

Name: komodo
Title: Administrator
Status: Offline
Join Date: Apr 2005
Location: Athens, GA
Rate My Car: 68 / 340
Your Ride: 1995 M3
Angry Freaky-Weird PHP Problem

Hey, you guys see how the thread breadcrumb is all messed up?

I just made a small test script and something is seriously haunted.

If any of you know PHP, care to lend me a hand with this? (jms/ghost)

I can't explain it.

The variable $parentlist is an array {[0] => '17', [1] => '18'}.

Take this code:

[code]
echo $vbulletin->forumcache[18]['title'] . "<br>";
foreach ($parentlist AS $forumID)
{
echo $vbulletin->forumcache[18]['title'] . "<br>";
$forumTitle = $vbulletin->forumcache["$forumID"]['title'];
$navbits['forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f=$forumID"] = $forumTitle;
}[/code]
The output of this block is consistantly:

[code]United Lounge **MEMBERS ONLY**
United Lounge **MEMBERS ONLY**
General Topics[/code]

How the hell did element 18 of the forumcache array change through that loop, which just indexes the breadcrumb elements for the link list at the top?

Am I just an idiot, or is there something seriously wrong there?
__________________


Last edited by komodo; 03-08-2006 at 11:52 PM..
  Reply With Quote
Old 03-09-2006, 06:44 AM   #2
e90jimmy

Name: e90jimmy
Title: Member
Status: Offline
Join Date: May 2005
Rate My Car: 96 / 340
First Off, the $forumID should not be in Quotes,

[code]
$forumTitle = $vbulletin->forumcache[$forumID]['title'];
[/code]
__________________
Logic is a crutch for people who lack creativity -- Me
  Reply With Quote
Old 03-09-2006, 09:19 AM   #3
jms
 
jms's Avatar

Name: jms
Title: ______
Status: Offline
Join Date: Jul 2005
Location: Pittsburgh,PA
Rate My Car: 105 / 340
Your Ride: 99 328I Convertible
I agree the $forumID shouldn't be in quotes, that's just bad coding
[php]
echo $vbulletin->forumcache[18]['title'] . "<br>";
foreach ($parentlist AS $forumID)
{
echo $vbulletin->forumcache[18]['title'] . "<br>";
$forumTitle = $vbulletin->forumcache[$forumID]['title'];
$navbits['forumdisplay.php?' . $vbulletin->session->vars['sessionurl'] . "f=" . $forumID] = $forumTitle;
}
[/php]

now I'm looking at this and the only thing that is being echoed is $vbulletin->forumcache[18]['title'] . "<br>";

I'm not sure what is in the forumcache array but it should display the same thing 3 times. do more output until you see what is changing.
  Reply With Quote
Old 03-09-2006, 10:52 AM   #4
komodo
 
komodo's Avatar

Name: komodo
Title: Administrator
Status: Offline
Join Date: Apr 2005
Location: Athens, GA
Rate My Car: 68 / 340
Your Ride: 1995 M3
I have tried forumid with and without quotes. It came with quotes originally from vbulletin as how they coded it, and good or bad it works on most sites out there.


And that's why I'm confused.... element 18 doesn't appear to be touched, so how is it being changed?

Actually, I suppose I could break it up into two loops (lose effeciency though), and create a seperate array for the forumtitle, which I'll use to assign to navbits in the 2nd loop....

Hum...
__________________

  Reply With Quote
Old 03-09-2006, 12:16 PM   #5
jms
 
jms's Avatar

Name: jms
Title: ______
Status: Offline
Join Date: Jul 2005
Location: Pittsburgh,PA
Rate My Car: 105 / 340
Your Ride: 99 328I Convertible
you could print_r the forumcache array at each step and see where it might be changed. Is it possible that something else might be changing the forumcache array?
  Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Angel Eye Problem, one halo not working right Tochenzo E36 7 12-07-2005 06:46 PM


All times are GMT -5. The time now is 01:54 AM.

A vBSkinworks Design

 
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Copyright © 2005-2013 UnitedBimmer.com