PDA

View Full Version : defining an array and $istyles


sabret00the
01-18-2006, 03:00 PM
first off can someone tell me where $istyles is defined please?

secondly, what's wrong with this?
if (!$istyles)
{
$istyles = array(
[pi_button_down] => array(
[0] => '#98B5E2',
[1] => '#000000',
[2] => '0px',
[3] => '1px solid #316AC5'
),
[pi_button_hover] => array(
[0] => '#C1D2EE',
[1] => '#000000',
[2] => '0px',
[3] => '1px solid #316AC5'
),
[pi_button_normal] => array(
[0] => '#E1E1E2',
[1] => '#000000',
[2] => '1px',
[3] => 'none'
),
[pi_button_selected] => array(
[0] => '#F1F6F8',
[1] => '#000000',
[2] => '0px',
[3] => '1px solid #316AC5'
),
[pi_menu_down] => array(
[0] => '#98B5E2',
[1] => '#316AC5',
[2] => '0px',
[3] => '1px solid #316AC5'
),
[pi_menu_hover] => array(
[0] => '#C1D2EE',
[1] => '#316AC5',
[2] => '0px',
[3] => '1px solid #316AC5',
),
[pi_menu_normal] => array(
[0] => '#FFFFFF',
[1] => '#000000',
[2] => '0px',
[3] => '1px solid #FFFFFF'
),
[pi_popup_down] => array(
[0] => '#98B5E2',
[1] => '#000000',
[2] => '0px',
[3] => '1px solid #316AC5'
)
);
}

it's telling me
Parse error: parse error, expecting `')'' in K:\Network\xampp\htdocs\3.5.x\xxx\submit.php on line 217

theirs clearly not :(

Andreas
01-18-2006, 03:17 PM
First of all, i'd try to use correct PHP


if (!$istyles)
{
$istyles = array(
'pi_button_down' => array(
0 => '#98B5E2',
1 => '#000000',
2 => '0px',
3 => '1px solid #316AC5'
),
'pi_button_hover' => array(
0 => '#C1D2EE',
1 => '#000000',
2 => '0px',
3 => '1px solid #316AC5'
),
'pi_button_normal' => array(
0 => '#E1E1E2',
1 => '#000000',
2 => '1px',
3 => 'none'
),
'pi_button_selected' => array(
0 => '#F1F6F8',
1 => '#000000',
2 => '0px',
3 => '1px solid #316AC5'
),
'pi_menu_down' => array(
0 => '#98B5E2',
1 => '#316AC5',
2 => '0px',
3 => '1px solid #316AC5'
),
'pi_menu_hover' => array(
0 => '#C1D2EE',
1 => '#316AC5',
2 => '0px',
3 => '1px solid #316AC5',
),
'pi_menu_normal' => array(
0 => '#FFFFFF',
1 => '#000000',
2 => '0px',
3 => '1px solid #FFFFFF'
),
'pi_popup_down' => array(
0 => '#98B5E2',
1 => '#000000',
2 => '0px',
3 => '1px solid #316AC5'
)
);
}




$istyles_js = construct_editor_styles_js();





function construct_editor_styles_js($editorstyles = false)
{
// istyles - CSS in order: background / color / padding / border
global $istyles;

if (!is_array($istyles))
{
if (!$editorstyles)
{
$istyles = unserialize($GLOBALS['style']['editorstyles']);
}
else
{
$istyles = unserialize($editorstyles);
}
}

$istyle = array();
foreach ($istyles AS $key => $array)
{
$istyle[] = "\"$key\" : [ \"$array[0]\", \"$array[1]\", \"$array[2]\", \"$array[3]\" ]";
}

return implode(", ", $istyle);
}

sabret00the
01-19-2006, 07:50 PM
lol, thanks kirby, i have no idea what happened there :o)