osCommerce France : Accueil Forum Portail osCommerce France Réponses aux questions Foire aux contributions

Bienvenue invité ( Connexion | Inscription )

 
Reply to this topicStart new topic
> Comment dupliquer un box( 1 addon pour 2 boxes différents)
roiphoto
posté 5 Jun 2017, 10:43
Message #1


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 119
Inscrit : 6-August 07
Lieu : 93200
Membre no 18622



Comment dupliquer un box( 1 addon pour 2 boxes différents)

Bonjour,

Ma configuration
Oscommerce 2.3.3.4 anglais couplé avec oscomm 2.3.3.4-FR-V1- avril 2014 Pack.zip
Easyphp-devserveur-14.1vc11
PHP 5.5.8
Windows 8 Pro, 32 bits
+ Addon Must Accept Terms Conditions (MATC_for_osC2.3x.zip)
+ banner box with rotator (banner_box 1.2)
LOCAL

Mes soucis ? : J’ai installé banner_box1.2. Aucun problème ? Il fonctionne correctement avec les rotations.

1 - Je voudrais cette fois-ci dupliquer le box avec la même contribution et lui attribuer un autre banner_groupe de sorte que chacun des boxes gère des images différentes

2 – je voudrais mettre un lien hypertexte sur l’image afin qu’il pointe sur le site de l’annonceur dans un nouvel onglet

SOS s’il vous plaît
Merci
Go to the top of the page
 
badcape
posté 6 Jun 2017, 06:03
Message #2


Ceinture bleue OSC
Icône de groupe

Groupe : Membres
Messages : 1071
Inscrit : 28-September 07
Lieu : Saint paul - REUNION
Membre no 19202



'jour Roiphoto,
dupliquer ne doit pas poser trop de problème, juste attention à bien modifier ton fichier box: banner_ rotator....
je n'ai pas cette contrib installée sur mon site mais à la vue des fichiers ça doit coller. renome bm_banner_rotator en bm_banner_rotator2 (par exemple); ouvre ce fichier et fais de même pour "bm_banner_rotator, MODULE_BOXES_BANNER_ROTATOR..., idem pour les nom de tables dans TABLE_CONFIGURATION. a toi de voir pour le fichier css dans ext: si tu veux avoir un design différent il te faut ou créer de nouvelles class ou changer le lien après avoir créer un autre stylesheet dans le même répertoire.
Tente le coup sur ton local en duplicant juste ce fichier et vois ce que ça donne avec ton banner_manager: je pense que ça va peut être coincer. je peux me tromper mais j'utilise pas de bannière pour le moment.
Ah oui, comme tu as modifié ton bm_banner_rotator tu dois créer et faire de même avec un nouveau fichier langue (.... rotator2.php).
On fait dans le basique happy.gif
cool.gif


--------------------
Thierry
En prod Server: Percona Server via UNIX socket Percona Server version:10.1.20-MariaDB - Percona Server (GPL),
PHP 5.5.30 phpMyAdmin 4.0.10.6 Database version: MySQL 5.5.5-10.1.20 extension: mysqli
version Oscommerce-2.3.4 bootstrap avec un tas comme ça de contributions ...... et bien d'autres dont je me suis inspiré à grand renfort de café !
Un grand merci à tous !(pour votre aide et votre patience....)
En local:
1) Pour suivre mon site en prod - EasyPHP DevServer 14.1 VC9 "Minakami" avec oscom 2.3.4 Bootstrap Gold + KissIT_image thumbnailer, Product fields group, Products Extra Fields, margin report, account_create_in_admin, easy populate, FAQ desk, MATC, SPPC, quick updates for SPPC, slick reCaptcha, modular front page module, Select Product Image Directory, Edit page (page control), Message box, Horizontal categories menu BS, Edit order, Edit invoice, Hide categories with category cache, Related products BS, Ultimate Seo Urls, Withdrawal form for BS... modifiées et d'autre contrib que je teste avant de mettre en prod.
2) Pour dev Phoenix 1.0.2.0, Devserver sous PHP 7.1.3 et Database MySQL 5.7.17
Go to the top of the page
 
roiphoto
posté 16 Jun 2017, 08:54
Message #3


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 119
Inscrit : 6-August 07
Lieu : 93200
Membre no 18622



Bonjour,

Rappel de configuration :
oscomm 2.2RC1 + PHP 4.3.10 + Must Accept Conditions Terms + Column banner + banner in box
EN LOCAL

J’ai lu, relu, essayé et ré-essayé, j’ai réussi à dupliquer les boxes,
J’ai dupliqué et changé de nom au fichier /includes/boxes/column_banner.php en column_banner1.php mais tous partagent le même groupe bien que j’ai défini un groupe différent par box dupliqué.
Sûrement que je n’ai pas compris le changement qu’il fallait faire dans le fichier /includes/boxes/column_banner1.php que je vous envoie

