Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Stylesheet skins +admin install


Guest

Recommended Posts

Posted

Hello people:)

 

I'm trying to install a contribution, that lets the customers change the skin on my shop. ( http://www.oscommerce.com/community/contri.../search,infobox ) But during the installation, I get to a point, where I basically dont understandt what the scipt owner mean...! ? I've copied the readme.txt here, and highlighted the point where I get lost.... Have a look here:

 

 

START OF CODE:

_____________________

OSC2.2MS2

 

CSS "skins" - very simple! + admin

BEWARE: a lot of work (but simple)!!!

 

usual disclaimers: make backup. I'm not responsible for damages caused by this contrib.

All files are GPL

 

 

file: admin/includes/boxes/modules.php

 

add a link to themes, like the rest of the links there:

 

'<a href="' . tep_href_link(FILENAME_MODULES, 'set=themes', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_MODULES_THEMES . '</a>'

 

 

file: admin/includes/languages/english.php (norwegian.php etc)

add: define('BOX_MODULES_THEMES', 'Themes');

 

file: admin/modules.php

add: (line 19)

case 'themes':

$module_type = 'themes';

$module_directory = DIR_FS_CATALOG_MODULES . 'themes/';

$module_key = 'MODULE_THEMES_INSTALLED';

define('HEADING_TITLE', HEADING_TITLE_MODULES_THEMES);

break;

 

file: admin/includes/languages/norwegian/modules.php

add: define('HEADING_TITLE_MODULES_THEMES', 'Webshop Theme');

 

-----------------------------------------------------------------------------------------------

THE MOST BORING STEP:

file: each in catalog/: change "stylesheet.css" into <?php echo '"'. DIR_WS_MODULES . STYLE_SHEET . '"' ?>

-----------------------------------------------------------------------------------------------

 

file: application_top.php

// include theme

$query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key ='THEME_CURRENT_CONFIG'");

$res = tep_db_fetch_array($query);

require(DIR_WS_MODULES . $res['configuration_value']);

 

 

copy with subdirs includes/modules/themes/*.* and includes/languages/english/modules/themes/* into your catalog root

 

 

HACK #1 no two modules active at the same time:

file: admin/moduels.php

 

line ~51-57

find:

case 'install':

case 'remove':

 

change into:

 

case 'install':

if(tep_not_null($set)) {

if($set == 'themes') {

//remove other themes

$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = '" . $module_key . "'");

$check = tep_db_fetch_array($check_query);

$mdls = explode(';',$check['configuration_value']);

for($mdi=0;$mdi<sizeof($mdls);$mdi++)

{

$modname = $mdls[$mdi];

if (file_exists($module_directory . $modname) && (strlen($modname) != 0)) {

include($module_directory . $modname);

$class = substr($modname,0,strpos($modname,'.'));

$module = new $class;

$module->remove();

}

}

}

} // no break!

case 'remove':

 

-------------------------------------------------------------------------------------------

That's all! Comments, suggestions, donations;) welcome -> Piotr Kami?ski <[email protected]>

Please, tell me if you find it useful (or not).

-------------------------------------------------------------------------------------------

 

MAKING NEW THEME:

 

copy includes/modules/themes/original.php to a new name let's assume mytheme.php

create directory includes/modules/themes/mytheme and copy there stylesheet.css and themeconfig.php from includes/modules/themes/original

copy empty file includes/languages/english/modules/themes/original.php to includes/languages/english/modules/themes/mytheme.php

 

 

edit file: includes/modules/themes/mytheme.php

 

change every occurance of original to mytheme (leaving case as it is - ORIGINAL->MYTHEME, original->mytheme

every line you should change is marked with // CHANGE THIS!

this way you change database field names (UPPERCASE) and strings or class names (lowercase and MiXeD)

!change path in line 36!

 

 

edit file: includes/modules/themes/mytheme/themeconfig.php

change path in line 2 (original -> mytheme)

 

and the most important thing:

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

edit file: includes/modules/themes/mytheme/stylesheet.css

 

play with it, add new colors, borders, paddings. A lot of fun!!!

some tips: color: and background: should really be different!!!

 

TODO:

-> get rid of rounded corners in boxes using the themeconfig.php file

_________________________________________________________

END OF CODE

 

... what the h... does that mean? I'm not english, could someone translate this or explain this line in another way??? I'm a bit stuck (in the middle of the installation :'(

Posted

It means in every file that you find

 

<link rel="stylesheet" type="text/css" href="stylesheet.css">

 

You need to replace the stylesheet.css with the code provided.

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

  • 1 year later...
Posted

hello

 

I has yours contri CSS ?Skins? simple but fun+admin!

 

but in the guide you do not describe as with application_top.php make exact?

 

which application_top.php do you mean, in catalog/include or admin/include?

 

 

 

greeting

marco

Posted
Hello people:)

 

I'm trying to install a contribution, that lets the customers change the skin on my shop. ( http://www.oscommerce.com/community/contri.../search,infobox ) But during the installation, I get to a point, where I basically dont understandt what the scipt owner mean...! ? I've copied the readme.txt here, and highlighted the point where I get lost.... Have a look here:

START OF CODE:

_____________________

OSC2.2MS2

 

CSS "skins" - very simple! + admin

BEWARE: a lot of work (but simple)!!!

 

usual disclaimers: make backup. I'm not responsible for damages caused by this contrib.

All files are GPL

file: admin/includes/boxes/modules.php

 

add a link to themes, like the rest of the links there:

 

'<a href="' . tep_href_link(FILENAME_MODULES, 'set=themes', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_MODULES_THEMES . '</a>'

file: admin/includes/languages/english.php (norwegian.php etc)

add: define('BOX_MODULES_THEMES', 'Themes');

 

file: admin/modules.php

add: (line 19)

case 'themes':

$module_type = 'themes';

$module_directory = DIR_FS_CATALOG_MODULES . 'themes/';

$module_key = 'MODULE_THEMES_INSTALLED';

define('HEADING_TITLE', HEADING_TITLE_MODULES_THEMES);

break;

 

file: admin/includes/languages/norwegian/modules.php

add: define('HEADING_TITLE_MODULES_THEMES', 'Webshop Theme');

 

-----------------------------------------------------------------------------------------------

THE MOST BORING STEP:

file: each in catalog/: change "stylesheet.css" into <?php echo '"'. DIR_WS_MODULES . STYLE_SHEET . '"' ?>

-----------------------------------------------------------------------------------------------

 

file: application_top.php

// include theme

$query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key ='THEME_CURRENT_CONFIG'");

$res = tep_db_fetch_array($query);

require(DIR_WS_MODULES . $res['configuration_value']);

copy with subdirs includes/modules/themes/*.* and includes/languages/english/modules/themes/* into your catalog root

HACK #1 no two modules active at the same time:

file: admin/moduels.php

 

line ~51-57

find:

case 'install':

case 'remove':

 

change into:

 

case 'install':

if(tep_not_null($set)) {

if($set == 'themes') {

//remove other themes

$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = '" . $module_key . "'");

$check = tep_db_fetch_array($check_query);

$mdls = explode(';',$check['configuration_value']);

for($mdi=0;$mdi<sizeof($mdls);$mdi++)

{

$modname = $mdls[$mdi];

if (file_exists($module_directory . $modname) && (strlen($modname) != 0)) {

include($module_directory . $modname);

$class = substr($modname,0,strpos($modname,'.'));

$module = new $class;

$module->remove();

}

}

}

} // no break!

case 'remove':

 

-------------------------------------------------------------------------------------------

That's all! Comments, suggestions, donations;) welcome -> Piotr Kami?ski <[email protected]>

Please, tell me if you find it useful (or not).

-------------------------------------------------------------------------------------------

 

MAKING NEW THEME:

 

copy includes/modules/themes/original.php to a new name let's assume mytheme.php

create directory includes/modules/themes/mytheme and copy there stylesheet.css and themeconfig.php from includes/modules/themes/original

copy empty file includes/languages/english/modules/themes/original.php to includes/languages/english/modules/themes/mytheme.php

edit file: includes/modules/themes/mytheme.php

 

change every occurance of original to mytheme (leaving case as it is - ORIGINAL->MYTHEME, original->mytheme

every line you should change is marked with // CHANGE THIS!

this way you change database field names (UPPERCASE) and strings or class names (lowercase and MiXeD)

!change path in line 36!

edit file: includes/modules/themes/mytheme/themeconfig.php

change path in line 2 (original -> mytheme)

 

and the most important thing:

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

edit file: includes/modules/themes/mytheme/stylesheet.css

 

play with it, add new colors, borders, paddings. A lot of fun!!!

some tips: color: and background: should really be different!!!

 

TODO:

-> get rid of rounded corners in boxes using the themeconfig.php file

_________________________________________________________

END OF CODE

 

... what the h... does that mean? I'm not english, could someone translate this or explain this line in another way??? I'm a bit stuck (in the middle of the installation :'(

 

 

It means you have to go through every file in the catalog directory and change "stylesheet.css" into <?php echo '"'. DIR_WS_MODULES . STYLE_SHEET . '"' ?>.

I tried it on my local server and couldent get it to work. if you do try it backup backup backup before you try.

Posted

hello lrjbart

 

I also a local installation made, but receive as with the live system always the same error message!

 

Warning: main(includes/modules/): failed to open stream: No such file or directory in C:\apachefriends\xampp\htdocs\demo\includes\application_top.php on line 512

 

Fatal error: main(): Failed opening required 'includes/modules/' (include_path='.;C:\apachefriends\xampp\php\pear\') in C:\apachefriends\xampp\htdocs\demo\includes\application_top.php on line 512

 

I did not forget these changes!

"stylesheet.css" into <?php echo '"'. DIR_WS_MODULES . STYLE_SHEET . '"' ?>

 

 

know you which to be could?

 

sorry for my english!!

 

greeting marco

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...