Topic: Style Swithcer problem in joomla 1.5 (Read 2358 times)
Total Zero
Posts: 5
34 credits Members referred : 0
« on: Sep 02, 2007, 07:58:27 pm »
I am using your php style switcher in my Jomla 1.5 website it gives folowing error
Code:
Invalid argument supplied for foreach() in styleswitcher.php line 33.
which is this
Code:
foreach ($all_css as $key => $val) {
I used the file previously in jomla 1.0 but now it is now working .
Is there a different way to define this function?
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #1 on: Sep 03, 2007, 11:00:45 pm »
use this code before the foreach:
print_r($all_css);
and post the result here
Total Zero
Posts: 5
34 credits Members referred : 0
« Reply #2 on: Oct 02, 2007, 03:57:44 am »
this is the result
Array ( [800] => Array ( [file] => 800.css [label] => Narrow ) [wide] => Array ( [file] => template_css.css [label] => Wide ) ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\jomi\templates\my_photo\styleswitcher.php on line 37 Screen Resolution:
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #3 on: Oct 02, 2007, 07:12:39 am »
I think you changed something, what is your whole code snippet?
Total Zero
Posts: 5
34 credits Members referred : 0
« Reply #4 on: Oct 02, 2007, 09:40:21 pm »
yes I modifeyd the code to fit my css but also if I use your original code it gives the same error on same line foreach()
now I do not think it is issue with your code since it works perfect in joomla CMS 1.0x the error shows only in joomla CMS 1.5 this is why I asked if foreach could be defined differently
Total Zero
Posts: 5
34 credits Members referred : 0
« Reply #5 on: Oct 02, 2007, 09:42:26 pm »
wait ! could it be that it would give the error if the css files are not in place ?
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
wait ! could it be that it would give the error if the css files are not in place ?
no the error is related to the php code, so I think your messed up the array with data
Total Zero
Posts: 5
34 credits Members referred : 0
« Reply #7 on: Oct 02, 2007, 10:34:29 pm »
but how does it work on one installation and not on otherone? and again I just copy and paste the origynal code and same thing. Joomla 1.5 does not like the foreach()
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
but how does it work on one installation and not on otherone? and again I just copy and paste the origynal code and same thing. Joomla 1.5 does not like the foreach()
never used Joomla since its a horrible CMS, post the code here and maybe we can see the problem (still don't think that the problem is Joomla related)
I think your provider has changed the php config and you're using the wrong type of variables
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7062