NameSilo

Php offset problem

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
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.
GoDaddyGoDaddy
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

Watched threads: your alert now keeps up with new replies
When you watch a thread, each new reply now updates your alert. Before, you got one alert and then nothing until you read the thread...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back