NameSilo

Php offset problem

SpaceshipSpaceship
Watch

labrocca

Top Member
Impact
555
PHP:
        $ranknames = explode(',',setting('article_ranknames'));
        $count = 1;
        while (list(,$name) = each($ranknames))
        {
        	$name = trim($name);
            $template->ASLStatement($name . 'rank');
            if ($article['rank' . $count] != '-1')
            {
            	$template->ASLCondition($name . 'rank');
            }
            $vars2[$name . 'rank'] = $article['rank' . $count];
			$bar = imagecreatefrompng(setting('documentroot') . _MISCFOLDER . 'rankbar.png');
         	$width = imagesx($bar);
         	$height = imagesy($bar);
         	//$resized = round(($width / setting('article_rankingtotal')) * $article['rank' . $count]);
         	$resized = round((($width / setting('article_rankingtotal')) * (setting('article_rankingtotal') * $article['rank' . $count])) / setting('article_rankingtotal'),0);
         	$vars2[$name . 'rank_bar'] = '<img src="' . _SITEFOLDER . _MISCDIRECTORY . '/rankbar.png" width="' . $resized . '" height="' . $height . '" alt="' . $rank . '" />';

        	$count++;

        }


That code is giving me offset problem where I believe the $name array is the culprit. The code works on php4 but not php5 and it's a problem since host just updated (pricks).

Any help is greatly appreciated.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Appraise.net

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back