<?php
/*
// WebMakers.com Added - Column Banner
// Created by: Linda McGrath osCOMMERCE@WebMakers.com
// Test at: http://www.thewebmakerscorner.com
*/
?>
<!-- information //-->
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('align' => 'center',
'text' => BOX_HEADING_COLUMN_BANNER
);
new infoBoxHeading($info_box_contents, false, false);

$info_box_contents = array();
$info_box_contents[] = array('align' => 'center',
'text' => tep_display_banner('static', $banner)
);
new infoBox($info_box_contents);
?>
</td>
</tr>
<!-- information_eof //-->


Autre chose :
J’ai le même souci avec bannerinbox-1.1 avec le fichier /includes/boxes/boxad.php.
Que dois-je changer ? Je me permets de vous envoyer le fichier
<?php
/*
$Id: boxad.php, v 1.1 2002/03/21 by aubrey@mycon.co.za

osCommerce
http://www.oscommerce.com/

Copyright © 2000,2001 osCommerce

Released under the GNU General Public License


IMPORTANT NOTE:

This script is not part of the official osC distribution
but an add-on contributed to the osC community. Please
read the README and INSTALL documents that are provided
with this file for further information and installation notes.

*/
?>
<!-- banner-ad-in-a-box //-->
<?php
if ($banner = tep_banner_exists('dynamic', BOX_AD_BANNER_TYPE)) {
?>
<tr>
<td>

<?php
$bannerstring = tep_display_banner('static', $banner);

$info_box_contents = array();
$info_box_contents[] = array('align' => 'left',
'text' => BOX_AD_BANNER_HEADING
);
new infoBoxHeading($info_box_contents, false, false);

$info_box_contents = array();
$info_box_contents[] = array('align' => 'center',
'text' => $bannerstring
);
new infoBox($info_box_contents);
?>
</td>
</tr>
<?php
}
?>
<!-- banner-ad-in-a-box_eof //-->

Je vous remercie
Go to the top of the page
 
badcape
posté 16 Jun 2017, 17:54
Message #4


Ceinture bleue OSC
Icône de groupe

Groupe : Membres
Messages : 1071
Inscrit : 28-September 07
Lieu : Saint paul - REUNION
Membre no 19202



'soir Roiphoto,
dis moi: ta contrib, elle est pour quelle version oscommerce? 2.2RC1 ou Oscommerce 2.3.3.4 anglais couplé avec oscomm 2.3.3.4-FR-V1- avril 2014 Pack.zip ?
blink.gif
bon, va falloir que j'me trouve un temps pour télécharger ça et mieux comprendre.
Heuuu... mets moi un lien direct vers la page de la contrib. Merci.
cool.gif

Ce message a été modifié par badcape - 16 Jun 2017, 18:07.


--------------------
Thierry
En prod Server: Percona Server via UNIX socket Percona Server version:10.1.20-MariaDB - Percona Server (GPL),
PHP 5.5.30 phpMyAdmin 4.0.10.6 Database version: MySQL 5.5.5-10.1.20 extension: mysqli
version Oscommerce-2.3.4 bootstrap avec un tas comme ça de contributions ...... et bien d'autres dont je me suis inspiré à grand renfort de café !
Un grand merci à tous !(pour votre aide et votre patience....)
En local:
1) Pour suivre mon site en prod - EasyPHP DevServer 14.1 VC9 "Minakami" avec oscom 2.3.4 Bootstrap Gold + KissIT_image thumbnailer, Product fields group, Products Extra Fields, margin report, account_create_in_admin, easy populate, FAQ desk, MATC, SPPC, quick updates for SPPC, slick reCaptcha, modular front page module, Select Product Image Directory, Edit page (page control), Message box, Horizontal categories menu BS, Edit order, Edit invoice, Hide categories with category cache, Related products BS, Ultimate Seo Urls, Withdrawal form for BS... modifiées et d'autre contrib que je teste avant de mettre en prod.
2) Pour dev Phoenix 1.0.2.0, Devserver sous PHP 7.1.3 et Database MySQL 5.7.17
Go to the top of the page
 
roiphoto
posté 8 Jul 2017, 11:23
Message #5


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 119
Inscrit : 6-August 07
Lieu : 93200
Membre no 18622



Citation (badcape @ 16 Jun 2017, 17:54) *
'soir Roiphoto,
dis moi: ta contrib, elle est pour quelle version oscommerce? 2.2RC1 ou Oscommerce 2.3.3.4 anglais couplé avec oscomm 2.3.3.4-FR-V1- avril 2014 Pack.zip ?
blink.gif
bon, va falloir que j'me trouve un temps pour télécharger ça et mieux comprendre.
Heuuu... mets moi un lien direct vers la page de la contrib. Merci.
cool.gif


Bonjour Badcape

