Madman00 Posted December 1, 2004 Share Posted December 1, 2004 The Following controls the background color of all the infoboxes: } .infoBoxContents { background: #ffffff; font-family: Verdana, Arial, sans-serif; font-size: 10px; } I just want to change the bacjground color of the category box. so I added the following to stylesheet.css } .infoBox1 { background: #ffffff; font-family: Verdana, Arial, sans-serif; font-size: 10px; } My categories.php have the following that $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => $categories_string ); new infoBox($info_box_contents); ?> Where in categories do we make modifications to make it take effect. Did i do everythign right in stylesheet.css. Any Help is appriciated. Link to comment Share on other sites More sharing options...
peterr Posted December 2, 2004 Share Posted December 2, 2004 Hi, That class is used for all info boxes, therefore you will change the background for all of them, if you modify line 86 of /includes/classes/boxes.php Peter Link to comment Share on other sites More sharing options...
Madman00 Posted December 2, 2004 Author Share Posted December 2, 2004 That worked, but also affected the shopping cart background color as well. Can you explain why. Thank you. Hi, That class is used for all info boxes, therefore you will change the background for all of them, if you modify line 86 of /includes/classes/boxes.php Peter <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
peterr Posted December 2, 2004 Share Posted December 2, 2004 Hi, I did say it would change _all_ info boxes. :D Line 134 in /includes/boxes/categories.php new infoBox($info_box_contents); calls the class in /includes/classes/boxes.php , which of course is called by other PHP files. Just for testing, change line 86 back to ....... $this->table_parameters = 'class="infoBoxContents"'; then modify line 134 in /includes/boxes/categories.php to .... $tempvar = new infoBox($info_box_contents); then add immediately after that line ......... $tempvar = str_replace("infoBoxContents", "infoBox1", $tempvar); //replace class 'infoBoxContents' with class 'infoBox1' echo $tempvar; It's untested, so no guarantees. :) Peter Link to comment Share on other sites More sharing options...
Madman00 Posted December 21, 2004 Author Share Posted December 21, 2004 $tempvar is creating an error when it is modified in categories.php like you specified below. Any ideas. all i want to do is change the background color of the categories info box and leave the rest of the infoboxes background unaffected. Thanks for the help. Hi, I did say it would change _all_ info boxes. :D Line 134 in /includes/boxes/categories.php new infoBox($info_box_contents); calls the class in /includes/classes/boxes.php , which of course is called by other PHP files. Just for testing, change line 86 back to ....... $this->table_parameters = 'class="infoBoxContents"'; then modify line 134 in /includes/boxes/categories.php to .... $tempvar = new infoBox($info_box_contents); then add immediately after that line ......... $tempvar = str_replace("infoBoxContents", "infoBox1", $tempvar); //replace class 'infoBoxContents' with class 'infoBox1' echo $tempvar; It's untested, so no guarantees. :) Peter <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
peterr Posted December 21, 2004 Share Posted December 21, 2004 Hi, I did say it was untested. :D What is the error message ? Email me the file /includes/boxes/categories.php if you want. Peter Link to comment Share on other sites More sharing options...
wheeloftime Posted December 21, 2004 Share Posted December 21, 2004 $tempvar is creating an error when it is modified in categories.php like you specified below. Any ideas. all i want to do is change the background color of the categories info box and leave the rest of the infoboxes background unaffected. Thanks for the help. <{POST_SNAPBACK}> For simplicity and avoiding unneccassary hacking I would install THIS contribution. After that you can edit your heart out on each infobox seperately :D Link to comment Share on other sites More sharing options...
boxtel Posted December 21, 2004 Share Posted December 21, 2004 For simplicity and avoiding unneccassary hacking I would install THIS contribution.After that you can edit your heart out on each infobox seperately :D <{POST_SNAPBACK}> I simply use this, no need to alter the classes . $info_box_contents[] = array('align' => 'center', 'params' => 'valign="top" style="background-image: url(images/az_back_main.jpg); background-repeat: repeat-x;"', 'text' => $news_heading); new contentBox($info_box_contents); Treasurer MFC Link to comment Share on other sites More sharing options...
wheeloftime Posted December 21, 2004 Share Posted December 21, 2004 I simply use this, no need to alter the classes . $info_box_contents[] = array('align' => 'center', 'params' => 'valign="top" style="background-image: url(images/az_back_main.jpg); background-repeat: repeat-x;"', 'text' => $news_heading); new contentBox($info_box_contents); <{POST_SNAPBACK}> Interesting but how would that differentiate between the individual boxes ? And this doesn't seem as flexibel as having the differences inside the CSS. There you can play around more easily when changing the individual boxes (let's say I want a different background for the category box, the news box, the new items box etc.) ? Link to comment Share on other sites More sharing options...
boxtel Posted December 21, 2004 Share Posted December 21, 2004 Interesting but how would that differentiate between the individual boxes ?And this doesn't seem as flexibel as having the differences inside the CSS. There you can play around more easily when changing the individual boxes (let's say I want a different background for the category box, the news box, the new items box etc.) ? <{POST_SNAPBACK}> I do this in the boxes code (categories.php, search.php, etc.) itself so every box can have a different style. Treasurer MFC Link to comment Share on other sites More sharing options...
wheeloftime Posted December 21, 2004 Share Posted December 21, 2004 I do this in the boxes code (categories.php, search.php, etc.) itself so every box can have a different style. <{POST_SNAPBACK}> Hello Amanda, Thanks for the clarification, I now understand what you mean ! It is a matter of taste than I think, it is still easier to maintain one .css file as the multiple boxes files. So little time and so much to learn, I like osC :lol: Link to comment Share on other sites More sharing options...
Madman00 Posted December 27, 2004 Author Share Posted December 27, 2004 The below code doesn't seem to be working for me. it makes the category menu disappear. All i want to do is change the background of the category box only. Any suggestions. Also if i could just enter a color # instead number instead of inputing an image as a background, that would be even better. Any suggestions. Thanks. I simply use this, no need to alter the classes . $info_box_contents[] = array('align' => 'center', 'params' => 'valign="top" style="background-image: url(images/az_back_main.jpg); background-repeat: repeat-x;"', 'text' => $news_heading); new contentBox($info_box_contents); <{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
peterr Posted December 27, 2004 Share Posted December 27, 2004 Hi, Email me the file /includes/boxes/categories.php if you want. Peter Link to comment Share on other sites More sharing options...
peterr Posted December 27, 2004 Share Posted December 27, 2004 Hi, Email me the file /includes/boxes/categories.php if you want. <{POST_SNAPBACK}> Got the file, thanks, first thing I noticed was that you appear to be running MS-1 ... $Id: categories.php,v 1.23 2002/11/12 14:09:30 dgw_ Exp $ is that correct, because I'd say most of the replies here would have assumed you were using the latest, MS-2. Anyway, if you can't upgrade for some reason, I'll see what can be done. Peter Link to comment Share on other sites More sharing options...
boxtel Posted December 27, 2004 Share Posted December 27, 2004 The below code doesn't seem to be working for me. it makes the category menu disappear. All i want to do is change the background of the category box only.Any suggestions. Also if i could just enter a color # instead number instead of inputing an image as a background, that would be even better. Any suggestions. Thanks. <{POST_SNAPBACK}> don't simply copy this code, it was an example of how to pass the params variables to the class. Treasurer MFC Link to comment Share on other sites More sharing options...
peterr Posted December 27, 2004 Share Posted December 27, 2004 Hi Amanda, don't simply copy this code, it was an example of how to pass the params variables to the class. <{POST_SNAPBACK}> I had the same thought/concept, to try and pass the parameter, and we have tried this, doesn't work. I _think_ because the class/function 'infoBox' has this line: $this->table_parameters = 'class="infoBox"'; that even if the class element/key of the array is parsed to the class/function, it is not getting overwritten ?? Peter Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.