17, March 2010

Style Swithcer problem in joomla 1.5 - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Miscellaneous scripts or snippets (Moderator: Olaf)
Topic: Style Swithcer problem in joomla 1.5
« previous next »
Pages: [1] Print

Author Topic: Style Swithcer problem in joomla 1.5  (Read 1852 times)
Total Zero
*
Posts: 5
34 credits
Members referred : 0


« on: Sep 02, 2007, 08: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: Male
Posts: 6690
34708 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Sep 04, 2007, 12:00:45 am »

use this code before the foreach:

print_r($all_css);

and post the result here


Last blog : A new Wordpress theme for our blog
Total Zero
*
Posts: 5
34 credits
Members referred : 0


« Reply #2 on: Oct 02, 2007, 04: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: Male
Posts: 6690
34708 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Oct 02, 2007, 08:12:39 am »

I think you changed something, what is your whole code snippet?


Last blog : A new Wordpress theme for our blog
Total Zero
*
Posts: 5
34 credits
Members referred : 0


« Reply #4 on: Oct 02, 2007, 10: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, 10: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: Male
Posts: 6690
34708 credits
Members referred : 374


It's time to use PHP5!


« Reply #6 on: Oct 02, 2007, 10:48:34 pm »

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


Last blog : A new Wordpress theme for our blog
Total Zero
*
Posts: 5
34 credits
Members referred : 0


« Reply #7 on: Oct 02, 2007, 11: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: Male
Posts: 6690
34708 credits
Members referred : 374


It's time to use PHP5!


« Reply #8 on: Oct 03, 2007, 09:34:32 am »

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


Last blog : A new Wordpress theme for our blog
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7062
Tags : stylle switcher switcher Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Miscellaneous scripts or snippets (Moderator: Olaf)
Topic: Style Swithcer problem in joomla 1.5
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Mar 17, 2010, 08:16:32 am





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!





Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2010 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.