News:

CPG Release 1.6.28
added submissions from {406man}
cleaned up a few PHP (8.4) deprecations
fixed PHP deprecation in calendar
removed security vulnerability
(please upgrade when possible)

Main Menu

signature code like mine...

Started by Deus, October 12, 2005, 01:15:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Deus

If Abbas has it working, can we see your sig now please Rush?
https://daz-stuff.uk
DJ tutorials, E-Bikes, Movies and videogames.
(https://daz-stuff.uk/daz/signature.png)

Rush_To_Me

THANKS A LOT!!!  ;D You  guys surely are awsome so here it goes:

http://www.enlaces-digitales.com/gallery/pic.php

@Deus Thank you for the script!
@TranzNDance Thank you for your comments
@Abbas Ali I don't have enough words to repay the favor

I will study PHP a little more to help people like you guys ;)

One again Thank you for all

Manuel

dirtytricks

i configured the code to my liking but i cant seem to get the ".jpg" extension to work.

i have added in my .htaccess:
RewriteEngine on
RewriteRule ^([^/\&\?]*)pic\.jpg$ pic.php?$1
RewriteRule ^([^/\&\?]*)pic([0-9]*)\.jpg$ pic.php?alb=$2
RewriteRule ^([^/\&\?]*)pic([0-9]*)/([0-9]*)/(.*)\.jpg$ pic.php?alb=$2&txt=$4&q=$3
RewriteRule ^([^/\&\?]*)pic([0-9]*)/(.*)\.jpg$ pic.php?alb=$2&txt=$3


http://www.teamdirtytricks.net/drunktank/pic.php works just fine, but
http://www.teamdirtytricks.net/drunktank/pic.jpg produces a 404 error

Abbas Ali

Make sure the mod_rewrite is allowed on your server. Ask your webhost for the same.
Chief Geek at Ranium Systems

dirtytricks

it is, they said:
QuoteModRewrite is fully enabled in the server your account is on.
Unfortunatly we cannot provide technical assistance with creating
RewriteRule.

anyone got any ideas?

Pascal YAP

#45
Morning,

Is there any security risk if i use only pic.php without .htaccess ?
Because it's work fine as standalone for me !
RewriteRule and mod_rewrite are not allowed on my host  ???

PYAP

Abbas Ali

No security risk. You can use it like that. mod_rewrite is used only to make the urls look pretty.
Chief Geek at Ranium Systems

Pascal YAP

