Dynamic Sig

Stand-alone scripts designed for a specific function, but not neccessarily part of normal forum browsing.
Forum rules
Image Please feel free to download any Scripts here, support for each Script is located it's own thread.

To post your own Script, please first read the MOD / Script Guidelines

Re: Dynamic Sig

Postby Sniper_E » 09 Mar 2008, 21:42

:doh: Oh my goodness it's raggy again. *Yells into the back room* "Stitch, you have a customer up front."

and please don't use that huge sig in here. :club:
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 6981
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6


Re: Dynamic Sig

Postby raggy » 10 Mar 2008, 06:49

lol.

anywaysss i was using this signature to show how to change colours but i worked the 1st part out.

So i need to chnage colours on each line if thats ok?

also i will hide the signature on the spoiler.
raggy
Cadet IV
Cadet IV
 
Posts: 43
Joined: 06 Jul 2007, 14:50
Gender: Male

Re: Dynamic Sig

Postby stitch626 » 10 Mar 2008, 18:11

Hey Sniper you don't have to yell so loud :P

Hello raggy,
Let's get some colors added to that that sig. :)

First thing you need to do is define colors. The way we will do this is to create some color vars
like this: I have come up with an array of colors to get you started:
Code: Select all
// Defines The Color of the text. You can create as many colors as you like.
$black = imagecolorallocate($this_img, 0, 0, 0);
$red = imagecolorallocate($this_img, 199, 37, 33);
$blue = imagecolorallocate($this_img, 0, 0, 128);
$green = imagecolorallocate($this_img, 11, 70, 19);
$purple = imagecolorallocate($this_img, 153, 2, 104);
$yellow = imagecolorallocate($this_img, 223, 223, 0);
//End Colors

Take the above code and replace this line in your sig.php file:
Code: Select all
$color = imagecolorallocate($this_img, 0, 0, 0);

Now a bit down further in the file you will see these line of code:
Mine are bit different since I customized them for my site.
Code: Select all
imagestring($this_img, 3, 12, 1, $username, $color);
imagestring($this_img, 3, 150, 1, 'Welcome to', $color);
imagestring($this_img, 3, 228, 1, $config['sitename'], $color);
imagestring($this_img, 2, 12, 15, 'Your guide to Morel Mushrooms & the Great outdoors', $color);
imagestring($this_img, 3, 12, 30, 'Currently we have', $color);

Now take this line for example:
Code: Select all
imagestring($this_img, 3, 12, 30, 'Currently we have', $color);

This will print a line that says: "Currently we have"
Now I want to add a color to it: Let's make it "Blue"
Now you have:
Code: Select all
imagestring($this_img, 3, 12, 30, 'Currently we have', $blue);


get the idea?

So basically replace $color with $red or $blue ect...
User avatar
stitch626    
STG Moderator Leader
STG Moderator Leader
 
Posts: 3185
Joined: 08 Feb 2007, 20:47
Location: Michigan
Favorite Team: Detroit Red Wings
Gender: Male
phpBB Knowledge: 7

Re: Dynamic Sig

Postby raggy » 10 Mar 2008, 18:33

perfect :D i got it the 1st go and also added a new colour white

all i did was this

$white = imagecolorallocate($this_img, 255, 255, 255);

and chnaged it to white :D i got it now thanks alot dude.....

u the greatest and also great mod.

thanks again.

PS: Can we add links to the image? example CLICK HERE and it goes to the forum?
raggy
Cadet IV
Cadet IV
 
Posts: 43
Joined: 06 Jul 2007, 14:50
Gender: Male

Re: Dynamic Sig

Postby stitch626 » 10 Mar 2008, 19:06

You mean I created all those array of colors and you only wanted one? Where is my Can of sardines, I'm going to smack you with one. :P

Naa just kidding.

Your very Welcome raggy. :D

Well you could always paste those colors in there in case in the future you want to change more colors you will have the functionality to do so.

As for links in the sig goes, you can't do that since the sig is an output php source.
  I think I said that right  


Edit: Oh never mind.. you said you just added a color "white" Ok, so I didn't do all that for nothing :P
User avatar
stitch626    
STG Moderator Leader
STG Moderator Leader
 
Posts: 3185
Joined: 08 Feb 2007, 20:47
Location: Michigan
Favorite Team: Detroit Red Wings
Gender: Male
phpBB Knowledge: 7

Re: Dynamic Sig

Postby raggy » 11 Mar 2008, 09:13

stitch626 wrote:You mean I created all those array of colors and you only wanted one? Where is my Can of sardines, I'm going to smack you with one. :P

Naa just kidding.

Your very Welcome raggy. :D

Well you could always paste those colors in there in case in the future you want to change more colors you will have the functionality to do so.

As for links in the sig goes, you can't do that since the sig is an output php source.
  I think I said that right  


