Bonjour à tous,
Je trouvais qu'il manquait un bouton à enlargit! pour envoyer une photo en E-card. N'aillant rien trouvé sur le forum, j'ai fais la modif (comme j'ai pu
) moi-même.
Si ça interresse quelqu'un voici comment j'ai fais :
- créer un fichier nommé enl_ecard.php et y coller ceci:
<?php
/**************************************************
Coppermine 1.4.x Plugin - EnlargeIt! $VERSION$=2.14
*************************************************
Copyright (c) 2008 Timos-Welt (www.timos-welt.de)
*************************************************
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 3 of the License, or
(at your option) any later version.
***************************************************/
define('IN_COPPERMINE', true);
define('DISPLAYIMAGE_PHP', true);
define('INDEX_PHP', true);
define('UPLOAD_PHP', true);
require('include/init.inc.php');
global $ENLARGEITSET,$lang_enlargeit;
require('./plugins/enlargeit/include/load_enlargeitset.php');
/**
* Main code
*/
$pos = isset($_GET['pos']) ? (int)$_GET['pos'] : 0;
/**
* Hack added by tarique to prevent incorrect picture being seen on last view or last uploaded
*/
$pid = isset($_GET['pid']) ? (int)$_GET['pid'] : 0;
$cat = isset($_GET['cat']) ? (int)$_GET['cat'] : 0;
$album = isset($_GET['album']) ? $_GET['album'] : '';
//get_meta_album_set in functions.inc.php will populate the $ALBUM_SET instead; matches $META_ALBUM_SET.
get_meta_album_set($cat,$ALBUM_SET);
$META_ALBUM_SET = $ALBUM_SET; //displayimage uses $ALBUM_SET but get_pic_data in functions now uses $META_ALBUM_SET
// Retrieve data for the current picture
$pid = ($pos < 0) ? -$pos : $pid;
$result = cpg_db_query("SELECT aid from {$CONFIG['TABLE_PICTURES']} WHERE pid='$pid' $ALBUM_SET LIMIT 1");
if (mysql_num_rows($result) == 0) cpg_die(ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);
$row = mysql_fetch_array($result);
$album = $row['aid'];
$pic_data = get_pic_data($album, $pic_count, $album_name, -1, -1, false);
for($pos = 0; $pic_data[$pos]['pid'] != $pid && $pos < $pic_count; $pos++);
$pic_data = get_pic_data($album, $pic_count, $album_name, $pos, 1, false);
$CURRENT_PIC_DATA = $pic_data[0];
$lien_ecard = '<a href="ecard.php?album=' . $CURRENT_PIC_DATA['aid'] . '&pid='.$CURRENT_PIC_DATA['pid'].'&pos=' . $pos .'>Envoyer cette photo en E-card</a>';
echo <<<EOT
<table align="center" cellspacing="1" style="width:90%;height:90%">
<tr><td class="enl_infotable" align="center">
<p>La fonction E-card permet d'envoyer la photo sélectionnée comme <b>carte postale électronique</b> sur l'email du correspondant de votre choix</p>
</td></tr>
<tr><td class="enl_infotable" align="center">$lien_ecard</td></tr>
</table>
EOT;
?>
puis copier le fichier à la racine de la galerie.
- éditer le fichier : /plugins/enlargeit/codebase.php comme suit :
trouver
...
$i = 0;
if ($ENLARGEITSET['enl_buttonpic'])
{
$enlargeit_headcode .= "enl_buttonurl[".$i."] = 'pic';
";
$enlargeit_headcode .= "enl_buttontxt[".$i."] = \"".$lang_enlargeit['enl_tooltippic']."\";
";
$enlargeit_headcode .= "enl_buttonoff[".$i."] = 0;
";
$i = $i + 1;
}
...
chaque section comme celle-ci ( if ( ... ) { ... } ) détermine un bouton. Insérer ceci à l'emplacement où vous voulez voir apparaitre le bouton E-card :
$enlargeit_headcode .= "enl_buttonurl[".$i."] = 'enl_ecard.php?pos=-';
";
$enlargeit_headcode .= "enl_buttontxt[".$i."] = \"Envoyer cette photo en E-card\";
";
$enlargeit_headcode .= "enl_buttonoff[".$i."] = -176;
";
$i = $i + 1;
et le tour est joué.
Cela ouvre une page sommaire expliquant l'E-card avec un lien qui renvoi sur la page de l'E-card (ecard.php).
(Bon c'est un peu de la bidouille mais j'ai pas trouvé comment passer à la page ecard.php les variables nécessaire directement
, si quelqu'un a mieu je suis preneur )
ps: dans la modif de codebase.php, je me suis servi aussi d'une info trouvé sur le forum pour interdire les favoris au guest : il suffit de modifier les boutons que l'on veut cacher comme ceci :
if (USER_ID) { //ajout de if (USER_ID) { pour cacher le bouton au guest
if ($ENLARGEITSET['enl_buttonfav'])
{
$enlargeit_headcode .= "enl_buttonurl[".$i."] = 'enl_addfav.php?pid=';
";
$enlargeit_headcode .= "enl_buttontxt[".$i."] = \"".$lang_enlargeit['enl_tooltipfav']."\";
";
$enlargeit_headcode .= "enl_buttonoff[".$i."] = -32;
";
$i = $i + 1;
}
} // fin de if (USER_ID)