[MOD] Pixaco Interface
- This mod enable to Print Pictures over Pixaco Affili Partnerprogram
- tested with 4images 1.7.1
- you can copy your Printable Pictures (better Quality) to an Directory like 4images/data/media/{cat_id}
/big/{image_file_name} if the Pic isn`t there than don`t apear the Link
- you can store the Printable Pictures (better Quality) on an other Server (Url des Bildes Lokal) first the script looks there if the image exists
FILESFiles to be modified: (please take a backup copy of all of these!)
- includes/functions.php
- templates/your_template/details.html
New file:- admin/plugins/PixacoPrint.php
INSTALL1 Make New File: admin/plugins/PixacoPrint.php
<?php // PLUGIN_TITLE: Pixaco Partner
$nozip = 1;
define('IN_CP', 1);
$root_path = (eregi("\/personal_plugins\/", $PHP_SELF)) ? "./../../" : "./../";
define('ROOT_PATH', $root_path);
require(ROOT_PATH.'admin/admin_global.php');
show_admin_header();
$CreateCode = "CREATE TABLE IF NOT EXISTS `".$table_prefix."Pixaco` (
`ID` int(11) NOT NULL auto_increment,
`affiliLink` text NOT NULL,
`LinkText` text NOT NULL,
`Popupheigh` int(4) NOT NULL default '0',
`Popupwidth` int(4) NOT NULL default '0',
`PicdirfullRemote` text NOT NULL,
`PicdirfullLocal` text NOT NULL,
UNIQUE KEY `ID` (`ID`)
)
";
$resultCreate = $site_db->query($CreateCode);
$action = $_GET["action"];
if ($action == "update") {
global $site_db;
$sql = $MODE." ".$table_prefix."Pixaco SET
affiliLink='$affiliLink',
LinkText='$LinkText',
Popupheigh='$Popupheigh',
Popupwidth='$Popupwidth',
PicdirfullRemote='$PicdirfullRemote',
PicdirfullLocal='$PicdirfullLocal'
";
$result = $site_db->query($sql);
printf ("Daten geändert<br>");
}
function display_Pixaco() {
global $site_db,$table_prefix;
$sql = "SELECT * FROM ".$table_prefix."Pixaco";
$result = $site_db->query($sql);
$i=0;
while($row = $site_db->fetch_array($result)){
$i++;
$affiliLink= $row["affiliLink"];
$LinkText= $row["LinkText"];
$Popupheigh= $row["Popupheigh"];
$Popupwidth= $row["Popupwidth"];
$PicdirfullRemote= $row["PicdirfullRemote"];
$PicdirfullLocal= $row["PicdirfullLocal"];
}
if ($affiliLink =="") {
$affiliLink= "http://partners.webmasterplan.com/click.asp?ref=145817&site=3043&type=text&tnb=6 ";
}
if ($LinkText =="") {
$LinkText= "Bild zum PIXACO Warenkorb hinzufügen ";
}
if ($Popupheigh=="") {
$Popupheigh= "250";
}
if ($Popupwidth =="") {
$Popupwidth= "310";
}
if ($PicdirfullRemote =="") {
$PicdirfullRemote= "http://URL/galerie/4images/data/media/{cat_id}/big/{image_file_name}";
}
if ($PicdirfullLocal=="") {
$PicdirfullLocal= "http://URL/galerie/4images/data/media/{cat_id}/big/{image_file_name}";
}
if ($i==0) {
$Mode ="INSERT";
} else {
$Mode ="UPDATE";
}
echo '
<style type="text/css">
<!--
.Stil1 {font-size: xx-small}
.Beispiele {
font-size: xx-small;
font-style: italic;
font-weight: normal;
}
-->
</style>
<form action="PixacoPrint.php?action=update" method="post">
<input name="MODE" type="hidden" value="'.$Mode.'" size="8">
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#0000FF">
<tr>
<td class="tableborder">
<table cellpadding="3" cellspacing="1" border="0" width="100%">
<tr class="tableheader">
<td colspan="2"><a name=""><b><span class="tableheader">Pixaco</span></b></a></td>
</tr>
<tr class="tablerow" valign="top">
<td colspan="2">
<table width="100%" border="0">
<tr>
<td><strong>Affili Link: <br><span class="Beispiele">http://partners.webmasterplan.com/click.asp?ref=145817&site=3043&type=text&tnb=6 </span></strong></td>
<td width="40%"><textarea name="affiliLink" cols="50" rows="4">'.$affiliLink.'</textarea></td>
</tr>
<tr>
<td><strong>Link Text:<br><span class="Beispiele">Bild zum PIXACO Warenkorb hinzufügen </span> </strong></td>
<td width="40%"><textarea name="LinkText" cols="50" rows="4">'.$LinkText.'</textarea></td>
</tr>
<tr>
<td><strong>Höhe des Popup Fensters <br><span class="Beispiele">250</span> </strong></td>
<td width="40%"><input name="Popupwidth" type="text" value="'.$Popupwidth.'" size="4"></td>
</tr>
<tr>
<td><strong>Breite des Popup Fensters</strong> <br><span class="Beispiele">310</span></td>
<td width="40%"><input name="Popupheigh" type="text" value="'.$Popupheigh.'" size="4"></td>
</tr>
<tr>
<td><strong>Url des Bildes Remote </strong><br>Platzhalter:<br>
<table border="1">
<tr>
<td class="Stil1">{cat_id} = Kategorie ID </td>
</tr>
<tr>
<td class="Stil1">{image_file_name} = Datei Name des Bildes </td>
</tr>
</table>
<span class="Beispiele">http://URL/galerie/4images/data/media/{cat_id}/{PicChartOptions[Picdirlocal]}/{image_file_name}</span><span class="Stil1"><br></span>
</td>
<td width="40%"><textarea name="PicdirfullRemote" cols="50" rows="4">'.$PicdirfullRemote.'</textarea></td>
</tr>
<tr>
<td><strong>Url des Bildes Lokal</strong><br>Platzhalter:<br>
<table border="1">
<tr>
<td class="Stil1">{cat_id} = Kategorie ID </td>
</tr>
<tr>
<td class="Stil1">{image_file_name} = Datei Name des Bildes </td>
</tr>
</table>
<span class="Beispiele">http://URL/galerie/4images/data/media/{cat_id}/{PicChartOptions[Picdirlocal]}/{image_file_name}</span><br>
</td>
<td width="40%"><textarea name="PicdirfullLocal" cols="50" rows="4">'.$PicdirfullLocal.'</textarea></td>
</tr>
</table>
<p class="rowtitle"> Pixaco: <a href="http://partners.webmasterplan.com/click.asp?ref=145817&site=3043&type=text&tnb=1" target="_blank">www.pixaco.de</a></p>
<p class="rowtitle">Programmer: <a href="mailto:markus@dj-w.de">Markus Grampp </a><a href="http://www.dj-w.de" target="_blank">DJ W. Eventservice</a> </p>
<p class="rowtitle"><br>
</p></td>
</tr>
<tr class="tablefooter">
<td colspan="2" align="center"> <input type="submit" value=" Einstellungen Speichern " class="button"> </td>
</tr>
</table>
</td>
</tr>
</table>
</form>
';
}
display_Pixaco();
show_admin_footer();
?>
2 Insert Into includes/functions.php
bevore
?>
/* Druck über Pixaco Partnerprogramm affilinet */
function PicLargeforPixacoPrint($cat_id,$image_file_name) {
global $site_db,$table_prefix;
$sql="";
$sql = "SELECT * FROM ".$table_prefix."Pixaco";
$result = $site_db->query($sql);
// Werte aus DB holen
while ($row = $site_db->fetch_array($result)) {
$PicChartOptions[affiliLink]= $row[affiliLink];
$PicChartOptions[Linktext]= $row[LinkText];
$PicChartOptions[Popupheight]= $row[Popupheigh];
$PicChartOptions[Popupwidth]= $row[Popupwidth];
$PicChartOptions[PicdirfullRemote] = $row[PicdirfullRemote];
$PicChartOptions[PicdirfullLocal]= $row[PicdirfullLocal];
}
$PicChartOptions[PicdirfullLocal]= str_replace("{cat_id}", $cat_id, $PicChartOptions[PicdirfullLocal]);
$PicChartOptions[PicdirfullLocal]= str_replace("{image_file_name}", $image_file_name, $PicChartOptions[PicdirfullLocal]);
if (@fopen ($PicChartOptions[PicdirfullLocal], "r")) {
$PicChartOptions[PicdirfullLocal] = $PicChartOptions[PicdirfullLocal];
} else {
$PicChartOptions[PicdirfullLocal]="";
echo $PicChartOptions[PicdirfullLocal];
}
$PicChartOptions[PicdirfullRemote]= str_replace("{cat_id}", $cat_id, $PicChartOptions[PicdirfullRemote]);
$PicChartOptions[PicdirfullRemote]= str_replace("{image_file_name}", $image_file_name, $PicChartOptions[PicdirfullRemote]);
if (@fopen ($PicChartOptions[PicdirfullRemote], "r")) {
$PicChartOptions[PicdirfullRemote] = $PicChartOptions[PicdirfullRemote];
} else {
$PicChartOptions[PicdirfullRemote]="";
}
if ($PicChartOptions[PicdirfullRemote]=="") {
if ($PicChartOptions[PicdirfullLocal]=="") {
$PicChartOptions[Picdirfull] = "";
return "";
} else {
$PicChartOptions[Picdirfull] = $PicChartOptions[PicdirfullLocal];
}
} else {
$PicChartOptions[Picdirfull] = $PicChartOptions[PicdirfullRemote];
}
// Falls kein Bild in großer Version existiert
if ($PicChartOptions[Picdirfull] !="") {
$OutURL= "<a href=\"#\" onclick=\"javascript:window.open('".$PicChartOptions[affiliLink]."&prd=yes&smm=cookie&cmd=addimage&url0=".$PicChartOptions[Picdirfull]."','popup',
'width=".$PicChartOptions[Popupwidth].",height=".$PicChartOptions[Popupheight].",menubar=no,status=no,scrollbars=no,resizable=yes,left=50,top=50');\"> ".$PicChartOptions[Linktext]."</a>";
} else {
$OutURL= "";
}
return $OutURL;
}
3 Insert Into templates/your_template/details.html
On the place where do you want
<?php echo PicLargeforPixacoPrint($cat_id,$image_file_name);?>
4 Open Admin Control Panel
goto Pixaco
klick "Einstellungen Speichern"
Admin Panel Pic:User Pic:
If you want to allow only, that user can print the own images:
in Details.html:
bevore
<?php
insert
{if PrintPartner}
after
?>
insert
{endif PrintPartner}
in Details.php:
change
"admin_links" => $admin_links
to
"admin_links" => $admin_links,
"PrintPartner" => $PrintPartner
after
elseif ($is_image_owner) {
(2X)
insert
$PrintPartner = "1";