Edit: Oh never mind.. you said you just added a color "white" Ok, so I didn't do all that for nothing :P


lol i mean to say, I also added the colour white on there, And the colours you gave me, i used them too :D check my signature on the spoiler button lol. all i did was add an extra color :p
raggy
Cadet IV
Cadet IV
 
Posts: 43
Joined: 06 Jul 2007, 14:50
Gender: Male

Re: Dynamic Sig

Postby stitch626 » 11 Mar 2008, 09:40

Hey looks good man :thumbsup:
User avatar
stitch626    
STG Moderator Leader
STG Moderator Leader
 
Posts: 3185
Joined: 08 Feb 2007, 20:47
Location: Michigan
Favorite Team: Detroit Red Wings
Gender: Male
phpBB Knowledge: 7

Re: Dynamic Sig

Postby Scofield » 23 Mar 2008, 11:00

Please how I add to my sig picture for example this
Code: Select all
http://www.scoobyblog.com/wp-content/uploads/2006/06/sti-m5.jpg

I have a good sig, but is only color change
:beg:
Thanks

Spoiler:
<?php

define('IN_PHPBB', true);
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
$bg = 'http://www.mysite.com/sig.gif';

// $user->session_begin();

list($width, $height, $type) = @getimagesize($user->data['user_avatar']);

switch ( $type )
{
case 1:
$avatar = imagecreatefromgif($user->data['user_avatar']);
break;
case 2:
$avatar = imagecreatefromjpeg($user->data['user_avatar']);
break;
case 3:
$avatar = imagecreatefrompng($user->data['user_avatar']);
break;
}

if ( isset($_GET['bg']) )
{
list($bg_width, $bg_height, $bg_type) = @getimagesize($_GET['bg']);

switch ( $bg_type )
{
case 1:
$bg_img = imagecreatefromgif($_GET['bg']);
break;
case 2:
$bg_img = imagecreatefromjpeg($_GET['bg']);
break;
case 3:
$bg_img = imagecreatefrompng($_GET['bg']);
break;
}
}

$this_img = imagecreatetruecolor(468, 60);

if ( isset($bg_width) && isset($bg_height) && isset($bg_img) )
{
imagecopymerge($this_img, $bg_img, 0, 0, 0, 0, $bg_width, $bg_height, 100);
}

imagealphablending($this_img, TRUE);

$color = imagecolorallocate($this_img, 0, 0, 0);
$bg = imagecolorallocatealpha($this_img, rand(200, 250), rand(200, 250), rand(200, 250), 50);

imagefill($this_img, 0, 0, $bg);

if ( isset($width) && isset($height) )
{
imagecopymerge($this_img, $avatar, 468 - $width, 0, 0, 0, $width, $height, 100);
}

imagefilledrectangle($this_img, 0, 0, 467, 59, $bg);

// imagestring($this_img, 2, 4, 1, $config['sitename'] . ' (hi ' . $user->data['username'] . '!)', $color); // no cookies!!!
imagestring($this_img, 2, 4, 1, $config['sitename'], $color);
imagestring($this_img, 3, 4, 15, 'tomio ', $color);
imagestring($this_img, 2, 144, 15, ' @ ' . $config['cookie_domain'], $color);
imagestring($this_img, 2, 4, 29, 'Prispevkov: ' . $config['num_posts'] . ' | Tem: ' . $config['num_topics'] . ' | Userov: ' . $config['num_users'] . ' | Najnovsi user: ' . $config['newest_username'], $color);
imagestring($this_img, 1, 4, 49, $config['site_desc'], $color);
imagerectangle($this_img, 0, 0, 467, 59, $color);

header('Content-Type: image/gif');
imagegif($this_img);

?>
Scofield
Crewman
Crewman
 
Posts: 7
Joined: 17 Jul 2007, 05:59
Gender: Male

Re: Dynamic Sig

Postby beggers » 05 Aug 2008, 22:07

Okay guys, this looks cool but we need an optional parameter that would allow anyone to display their own stats by adding their ID number, like sig.php=723 or something like that. :thumbsup:
User avatar
beggers    
Supporter
Supporter
 
Posts: 166
Joined: 25 Jan 2008, 23:46
Favorite Team: Oakland Raiders
Gender: Male
phpBB Knowledge: 4

Re: Dynamic Sig

Postby shelliwood » 18 Aug 2008, 14:14

I've just moved to a new server and transfer this script over and it's now just showing as black! Nothing is showing for it in the error log

Any ideas what it might be?

Edit: Actually it's just ones with a background image that is givving a problem
shelliwood
Borg Drone
Borg Drone
 
Posts: 10
Joined: 09 Dec 2006, 06:36
Gender: Female

PreviousNext

Return to Scripts

Who is online

Users browsing this forum: No registered users and 3 guests