#47
Thanx Abbas  ;D
Look like that :
(//) http://www.pays-dignois.com/galerie/random.php (oh oh... this link do not work on 11-30-2006  ??? )

PYAP

peps

awesome script there guys. I had almost no probs "installing" it. The thing is that I get an image only with pic.jpg, the other options don't work. I wonder what is wrong! I would like to configure pic1 to be in another resolution after all this is the point in having pic, pic1, ...pic#. Anyone that can help me out here.

here is the link to the pic file: http://paparak.info/pic.jpg

here is the code

<?php

define
('IN_COPPERMINE'true);
define('INDEX_PHP'true);

require(
'include/init.inc.php');
header('content-type: image/jpeg');

$mlink=mysql_connect('localhost','***''***');
mysql_select_db('***'$mlink);
$sum_x=4;
$pos=4;

if(isset($_GET['q'])) {
$q=$_GET['q'];
} else {
$q=5;
}

if(isset($_GET['alb'])) {
$pics=mysql_query("select filepath, filename from pictures where aid=".$_GET['alb']." and pwidth>0 order 

by rand() limit 0,
$q");
} else {
$pics=mysql_query("select filepath, filename from {$CONFIG['TABLE_PICTURES']}

{$CONFIG['TABLE_ALBUMS']} where {$CONFIG['TABLE_ALBUMS']}.aid={$CONFIG['TABLE_PICTURES']}.aid and pwidth>0 

and visibility=0 order by rand() limit 0,
$q");
}
if(isset($_GET['txt'])) {
$txt=$_GET['txt'];
} else {
$txt="http://paparak.info";
}


while($pr=mysql_fetch_array($pics)) {
$fname[]="albums/".$pr['filepath']."th_".$pr['filename'];
list($width$height$type$attr) = getimagesize("albums/".$pr['filepath']."th_".$pr['filename']);
$sum_x+=$width+4;
$ix[]=$width;
$im[]=imagecreatefromjpeg("albums/".$pr['filepath']."th_".$pr['filename']); //echo 

"albums/".$pr['filepath']."th_".$pr['filename']."--";
}

$im_total = @imagecreatetruecolor($sum_x100);
for($pn=0$pn<$q$pn++) {
imagecopy($im_total$im[$pn], $pos400$ix[$pn], 92);
$pos=$pos+$ix[$pn]+4;
}
$pos=$pos-$ix[$pn]-4;
//imagecopy($im_total, $im[1], $pos, 4, 0, 0, $ix[1], 100);
//$pos=$pos+$ix[1]+4;
//imagecopy($im_total, $im[2], $pos, 4, 0, 0, $ix[2], 100);

$textcolor imagecolorallocate($im_total255255255);
$last_x=max($pos,150);
imagefilledrectangle($im_total$last_x-15280$last_x+21270);
imagestring($im_total4$last_x-15280$txt$textcolor);
imagejpeg($im_total);

?>


Thanks in advance

younk

I have tried this, but i wont work right.. It i prehaps just me who have forgot something.
http://www.babez.dk/galleri/pic.jpg

I hope you can help me.

Thanks in advange!

Dr Preacox

This is a damn handy script!!!

Here's a copy of the script with all the needed changes in it, or at least all the ones that need to make it work on newer versions.


<?php

define
('IN_COPPERMINE'true);
define('INDEX_PHP'true);

require(
'include/init.inc.php');
header('content-type: image/jpeg');

$mlink=mysql_connect('localhost','dcclorvv_gallery''6iuni2fr');
mysql_select_db('your gallery database'$mlink);
$sum_x=4;
$pos=4;

if(isset($_GET['q'])) {
$q=$_GET['q'];
} else {
$q=3;
}

if(isset($_GET['alb'])) {
$pics=mysql_query("select filepath, filename from {$CONFIG['TABLE_PICTURES']} where aid=".$_GET['alb']." and pwidth>0 order by rand() limit 0,$q");
} else {
$pics=cpg_db_query("select filepath, filename from {$CONFIG['TABLE_PICTURES']}{$CONFIG['TABLE_ALBUMS']} where {$CONFIG['TABLE_ALBUMS']}.aid={$CONFIG['TABLE_PICTURES']}.aid and pwidth>0 and visibility=0 order by rand() limit 0,$q");
}
if(isset($_GET['txt'])) {
$txt=$_GET['txt'];
} else {
$txt="www.dc-6.com/gallery/";
}


while($pr=mysql_fetch_array($pics)) {
$fname[]="albums/".$pr['filepath']."thumb_".$pr['filename'];
list($width$height$type$attr) = getimagesize("albums/".$pr['filepath']."thumb_".$pr['filename']);
$sum_x+=$width+4;
$ix[]=$width;
$im[]=imagecreatefromjpeg("albums/".$pr['filepath']."thumb_".$pr['filename']); //echo "albums/".$pr['filepath']."thumb_".$pr['filename']."--";
}

$im_total = @imagecreatetruecolor($sum_x128);
for($pn=0$pn<$q$pn++) {
imagecopy($im_total$im[$pn], $pos400$ix[$pn], 120);
$pos=$pos+$ix[$pn]+4;
}
$pos=$pos-$ix[$pn]-4;
//imagecopy($im_total, $im[1], $pos, 4, 0, 0, $ix[1], 120);
//$pos=$pos+$ix[1]+4;
//imagecopy($im_total, $im[2], $pos, 4, 0, 0, $ix[2], 120);

$textcolor imagecolorallocate($im_total255255255);
$last_x=max($pos,168);
imagefilledrectangle($im_total$last_x-168111$last_x+21260);
imagestring($im_total4$last_x-166111$txt$textcolor);
imagejpeg($im_total);

?>



.htaccess

RewriteEngine on

RewriteRule ^([^/\&\?]*)pic\.jpg$ pic.php?$1
RewriteRule ^([^/\&\?]*)pic([0-9]*)\.jpg$ pic.php?alb=$2
RewriteRule ^([^/\&\?]*)pic([0-9]*)/([0-9]*)/(.*)\.jpg$ pic.php?alb=$2&txt=$4&q=$3
RewriteRule ^([^/\&\?]*)pic([0-9]*)/(.*)\.jpg$ pic.php?alb=$2&txt=$3
My Mods:
Making Memberlist Public - VIEW
Different Way of Displaying Categories - VIEW
Coming Soon - Automated Sub Domains -MOD



madhatt

Here is mine.

Still testing

(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.madhatt.com%2Fgallery%2Fpic.php&hash=77ae8bb8d11310998a5b20a50a72ebbe026f7f7f)

Deus

Digging up an old thread.

Is there a way of this code being slightly modified to show just one image from a gallery of the users choice?
ie, I'd like to show a full size signature image, without text, and just the one image?
But it does need to work alongside the same code.
does this make sense?

Thanks in advance,
Darron.
https://daz-stuff.uk
DJ tutorials, E-Bikes, Movies and videogames.
(https://daz-stuff.uk/daz/signature.png)

Deus

I am wondering if anyone fancies commenting in the script.
I've just had an hour of fun randomly changing numbers to get it to work correctly.
I have NO clue of whats what and would love to know what to change to fix things in future.
https://daz-stuff.uk
DJ tutorials, E-Bikes, Movies and videogames.
(https://daz-stuff.uk/daz/signature.png)

Deus

updated URLs, all out of date and broken.
Now they're all ok.
https://daz-stuff.uk
DJ tutorials, E-Bikes, Movies and videogames.
(https://daz-stuff.uk/daz/signature.png)

Pascal YAP


kpfan

Where do I edit my template. I don't know what option in the admin controls to chose. To allow me to add my stat code to the footer.

Deus

it looks like the code isn't working, or at least for me, has anything changed in CPG 1.5.x for it to break the code?
http://cpg.mess-hall.co.uk/pic45.jpg
https://daz-stuff.uk
DJ tutorials, E-Bikes, Movies and videogames.
(https://daz-stuff.uk/daz/signature.png)