Oscommerce 2.2rc1 (oscommerce_2.2rc1_FR_w3c_3.zip
EasyPHP 1.8 avec PHP 4.3.10
Win 8 Pro
LOCAL
Voici les 2 bannières que je voudrais dupliquer (à chaque duplicata, il lui sera attribué son banner_groupe spécifique à lui seul)

Bannerinbox.zip https://apps.oscommerce.com/reN56

Columnbanner v1.0.zip https://apps.oscommerce.com/Get&bQnpQ&bAReC

C’est le principe de duplication que je n’ai pas compris.

J'ai abandonné pour le moment oscomm 2.3

Merci à tous
Go to the top of the page
 
Rusti
posté 8 Jul 2017, 15:23
Message #6


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 103
Inscrit : 11-October 10
Lieu : Villemomble
Membre no 28103



Quand tu duplique une boxe tu lui donne un nouveau nom boxad_2.php
Tu dois indiquer ce nouveau dans le columm_right ou left
require(DIR_WS_BOXES . 'boxad_2.php');

Certaine boxe ajoute des tables dans la base de données, quand cela arrive tu dois aussi modifier le nom des tables dans le fichier de configuration de la boxe avant de l'installer.

Bon code

Ce message a été modifié par Rusti - 8 Jul 2017, 15:26.


--------------------
osCommerce v2.3
Go to the top of the page
 
roiphoto
posté 16 Jul 2017, 11:02
Message #7


Ceinture jaune+ OSC
Icône de groupe

Groupe : Membres
Messages : 119
Inscrit : 6-August 07
Lieu : 93200
Membre no 18622



Bonjour,
Oscomm 2.3.3.4 EN couplé avec oscommerce-2.3.3.4 - FR - V1 - avril 2014 – Pack
EasyPHP-DevServer-14.1VC11 (avec PHP 5.5.cool.gif
win 8 Pro
+ ADDON oscom-banner-box-161ub-6K9tbz.zip
LOCAL

Je voudrais dupliquer le box de cet addon

J’ai également fouillé sur le forum USA qui propose la méthode suivante qui serait (à mon avis) transposable à un autre box à dupliquer. A toutes fins utiles, voici le lien sur le forum oscommerce USA
https://forums.oscommerce.com/topic/367702-...comment-1549064

Voici la méthode proposée :

Posted November 30, 2010 • Report post
The column boxes are modules in 2.3.x. Here's a quick outline of how to create a new box:

1 - Copy catalog/includes/modules/boxes/bm_information.php and give it a new name.
2 - Edit that file and change bm_information to your new box name throughout that file.
3 - Change all of the constants that include _INFORMATION_ to include your new name instead. Keep them in all caps.
4 - Change the content to what you want in your new box. If you are using links to new files, keep the same format as the links in that box. The part that generates the box is in the execute() method.
5 - Copy catalog/includes/languages/english/modules/boxes/bm_information.php and give it a the same name as you did the file in step 1.
6 - Make the same changes to the constants in this file that you made in step 3.
7 - Upload your two new files.
8 - Go to your store Admin > Modules > Boxes and install your new module. Give it a sort order that will place it where you want it.

Mes problèmes ?
1 -J’ai réussi à dupliquer le box mais le contenu apparaît dans le box dupliqué, après la rotation des images que j’ai insérer la boucle s’arrête et ne démarre qu’àprès un nouveau changement de page, est-ce normal ? je ne sais pas ! Le groupe d’images est respectée !
2 – Le box original qui, au début fonctionnait est présent à l’écran, mais VIDE
3 – je n’ai pas compris comment changer the content préconisé aux étapes 3 et 6
Voici le fichier original de l’addon :

/includes/module/boxes/bm_manager_totator.php
<?php
/*
$Id: bm_banner_rotator.php v1.1 Kymation $
$Enhanced by Gergely. Thanks to Kymation's oscommerce contribution$
$Loc: catalog/includes/modules/boxes/ $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright © 2011 osCommerce

Released under the GNU General Public License
*/

class bm_banner_rotator {
var $code = 'bm_banner_rotator';
var $group = 'boxes';
var $header_tag = 'header_tags';
var $title;
var $description;
var $sort_order;
var $enabled = false;

function bm_banner_rotator() {
$this->title = MODULE_BOXES_BANNER_ROTATOR_TITLE;
$this->description = MODULE_BOXES_BANNER_ROTATOR_DESCRIPTION;

if ( defined( 'MODULE_BOXES_BANNER_ROTATOR_STATUS' ) ) {
$this->sort_order = MODULE_BOXES_BANNER_ROTATOR_SORT_ORDER;
$this->enabled = (MODULE_BOXES_BANNER_ROTATOR_STATUS == 'True');

$this->group = ((MODULE_BOXES_BANNER_ROTATOR_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right');
}
}

function execute() {
global $language, $oscTemplate, $languages_id;

if ($banner = tep_banner_exists('dynamic', MODULE_BOXES_BANNER_ROTATOR_GROUP_NAME)) {
$module_contents = '<div class="ui-widget infoBoxContainer">' . PHP_EOL;

if( tep_not_null( constant( 'MODULE_BOXES_BANNER_ROTATOR_TITLE_' . strtoupper( $language ) ) ) ) {
$module_contents .= ' <div class="ui-widget-header infoBoxHeading">' . PHP_EOL;

if( tep_not_null( MODULE_BOXES_BANNER_ROTATOR_TITLE_LINK ) ) {
$module_contents .= ' <a href="' . tep_href_link(MODULE_BOXES_BANNER_ROTATOR_TITLE_LINK) . '">';
}

$module_contents .= constant( 'MODULE_BOXES_BANNER_ROTATOR_TITLE_' . strtoupper( $language ) );

if( tep_not_null( MODULE_BOXES_BANNER_ROTATOR_TITLE_LINK ) ) {
$module_contents .= '</a>';
}

$module_contents .= PHP_EOL;
$module_contents .= ' </div>' . PHP_EOL;
} // if( tep_not_null( 'MODULE_BOXES_BANNER_ROTATOR_TITLE_

if (MODULE_BOXES_BANNER_ROTATOR_SWITCH == 'False') {
// Static banner
$module_contents .= ' <div class="ui-widget-content infoBoxContents" style="text-align: ' . MODULE_BOXES_BANNER_ROTATOR_CONTENT_ALIGNMENT . ';">' . PHP_EOL;

$module_contents .= tep_display_banner('static', $banner);

$module_contents .= ' </div>' . PHP_EOL;
$module_contents .= '</div>' . PHP_EOL;

} else {
//banner rotator
$module_contents .= ' <div class="ui-widget-content infoBoxContents bannerRotator" style="text-align: ' . MODULE_BOXES_BANNER_ROTATOR_CONTENT_ALIGNMENT . ';">' . PHP_EOL;

$banner_query_raw = "
select
banners_id,
banners_url,
banners_image,
banners_html_text,
status
from
" . TABLE_BANNERS . "
where
banners_group = '" . MODULE_BOXES_BANNER_ROTATOR_GROUP_NAME . "'
and language_id = '" . ( int )$languages_id . "'
and status = 1
order by
" . MODULE_BOXES_BANNER_ROTATOR_ORDER . "
limit
" . MODULE_BOXES_BANNER_ROTATOR_MAX_DISPLAY
;
// print $banner_query_raw; exit();

$banner_query = tep_db_query( $banner_query_raw );
if( tep_db_num_rows( $banner_query ) > 0 ) {

$module_contents .= '<div id="bannerRotatorBox">';
$module_contents .= '<ul>';
while( $banner = tep_db_fetch_array( $banner_query ) ) {
$module_contents .= ' <li>';
if( $banner['banners_url'] != '' ) {
$module_contents .= '<a href="' . tep_href_link( FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_self">';
}
if (tep_not_null($banner['banners_html_text'])) {
$module_contents .= $banner['banners_html_text'];
} else {
$module_contents .= tep_image( DIR_WS_IMAGES . $banner['banners_image']);
}
if( $banner['banners_url'] != '' ) {
$module_contents .= '</a>';
}
$module_contents .= '</li>';

tep_update_banner_display_count( $banner['banners_id'] );
}

$module_contents .= '</ul>';
if (MODULE_BOXES_BANNER_ROTATOR_NAVIGATION == 'True') {
$module_contents .= '<div id="bannerNavBox"></div>' . PHP_EOL;;
}
$module_contents .= '</div>' . PHP_EOL;
$module_contents .= '</div>' . PHP_EOL;
}

$module_contents .= '</div>' . PHP_EOL;
$module_contents .= ' <script type="text/javascript">' . PHP_EOL;
$module_contents .= ' $(document).ready(function(){' . PHP_EOL;
$module_contents .= ' bannerRotatorBox(\'#bannerRotatorBox\', ' . MODULE_BOXES_BANNER_ROTATOR_FADE_VALUE . ', ' . MODULE_BOXES_BANNER_ROTATOR_SHOWTIME_VALUE . ');' . PHP_EOL;
$module_contents .= ' });' . PHP_EOL;
$module_contents .= ' </script>' . PHP_EOL;
}
$oscTemplate->addBlock( $module_contents, $this->group );

$header_tag = '<link rel="stylesheet" type="text/css" href="ext/jquery/bannerRotator/bannerRotatorBox.css" />' . PHP_EOL;
$header_tag .= '<script type="text/javascript" src="ext/jquery/bannerRotator/bannerRotatorBox.js"></script>' . PHP_EOL;

$oscTemplate->addBlock( $header_tag, $this->header_tag );
}
}

function isEnabled() {
return $this->enabled;
}

function check() {
return defined('MODULE_BOXES_BANNER_ROTATOR_STATUS');
}

function install() {
// Check whether the banners table has been altered and add the language field if it has not
$check_structure_query_raw = "describe " . TABLE_BANNERS;
$check_structure_query = tep_db_query( $check_structure_query_raw );

$banners_language = false;
while( $check_structure_data = tep_db_fetch_array( $check_structure_query ) ) {
if( $check_structure_data['Field'] == 'language_id' ) {
$banners_language = true;
}
}

// Now insert the language field if we need to
if( $banners_language == false ) {
// ALTER TABLE `banners` ADD `language_id` INT( 11 ) NOT NULL DEFAULT '1' AFTER `banners_id` ;
tep_db_query( "alter table " . TABLE_BANNERS . " add column `language_id` INT( 11 ) NOT NULL default '1' after `banners_id`" );
}

include_once( DIR_WS_CLASSES . 'language.php' );
$bm_banner_language_class = new language;
$languages = $bm_banner_language_class->catalog_languages;

foreach( $languages as $this_language ) {
$this->languages_array[$this_language['id']] = $this_language['directory'];
}

tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Banner Module', 'MODULE_BOXES_BANNER_ROTATOR_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_BANNER_ROTATOR_SORT_ORDER', '1000', 'Sort order of display. Lowest is displayed first.', '6', '1', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_BANNER_ROTATOR_CONTENT_PLACEMENT', 'Left Column', 'Should the module be loaded in the left or right column?', '6', '2', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Title Link', 'MODULE_BOXES_BANNER_ROTATOR_TITLE_LINK', 'index.php', 'Link the title of the box to a page (Leave empty for no link.)', '6', '3', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Alignment', 'MODULE_BOXES_BANNER_ROTATOR_CONTENT_ALIGNMENT', 'center', 'Align the banner to the left, center, or right?', '6', '5', 'tep_cfg_select_option(array(\'left\', \'center\', \'right\'), ', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Rotate Banners', 'MODULE_BOXES_BANNER_ROTATOR_SWITCH', 'False', 'Would you like to rotate banners in the box?', '6', '7', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Banners Fade', 'MODULE_BOXES_BANNER_ROTATOR_FADE_VALUE', 500, 'How much time to fade from one banner to the next if Rotate Banners on? Numbers are in milliseconds, so 1000 is one second.', '6', '8', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Banners Show Time', 'MODULE_BOXES_BANNER_ROTATOR_SHOWTIME_VALUE', 4000, 'How much time each banner is shown if Rotate Banners on? Numbers are in milliseconds, so 1000 is one second.', '6', '9', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Banner Rotator Navigation', 'MODULE_BOXES_BANNER_ROTATOR_NAVIGATION', 'True', 'Do you want to enable Banner Rotator Navigation?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Banners Box Goup Name', 'MODULE_BOXES_BANNER_ROTATOR_GROUP_NAME', 'box_module', 'Add this group name for box banners.', '6', '11', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Max Banners in Rotation', 'MODULE_BOXES_BANNER_ROTATOR_MAX_DISPLAY', '4', 'Number of banners to show when the rotator is used.', '6', '12', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Banner Rotation Order', 'MODULE_BOXES_BANNER_ROTATOR_ORDER', 'banners_id', 'Order of banners to show when the rotator is used.', '6', '13', 'tep_cfg_select_option(array(\'banners_id\', \'rand()\'), ', now())");

foreach( $this->languages_array as $language_name ) {
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ( '" . ucwords( $language_name ) . " Title', 'MODULE_BOXES_BANNER_ROTATOR_TITLE_" . strtoupper( $language_name ) . "', 'Generic Title', 'Enter the title that you want on your box in " . $language_name . "', '6', '10', now())" );
}
}

function remove() {
tep_db_query( "delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}

function keys() {
include_once( DIR_WS_CLASSES . 'language.php' );
$bm_banner_language_class = new language;
$languages = $bm_banner_language_class->catalog_languages;

foreach( $languages as $this_language ) {
$this->languages_array[$this_language['id']] = $this_language['directory'];
}

$keys = array();

$keys[] = 'MODULE_BOXES_BANNER_ROTATOR_STATUS';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR_SORT_ORDER';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR_TITLE_LINK';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR_CONTENT_PLACEMENT';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR_CONTENT_ALIGNMENT';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR_SWITCH';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR_FADE_VALUE';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR_SHOWTIME_VALUE';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR_NAVIGATION';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR_GROUP_NAME';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR_MAX_DISPLAY';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR_ORDER';

foreach( $this->languages_array as $language_name ) {
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR_TITLE_' . strtoupper( $language_name );
}

return $keys;
}
}
?>
Voici mon fichier après tranformation
/inludes/module/boxes/bm_banner_rotator.php
<?php
/*
$Id: bm_banner_rotator.php v1.1 Kymation $
$Enhanced by Gergely. Thanks to Kymation's oscommerce contribution$
$Loc: catalog/includes/modules/boxes/ $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright © 2011 osCommerce

Released under the GNU General Public License
*/

class bm_banner_rotator4 {
var $code = 'bm_banner_rotator4';
var $group = 'boxes';
var $header_tag = 'header_tags';
var $title;
var $description;
var $sort_order;
var $enabled = false;

function bm_banner_rotator4() {
$this->title = MODULE_BOXES_BANNER_ROTATOR4_TITLE;
$this->description = MODULE_BOXES_BANNER_ROTATOR4_DESCRIPTION;

if ( defined( 'MODULE_BOXES_BANNER_ROTATOR4_STATUS' ) ) {
$this->sort_order = MODULE_BOXES_BANNER_ROTATOR4_SORT_ORDER;
$this->enabled = (MODULE_BOXES_BANNER_ROTATOR4_STATUS == 'True');

$this->group = ((MODULE_BOXES_BANNER_ROTATOR4_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right');
}
}

function execute() {
global $language, $oscTemplate, $languages_id;

if ($banner = tep_banner_exists('dynamic', MODULE_BOXES_BANNER_ROTATOR4_GROUP_NAME)) {
$module_contents = '<div class="ui-widget infoBoxContainer">' . PHP_EOL;

if( tep_not_null( constant( 'MODULE_BOXES_BANNER_ROTATOR4_TITLE_' . strtoupper( $language ) ) ) ) {
$module_contents .= ' <div class="ui-widget-header infoBoxHeading">' . PHP_EOL;

if( tep_not_null( MODULE_BOXES_BANNER_ROTATOR4_TITLE_LINK ) ) {
$module_contents .= ' <a href="' . tep_href_link(MODULE_BOXES_BANNER_ROTATOR4_TITLE_LINK) . '">';
}

$module_contents .= constant( 'MODULE_BOXES_BANNER_ROTATOR4_TITLE_' . strtoupper( $language ) );

if( tep_not_null( MODULE_BOXES_BANNER_ROTATOR4_TITLE_LINK ) ) {
$module_contents .= '</a>';
}

$module_contents .= PHP_EOL;
$module_contents .= ' </div>' . PHP_EOL;
} // if( tep_not_null( 'MODULE_BOXES_BANNER_ROTATOR4_TITLE_

if (MODULE_BOXES_BANNER_ROTATOR4_SWITCH == 'False') {
// Static banner
$module_contents .= ' <div class="ui-widget-content infoBoxContents" style="text-align: ' . MODULE_BOXES_BANNER_ROTATOR4_CONTENT_ALIGNMENT . ';">' . PHP_EOL;

$module_contents .= tep_display_banner('static', $banner);

$module_contents .= ' </div>' . PHP_EOL;
$module_contents .= '</div>' . PHP_EOL;

} else {
//banner rotator
$module_contents .= ' <div class="ui-widget-content infoBoxContents bannerRotator" style="text-align: ' . MODULE_BOXES_BANNER_ROTATOR4_CONTENT_ALIGNMENT . ';">' . PHP_EOL;

$banner_query_raw = "
select
banners_id,
banners_url,
banners_image,
banners_html_text,
status
from
" . TABLE_BANNERS . "
where
banners_group = '" . MODULE_BOXES_BANNER_ROTATOR4_GROUP_NAME . "'
and language_id = '" . ( int )$languages_id . "'
and status = 1
order by
" . MODULE_BOXES_BANNER_ROTATOR4_ORDER . "
limit
" . MODULE_BOXES_BANNER_ROTATOR4_MAX_DISPLAY
;
// print $banner_query_raw; exit();

$banner_query = tep_db_query( $banner_query_raw );
if( tep_db_num_rows( $banner_query ) > 0 ) {

$module_contents .= '<div id="bannerRotatorBox">';
$module_contents .= '<ul>';
while( $banner = tep_db_fetch_array( $banner_query ) ) {
$module_contents .= ' <li>';
if( $banner['banners_url'] != '' ) {
$module_contents .= '<a href="' . tep_href_link( FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_self">';
}
if (tep_not_null($banner['banners_html_text'])) {
$module_contents .= $banner['banners_html_text'];
} else {
$module_contents .= tep_image( DIR_WS_IMAGES . $banner['banners_image']);
}
if( $banner['banners_url'] != '' ) {
$module_contents .= '</a>';
}
$module_contents .= '</li>';

tep_update_banner_display_count( $banner['banners_id'] );
}

$module_contents .= '</ul>';
if (MODULE_BOXES_BANNER_ROTATOR4_NAVIGATION == 'True') {
$module_contents .= '<div id="bannerNavBox"></div>' . PHP_EOL;;
}
$module_contents .= '</div>' . PHP_EOL;
$module_contents .= '</div>' . PHP_EOL;
}

$module_contents .= '</div>' . PHP_EOL;
$module_contents .= ' <script type="text/javascript">' . PHP_EOL;
$module_contents .= ' $(document).ready(function(){' . PHP_EOL;
$module_contents .= ' bannerRotatorBox(\'#bannerRotatorBox\', ' . MODULE_BOXES_BANNER_ROTATOR4_FADE_VALUE . ', ' . MODULE_BOXES_BANNER_ROTATOR4_SHOWTIME_VALUE . ');' . PHP_EOL;
$module_contents .= ' });' . PHP_EOL;
$module_contents .= ' </script>' . PHP_EOL;
}
$oscTemplate->addBlock( $module_contents, $this->group );

$header_tag = '<link rel="stylesheet" type="text/css" href="ext/jquery/bannerRotator/bannerRotatorBox.css" />' . PHP_EOL;
$header_tag .= '<script type="text/javascript" src="ext/jquery/bannerRotator/bannerRotatorBox.js"></script>' . PHP_EOL;

$oscTemplate->addBlock( $header_tag, $this->header_tag );
}
}

function isEnabled() {
return $this->enabled;
}

function check() {
return defined('MODULE_BOXES_BANNER_ROTATOR4_STATUS');
}

function install() {
// Check whether the banners table has been altered and add the language field if it has not
$check_structure_query_raw = "describe " . TABLE_BANNERS;
$check_structure_query = tep_db_query( $check_structure_query_raw );

$banners_language = false;
while( $check_structure_data = tep_db_fetch_array( $check_structure_query ) ) {
if( $check_structure_data['Field'] == 'language_id' ) {
$banners_language = true;
}
}

// Now insert the language field if we need to
if( $banners_language == false ) {
// ALTER TABLE `banners` ADD `language_id` INT( 11 ) NOT NULL DEFAULT '1' AFTER `banners_id` ;
tep_db_query( "alter table " . TABLE_BANNERS . " add column `language_id` INT( 11 ) NOT NULL default '1' after `banners_id`" );
}

include_once( DIR_WS_CLASSES . 'language.php' );
$bm_banner_language_class = new language;
$languages = $bm_banner_language_class->catalog_languages;

foreach( $languages as $this_language ) {
$this->languages_array[$this_language['id']] = $this_language['directory'];
}

tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Banner Module', 'MODULE_BOXES_BANNER_ROTATOR4_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_BANNER_ROTATOR4_SORT_ORDER', '1000', 'Sort order of display. Lowest is displayed first.', '6', '1', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_BANNER_ROTATOR4_CONTENT_PLACEMENT', 'Left Column', 'Should the module be loaded in the left or right column?', '6', '2', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Title Link', 'MODULE_BOXES_BANNER_ROTATOR4_TITLE_LINK', 'index.php', 'Link the title of the box to a page (Leave empty for no link.)', '6', '3', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Alignment', 'MODULE_BOXES_BANNER_ROTATOR4_CONTENT_ALIGNMENT', 'center', 'Align the banner to the left, center, or right?', '6', '5', 'tep_cfg_select_option(array(\'left\', \'center\', \'right\'), ', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Rotate Banners', 'MODULE_BOXES_BANNER_ROTATOR4_SWITCH', 'False', 'Would you like to rotate banners in the box?', '6', '7', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Banners Fade', 'MODULE_BOXES_BANNER_ROTATOR4_FADE_VALUE', 500, 'How much time to fade from one banner to the next if Rotate Banners on? Numbers are in milliseconds, so 1000 is one second.', '6', '8', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Banners Show Time', 'MODULE_BOXES_BANNER_ROTATOR4_SHOWTIME_VALUE', 4000, 'How much time each banner is shown if Rotate Banners on? Numbers are in milliseconds, so 1000 is one second.', '6', '9', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Banner Rotator Navigation', 'MODULE_BOXES_BANNER_ROTATOR4_NAVIGATION', 'True', 'Do you want to enable Banner Rotator Navigation?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Banners Box Goup Name', 'MODULE_BOXES_BANNER_ROTATOR4_GROUP_NAME', 'box_modul4', 'Add this group name for box banners.', '6', '11', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Max Banners in Rotation', 'MODULE_BOXES_BANNER_ROTATOR4_MAX_DISPLAY', '4', 'Number of banners to show when the rotator is used.', '6', '12', now())");
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Banner Rotation Order', 'MODULE_BOXES_BANNER_ROTATOR4_ORDER', 'banners_id', 'Order of banners to show when the rotator is used.', '6', '13', 'tep_cfg_select_option(array(\'banners_id\', \'rand()\'), ', now())");

foreach( $this->languages_array as $language_name ) {
tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ( '" . ucwords( $language_name ) . " Title', 'MODULE_BOXES_BANNER_ROTATOR4_TITLE_" . strtoupper( $language_name ) . "', 'Generic Title', 'Enter the title that you want on your box in " . $language_name . "', '6', '10', now())" );
}
}

function remove() {
tep_db_query( "delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}

function keys() {
include_once( DIR_WS_CLASSES . 'language.php' );
$bm_banner_language_class = new language;
$languages = $bm_banner_language_class->catalog_languages;

foreach( $languages as $this_language ) {
$this->languages_array[$this_language['id']] = $this_language['directory'];
}

$keys = array();

$keys[] = 'MODULE_BOXES_BANNER_ROTATOR4_STATUS';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR4_SORT_ORDER';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR4_TITLE_LINK';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR4_CONTENT_PLACEMENT';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR4_CONTENT_ALIGNMENT';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR4_SWITCH';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR4_FADE_VALUE';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR4_SHOWTIME_VALUE';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR4_NAVIGATION';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR4_GROUP_NAME';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR4_MAX_DISPLAY';
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR4_ORDER';

foreach( $this->languages_array as $language_name ) {
$keys[] = 'MODULE_BOXES_BANNER_ROTATOR4_TITLE_' . strtoupper( $language_name );
}

return $keys;
}
}
?>

/includes/languages/french/module/boxes/bm_banner_rotator.php
<?php
/*
$Id: bm_banner.php v1.0 $
$Loc: catalog/includes/languages/english/modules/boxes/ $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright © 2011 osCommerce

Released under the GNU General Public License
*/

define( 'MODULE_BOXES_BANNER_ROTATOR_TITLE', 'Banner Box with Rotator' );
define( 'MODULE_BOXES_BANNER_ROTATOR_DESCRIPTION', 'Show the banner box in a column.' );
?>
La mienne dupliquée
/includes/languages/modules/boxes/bm_banner_rotaor.php
<?php
/*
$Id: bm_banner.php v1.0 $
$Loc: catalog/includes/languages/english/modules/boxes/ $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright © 2011 osCommerce

Released under the GNU General Public License
*/

define( 'MODULE_BOXES_BANNER_ROTATOR4_TITLE', 'Banner Box with Rotator4' );
define( 'MODULE_BOXES_BANNER_ROTATOR4_DESCRIPTION', 'Show the banner box4 in a column.' );
?>
Qu’est-ce qui ne va pas chez moi ?
Je vous remercie
Go to the top of the page
 
badcape
posté 16 Jul 2017, 15:25
Message #8


Ceinture bleue OSC
Icône de groupe

Groupe : Membres
Messages : 1071
Inscrit : 28-September 07
Lieu : Saint paul - REUNION
Membre no 19202



Bonsoir Roiphoto,
déjà pour commencer, je suis amusé de lire que ton post du forum US te dit point par point ce que je t'avais expliquer rapidement..... passons happy.gif
tu as tout dupliqué, puis changé les "constants" des points 3 et 6 par "ROTATOR4"; les chemins vers le stylesheet et le fichier JS sont identiques (mais ne devraient pas poser de problème); et je lis
Code
Voici mon fichier après tranformation
/inludes/module/boxes/bm_banner_rotator.php
<?php
/*
$Id: bm_banner_rotator.php v1.1 Kymation $
$Enhanced by Gergely. Thanks to Kymation's oscommerce contribution$
$Loc: catalog/includes/modules/boxes/ $.......

"plus bas":

La mienne dupliquée
/includes/languages/modules/boxes/bm_banner_rotaor.php
<?php
/*
$Id: bm_banner.php v1.0 $
$Loc: catalog/includes/languages/english/modules/boxes/ $.....

as-tu copié la barre de nav en local pour nous donner le chemin? ou as-tu tapé ça en oubliant ..../rotator4.php?
Je ne me suis pas penché en profondeur sur le fonctionnement des banners que je n'utilise pas mais en premier lieu, je te conseille de re-vérifier tous les noms des fichiers et les $Id: des entêtes commentées /*: une double assurance!!!! Tes fichiers édités ici ont l'air ok. Regarde aussi dans ta DB si tout est clair après ton installation de la contrib dupliquée: TABLE_BANNERS en particulier.
J'sais pas pourquoi mais perso j'aurais surement dupliqué aussi la TABLE_BANNERS en la renomant pour éviter les conflicts "potentiels".....

cool.gif


--------------------
Thierry
En prod Server: Percona Server via UNIX socket Percona Server version:10.1.20-MariaDB - Percona Server (GPL),
PHP 5.5.30 phpMyAdmin 4.0.10.6 Database version: MySQL 5.5.5-10.1.20 extension: mysqli
version Oscommerce-2.3.4 bootstrap avec un tas comme ça de contributions ...... et bien d'autres dont je me suis inspiré à grand renfort de café !
Un grand merci à tous !(pour votre aide et votre patience....)
En local:
1) Pour suivre mon site en prod - EasyPHP DevServer 14.1 VC9 "Minakami" avec oscom 2.3.4 Bootstrap Gold + KissIT_image thumbnailer, Product fields group, Products Extra Fields, margin report, account_create_in_admin, easy populate, FAQ desk, MATC, SPPC, quick updates for SPPC, slick reCaptcha, modular front page module, Select Product Image Directory, Edit page (page control), Message box, Horizontal categories menu BS, Edit order, Edit invoice, Hide categories with category cache, Related products BS, Ultimate Seo Urls, Withdrawal form for BS... modifiées et d'autre contrib que je teste avant de mettre en prod.
2) Pour dev Phoenix 1.0.2.0, Devserver sous PHP 7.1.3 et Database MySQL 5.7.17
Go to the top of the page
 

Reply to this topicStart new topic
1 utilisateur(s) sur ce sujet (1 invité(s) et 0 utilisateur(s) anonyme(s))
0 membre(s) :

 



RSS Version bas débit Nous sommes le : 19th March 2024 - 09:21
Ce site est déclaré auprès de la commision Nationale
de l'Informatique et des Libertés (déclaration n°: 1043896)