|  | |
01-02-2009, 04:46 PM
|
#31 (permalink)
|
TF's First DICE User. Join Date: Jul 2007 Location: Burlington VT Posts: 3,976
| Re: Signature Rotation Code nope. it'll be 3 that i've posted so far. and then i can just change them around if i make a new one that i like.
i've also got a library of close to 100 sigs on my computer that i might draw from.
__________________ MacBook Pro C2D T8800 @ 2.66GHz | 4GB DDR3 1066MHz | 9600M GT 256MB | 320GB HDD 24" Acer B243w Cavalry 1TB Firewire800 External |
| |
01-02-2009, 04:56 PM
|
#32 (permalink)
|
Wizard Techie Join Date: Feb 2006 Location: Maine Posts: 3,683
| Re: Signature Rotation Code Code: <?php
$pic = array (
'http://link-to-image.jpg',
'http://link-to-image2.jpg',
'http://link-to-image3.jpg',
'http://link-to-image4.jpg',
);
$i = rand(0,count($pic)-1);
$currPic = $pic[$i];
function getExt($img='')
{
$pos = strrpos($img,'.');
$ext = substr($img,$pos+1,strlen($img));
if ($ext === 'jpeg') {
$ext = 'jpg';
}
return strtolower ($ext);
}
function errorImg($pic='')
{
$img = imagecreatetruecolor (150,30);
$bgc = imagecolorallocate ($img,255,255,255);
$tc = imagecolorallocate ($img,0,0,0);
imagefilledrectangle ($img,0,0,150,30,$bgc);
imagestring ($img,1,5,5,'Error Loading '.$pic,$tc);
return $img;
}
$ext = getExt($currPic);
if ($ext == 'jpg') {
if (! ($img = @imagecreatefromjpeg ($currPic))) {
$img = errorImg($currPic);
}
header ('Content-Type: image/jpeg');
imagejpeg ($img);
} elseif ($ext == 'gif') {
if (! ($img = @imagecreatefromgif ($currPic))) {
$img = errorImg($currPic);
}
header ('Content-Type: image/gif');
imagegif ($img);
} elseif ($ext == 'png') {
if (! ($img = @imagecreatefrompng ($currPic))) {
$img = errorImg($currPic);
}
header ('Content-Type: image/png');
imagepng ($img);
}
imagedestroy ($img);
?>
Save this as whatever you want .php
Find a free webhost, or use a real webhost if you have one. Then, add your pictures here: Code: $pic = array (
'http://link-to-image.jpg',
'http://link-to-image2.jpg',
'http://link-to-image3.jpg',
'http://link-to-image4.jpg',
);
Using the format that I have. Single quotes around each link, followed by a comma. Just copy what I have and you're set. You can have an unlimited amount of pictures. They must be saved as .jpg, .jpeg, .gif, or .png.
Then, for the sig, just do this: Code: [img ]http://url-to-where-the-php-script-is.php[/img ]
Should work. Try it.
__________________ Need website help? PM me!
Last edited by CrazeD; 01-02-2009 at 05:07 PM.
|
| |
01-02-2009, 05:02 PM
|
#33 (permalink)
|
TF's First DICE User. Join Date: Jul 2007 Location: Burlington VT Posts: 3,976
| Re: Signature Rotation Code the sig code isn't there
and like free webhost as in like webs.com. would that work?
__________________ MacBook Pro C2D T8800 @ 2.66GHz | 4GB DDR3 1066MHz | 9600M GT 256MB | 320GB HDD 24" Acer B243w Cavalry 1TB Firewire800 External
Last edited by Peter.Cort; 01-02-2009 at 05:05 PM.
|
| |
01-02-2009, 05:07 PM
|
#34 (permalink)
|
Wizard Techie Join Date: Feb 2006 Location: Maine Posts: 3,683
| Re: Signature Rotation Code Edited, remove spaces in tags.
__________________ Need website help? PM me! |
| |
01-02-2009, 05:11 PM
|
#35 (permalink)
|
TF's First DICE User. Join Date: Jul 2007 Location: Burlington VT Posts: 3,976
| Re: Signature Rotation Code ok. so where do i plop the long script? does that go in my apache index page? or does that go somewhere else.
and then the shorter one with the image links directly into it, that goes into the apache page.
correct?
__________________ MacBook Pro C2D T8800 @ 2.66GHz | 4GB DDR3 1066MHz | 9600M GT 256MB | 320GB HDD 24" Acer B243w Cavalry 1TB Firewire800 External
Last edited by Peter.Cort; 01-02-2009 at 05:52 PM.
|
| |
01-03-2009, 09:59 AM
|
#36 (permalink)
|
Wizard Techie Join Date: Feb 2006 Location: Maine Posts: 3,683
| Re: Signature Rotation Code The shorter code is part of the bigger code, you'll see it at the top of the long code. I was just showing where you'd set your links in the long code. That sounds really confusing, whoas. o.O
If you plan to host it on your own pc, then you need to have Apache (or IIS) and PHP installed and configured, as well as the GD library. Once you have that, just save the script as, say, pics.php (with any text editor, doesn't matter) and then put it in your Apache document root folder (as defined in the httpd.conf).
Then you need to open port 80 in your router, and hope that you have a static IP, and hope that your ISP doesn't block port 80 (otherwise you need to use a different port).
__________________ Need website help? PM me! |
| |
01-03-2009, 10:03 AM
|
#37 (permalink)
|
T.F's Resident Cool Guy... Join Date: Aug 2006 Posts: 1,625
| Re: Signature Rotation Code Quote:
Originally Posted by CrazeD The shorter code is part of the bigger code, you'll see it at the top of the long code. I was just showing where you'd set your links in the long code. That sounds really confusing, whoas. o.O
If you plan to host it on your own pc, then you need to have Apache (or IIS) and PHP installed and configured, as well as the GD library. Once you have that, just save the script as, say, pics.php (with any text editor, doesn't matter) and then put it in your Apache document root folder (as defined in the httpd.conf).
Then you need to open port 80 in your router, and hope that you have a static IP, and hope that your ISP doesn't block port 80 (otherwise you need to use a different port). | And dyndns
This is your best bet, I doubt your connection could cope with the load anyhow... 100WebSpace: Free Web Hosting Plan
Tkey |
| |
01-03-2009, 10:50 AM
|
#38 (permalink)
|
Wizard Techie Join Date: Feb 2006 Location: Maine Posts: 3,683
| Re: Signature Rotation Code You don't necessarily need dyndns. Only if you don't have a static IP do you need that.
But, I agree... just go with a free web host that supports PHP and GD.
If you really need to, I can throw it on my hosting.
__________________ Need website help? PM me! |
| |
01-03-2009, 12:19 PM
|
#39 (permalink)
|
TF's First DICE User. Join Date: Jul 2007 Location: Burlington VT Posts: 3,976
| Re: Signature Rotation Code aite so i registered my stuff on the 100webspace thing and got that all done. i enabled php 5 (don't know differences between 4,5 and 6...) and then i uploaded the .php file to the ftp. when i put in the link to where the script is located nothing pops up in my sig. Thing is I don't know how to enable GD. ideas?
__________________ MacBook Pro C2D T8800 @ 2.66GHz | 4GB DDR3 1066MHz | 9600M GT 256MB | 320GB HDD 24" Acer B243w Cavalry 1TB Firewire800 External |
| |
01-03-2009, 12:58 PM
|
#40 (permalink)
|
T.F's Resident Cool Guy... Join Date: Aug 2006 Posts: 1,625
| Re: Signature Rotation Code Run the following script, it will tell you if GD is supported or not. Code: <?php
/* Displays details of GD support on your server */
echo '<div style="margin: 10px;">';
echo '<p style="color: #444444; font-size: 130%;">GD is ';
if (function_exists("gd_info")) {
echo '<span style="color: #00AA00; font-weight: bold;">supported</span> by your server!</p>';
$gd = gd_info();
foreach ($gd as $k => $v) {
echo '<div style="width: 340px; border-bottom: 1px solid #DDDDDD; padding: 2px;">';
echo '<span style="float: left;width: 300px;">' . $k . '</span> ';
if ($v)
echo '<span style="color: #00AA00; font-weight: bold;">Yes</span>';
else
echo '<span style="color: #EE0000; font-weight: bold;">No</span>';
echo '<div style="clear:both;"><!-- --></div></div>';
}
} else {
echo '<span style="color: #EE0000; font-weight: bold;">not supported</span> by your server!</p>';
}
echo '<p>by <a href="http://www.dagondesign.com">dagondesign.com</a></p>';
echo '</div>';
?>
|
| |  | | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | |