Hello !
C'est encore moi :-)
pour faire plus claire :
J'ai pris une base vierge de thelia,
activée le plugin....
Sur la base du pluging avec corrif de manu
Messagecmd.class.php
<?php
/*************************************************************************************/
/* */
/* Thelia */
/* */
/* Copyright (c) Octolys Development */
/* email : thelia@octolys.fr */
/* web : http://www.octolys.fr */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License, or */
/* (at your option) any later version. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* */
/*************************************************************************************/
?>
<?php
include_once(realpath(dirname(__FILE__)) . "/../../../classes/PluginsClassiques.class.php");
class Messagecmd extends PluginsClassiques{
var $id;
var $commande;
var $expediteur;
var $destinataire;
var $message;
var $table = "messagecmd";
var $bddvars=array("id", "commande", "expediteur", "destinataire", "message");
function init(){
$cnx = new Cnx();
$query_messagecmd = "CREATE TABLE `messagecmd` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`commande` INT NOT NULL ,
`expediteur` TEXT NOT NULL ,
`destinataire` TEXT NOT NULL ,
`message` TEXT NOT NULL
)";
$resul_messagecmd = mysql_query($query_messagecmd, $cnx->link);
}
function Messagecmd(){
$this->PluginsClassiques("Messagecmd");
}
function charger($commande){
return $this->getVars("select * from $this->table where commande=\"$commande\"");
}
function action(){
global $res;
if($_REQUEST['texte_messagecmd'] != ""){
$_SESSION['texte_messagecmd'] = $_REQUEST['texte_messagecmd'];
$_SESSION['texte_destinatairecmd'] = $_REQUEST['texte_destinatairecmd'];
$_SESSION['texte_expediteurcmd'] = $_REQUEST['texte_expediteurcmd'];
}
$res = str_replace("#MESSAGECMD", $_SESSION['texte_messagecmd'], $res);
$res = str_replace("#DESTINATAIRECMD", $_SESSION['texte_destinatairecmd'], $res);
$res = str_replace("#EXPEDITEURCMD", $_SESSION['texte_expediteurcmd'], $res);
}
function aprescommande($commande){
if($_SESSION['texte_messagecmd']){
$msg = new Messagecmd();
$msg->commande = $commande->id;
$msg->message = $_SESSION['texte_messagecmd'];
$msg->destinataire = $_SESSION['texte_destinatairecmd'];
$msg->expediteur = $_SESSION['texte_expediteurcmd'];
$msg->add();
$_SESSION['texte_messagecmd'] = "";
$_SESSION['texte_destinatairecmd'] = "";
$_SESSION['texte_expediteurcmd'] = "";
}
}
}
?>
aucun changement sur "messagecmd_admin_commandedetails.php"
Sur la page commande.html, j'ai le code suivant
<td width="540" align="center" valign="top" bgcolor="#DBDBDB"> <p><br>
</p>
<THELIA SI CONNECTE>
<div class="retour">
vous êtes connecté à votre compte sous le nom : #CLIENT_NOM (<a href="#URLDECONNEXION">se déconnecter</a>)</div>
</THELIA SI CONNECTE>
<p> </p>
<p> </p>
<p> </p>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="10" bgcolor="#FFFFFF" class="fiches_petites_blanc">
<THELIA_CONTENU_PANIER type="PANIER">
<tr bgcolor="#FFFFFF">
<td width="114" align="center" valign="middle"> <THELIA_IMAGE type="IMAGE" num="1" produit="#ID" largeur="40">
<div align="center"><img src="#IMAGE" alt="#PRODTITRE " title="#PRODTITRE " border="0" class="contourImage" /> </div>
</THELIA_IMAGE> </td>
<td width="356" height="20" align="center" valign="middle" bgcolor="#FFFFFF"><div align="left">#TITRE</div></td>
</tr>
</THELIA_CONTENU_PANIER>
</table>
<form action="#URLCOURANTEPARAM" id="Messagecmd" method="POST">
<input type="hidden" name="action" value="" />
Expéditeur : <input type="text" name="texte_expediteurcmd" value="#EXPEDITEURCMD" /><br />
Destinataire : <input type="text" name="texte_destinatairecmd" value="#DESTINATAIRECMD" /><br />
Message :
<textarea name="texte_messagecmd" maxlength="200" rows="4" >#MESSAGECMD</textarea>
<THELIA_PAIEMENT type="PAIEMENT">
<p> </p>
<p><a href="#URLPAYER" onclick="document.getElementById('Messagecmd').submit()">
<img src="doc/boutons/envoyer.gif" width="115" height="30" border="0" /></a></p>
<p> </p>
<p> </p>
</THELIA_PAIEMENT>
</form>
<p> </p></td>
Sachant que je n'ai qu'un seul mode de paiement ...
Voili - voilou pour les précisions.
Merci.
Last edited by wts (10-02-2009 22:07:30)