5, December 2008

Style Swithcer problem in joomla 1.5 - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ 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 1194 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: 6486
39748 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 : Just a better Internet portal provided by Google
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: 6486
39748 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 : Just a better Internet portal provided by Google
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: 6486
39748 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 : Just a better Internet portal provided by Google
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: 6486
39748 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 : Just a better Internet portal provided by Google
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....

Topic sponsors:
Get a permanent link here for $1.99!


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?
Dec 05, 2008, 01:44:31 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!


Forum Statistics
Total Posts: 37.995
Total Topics: 7.685
Total Members: 4.467
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: jschless81

29 Guests, 4 Users online :

10 users online today:



Readers

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