forum.coppermine-gallery.net
No Support => Modifications/Add-Ons/Hacks => Mods: Statistics => Topic started by: Bruz on March 01, 2004, 11:24:45 am
-
It's hard for me do describe in the topic what this mod is exactly about - just have a look!
Hi!
I had the idea to crate an image which contains the statistics of my coppermine-album.
The really best thing would be, I've thought, if it's possible to show on the very left a random picture and right beside it some informations about my album:
[list=1]The album name
total pictures
total comments
total viewed[/list:o]
-
I've thought of ssi.php and used it - thanks to the developer!
And thats what it finally looks like:
----
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.kingbruz.de%2FFotos%2Fsignatur_cpg.php&hash=b7bf1fbae41c2d8c534416d10d32fe51619697d7)
----
EDIT:
If anybody is interested in this mod, please tell me. I've rewritten it completely as you see above - now it creates even a full-color-image!
-
I am interested :)
-
And here's the mod: [last updated: 07.03.2004]
First, get you a copy of the ssi.php which is contained in this file:
http://prdownloads.sourceforge.net/coppermine/cpg1.1mod_ssi.zip?download
Rename the ssi.php to signature_cgp.php and store it in your coppermine-root-dir.
Open signature_cpg.php
find:
/////////////////// edit the following lines //////////////////////////////
edit the following lines to match your album / your language (you don't really need to fill in your language, it's not needet for this mod)
find
print <<<EOT
till
EOT;
(lines 34-40)
and delete it.
find
$return_value.= "<img src=\"".$url_of_cpg_dir.$cpg_album_path.$row['filepath'].$cpg_thumb_pfx.$row['filename']."\" border=\"0\" alt=\"\" title=\"";
replace with
$return_value.= "".$url_of_cpg_dir.$cpg_album_path.$row[rawurlencode('filepath')].rawurlencode($cpg_thumb_pfx.$row['filename']);
delete the following 8 Lines ("if ($row['title']!="")" till "$return_value.=$td_end."\n";")
find
function cpg_random()
{
return cpg_thumb(1,1,1,"",1);
}
after, add
function random_picture()
{
return cpg_thumb(0,0,1,"",1);
}
find
//function taken from functions.inc.php
function db_connect()
{
global $CONFIG;
$result = @mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);
if (!$result)
return false;
if (!mysql_select_db($CONFIG['dbname']))
return false;
return $result;
}
after, add
$total_pics = cpg_total_pics("");
$total_albums = cpg_total_albums();
$total_comments = cpg_total_comments();
$total_views = cpg_total_views("");
$random_picture = random_picture();
$im = ImageCreateTrueColor (375, 75);
$bgc = ImageColorAllocate ($im, 255, 255, 255);
$farbe_text = ImageColorAllocate ($im, 0, 0, 132);
$farbe_online = ImageColorAllocate ($im, 255, 0, 0);
$tc = ImageColorAllocate ($im, 3, 5, 17);
ImageFilledRectangle ($im, 0, 0, 375, 75 ,$bgc);
ImageString($im, 3, 105, 7, "Statistics of [your album-name here]", $farbe_text);
ImageString($im, 2, 105, 20, "$total_pics Pictures", $tc);
ImageString($im, 2, 105, 30, "$total_albums Albums", $tc);
ImageString($im, 2, 105, 40, "$total_comments Comments", $tc);
ImageString($im, 2, 105, 50, "viewed $total_views times", $tc);
imagecolortransparent($im, $bgc);
$background = $im ;
$insert = imagecreatefromjpeg($random_picture);
imagecolortransparent($insert, imagecolorexact($insert,255,0,255));
$insert_x = imagesx($insert);
$insert_y = imagesy($insert);
imagecopymerge($background,$insert,0,0,0,0,$insert_x,$insert_y,100);
header("Content-Type: image/png");
imagepng($background,"",100);
ImageDestroy ($im);
save the file.
Now you can add the statistic-image with
[img]http://yourdomain/your-path-to-coppermine/signature_cpg.php[/img]
or with the HTML equivalents.
You're done!
-
Looks cool. Is there a way to change the font?
-
Font is the second parameter to the ImageString function. You can use 1 to 5 to select from the built-in fonts.
-
THX for your answer, Nibbler!
I'm interested in what your statistics-image looks like - would be nice, if every user who is unsing this hack could post his image!
-
wish i could show it to you, but unfortunately there's a problem:
http://fotografie.meewezen.nl:8080/coppermine/signature_cgp.php
running W2k3, apache. there also seems to be a problem with this line:
$return_value.= "".$url_of_cpg_dir.$cpg_album_path.$row['filepath'].rawurlencode($cpg_thumb_pfx.$row['filename']);
which i could not find in the downloaded ssi.php :( (other version?)
i deleted the 8 lines following a line that was similar.
please help, b/c i would love to use this hack.
-
I'm sorry - you're right!
Instead, look for
$return_value.= "<img src=\"".$url_of_cpg_dir.$cpg_album_path.$row['filepath'].$cpg_thumb_pfx.$row['filename']."\" border=\"0\" alt=\"\" title=\"";
and replace with:
$return_value.= "".$url_of_cpg_dir.$cpg_album_path.$row['filepath'].rawurlencode($cpg_thumb_pfx.$row['filename']);
and delete the following 8 lines - this lines are:
if ($row['title']!="") {$return_value.= $row['title']."
";}
if ($row['caption']!="") {$return_value.= $row['caption']."
";}
if ($row['keywords']!="") {$return_value.= $cpg_lang_keywords . ": " . $row['keywords']."
";}
if ($row['hits']!="") {$return_value.= $row['hits']." ".$cpg_lang_views."
";}
if($cpg_random=="1") {$return_value.= $cpg_lang_random;}
$return_value.= "\" align=\"left\" class=\"padright\">";
if ($cpg_include_link==1){$return_value.="</a>";}
$return_value.=$td_end."\n";
I have corrected the line in my post above - thanks thoth!
-
thanks Bruz this is great!!
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Ffotos.meewezen.nl%2Fsignature_cpg.php&hash=63e6ebfc554c8ae1f3c1404734b2f72ace5502b9)
-
I've done some researches on it, but without succsess..
I'd like to have the background of the image transparent, but the commands seems not to work correctly with 'ImageCreateTrueColor'
Anybody able to fix this?
-
Now you can add the statistic-image with http://yourdomain/your-path-to-coppermine/signature_cpg.php
or with the HTML equivalents.
What is the equivalent HTML code? I have tried different versions without any result. Please help - I would like to implement this genious mod on our site 8)
Thanks,
Christian
-
Test :)
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.sortons.net%2Fphotos%2Fsignature_cpg.php&hash=427c5b535b6d24869e9e7060ba1a833f6e6933b2)
Ok ... don't work for me : what a pity :)
-
I did find a solution:
<img src="http://www.site.url/path/file.php">
Thanks again, Christian
-
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fskylinedesigns.net%2Ffoto%2Ffoto-gallery%2Fsignature_cgp.php&hash=644acf5d744e8e1211fd72aa4f8ac788b2f799ae)
uhh.. I kinda got it to work.. what am I doing wrong?
-
hard to say without a link and your actual code... :(
GauGau
-
Could you post the full source, with modifications done in the ssi file? It would be helpful for everyone, instead of having to modify ssi.php ourselves.
Thanks, Frank
-
Could you post the full source, with modifications done in the ssi file? It would be helpful for everyone, instead of having to modify ssi.php ourselves.
Thanks, Frank
Sure, but you have to do some modifications - or it will show the stats of my gallery ;)
So, change the lines after
/////////////////// edit the following lines //////////////////////////////
to match your settings!
@ php-coders: I think it is possible to delete some stuff out of the orginal ssi.php - this would make the file smaller.
You will need to put this code in a new file called 'signatur.php' (or something else) and put it in your coppermine-root-dir.
<?php
// ------------------------------------------------------------------------- //
// include script for CPG (c) 2003 GauGau (mail@gaugau.de) V1.4 //
// http://gaugau.de/ changed by Bruz //
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery v1.1 //
// ------------------------------------------------------------------------- //
// Copyright (C) 2002,2003 Grégory DEMAR <gdemar@wanadoo.fr> //
// http://www.chezgreg.net/coppermine/ //
// ------------------------------------------------------------------------- //
// Based on PHPhotoalbum by Henning Stųverud <henning@stoverud.com> //
// http://www.stoverud.com/PHPhotoalbum/ //
// ------------------------------------------------------------------------- //
// 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. //
// ------------------------------------------------------------------------- //
/////////////////// edit the following lines //////////////////////////////
$url_of_cpg_dir='http://www.yourpath'; // full path to your coppermine gallery (with trailing slash)
$absolute_path_to_coppermine='/yourpath/'; // absolute path on your server to coppermine gallery (with trailing slash)
// to find more about absolute paths, check http://www.php.net/manual/en/function.phpinfo.php and look for 'DOCUMENT_ROOT' in your phpinfo.php
$cpg_decimal_point=","; //what character is used to separate decimals in your country, e.g. in Germany ",", in GB "."
$cpg_thousands_separator="."; //what character is used to separate thousands in your country, e.g. in Germany ".", in GB & US ",", in France " "
$cpg_lang_pics = "Bilder"; //translate this
$cpg_lang_views = "mal angesehen"; //translate this
$cpg_lang_random = "Zufallsbild"; //translate this
$cpg_lang_keywords = "Keywords"; //translate this
/////// don't edit below this line unless you know what your're doing /////////
include_once( $absolute_path_to_coppermine.'/include/config.inc.php');
// definition taken from init.inc.php
$CONFIG['TABLE_PICTURES'] = $CONFIG['TABLE_PREFIX']."pictures";
$CONFIG['TABLE_ALBUMS'] = $CONFIG['TABLE_PREFIX']."albums";
$CONFIG['TABLE_COMMENTS'] = $CONFIG['TABLE_PREFIX']."comments";
$CONFIG['TABLE_CATEGORIES'] = $CONFIG['TABLE_PREFIX']."categories";
$CONFIG['TABLE_CONFIG'] = $CONFIG['TABLE_PREFIX']."config";
$CONFIG['TABLE_USERGROUPS'] = $CONFIG['TABLE_PREFIX']."usergroups";
$CONFIG['TABLE_VOTES'] = $CONFIG['TABLE_PREFIX']."votes";
$CONFIG['TABLE_USERS'] = $CONFIG['TABLE_PREFIX']."users";
// Connect to database
db_connect() || die("<b>Coppermine critical error</b>:<br />Unable to connect to database !<br /><br />MySQL said: <b>".mysql_error()."</b>");
// get config data
$result = mysql_query("SELECT * from {$CONFIG['TABLE_CONFIG']} WHERE name='fullpath'");
$row = mysql_fetch_row($result);
$cpg_album_path=$row[1];
$result = mysql_query("SELECT * from {$CONFIG['TABLE_CONFIG']} WHERE name='thumb_pfx'");
$row = mysql_fetch_row($result);
$cpg_thumb_pfx=$row['1'];
$result = mysql_query("SELECT * from {$CONFIG['TABLE_CONFIG']} WHERE name='thumbcols'");
$row = mysql_fetch_row($result);
$cpg_thumbcols=$row['1'];
if ($function == 'cpg_thumb' || $function == 'recentTopics' || $function == 'whosOnline' || $function == 'welcome' || $function == 'menubar' || $function == 'logout' || $function == 'login' || $function == 'topBoards' || $function == 'topTopicsViews' || $function == 'topTopicsReplies' || $function == 'latestMember' || $function == 'boardStats')
{
$function(); // Execute Function
exit;
}
function cpg_thumb()
{
GLOBAL $CONFIG,$url_of_cpg_dir,$cpg_album_path,$cpg_thumb_pfx,$cpg_thumbcols,$cpg_lang_random,$cpg_lang_views,$cpg_lang_keywords;
$numargs = func_num_args();
$arg_list = func_get_args();
if ($numargs > 0) {$cpg_include_link=$arg_list[0];}
if ($numargs > 1) {$cpg_link_singlepic=$arg_list[1];}
if ($numargs > 2) {$cpg_how_many=$arg_list[2];}
if ($numargs > 3) {$cgp_limit_album=$arg_list[3];}
if ($numargs > 4) {$cpg_random=$arg_list[4];}
if ($numargs > 5) {$cpg_link_target=$arg_list[5];}
if ($cpg_link_target==""){$cpg_link_target="_top";}
//get pic info
$query = "SELECT * from {$CONFIG['TABLE_PICTURES']} WHERE approved='YES' ";
if($cgp_limit_album!=""){$query.="AND aid='".$cgp_limit_album."'";}
$query.=" AND user2!='1' ORDER BY ";
if($cpg_random=="1"){$query.="RAND()";}else{$query.="ctime";}
$query.=" DESC LIMIT 0,".$cpg_how_many;
$result = mysql_query($query);
if ($cpg_how_many!=1)
{
$return_value="<table align=\"center\" cellspacing=\"0\" cellpadding=\"10\" align=\"center\" class=\"maintable\" border=\"0\">";
$td_start="<td valign=\"middle\" class=\"thumbnails\" align=\"center\">\n";
$td_end="</td>";
$cpg_table_end="</table>";
$tr_start="<tr>\n";
$tr_end="</tr>\n";
}
else
{
$return_value="";
$td_start="";
$td_end="";
$cpg_table_end="";
$tr_start="";
$tr_end="";
}
$counter=0;
if ($cpg_thumbcols > $cpg_how_many) {$cpg_thumbcols=$cpg_how_many;}
while ($row = mysql_fetch_array($result)) {
//------
if ($counter==0){$return_value.=$tr_start;}
$return_value.=$td_start;
if ($cpg_include_link==1)
{
$return_value.= "<a href=\"";
if ($cpg_link_singlepic==1)
{
if ($cpg_link_target=="popup")
{
$return_value.="javascript:;\" onClick=\"MM_openBrWindow('".$url_of_cpg_dir."displayimage.php?pid=".$row['pid']."&fullsize=1','".uniqid(rand())."','toolbar=yes,status=yes,resizable=yes,width=".($row['pwidth']+16).",height=".($row['pheight']+16)."')\"";
}
else
{
$return_value.=$url_of_cpg_dir."displayimage.php?&pos=-".$row['pid'];
}
}
else
{
$return_value.=$url_of_cpg_dir."thumbnails.php?album=".$row['aid'];
}
$return_value.="\" ";
if($cpg_link_target=="popup"){$return_value.="";}else{$return_value.="target=\"".$cpg_link_target."\"";}
$return_value.=">";
}
$return_value.= "".$url_of_cpg_dir.$cpg_album_path.$row[rawurlencode('filepath')].rawurlencode($cpg_thumb_pfx.$row['filename']);
//if ($row['title']!="") {$return_value.= $row['title']." ";}
//if ($row['caption']!="") {$return_value.= $row['caption']." ";}
//if ($row['keywords']!="") {$return_value.= $cpg_lang_keywords . ": " . $row['keywords']." ";}
//if ($row['hits']!="") {$return_value.= $row['hits']." ".$cpg_lang_views." ";}
//if($cpg_random=="1") {$return_value.= $cpg_lang_random;}
//$return_value.= "\" align=\"left\" class=\"padright\">";
//if ($cpg_include_link==1){$return_value.="</a>";}
//$return_value.=$td_end."\n";
$counter++;
if ($counter==$cpg_thumbcols){$counter=0;$return_value.=$tr_end;}
}
$return_value.=$cpg_table_end;
return $return_value;
}
function cpg_single()
{
$numargs = func_num_args();
$arg_list = func_get_args();
if ($numargs > 0){return cpg_thumb(1,1,1,"",0,$arg_list[0]);}
else{return cpg_thumb(1,1,1,"",0);}
}
function cpg_total_pics($cgp_limit_album)
{
GLOBAL $CONFIG,$cpg_decimal_point,$cpg_thousands_separator;
$query = "SELECT COUNT(*) from {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES'";
if($cgp_limit_album!=""){$query.=" AND aid='".$cgp_limit_album."'";}
$result = mysql_query($query);
$nbEnr = mysql_fetch_array($result);
$pic_count = $nbEnr[0];
mysql_free_result($result);
return number_format($pic_count,0,$cpg_decimal_point,$cpg_thousands_separator);
}
function cpg_total_views($cgp_limit_album)
{
GLOBAL $CONFIG,$cpg_decimal_point,$cpg_thousands_separator;
$query = "SELECT sum(hits) FROM {$CONFIG['TABLE_PICTURES']} WHERE 1";
if($cgp_limit_album!=""){$query.=" AND aid='".$cgp_limit_album."'";}
$result = mysql_query($query);
$nbEnr = mysql_fetch_array($result);
$view_count = $nbEnr[0];
mysql_free_result($result);
return number_format($view_count,0,$cpg_decimal_point,$cpg_thousands_separator);
}
function cpg_hit_ratio($cgp_limit_album)
{
GLOBAL $CONFIG;
//get stats
$result=mysql_query("SELECT sum(hits) FROM {$CONFIG['TABLE_PICTURES']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$hit_count = (int)$nbEnr[0];
$result=mysql_query("SELECT count(*) FROM {$CONFIG['TABLE_PICTURES']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$picture_count = $nbEnr[0];
$cpg_ratio_string=str_replace(".", ",",(floor(((str_replace(".", "", cpg_total_views($cgp_limit_album))/str_replace(".", "", cpg_total_pics($cgp_limit_album)))*10)/($hit_count/$picture_count)))/10);
//$cpg_ratio_string=cpg_total_views($cgp_limit_album).'|'.cpg_total_pics($cgp_limit_album).'|'.$hit_count.'|'.$picture_count;
return $cpg_ratio_string;
}
function cpg_stat_string($cgp_limit_album)
{
GLOBAL $url_of_cpg_dir,$cpg_lang_pics,$cpg_lang_views;
$cpg_stat_string='[<a href="'.$url_of_cpg_dir.'thumbnails.php?album='.$cgp_limit_album.'"><b>';
$cpg_stat_string.=cpg_total_pics($cgp_limit_album);
$cpg_stat_string.='</b> ' . $cpg_lang_pics . '</a>, <a href="'.$url_of_cpg_dir.'thumbnails.php?album=topn&cat=-'.$cgp_limit_album.'"><b>';
$cpg_stat_string.=cpg_total_views($cgp_limit_album);
$cpg_stat_string.='</b> ' . $cpg_lang_views . '</a>';
$cpg_stat_string.=', <span class="tool" title="SF=Spanner-Faktor: Wie oft sind die Bilder dieses Albums durchschnittlich angeklickt worden, im Vergleich zur gesamten Galerie?">SF: '.cpg_hit_ratio($cgp_limit_album).'</span>';
$cpg_stat_string.=']';
return $cpg_stat_string;
}
function cpg_total_albums()
{
GLOBAL $CONFIG,$cpg_decimal_point,$cpg_thousands_separator;
$query = "SELECT count(*) FROM {$CONFIG['TABLE_ALBUMS']} WHERE 1";
$result = mysql_query($query);
$nbEnr = mysql_fetch_array($result);
$album_count = $nbEnr[0];
mysql_free_result($result);
return number_format($album_count,0,$cpg_decimal_point,$cpg_thousands_separator);
}
function cpg_total_comments()
{
GLOBAL $CONFIG,$cpg_decimal_point,$cpg_thousands_separator;
$query = "SELECT count(*) FROM {$CONFIG['TABLE_COMMENTS']} WHERE 1";
$result = mysql_query($query);
$nbEnr = mysql_fetch_array($result);
$comments_count = $nbEnr[0];
mysql_free_result($result);
return number_format($comments_count,0,$cpg_decimal_point,$cpg_thousands_separator);
}
function cpg_total_cats()
{
GLOBAL $CONFIG,$cpg_decimal_point,$cpg_thousands_separator;
$query = "SELECT count(*) FROM {$CONFIG['TABLE_CATEGORIES']} WHERE 1";
$result = mysql_query($query);
$nbEnr = mysql_fetch_array($result);
$cats_count = $nbEnr[0];
mysql_free_result($result);
return number_format($cats_count,0,$cpg_decimal_point,$cpg_thousands_separator);
}
function cpg_random()
{
return cpg_thumb(1,1,1,"",1);
}
function random_picture()
{
return cpg_thumb(0,0,1,"",1);
}
function cpg_search($cpg_size,$cpg_question,$cpg_submit_text)
{
GLOBAL $url_of_cpg_dir;
$cpg_search_string = "<form method=\"get\" action=\"" . $url_of_cpg_dir . "thumbnails.php\" name=\"search_cpg\">
<input type=\"hidden\" name=\"album\" value=\"search\" />
<input type=\"hidden\" name=\"type\" value=\"full\" />
<input type=\"input\" name=\"search\" maxlength=\"255\" size=\"" . $cpg_size . "\" value=\"" . $cpg_question . "\" class=\"textfield\" onfocus=\"this.value=''\" />";
if ($cpg_submit_text!="" and $cpg_submit_text!="0")
{
$cpg_search_string.= " <input type=\"submit\" value=\"" . $cpg_submit_text . "\" class=\"submit\" />";
}
$cpg_search_string.= "</form>";
return $cpg_search_string;
}
function cpg_stats()
{
GLOBAL $CONFIG;
$result=mysql_query("SELECT count(*) FROM {$CONFIG['TABLE_ALBUMS']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$album_count = $nbEnr[0];
mysql_free_result($result);
$result=mysql_query("SELECT count(*) FROM {$CONFIG['TABLE_PICTURES']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$picture_count = $nbEnr[0];
mysql_free_result($result);
$result=mysql_query("SELECT count(*) FROM {$CONFIG['TABLE_COMMENTS']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$comment_count = $nbEnr[0];
mysql_free_result($result);
$result=mysql_query("SELECT count(*) FROM {$CONFIG['TABLE_CATEGORIES']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$cat_count = $nbEnr[0] - $HIDE_USER_CAT;
mysql_free_result($result);
$result=mysql_query("SELECT sum(hits) FROM {$CONFIG['TABLE_PICTURES']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$hit_count = (int)$nbEnr[0];
mysql_free_result($result);
print $picture_count.", ".$album_count.", ".$cat_count.", ".$comment_count.", ".$hit_count;
}
//function taken from functions.inc.php
function db_connect()
{
global $CONFIG;
$result = @mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);
if (!$result)
return false;
if (!mysql_select_db($CONFIG['dbname']))
return false;
return $result;
}
$total_pics = cpg_total_pics("");
$total_albums = cpg_total_albums();
$total_comments = cpg_total_comments();
$total_views = cpg_total_views("");
$random_picture = random_picture();
$im = ImageCreateTrueColor (250, 75); // Bild $im mit den Abmessungen 250x75 erzeugen
$bgc = ImageColorAllocate ($im, 255, 255, 255); // $bgc (Hintergrund) auf "weiß" setzten
$farbe_text = ImageColorAllocate ($im, 0, 0, 132); // Textfarbe
$farbe_online = ImageColorAllocate ($im, 255, 0, 0); // Textfarbe
$tc = ImageColorAllocate ($im, 3, 5, 17); // Textfarbe
ImageFilledRectangle ($im, 0, 0, 250, 75 ,$bgc); // Bild $im mit der Hintergrundfarbe füllen
ImageString($im, 3, 105, 7, "Daniel's Fotos", $farbe_text); // Ausgabe von Text im Bild $im
ImageString($im, 2, 105, 20, "$total_pics Pictures", $tc); // Ausgabe von Text im Bild $im
ImageString($im, 2, 105, 30, "$total_albums Albums", $tc); // Ausgabe von Text im Bild $im
ImageString($im, 2, 105, 40, "$total_comments Comments", $tc); // Ausgabe von Text im Bild $im
ImageString($im, 2, 105, 50, "viewed $total_views times", $tc); // Ausgabe von Text im Bild $im
imagecolortransparent($im, $bgc); // Die Farbe $bgc wird für das Bild $im als transparent gesetzt
$background = $im ; // Das Bild $im wird als $background definiert
$insert = imagecreatefromjpeg($random_picture); // Die Variable $random_picture, die eine URL enthält, wird als $insert definiert
$insert_x = imagesx($insert);
$insert_y = imagesy($insert);
imagecopymerge($background,$insert,0,0,0,0,$insert_x,$insert_y,100); // Die Bilder werden zusammengesetzt
imagecolortransparent($insert, $bgc); // Die Farbe $bgc wird für das gesamte Bild als transparent gesetzt
header("Content-Type: image/png");
imagepng($background,"",100);
ImageDestroy ($im);
?>
Bruz
-
Used exact same code you did, but random thumb never comes up with it, although all the stats are correct. Dont know how to fix this.
(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fwww.skylinedesigns.net%2Ffoto%2Ffoto-gallery%2Fsignat.php&hash=dde982adb14e73b4f43536d30099f481afb4250a)
I thought it might be an .htaccess file issue, but it won't work even when viewing it locally, or if i remove the files.
-
Maybe you are using a glib or php version, that doesn't support imagecopymerge...
-
Great tool! used it on my front-page on www.luchtzak.be !
I hope it doesn't slow down loading too much...
greetings,
Bart
-
am I right that this one requires GD 2.0 (which I do not have :cry: ) ???
Is there any chance in getting it done with GD 1.6.2?
-
How can I change the type of letters into e.g. Verdana ? And what's the code for colour #336699 ? And how can I make the numbers in bold ?
greetings,
Bart
-
you can't have every font, unless the server is yours to install fonts on. Usually, if you're webhosted, you'll have to go with the fonts that are pre-installed on the server.
GauGau
-
if your host has GlyphGate you pretty much got any font at your disposal.
www.glyphgate.com
Maybe ask them or whatever
-
And what's the code for colour #336699 ?
The RGB code is 51, 102, 153.
The cmyk code is 86, 60, 18, 2.
-
I try and edit the code to have the text underneath the pic but it doesnt work.
Anyone have done it?
-
To have the Text underneath the image you will have
a) to make the background image ($im) bigger (higher to have space under the random-pic)
b) to change the coordinates of the textlines
-
Okie now i'm stuck with the "coordinate of the textline". Which line is this exactly?
$im = ImageCreateTrueColor (245, 177);
$bgc = ImageColorAllocate ($im, 255, 255, 255);
$farbe_text = ImageColorAllocate ($im, 0, 0, 132);
$farbe_online = ImageColorAllocate ($im, 255, 0, 0);
$tc = ImageColorAllocate ($im, 1, 5, 17);
ImageFilledRectangle ($im, 0, 0, 245, 177,$bgc);
ImageString($im, 3, 135, 10, "Member Gallery", $farbe_text);
ImageString($im, 2, 135, 20, "$total_pics Pictures", $tc);
ImageString($im, 2, 135, 30, "$total_albums Albums", $tc);
ImageString($im, 2, 135, 40, "$total_comments Comments", $tc);
ImageString($im, 2, 135, 50, "viewed $total_views times", $tc);
-
Okie now i'm stuck with the "coordinate of the textline". Which line is this exactly?
Ok, lets take
ImageString($im, 3, 135, 10, "Member Gallery", $farbe_text);
as example.
The first number, the "3" ist the text-style.
The second number, the "135" is the hspace from the left image-border. (Here: the text starts 135 pixles to the right from the left border)
The third number, the "10" is the vspace from the upper image-border. (Here: the text starts 10 pixels under the upper border)
What you'll need to do is to change the coordinates like this:
your random image will be 100 pixels high. So your first textline should start at 10,110 (just try it!) The next should be at 10,120 and so on!
(10,110 means: ImageString($im, 3, 10, 110, "Member Gallery", $farbe_text);
Bruz
-
Okie that worked.
Also how do i make the thumbnail of the image wider?
-
I think you are talking about the random-image, do you?
Because we are taking a coppermine-generated thumbnail with the with of 100 pixels it would look not very good if this image would be stretched to lets say 200 pixels.
Or did I get you wrong?
-
Yes you're right, i just double check the config in coppermine and it's optimised at 120. So i cant really make it any bigger without putting it out of focus. :'( :'(.
Because i wish to have the image larger, i just notice the slide-show photos are abit larger than the random images (as seen when you click on the thumbnail), so now how could i incorporate the slide show photos instead of the thumbnail photos for the statistics random image?
-
Well, you could take the mid-size image - but: how big will your signature be? 400 to 300 Pixels?
Maybe you can post a link, so I can make my a picture of what you are doing?
-
Okie refer to this. (http://www.preludeaustralia.com/forums/index.php?)
Atm, the width of the random inage (in that box) is 120 pixs, the portal box itself has width 189 pixs. What i want to do is incorporate slideshow pics (http://www.gallery04.preludeaustralia.com/displayimage.php?album=lastup&cat=0&pos=2) which has width 169 pixs instead of the random pics. My aim is the take up as much space of the portal box as possible.
-
Ok, I see.
I will change the code for you - but I'm very busy at the moment (school) and so I don't know when I'll be able to do this. (But I think, I'll have time tomorrow)
-
Forever grateful ;)
-
I have been looking for almost a week for a MOD to intergade my coppermine,album/pic into my portal page. Can someone please tell me this is the right place. Ome I would like to have exactly what you have on your portal. "your pic in a block" is it at all possible if you could send me the code. I would be forever greatful.
*On my knee's begging*
-
It's just a table frame
<tr><td>
<table border="8" cellpadding="2" cellspacing="5" align="center">
<td>
<div align="center">[img]http://www.*.com/signature_cgp.php[/img}
</table></td></tr>
} should be ]
-
Oh no I'm sorry I should have explained myself better. I need the code to add block and pic onto my ezportal
-
Are you talking to me or someone else? :)
-
Yes you
-
Still not 100% sure what you mean but here is the changes i've made. Compare it to the original script.
$im = ImageCreateTrueColor (120, 150);
$bgc = ImageColorAllocate ($im, 223, 230, 239);
$farbe_text = ImageColorAllocate ($im, 0, 0, 132);
$farbe_online = ImageColorAllocate ($im, 255, 0, 0);
$tc = ImageColorAllocate ($im, 1, 5, 17);
ImageFilledRectangle ($im, 0, 0, 120, 150,$bgc);
ImageString($im, 3, 10, 90, "Member Gallery", $farbe_text);
ImageString($im, 2, 10, 100, "$total_pics Pictures", $tc);
ImageString($im, 2, 10, 110, "$total_albums Albums", $tc);
ImageString($im, 2, 10, 120, "$total_comments Comments", $tc);
ImageString($im, 2, 10, 130, "viewed $total_views times", $tc);
-
You see how you have a pic on your website, you are using a portal right? Smartor ezPortal I would also like to have the block with a pic coming from my coppermine album as well. I was hoping you could share the code with me, how you did it. I would like to have 2 pic's horisontal on my Portal. Help if you can please.
Thank you
-
You see how you have a pic on your website, you are using a portal right? Smartor ezPortal I would also like to have the block with a pic coming from my coppermine album as well. I was hoping you could share the code with me, how you did it. I would like to have 2 pic's horisontal on my Portal. Help if you can please.
Thank you
No sorry not across going down the right side of my portal
-
The code/script is made by Bruz. It's on the first page of this thread. Details are all there (4th post down).
The code is for one pic...
Bruz, have you got that amendment for me man? ;)
-
And how do I place it in a "block" in my portal page? I know how to do a "block" but how I connect signature.php to my portal with block. hope you understand me. please forgive me, i'm new to this. :(
-
I was right about not 100% sure about what you're trying to say. ;D
Do u know how to make new portal boxes with your potal? if so just put the table code i gave earlier in the text area of the new box (assumming your portal box allows for htmls) along with your working script.
If you read this thread from the begining you would know that the code/script was made to work with image tags.
If you still have probs, PMe me your portal admin logon (ie IDs and password) and hopefully i can do it for you.
-
AEM..........please help! I have tried installing this album on my portal page. running ezportal "smartor" I have failed miserably over and over. I have a block with lastest upload, but I did it manually.
Lots of work chaging pic every time my user uploads one.
MY question is AEM......can I give you my info and you config this for me please. I would like to have a block on my portal.php page with recent pic uploaded.
If you could help it be awsome.
-
I can try. At the moment i'm still not sure what you are trying to achieve.
PM me the details (access details) and i see what i can do.
-
I have a question, one of my members asked me this: http://www.luchtzak.be/modules.php?name=Forums&file=viewtopic&p=41306#41306
is this possible to program something in the signature.php ?
-
luchtzak: I got a question, how to add more information on the image? The total user, Last pic, ...?
thanks
-
The post that included "all of the code edited" had html where some important characters went. here is the correct code:
<?
// ------------------------------------------------------------------------- //
// include script for CPG (c) 2003 GauGau (mail@gaugau.de) V1.4 //
// http://gaugau.de/ //
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery v1.1 //
// ------------------------------------------------------------------------- //
// Copyright (C) 2002,2003 Grégory DEMAR <gdemar@wanadoo.fr> //
// http://www.chezgreg.net/coppermine/ //
// ------------------------------------------------------------------------- //
// Based on PHPhotoalbum by Henning Stųverud <henning@stoverud.com> //
// http://www.stoverud.com/PHPhotoalbum/ //
// ------------------------------------------------------------------------- //
// 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. //
// ------------------------------------------------------------------------- //
/////////////////// edit the following lines //////////////////////////////
$url_of_cpg_dir='http://url of your coppermine/'; // full path to your coppermine gallery (with trailing slash)
$absolute_path_to_coppermine='/path to your coppermine/'; // absolute path on your server to coppermine gallery (with trailing
slash)
// to find more about absolute paths, check http://www.php.net/manual/en/function.phpinfo.php and look for 'DOCUMENT_ROOT' in your
phpinfo.php
$cpg_decimal_point="."; //what character is used to separate decimals in your country, e.g. in Germany ",", in GB "."
$cpg_thousands_separator=","; //what character is used to separate thousands in your country, e.g. in Germany ".", in GB & US ",", in France
" "
$cpg_lang_pics = "Pictures"; //translate this
$cpg_lang_views = "view"; //translate this
$cpg_lang_random = "Random pic of this album"; //translate this
$cpg_lang_keywords = "Keywords"; //translate this
/////// don't edit below this line unless you know what your're doing /////////
include_once( $absolute_path_to_coppermine.'/include/config.inc.php');
// definition taken from init.inc.php
$CONFIG['TABLE_PICTURES'] = $CONFIG['TABLE_PREFIX']."pictures";
$CONFIG['TABLE_ALBUMS'] = $CONFIG['TABLE_PREFIX']."albums";
$CONFIG['TABLE_COMMENTS'] = $CONFIG['TABLE_PREFIX']."comments";
$CONFIG['TABLE_CATEGORIES'] = $CONFIG['TABLE_PREFIX']."categories";
$CONFIG['TABLE_CONFIG'] = $CONFIG['TABLE_PREFIX']."config";
$CONFIG['TABLE_USERGROUPS'] = $CONFIG['TABLE_PREFIX']."usergroups";
$CONFIG['TABLE_VOTES'] = $CONFIG['TABLE_PREFIX']."votes";
$CONFIG['TABLE_USERS'] = $CONFIG['TABLE_PREFIX']."users";
// Connect to database
db_connect() || die("<b>Coppermine critical error</b>:<br />Unable to connect to database !<br /><br />MySQL said:
<b>".mysql_error()."</b>");
// get config data
$result = mysql_query("SELECT * from {$CONFIG['TABLE_CONFIG']} WHERE name='fullpath'");
$row = mysql_fetch_row($result);
$cpg_album_path=$row[1];
$result = mysql_query("SELECT * from {$CONFIG['TABLE_CONFIG']} WHERE name='thumb_pfx'");
$row = mysql_fetch_row($result);
$cpg_thumb_pfx=$row['1'];
$result = mysql_query("SELECT * from {$CONFIG['TABLE_CONFIG']} WHERE name='thumbcols'");
$row = mysql_fetch_row($result);
$cpg_thumbcols=$row['1'];
if ($function == 'cpg_thumb' || $function == 'recentTopics' || $function == 'whosOnline' || $function == 'welcome' || $function == 'menubar'
|| $function == 'logout' || $function == 'login' || $function == 'topBoards' || $function == 'topTopicsViews' || $function ==
'topTopicsReplies' || $function == 'latestMember' || $function == 'boardStats')
{
$function(); // Execute Function
exit;
}
function cpg_thumb()
{
GLOBAL $CONFIG,$url_of_cpg_dir,$cpg_album_path,$cpg_thumb_pfx,$cpg_thumbcols,$cpg_lang_random,$cpg_lang_views,$cpg_lang_keywords;
$numargs = func_num_args();
$arg_list = func_get_args();
if ($numargs > 0) {$cpg_include_link=$arg_list[0];}
if ($numargs > 1) {$cpg_link_singlepic=$arg_list[1];}
if ($numargs > 2) {$cpg_how_many=$arg_list[2];}
if ($numargs > 3) {$cgp_limit_album=$arg_list[3];}
if ($numargs > 4) {$cpg_random=$arg_list[4];}
if ($numargs > 5) {$cpg_link_target=$arg_list[5];}
if ($cpg_link_target==""){$cpg_link_target="_top";}
//get pic info
$query = "SELECT * from {$CONFIG['TABLE_PICTURES']} WHERE approved='YES' ";
if($cgp_limit_album!=""){$query.="AND aid='".$cgp_limit_album."'";}
$query.=" AND user2!='1' ORDER BY ";
if($cpg_random=="1"){$query.="RAND()";}else{$query.="ctime";}
$query.=" DESC LIMIT 0,".$cpg_how_many;
$result = mysql_query($query);
if ($cpg_how_many!=1)
{
$return_value="<table align=\"center\" cellspacing=\"0\" cellpadding=\"10\" align=\"center\" class=\"maintable\" border=\"0\">";
$td_start="<td valign=\"middle\" class=\"thumbnails\" align=\"center\">\n";
$td_end="</td>";
$cpg_table_end="</table>";
$tr_start="<tr>\n";
$tr_end="</tr>\n";
}
else
{
$return_value="";
$td_start="";
$td_end="";
$cpg_table_end="";
$tr_start="";
$tr_end="";
}
$counter=0;
if ($cpg_thumbcols > $cpg_how_many) {$cpg_thumbcols=$cpg_how_many;}
while ($row = mysql_fetch_array($result)) {
//------
if ($counter==0){$return_value.=$tr_start;}
$return_value.=$td_start;
if ($cpg_include_link==1)
{
$return_value.= "<a href=\"";
if ($cpg_link_singlepic==1)
{
if ($cpg_link_target=="popup")
{
$return_value.="javascript:;\"
onClick=\"MM_openBrWindow('".$url_of_cpg_dir."displayimage.php?pid=".$row['pid']."&fullsize=1','".uniqid(rand())."','toolbar=yes,status=yes,r
esizable=yes,width=".($row['pwidth']+16).",height=".($row['pheight']+16)."')\"";
}
else
{
$return_value.=$url_of_cpg_dir."displayimage.php?&pos=-".$row['pid'];
}
}
else
{
$return_value.=$url_of_cpg_dir."thumbnails.php?album=".$row['aid'];
}
$return_value.="\" ";
if($cpg_link_target=="popup"){$return_value.="";}else{$return_value.="target=\"".$cpg_link_target."\"";}
$return_value.=">";
}
$return_value.= "".$url_of_cpg_dir.$cpg_album_path.$row[rawurlencode('filepath')].rawurlencode($cpg_thumb_pfx.$row['filename']);
//if ($row['title']!="") {$return_value.= $row['title']." ";}
//if ($row['caption']!="") {$return_value.= $row['caption']." ";}
//if ($row['keywords']!="") {$return_value.= $cpg_lang_keywords . ": " . $row['keywords']." ";}
//if ($row['hits']!="") {$return_value.= $row['hits']." ".$cpg_lang_views." ";}
//if($cpg_random=="1") {$return_value.= $cpg_lang_random;}
//$return_value.= "\" align=\"left\" class=\"padright\">";
//if ($cpg_include_link==1){$return_value.="</a>";}
//$return_value.=$td_end."\n";
$counter++;
if ($counter==$cpg_thumbcols){$counter=0;$return_value.=$tr_end;}
}
$return_value.=$cpg_table_end;
return $return_value;
}
function cpg_single()
{
$numargs = func_num_args();
$arg_list = func_get_args();
if ($numargs > 0){return cpg_thumb(1,1,1,"",0,$arg_list[0]);}
else{return cpg_thumb(1,1,1,"",0);}
}
function cpg_total_pics($cgp_limit_album)
{
GLOBAL $CONFIG,$cpg_decimal_point,$cpg_thousands_separator;
$query = "SELECT COUNT(*) from {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES'";
if($cgp_limit_album!=""){$query.=" AND aid='".$cgp_limit_album."'";}
$result = mysql_query($query);
$nbEnr = mysql_fetch_array($result);
$pic_count = $nbEnr[0];
mysql_free_result($result);
return number_format($pic_count,0,$cpg_decimal_point,$cpg_thousands_separator);
}
function cpg_total_views($cgp_limit_album)
{
GLOBAL $CONFIG,$cpg_decimal_point,$cpg_thousands_separator;
$query = "SELECT sum(hits) FROM {$CONFIG['TABLE_PICTURES']} WHERE 1";
if($cgp_limit_album!=""){$query.=" AND aid='".$cgp_limit_album."'";}
$result = mysql_query($query);
$nbEnr = mysql_fetch_array($result);
$view_count = $nbEnr[0];
mysql_free_result($result);
return number_format($view_count,0,$cpg_decimal_point,$cpg_thousands_separator);
}
function cpg_hit_ratio($cgp_limit_album)
{
GLOBAL $CONFIG;
//get stats
$result=mysql_query("SELECT sum(hits) FROM {$CONFIG['TABLE_PICTURES']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$hit_count = (int)$nbEnr[0];
$result=mysql_query("SELECT count(*) FROM {$CONFIG['TABLE_PICTURES']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$picture_count = $nbEnr[0];
$cpg_ratio_string=str_replace(".", ",",(floor(((str_replace(".", "", cpg_total_views($cgp_limit_album))/str_replace(".", "",
cpg_total_pics($cgp_limit_album)))*10)/($hit_count/$picture_count)))/10);
//$cpg_ratio_string=cpg_total_views($cgp_limit_album).'|'.cpg_total_pics($cgp_limit_album).'|'.$hit_count.'|'.$picture_count;
return $cpg_ratio_string;
}
function cpg_stat_string($cgp_limit_album)
{
GLOBAL $url_of_cpg_dir,$cpg_lang_pics,$cpg_lang_views;
$cpg_stat_string='[<a href="'.$url_of_cpg_dir.'thumbnails.php?album='.$cgp_limit_album.'"><b>';
$cpg_stat_string.=cpg_total_pics($cgp_limit_album);
$cpg_stat_string.='</b> ' . $cpg_lang_pics . '</a>, <a href="'.$url_of_cpg_dir.'thumbnails.php?album=topn&cat=-'.$cgp_limit_album.'"><b>';
$cpg_stat_string.=cpg_total_views($cgp_limit_album);
$cpg_stat_string.='</b> ' . $cpg_lang_views . '</a>';
$cpg_stat_string.=', <span class="tool" title="SF=Spanner-Faktor: Wie oft sind die Bilder dieses Albums durchschnittlich angeklickt
worden, im Vergleich zur gesamten Galerie?">SF: '.cpg_hit_ratio($cgp_limit_album).'</span>';
$cpg_stat_string.=']';
return $cpg_stat_string;
}
function cpg_total_albums()
{
GLOBAL $CONFIG,$cpg_decimal_point,$cpg_thousands_separator;
$query = "SELECT count(*) FROM {$CONFIG['TABLE_ALBUMS']} WHERE 1";
$result = mysql_query($query);
$nbEnr = mysql_fetch_array($result);
$album_count = $nbEnr[0];
mysql_free_result($result);
return number_format($album_count,0,$cpg_decimal_point,$cpg_thousands_separator);
}
function cpg_total_comments()
{
GLOBAL $CONFIG,$cpg_decimal_point,$cpg_thousands_separator;
$query = "SELECT count(*) FROM {$CONFIG['TABLE_COMMENTS']} WHERE 1";
$result = mysql_query($query);
$nbEnr = mysql_fetch_array($result);
$comments_count = $nbEnr[0];
mysql_free_result($result);
return number_format($comments_count,0,$cpg_decimal_point,$cpg_thousands_separator);
}
function cpg_total_cats()
{
GLOBAL $CONFIG,$cpg_decimal_point,$cpg_thousands_separator;
$query = "SELECT count(*) FROM {$CONFIG['TABLE_CATEGORIES']} WHERE 1";
$result = mysql_query($query);
$nbEnr = mysql_fetch_array($result);
$cats_count = $nbEnr[0];
mysql_free_result($result);
return number_format($cats_count,0,$cpg_decimal_point,$cpg_thousands_separator);
}
function cpg_random()
{
return cpg_thumb(1,1,1,"",1);
}
function random_picture()
{
return cpg_thumb(0,0,1,"",1);
}
function cpg_search($cpg_size,$cpg_question,$cpg_submit_text)
{
GLOBAL $url_of_cpg_dir;
$cpg_search_string = "<form method=\"get\" action=\"" . $url_of_cpg_dir . "thumbnails.php\" name=\"search_cpg\">
<input type=\"hidden\" name=\"album\" value=\"search\" />
<input type=\"hidden\" name=\"type\" value=\"full\" />
<input type=\"input\" name=\"search\" maxlength=\"255\" size=\"" . $cpg_size . "\" value=\"" . $cpg_question . "\" class=\"textfield\"
onfocus=\"this.value=''\" />";
if ($cpg_submit_text!="" and $cpg_submit_text!="0")
{
$cpg_search_string.= " <input type=\"submit\" value=\"" . $cpg_submit_text . "\" class=\"submit\" />";
}
$cpg_search_string.= "</form>";
return $cpg_search_string;
}
function cpg_stats()
{
GLOBAL $CONFIG;
$result=mysql_query("SELECT count(*) FROM {$CONFIG['TABLE_ALBUMS']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$album_count = $nbEnr[0];
mysql_free_result($result);
$result=mysql_query("SELECT count(*) FROM {$CONFIG['TABLE_PICTURES']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$picture_count = $nbEnr[0];
mysql_free_result($result);
$result=mysql_query("SELECT count(*) FROM {$CONFIG['TABLE_COMMENTS']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$comment_count = $nbEnr[0];
mysql_free_result($result);
$result=mysql_query("SELECT count(*) FROM {$CONFIG['TABLE_CATEGORIES']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$cat_count = $nbEnr[0] - $HIDE_USER_CAT;
mysql_free_result($result);
$result=mysql_query("SELECT sum(hits) FROM {$CONFIG['TABLE_PICTURES']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$hit_count = (int)$nbEnr[0];
mysql_free_result($result);
print $picture_count.", ".$album_count.", ".$cat_count.", ".$comment_count.", ".$hit_count;
}
//function taken from functions.inc.php
function db_connect()
{
global $CONFIG;
$result = @mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);
if (!$result)
return false;
if (!mysql_select_db($CONFIG['dbname']))
return false;
return $result;
}
$total_pics = cpg_total_pics("");
$total_albums = cpg_total_albums();
$total_comments = cpg_total_comments();
$total_views = cpg_total_views("");
$random_picture = random_picture();
$im = ImageCreateTrueColor (375, 150);
$bgc = ImageColorAllocate ($im, 255, 255, 255);
$farbe_text = ImageColorAllocate ($im, 0, 0, 132);
$farbe_online = ImageColorAllocate ($im, 255, 0, 0);
$tc = ImageColorAllocate ($im, 3, 5, 17);
ImageFilledRectangle ($im, 0, 0, 375, 150 ,$bgc);
ImageString($im, 3, 155, 7, "Your name here Statistics", $farbe_text);
ImageString($im, 2, 155, 20, "$total_pics Pictures", $tc);
ImageString($im, 2, 155, 30, "$total_albums Albums", $tc);
ImageString($im, 2, 155, 40, "$total_comments Comments", $tc);
ImageString($im, 2, 155, 50, "viewed $total_views times", $tc);
imagecolortransparent($im, $bgc);
$background = $im ;
$insert = imagecreatefromjpeg($random_picture);
imagecolortransparent($insert, imagecolorexact($insert,255,0,255));
$insert_x = imagesx($insert);
$insert_y = imagesy($insert);
imagecopymerge($background,$insert,0,0,0,0,$insert_x,$insert_y,100);
header("Content-Type: image/png");
imagepng($background,"",100);
ImageDestroy ($im);
?>
Edit it with your path...
-
nukeworker, well done! :)
I've started to clean the code manually, but later I've noticed that you have already done it ;D
-
nukeworker, well done! :)
I've started to clean the code manually, but later I've noticed that you have already done it ;D
Thanks, I didn't translate some of the remarks... Perhaps someone else can. It might be useful for some people. I had to play with it a while to work corectly with my image dimentions.
-
works great, thanks
:D
-
Hello,
I'd already installed this mod into my CPG and it works great.
But I see, this mod allow everyone to see all photos inside the gallery without any restrictions.
For example, all photos inside my private album can be also viewed.
I don't know, do you have ideas to modify this mod to be more less security vulnerabilities? ???
Ayako
-
this hack is based on my ssi_mod hack, which doesn't take permissions into account - that's why I recommend not using my mod anymore. The same thing applies for all hacks that are based on my mod: if you're concerned about privacy, you shouldn't use it. There's no hack to the hack available that takes permissions into account.
GauGau
-
Hi all,
is there a way to make the signature.php so that when a random picture appears, and you click on the image it auto-directs you to that particular image? I have alot of pics on coppermine and it's difficult to locate that image.
-
Doesn't work for me, my picture is empty :[
-
this requires GD 2.0.
is there any based on GD 1.0?
-
Nice, works swell.
-
i have one problem..
the random pic is over stats..
please see
http://www.neeth.info/galerija/signature_cpg.php
tnx..
-
i have one problem..
the random pic is over stats..
please see
http://www.neeth.info/galerija/signature_cpg.php
tnx..
I have the SAME problem! http://www.galeria4x4.com.mx/photos/signature_cpg.php
Besides, the thumb looks desproportionate, I mean, wider that it should be. Is there a way to tell the script: "Please respect the size of the original thumb and display it in its original size"???
-
NEETH!!!! I found and corrected the problem, please find the following lines in your code:
ImageString($im, 3, 155, 7, "Galeria4x4.com.mx", $farbe_text);
ImageString($im, 2, 155, 20, "$total_pics Fotos", $tc);
ImageString($im, 2, 155, 30, "vistas $total_views veces", $tc);
ImageString($im, 2, 155, 40, "$total_albums Albums", $tc);
ImageString($im, 2, 155, 50, "$total_comments Comentarios", $tc);
The "155" was "105" originaly. Play with this numbers, they give the instructions as where to place the text. I guess "155" is 155 pixels from left to right.
However, I still believe that the thumb looks desproportionate, I mean, wider that it should be.
-
Maybe you should adjust the ssi to only grab jpegs, or the background bit to allow use of imagecreatefromgif() if appropriate.
-
Maybe you should adjust the ssi to only grab jpegs, or the background bit to allow use of imagecreatefromgif() if appropriate.
Thanks Nibbler, any suggestion on how to do it? Just let me know which lines of code should I find and I'll play with them to restrict to jpeg grabbing.
Cya...
PS.- The forum in which I want to use this signature doesn't let me include "png" pictures in my signatures. It seems the [ IMG ] function only takes .gifs and .jpegs... any ideas in how to fool or trick the system?
-
I have the same problem since phpbb doesn't accept php files in img. Put this into an .htaccess file:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule sig.png sig.php [L]
syntax is what is the fake extension and what to actually point it to.
-
I'm sorry for asking this stupid question, but what is a ".htaccess file"? ??? ??? ???
Thanks for the help again TranzNDance, I'll use it as soon as I figure what is an .htaccess file.
Cya...
-
Sorry, I forgot to add the disclaimer that not everyone can edit the .htaccess file. You should ask your webhost if you can do it so you don't waste time trying something you can't do.
-
Joel: Can I edit the .htaccess file?
Brad: Yes you can edit the .htaccess file. Please do so in your Site Admin Panel
Joel: THANKSSSS!!!
Brad: You can edit it in the File Manager in your Site Admin Panel
;D ;D ;D
-
.htaccess is a configuration file for the webserver. It lets you make changes to your account without affecting other accounts on the same server. If you put into the root of your web docs folder, whatever it may be called, the settings will be inherited by all subfolders. Since this extension manipulation is something you are unlikely to want to happen to all files, you should only use it specifically for one folder.
Put the .htaccess file with the above content, edited to suit your file names/extensions, into the same folder that you want to apply the settings.
-
W O W ! ! ! It's WORKING now!!! Thank you very much TranzNDance!!!
-
I have applied all the changes to the signature_cpg.php and uploaded it to my coppermine dir at http://yourdomain.com/cpg
I'm getting a red x as a display and when i get the property for the x it points to signature_cpg.php ..
I think it's has to do with the following settings:
$url_of_cpg_dir='http://yourdomain.com/cpg/'; // full path to your coppermine gallery (with trailing slash)
$absolute_path_to_coppermine='cpg/'; // absolute path on your server to coppermine gallery (with trailing slash)
-
Absolute path would look something like this, depending on if your server is running linux or windows:
/home/user/public_html/cpg/
That's just an example.
-
Firstly, thanks TranzNDance for the explanation of the absolute path..
I copied the codes re-written by nukeworker and overwrite my signature_cpg.php and placed the file in the root of my coppermine dir..
I changed of course the 2 lines to my album:
$url_of_cpg_dir='http://yourdomain.com/cpg/'; // full path to your coppermine gallery (with trailing slash)
$absolute_path_to_coppermine='/home/user/public_html/path/cpg/'; // absolute path on your server to coppermine gallery (with trailing slash)
I also added the image path to my template.html:
<td valign="top" bordercolor="#666666" bgcolor="#FFFFFF" style="border: 1px solid;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" align="center">
<h1>{GAL_NAME}</h1>
<h3>{GAL_DESCRIPTION}</h3><br />
{MAIN_MENU}<br /></td>
</tr>
<tr><td>
<table border="8" cellpadding="2" cellspacing="5" align="center">
<td>
<div align="center"><img src="'http://yourdomain.com/cpg/signature_cgp.php">
</table></td></tr>
</table>
I still get the red x as an image.. What am I doing wrong?
-
Are you using the correct absolute path for your server? You need to confirm with your webhost as it varies.
-
Yes, the absolute path is correct.. When I right-click and select properties on the red x it shows the correct path to the signature_cpg.php..
Example of my configuration:
$url_of_cpg_dir='http://yourdomain.com/phpbb/cpg/'; // full path to your coppermine gallery (with trailing slash)
$absolute_path_to_coppermine='/home/sbstechinc/public_html/phpbb/cpg/'; // absolute path on your server to coppermine gallery (with trailing slash)
-
get this error message:
Parse error: parse error, unexpected T_VARIABLE in c:\ibserver\www\fotoforum\signature_cgp.php on line 26
-
Remove "" from 28 line ...
I have another question. How to change script to get image only from one selected album ???
-
I have another question. How to change script to get image only from one selected album ???
Find this:
//get pic info
$query = "SELECT * from {$CONFIG['TABLE_PICTURES']} WHERE approved='YES' ";
Change to this:
//get pic info
$query = "SELECT * from {$CONFIG['TABLE_PICTURES']} WHERE approved='YES' AND aid=x";
Replace the x with your album number.
-
Hey, looks like a great mod. I have followed the instructions and i just get:
"No input file specified."
file: http://mysimtractor.com/cpg1412/signature_cgp.php (http://mysimtractor.com/cpg1412/signature_cgp.php)
heres the file:
<?
// ------------------------------------------------------------------------- //
// include script for CPG (c) 2003 GauGau (mail@gaugau.de) V1.4 //
// http://gaugau.de/ //
// ------------------------------------------------------------------------- //
// Coppermine Photo Gallery v1.1 //
// ------------------------------------------------------------------------- //
// Copyright (C) 2002,2003 Grégory DEMAR <gdemar@wanadoo.fr> //
// http://www.chezgreg.net/coppermine/ //
// ------------------------------------------------------------------------- //
// Based on PHPhotoalbum by Henning Stųverud <henning@stoverud.com> //
// http://www.stoverud.com/PHPhotoalbum/ //
// ------------------------------------------------------------------------- //
// 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. //
// ------------------------------------------------------------------------- //
/////////////////// edit the following lines //////////////////////////////
$url_of_cpg_dir='http://www.mysimtractor.com/cpg1412/'; // full path to your coppermine gallery (with trailing slash)
$absolute_path_to_coppermine='/home/fhlinux164/m/mysimtractor.com/user/htdocs/cpg1412/'; // absolute path on your server to coppermine gallery (with trailing slash)
// to find more about absolute paths, check http://www.php.net/manual/en/function.phpinfo.php and look for 'DOCUMENT_ROOT' in your phpinfo.php
$cpg_decimal_point="."; //what character is used to separate decimals in your country, e.g. in Germany ",", in GB "."
$cpg_thousands_separator=","; //what character is used to separate thousands in your country, e.g. in Germany ".", in GB & US ",", in France " "
$cpg_lang_pics = "Pictures"; //translate this
$cpg_lang_views = "view"; //translate this
$cpg_lang_random = "Random pic of this album"; //translate this
$cpg_lang_keywords = "Keywords"; //translate this
/////// don't edit below this line unless you know what your're doing /////////
include_once( $absolute_path_to_coppermine.'/include/config.inc.php');
// definition taken from init.inc.php
$CONFIG['TABLE_PICTURES'] = $CONFIG['TABLE_PREFIX']."pictures";
$CONFIG['TABLE_ALBUMS'] = $CONFIG['TABLE_PREFIX']."albums";
$CONFIG['TABLE_COMMENTS'] = $CONFIG['TABLE_PREFIX']."comments";
$CONFIG['TABLE_CATEGORIES'] = $CONFIG['TABLE_PREFIX']."categories";
$CONFIG['TABLE_CONFIG'] = $CONFIG['TABLE_PREFIX']."config";
$CONFIG['TABLE_USERGROUPS'] = $CONFIG['TABLE_PREFIX']."usergroups";
$CONFIG['TABLE_VOTES'] = $CONFIG['TABLE_PREFIX']."votes";
$CONFIG['TABLE_USERS'] = $CONFIG['TABLE_PREFIX']."users";
// Connect to database
db_connect() || die("<b>Coppermine critical error</b>:<br />Unable to connect to database !<br /><br />MySQL said: <b>".mysql_error()."</b>");
// get config data
$result = mysql_query("SELECT * from {$CONFIG['TABLE_CONFIG']} WHERE name='fullpath'");
$row = mysql_fetch_row($result);
$cpg_album_path=$row[1];
$result = mysql_query("SELECT * from {$CONFIG['TABLE_CONFIG']} WHERE name='thumb_pfx'");
$row = mysql_fetch_row($result);
$cpg_thumb_pfx=$row['1'];
$result = mysql_query("SELECT * from {$CONFIG['TABLE_CONFIG']} WHERE name='thumbcols'");
$row = mysql_fetch_row($result);
$cpg_thumbcols=$row['1'];
if ($function == 'cpg_thumb' || $function == 'recentTopics' || $function == 'whosOnline' || $function == 'welcome' || $function == 'menubar' || $function == 'logout' || $function == 'login' || $function == 'topBoards' || $function == 'topTopicsViews' || $function == 'topTopicsReplies' || $function == 'latestMember' || $function == 'boardStats')
{
$function(); // Execute Function
exit;
}
function cpg_thumb()
{
GLOBAL $CONFIG,$url_of_cpg_dir,$cpg_album_path,$cpg_thumb_pfx,$cpg_thumbcols,$cpg_lang_random,$cpg_lang_views,$cpg_lang_keywords;
$numargs = func_num_args();
$arg_list = func_get_args();
if ($numargs > 0) {$cpg_include_link=$arg_list[0];}
if ($numargs > 1) {$cpg_link_singlepic=$arg_list[1];}
if ($numargs > 2) {$cpg_how_many=$arg_list[2];}
if ($numargs > 3) {$cgp_limit_album=$arg_list[3];}
if ($numargs > 4) {$cpg_random=$arg_list[4];}
if ($numargs > 5) {$cpg_link_target=$arg_list[5];}
if ($cpg_link_target==""){$cpg_link_target="_top";}
//get pic info
$query = "SELECT * from {$CONFIG['TABLE_PICTURES']} WHERE approved='YES' ";
if($cgp_limit_album!=""){$query.="AND aid='".$cgp_limit_album."'";}
$query.=" AND user2!='1' ORDER BY ";
if($cpg_random=="1"){$query.="RAND()";}else{$query.="ctime";}
$query.=" DESC LIMIT 0,".$cpg_how_many;
$result = mysql_query($query);
if ($cpg_how_many!=1)
{
$return_value="<table align=\"center\" cellspacing=\"0\" cellpadding=\"10\" align=\"center\" class=\"maintable\" border=\"0\">";
$td_start="<td valign=\"middle\" class=\"thumbnails\" align=\"center\">\n";
$td_end="</td>";
$cpg_table_end="</table>";
$tr_start="<tr>\n";
$tr_end="</tr>\n";
}
else
{
$return_value="";
$td_start="";
$td_end="";
$cpg_table_end="";
$tr_start="";
$tr_end="";
}
$counter=0;
if ($cpg_thumbcols > $cpg_how_many) {$cpg_thumbcols=$cpg_how_many;}
while ($row = mysql_fetch_array($result)) {
//------
if ($counter==0){$return_value.=$tr_start;}
$return_value.=$td_start;
if ($cpg_include_link==1)
{
$return_value.= "<a href=\"";
if ($cpg_link_singlepic==1)
{
if ($cpg_link_target=="popup")
{
$return_value.="javascript:;\" onClick=\"MM_openBrWindow('".$url_of_cpg_dir."displayimage.php?pid=".$row['pid']."&fullsize=1','".uniqid(rand())."','toolbar=yes,status=yes,resizable=yes,width=".($row['pwidth']+16).",height=".($row['pheight']+16)."')\"";
}
else
{
$return_value.=$url_of_cpg_dir."displayimage.php?&pos=-".$row['pid'];
}
}
else
{
$return_value.=$url_of_cpg_dir."thumbnails.php?album=".$row['aid'];
}
$return_value.="\" ";
if($cpg_link_target=="popup"){$return_value.="";}else{$return_value.="target=\"".$cpg_link_target."\"";}
$return_value.=">";
}
$return_value.= "".$url_of_cpg_dir.$cpg_album_path.$row['filepath'].rawurlencode($cpg_thumb_pfx.$row['filename']);
$counter++;
if ($counter==$cpg_thumbcols){$counter=0;$return_value.=$tr_end;}
}
$return_value.=$cpg_table_end;
return $return_value;
}
function cpg_single()
{
$numargs = func_num_args();
$arg_list = func_get_args();
if ($numargs > 0){return cpg_thumb(1,1,1,"",0,$arg_list[0]);}
else{return cpg_thumb(1,1,1,"",0);}
}
function cpg_total_pics($cgp_limit_album)
{
GLOBAL $CONFIG,$cpg_decimal_point,$cpg_thousands_separator;
$query = "SELECT COUNT(*) from {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES'";
if($cgp_limit_album!=""){$query.=" AND aid='".$cgp_limit_album."'";}
$result = mysql_query($query);
$nbEnr = mysql_fetch_array($result);
$pic_count = $nbEnr[0];
mysql_free_result($result);
return number_format($pic_count,0,$cpg_decimal_point,$cpg_thousands_separator);
}
function cpg_total_views($cgp_limit_album)
{
GLOBAL $CONFIG,$cpg_decimal_point,$cpg_thousands_separator;
$query = "SELECT sum(hits) FROM {$CONFIG['TABLE_PICTURES']} WHERE 1";
if($cgp_limit_album!=""){$query.=" AND aid='".$cgp_limit_album."'";}
$result = mysql_query($query);
$nbEnr = mysql_fetch_array($result);
$view_count = $nbEnr[0];
mysql_free_result($result);
return number_format($view_count,0,$cpg_decimal_point,$cpg_thousands_separator);
}
function cpg_hit_ratio($cgp_limit_album)
{
GLOBAL $CONFIG;
//get stats
$result=mysql_query("SELECT sum(hits) FROM {$CONFIG['TABLE_PICTURES']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$hit_count = (int)$nbEnr[0];
$result=mysql_query("SELECT count(*) FROM {$CONFIG['TABLE_PICTURES']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$picture_count = $nbEnr[0];
$cpg_ratio_string=str_replace(".", ",",(floor(((str_replace(".", "", cpg_total_views($cgp_limit_album))/str_replace(".", "", cpg_total_pics($cgp_limit_album)))*10)/($hit_count/$picture_count)))/10);
//$cpg_ratio_string=cpg_total_views($cgp_limit_album).'|'.cpg_total_pics($cgp_limit_album).'|'.$hit_count.'|'.$picture_count;
return $cpg_ratio_string;
}
function cpg_stat_string($cgp_limit_album)
{
GLOBAL $url_of_cpg_dir,$cpg_lang_pics,$cpg_lang_views;
$cpg_stat_string='[<a href="'.$url_of_cpg_dir.'thumbnails.php?album='.$cgp_limit_album.'"><b>';
$cpg_stat_string.=cpg_total_pics($cgp_limit_album);
$cpg_stat_string.='</b> ' . $cpg_lang_pics . '</a>, <a href="'.$url_of_cpg_dir.'thumbnails.php?album=topn&cat=-'.$cgp_limit_album.'"><b>';
$cpg_stat_string.=cpg_total_views($cgp_limit_album);
$cpg_stat_string.='</b> ' . $cpg_lang_views . '</a>';
$cpg_stat_string.=', <span class="tool" title="SF=Spanner-Faktor:Wie oft sind die Bilder dieses Albums durchschnittlich angeklickt worden, im Vergleich zur gesamten Galerie?">SF: '.cpg_hit_ratio($cgp_limit_album).'</span>';
$cpg_stat_string.=']';
return $cpg_stat_string;
}
function cpg_total_albums()
{
GLOBAL $CONFIG,$cpg_decimal_point,$cpg_thousands_separator;
$query = "SELECT count(*) FROM {$CONFIG['TABLE_ALBUMS']} WHERE 1";
$result = mysql_query($query);
$nbEnr = mysql_fetch_array($result);
$album_count = $nbEnr[0];
mysql_free_result($result);
return number_format($album_count,0,$cpg_decimal_point,$cpg_thousands_separator);
}
function cpg_total_comments()
{
GLOBAL $CONFIG,$cpg_decimal_point,$cpg_thousands_separator;
$query = "SELECT count(*) FROM {$CONFIG['TABLE_COMMENTS']} WHERE 1";
$result = mysql_query($query);
$nbEnr = mysql_fetch_array($result);
$comments_count = $nbEnr[0];
mysql_free_result($result);
return number_format($comments_count,0,$cpg_decimal_point,$cpg_thousands_separator);
}
function cpg_total_cats()
{
GLOBAL $CONFIG,$cpg_decimal_point,$cpg_thousands_separator;
$query = "SELECT count(*) FROM {$CONFIG['TABLE_CATEGORIES']} WHERE 1";
$result = mysql_query($query);
$nbEnr = mysql_fetch_array($result);
$cats_count = $nbEnr[0];
mysql_free_result($result);
return number_format($cats_count,0,$cpg_decimal_point,$cpg_thousands_separator);
}
function cpg_random()
{
return cpg_thumb(1,1,1,"",1);
}
function random_picture()
{
return cpg_thumb(0,0,1,"",1);
}
function cpg_search($cpg_size,$cpg_question,$cpg_submit_text)
{
GLOBAL $url_of_cpg_dir;
$cpg_search_string = "<form method=\"get\" action=\"" . $url_of_cpg_dir . "thumbnails.php\" name=\"search_cpg\">
<input type=\"hidden\" name=\"album\" value=\"search\" />
<input type=\"hidden\" name=\"type\" value=\"full\" />
<input type=\"input\" name=\"search\" maxlength=\"255\" size=\"" . $cpg_size . "\" value=\"" . $cpg_question . "\" class=\"textfield\" onfocus=\"this.value=''\" />";
if ($cpg_submit_text!="" and $cpg_submit_text!="0")
{
$cpg_search_string.= " <input type=\"submit\" value=\"" . $cpg_submit_text . "\" class=\"submit\" />";
}
$cpg_search_string.= "</form>";
return $cpg_search_string;
}
function cpg_stats()
{
GLOBAL $CONFIG;
$result=mysql_query("SELECT count(*) FROM {$CONFIG['TABLE_ALBUMS']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$album_count = $nbEnr[0];
mysql_free_result($result);
$result=mysql_query("SELECT count(*) FROM {$CONFIG['TABLE_PICTURES']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$picture_count = $nbEnr[0];
mysql_free_result($result);
$result=mysql_query("SELECT count(*) FROM {$CONFIG['TABLE_COMMENTS']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$comment_count = $nbEnr[0];
mysql_free_result($result);
$result=mysql_query("SELECT count(*) FROM {$CONFIG['TABLE_CATEGORIES']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$cat_count = $nbEnr[0] - $HIDE_USER_CAT;
mysql_free_result($result);
$result=mysql_query("SELECT sum(hits) FROM {$CONFIG['TABLE_PICTURES']} WHERE 1");
$nbEnr = mysql_fetch_array($result);
$hit_count = (int)$nbEnr[0];
mysql_free_result($result);
print $picture_count.", ".$album_count.", ".$cat_count.", ".$comment_count.", ".$hit_count;
}
//function taken from functions.inc.php
function db_connect()
{
global $CONFIG;
$result = @mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);
if (!$result)
return false;
if (!mysql_select_db($CONFIG['dbname']))
return false;
return $result;
}
$total_pics = cpg_total_pics("");
$total_albums = cpg_total_albums();
$total_comments = cpg_total_comments();
$total_views = cpg_total_views("");
$random_picture = random_picture();
$im = ImageCreateTrueColor (375, 75);
$bgc = ImageColorAllocate ($im, 255, 255, 255);
$farbe_text = ImageColorAllocate ($im, 0, 0, 132);
$farbe_online = ImageColorAllocate ($im, 255, 0, 0);
$tc = ImageColorAllocate ($im, 3, 5, 17);
ImageFilledRectangle ($im, 0, 0, 375, 75 ,$bgc);
ImageString($im, 3, 105, 7, "Statistics of [your album-name here]", $farbe_text);
ImageString($im, 2, 105, 20, "$total_pics Pictures", $tc);
ImageString($im, 2, 105, 30, "$total_albums Albums", $tc);
ImageString($im, 2, 105, 40, "$total_comments Comments", $tc);
ImageString($im, 2, 105, 50, "viewed $total_views times", $tc);
imagecolortransparent($im, $bgc);
$background = $im ;
$insert = imagecreatefromjpeg($random_picture);
imagecolortransparent($insert, imagecolorexact($insert,255,0,255));
$insert_x = imagesx($insert);
$insert_y = imagesy($insert);
imagecopymerge($background,$insert,0,0,0,0,$insert_x,$insert_y,100);
header("Content-Type: image/png");
imagepng($background,"",100);
ImageDestroy ($im);
?>
Thanks and i would appreciate the help.
-
The signature ins:
http://mysimtractor.com/cpg1412/signature_cpg.php (http://mysimtractor.com/cpg1412/signature_cpg.php)
the error i get is:
<br />
<b>Notice</b>: Undefined variable: function in <b>/home/fhlinux164/m/mysimtractor.com/user/htdocs/cpg1412/signature_cpg.php</b> on line <b>59</b><br />
<br />
<b>Notice</b>: Undefined variable: function in <b>/home/fhlinux164/m/mysimtractor.com/user/htdocs/cpg1412/signature_cpg.php</b> on line <b>59</b><br />
<br />
<b>Notice</b>: Undefined variable: function in <b>/home/fhlinux164/m/mysimtractor.com/user/htdocs/cpg1412/signature_cpg.php</b> on line <b>59</b><br />
<br />
<b>Notice</b>: Undefined variable: function in <b>/home/fhlinux164/m/mysimtractor.com/user/htdocs/cpg1412/signature_cpg.php</b> on line <b>59</b><br />
<br />
<b>Notice</b>: Undefined variable: function in <b>/home/fhlinux164/m/mysimtractor.com/user/htdocs/cpg1412/signature_cpg.php</b> on line <b>59</b><br />
<br />
<b>Notice</b>: Undefined variable: function in <b>/home/fhlinux164/m/mysimtractor.com/user/htdocs/cpg1412/signature_cpg.php</b> on line <b>59</b><br />
<br />
<b>Notice</b>: Undefined variable: function in <b>/home/fhlinux164/m/mysimtractor.com/user/htdocs/cpg1412/signature_cpg.php</b> on line <b>59</b><br />
<br />
<b>Notice</b>: Undefined variable: function in <b>/home/fhlinux164/m/mysimtractor.com/user/htdocs/cpg1412/signature_cpg.php</b> on line <b>59</b><br />
<br />
<b>Notice</b>: Undefined variable: function in <b>/home/fhlinux164/m/mysimtractor.com/user/htdocs/cpg1412/signature_cpg.php</b> on line <b>59</b><br />
<br />
<b>Notice</b>: Undefined variable: function in <b>/home/fhlinux164/m/mysimtractor.com/user/htdocs/cpg1412/signature_cpg.php</b> on line <b>59</b><br />
<br />
<b>Notice</b>: Undefined variable: function in <b>/home/fhlinux164/m/mysimtractor.com/user/htdocs/cpg1412/signature_cpg.php</b> on line <b>59</b><br />
<br />
<b>Notice</b>: Undefined variable: function in <b>/home/fhlinux164/m/mysimtractor.com/user/htdocs/cpg1412/signature_cpg.php</b> on line <b>59</b><br />
<br />
<b>Notice</b>: Undefined variable: cpg_link_target in <b>/home/fhlinux164/m/mysimtractor.com/user/htdocs/cpg1412/signature_cpg.php</b> on line <b>76</b><br />
‰PNG
IHDRwKmPĖtRNS˙˙˙7X}<br />
<b>Warning</b>: imagepng() [<a href='function.imagepng'>function.imagepng</a>]: gd-png: fatal libpng error: zlib error in <b>/home/fhlinux164/m/mysimtractor.com/user/htdocs/cpg1412/signature_cpg.php</b> on line <b>338</b><br />
<br />
<b>Warning</b>: imagepng() [<a href='function.imagepng'>function.imagepng</a>]: gd-png error: setjmp returns error condition in <b>/home/fhlinux164/m/mysimtractor.com/user/htdocs/cpg1412/signature_cpg.php</b> on line <b>338</b><br />
-
Leave notices_display turned off if you don't know what they mean. Make sure that you have png support in GD
-
i checked my phpinfo and gd png is enabled.