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 stitch626 » 01 Mar 2008, 11:44

Ok Raggy,

Let's just keep this simple and let's stick with the original instructions of this script.
Open up your sig.php file and replace all your code with this:
Spoiler:
Code: Select all
<?php
define('IN_PHPBB', true);
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
$bg = 'http://www.seo-fed.com/sig.gif';

$user->session_begin();
$username = ($user->data['user_id'] != ANONYMOUS) ? 'Hey ' . $user->data['username'] . '!' : '';
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;
}

list($bg_width, $bg_height, $bg_type) = @getimagesize($bg);
switch ( $bg_type )
{
case 1:
$bg_img = imagecreatefromgif($bg);
break;
case 2:
$bg_img = imagecreatefromjpeg($bg);
break;
case 3:
$bg_img = imagecreatefrompng($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, 3, 100, 0, $username, $color);
imagestring($this_img, 3, 175, 0, 'Visit Us At', $color);
imagestring($this_img, 3, 275, 0, $config['sitename'], $color);
imagestring($this_img, 3, 170, 15, 'PS2 & PS3 Online Gaming E-FED', $color);
imagestring($this_img, 3, 170, 20, 'PS2 & PS3 Online Gaming E-FED', $color);
imagestring($this_img, 3, 170, 25, 'PS2 & PS3 Online Gaming E-FED', $color);
imagestring($this_img, 3, 8, 30, $config['num_topics'] . ' Topics ' . $config['num_posts'] . ' Posts ' . $config['num_users'] . ' Members,', $color);
imagestring($this_img, 3, 274, 30, 'Our Newest Member ' . $config['newest_username'], $color);
imagestring($this_img, 2, 4, 44, $config['site_desc'], $color);
imagerectangle($this_img, 0, 0, 467, 59, $color);

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


Upload this file to your root directory of your forums:
In your case I think your path is:
http://www.seo-fed.com/forums
Then upload your sig.gif to the same directory
Whatever other folders you have created just get rid of them.
Let's see if you can get this up and going first then we can see what we can do about placing these files into a sig folder if you wish.

Let us know how it goes.
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 » 01 Mar 2008, 11:54

stitch626 wrote:Ok Raggy,

Let's just keep this simple and let's stick with the original instructions of this script.
Open up your sig.php file and replace all your code with this:
Spoiler:
Code: Select all
<?php
define('IN_PHPBB', true);
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.'.$phpEx);
$bg = 'http://www.seo-fed.com/sig.gif';

$user->session_begin();
$username = ($user->data['user_id'] != ANONYMOUS) ? 'Hey ' . $user->data['username'] . '!' : '';
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;
}

list($bg_width, $bg_height, $bg_type) = @getimagesize($bg);
switch ( $bg_type )
{
case 1:
$bg_img = imagecreatefromgif($bg);
break;
case 2:
$bg_img = imagecreatefromjpeg($bg);
break;
case 3:
$bg_img = imagecreatefrompng($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, 3, 100, 0, $username, $color);
imagestring($this_img, 3, 175, 0, 'Visit Us At', $color);
imagestring($this_img, 3, 275, 0, $config['sitename'], $color);
imagestring($this_img, 3, 170, 15, 'PS2 & PS3 Online Gaming E-FED', $color);
imagestring($this_img, 3, 170, 20, 'PS2 & PS3 Online Gaming E-FED', $color);
imagestring($this_img, 3, 170, 25, 'PS2 & PS3 Online Gaming E-FED', $color);
imagestring($this_img, 3, 8, 30, $config['num_topics'] . ' Topics ' . $config['num_posts'] . ' Posts ' . $config['num_users'] . ' Members,', $color);
imagestring($this_img, 3, 274, 30, 'Our Newest Member ' . $config['newest_username'], $color);
imagestring($this_img, 2, 4, 44, $config['site_desc'], $color);
imagerectangle($this_img, 0, 0, 467, 59, $color);

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


Upload this file to your root directory of your forums:
In your case I think your path is:
http://www.seo-fed.com/forums
Then upload your sig.gif to the same directory
Whatever other folders you have created just get rid of them.
Let's see if you can get this up and going first then we can see what we can do about placing these files into a sig folder if you wish.

Let us know how it goes.


i dont have a root folder. its direct. http://www.seo-fed.com/(no folder)

so basically i have done what u told me

sig.gif and sig.php onto the root directory. now ?
raggy
Cadet IV
Cadet IV
 
Posts: 43
Joined: 06 Jul 2007, 14:50
Gender: Male

Re: Dynamic Sig

Postby stitch626 » 01 Mar 2008, 12:15

Ok so then you would place these two files under
http://www.seo-fed.com/

So then you would have:
Code: Select all
http://www.seo-fed.com/sig.php
and
http://www.seo-fed.com/sig.gif
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 » 01 Mar 2008, 12:16

stitch626 wrote:Ok so then you would place these two files under
http://www.seo-fed.com/

So then you would have:
Code: Select all
http://www.seo-fed.com/sig.php
and
http://www.seo-fed.com/sig.gif


correct :thumbsup:
raggy
Cadet IV
Cadet IV
 
Posts: 43
Joined: 06 Jul 2007, 14:50
Gender: Male

Re: Dynamic Sig

Postby stitch626 » 01 Mar 2008, 12:22

So whatcha got?
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 » 01 Mar 2008, 12:26

stitch626 wrote:So whatcha got?


http://seo-fed.com/sig.gif

just the blank banner :S
raggy
Cadet IV
Cadet IV
 
Posts: 43
Joined: 06 Jul 2007, 14:50
Gender: Male

Re: Dynamic Sig

Postby stitch626 » 01 Mar 2008, 12:33

make sure you have this code in your signature exactly as is:
Code: Select all
[img]http://seo-fed.com/sig.php?bg=sig.gif[/img]
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 » 01 Mar 2008, 12:41

here u go

Image

i did what u told me to do.
raggy
Cadet IV
Cadet IV
 
Posts: 43
Joined: 06 Jul 2007, 14:50
Gender: Male

Re: Dynamic Sig

Postby stitch626 » 01 Mar 2008, 12:54

Hmm I am stumped now. :scratch: If you want you can pm me your your FTP info and provide me with a test account on your board and I will have a look how things are structured and the code itself. I am sure you did everything correct but you never know. Sometimes it takes another set of eyes. All it takes in one tiny detail to throw everything off.

The only other thing I can think of ATM is maybe it has something to do with your host.
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 » 01 Mar 2008, 12:57

stitch626 wrote:Hmm I am stumped now. :scratch: If you want you can pm me your your FTP info and provide me with a test account on your board and I will have a look how things are structured and the code itself. I am sure you did everything correct but you never know. Sometimes it takes another set of eyes. All it takes in one tiny detail to throw everything off.

The only other thing I can think of ATM is maybe it has something to do with your host.


it could be but im ok to give u my ftp :D also if u managed to get this working lol ill donate :P for all the help u guided me with.
raggy
Cadet IV
Cadet IV
 
Posts: 43
Joined: 06 Jul 2007, 14:50
Gender: Male

PreviousNext

Return to Scripts

Who is online

Users browsing this forum: No registered users and 4 guests

cron