Contributions
Define Mainpage
Lets you edit the contents of the main catalog page (default.php) directly through the admin. Multiple language support for the 3 distro languages is included.
Version 1.0 had compatibility issues in the example page, nothing major. Also removed a typo here and there ;)
Expand All / Collapse All
An update for those who prefer using TinyMCE instead of htmlarea.
Not a full version, only 1 file to replace.
Rigadin
Just found a small error in the last instruction:
It reads:
// define_mainpage for B2B
define('BOX_CATALOG_DEFINE_MAINPAGE0', 'Retail/Public Main Msg.');
define('BOX_CATALOG_DEFINE_MAINPAGE1', 'Wholesale Main Msg.');
define('BOX_CATALOG_DEFINE_MAINPAGE'2, 'VIP's Main Msg.');
// define_mainpage_eof for B2B
And should be:
// define_mainpage for B2B
define('BOX_CATALOG_DEFINE_MAINPAGE0', 'Retail/Public Main Msg.');
define('BOX_CATALOG_DEFINE_MAINPAGE1', 'Wholesale Main Msg.');
define('BOX_CATALOG_DEFINE_MAINPAGE2', 'VIPs Main Msg.');
// define_mainpage_eof for B2B
MotzF |
final bug fixed |
11 Feb 2005 |
|
This is wrong
OPEN catalog/index.php:
====================================================================
Look for this around line 307 (near bottom):
====================================================================
<td class="main"><br><?php echo TEXT_MAIN; ?></td>
====================================================================
And replace that line with this:
====================================================================
<td class="main"><br><?php global $customer_id;
$customer_group_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
$customer_group = tep_db_fetch_array($customer_group_query);
if ( $customer_group['customers_group_id'] == 0)
{ include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_MAINPAGE_0); // Retail-Not logged in
} else {
if ( $customer_group['customers_group_id'] == 1)
{ include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_MAINPAGE_1); // Wholesale logged in
} else {
if ( $customer_group['customers_group_id'] == 2)
{ include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_MAINPAGE_2); // Vips logged in
}
}
}
?>
<br><br></td>
This is OK
<td class="main"><br><?php echo TEXT_MAIN; ?></td>
====================================================================
And replace that line with this:
====================================================================
<td class="main"><br><?php global $customer_id;
$customer_group_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
$customer_group = tep_db_fetch_array($customer_group_query);
if ( $customer_group['customers_group_id'] == 0)
{ include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFINE_MAINPAGE_0); // Retail-Not logged in
} else {
if ( $customer_group['customers_group_id'] == 1)
{ include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFINE_MAINPAGE_1); // Wholesale logged in
} else {
if ( $customer_group['customers_group_id'] == 2)
{ include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFINE_MAINPAGE_2); // Vips logged in
}
}
}
?>
<br><br></td>
My bug fixed 2 is wrong sorry
autor write
<td class="main"><br><?php global $customer_id;
$customer_group_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
$customer_group = tep_db_fetch_array($customer_group_query);
if ( $customer_group['customers_group_id'] == 0)
{ include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_MAINPAGE_0); // Retail-Not logged in
} else {
if ( $customer_group['customers_group_id'] == 1)
{ include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_MAINPAGE_1); // Wholesale logged in
} else {
if ( $customer_group['customers_group_id'] == 2)
{ include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_MAINPAGE_2); // Vips logged in
}
}
}
?>
<br><br></td>
and next
// define_mainpage for B2B
define('FILENAME_DEFINE_MAINPAGE0', 'define_mainpage0.php');
define('FILENAME_DEFINE_MAINPAGE1', 'define_mainpage1.php');
define('FILENAME_DEFINE_MAINPAGE2', 'define_mainpage2.php');
// define_mainpage for B2B
i must add this
// define_mainpage for B2B
define('FILENAME_DEFINE_MAINPAGE_0', 'define_mainpage0.php');
define('FILENAME_DEFINE_MAINPAGE_1', 'define_mainpage1.php');
define('FILENAME_DEFINE_MAINPAGE_2', 'define_mainpage2.php');
// define_mainpage for B2B
now working
file is org
Readme files small bug:
OPEN and EDIT admin/includes/languages/[language].php (english.php, german.php, etc.)
====================================================================
ADD these lines (follow suit) ADMIN BOXTYPE Listed
====================================================================
// define_mainpage for B2B
define('BOX_CATALOG_DEFINE_MAINPAGE0', 'Retail/Public Main Msg.');
define('BOX_CATALOG_DEFINE_MAINPAGE1', 'Wholesale Main Msg.');
bug -> define('BOX_CATALOG_DEFINE_MAINPAGE'2, 'VIP's Main Msg.');
fixed -> define('BOX_CATALOG_DEFINE_MAINPAGE2', 'VIP's Main Msg.');
// define_mainpage_eof for B2B
file is this same as org.
Traduction en Français du fichier d'installation. Excusez moi pour les fautes qui traineraient !
AUCUNE amélioration apportée. Ce pack contient tous les fichiers d'installation originaux. Seul le texte d'installation en Français a été ajouté.
Changed the install file as there was a mistake with the links in the admin side!
thanks Incite Brands for repack ;-)
Full Package (Define Mainpage for B2B Suite)
Attention: It does not include B2B Suite!!!
This is a modified version of the Define MainPage module (v 1.3) that works with the B2B Suite module. (http://www.oscommerce.com/community/contributions,1575/)
This should not be used otherwise.
Quick fix for some RedHat Users: This page produces an error in certain versions of RedHat. Some combinations of RH and PHP require all php tags to include the full tag syntax (i.e. <?php ) and will not work with the partial (<? ). This fixes the problem.
This zip has all the files and instructions
There was an error in the instructions.
Use this one.
********************************************************************
DEFINE MAINPAGE v1.3 osCommerce UPDATED FOR MS2 2.2 *
********************************************************************
Released 05APR02 by Mattice *
Revised 19JUL03 by MaxiDVD *
*
FULL MULTI-LINGUAL SUPPORT *
*
Original Author Notes/Description: *
-------------------------------------------------------------------*
Description: This addon lets you define *
the contents of the main catalog page through *
the Admin side of OSC. It supports the editing *
of the different languages/pages. *
*
Its basically a copy of define_languages.php *
so all credit for this thing should go to the *
OSC development team. I didn't write it, *
I just recycled it in a creative way ;) *
*
This release includes 3 define_mainpage examples *
(one for each distro language) so you can get *
an idea of what this code can do. Obviously *
you can do all this without this hack but this *
makes your editing and life in general a lot *
easier. Install it and you'll see what I mean. *
*
********************************************************************
This is just an updated Define Main page fuction. Spelling corrections are now corrected and also file placement are now corrected according to the new Snapshot
Enjoy and please read all the text before performing any updates.
Lets you edit the contents of the main catalog page (default.php) directly through the admin. Multiple language support for the 3 distro languages is included.
Version 1.0 had compatibility issues in the example page, nothing major. Also removed a typo here and there ;)
This little hack lets you edit the contents of the main catalog page (default.htm) directly through the admin. Multiple language support for the 3 distro languages is included.
I also included 3 different layout examples for the main catalog page to give you an idea of what's quickly possible by using existing code/stylesheets from OSC.
Hope you like it,
Mattice
Note: Contributions are used at own risk.