During user Registration progress bar is set to 150% in step 3 and to 134% in step 4. Here is the code from progressbar.php:
<?php
class CProgressbarHelper{
static public function getHTML( $max=100, $currval=0, $barclass='outerpgbar', $barfillclass='innerpgbar'){
if(!is_numeric($max) || !is_numeric($currval) || $max < 0 || $currval < 0)
return '<div>Progress bar cannot be generated properly</div>';
$width = intval(($currval/$max) * 100) ;
$barclass = (!empty($barclass))
? 'class="'.$barclass.'"'
: 'style="background-color:white; height:.8em; border :1px solid #D0D0D0; margin-bottom:10px; padding:1px; "' ;
$barfillclass = (!empty($barfillclass))
? 'class="'.$barfillclass.'" style="width:'.$width.'%;"'
: 'style="width:'.$width.'%; height: 100%; background-color:blue; position:relative;"' ;
//class progressbarfill : inside of the progress bar
$html = '<div '.$barclass.' >'.
'<div '.$barfillclass.'></div>'.
'</div>';
return $html;
}
}
I have also tried an answer to such an issue at another blog as to change the line 1055 of /administrator/components/com_community/installer.helper.php from
$html .='<div class="outerpg"><div class="innerpgbar" style="width:'.$percentage.'%;"> '. $percentage .'%</div></div>';
to
$html .='<div class="outerpg"><div class="innerpgbar" style="width:'.($percentage/2).'%;"> '. $(percentage/2) .'%</div></div>';
But it is still not working properly. In fact, it has cut the progress bar in half on the first user registration page.
I can’t show the image here clearly, but you can understand it by registering at Jomsocial>>Demo. In fact, you won’t see the error there.
The code which called this function passed a value for
$currvalwhich is higher than$max. Something likegetHTML(100, 154)(this will give you 154% as result).You may add the following line:
(before the
$width = intval(($currval/$max) * 100);line)This way, you avoid having percentage higher than 100%.