UK Webmaster Talk - Online Marketing - SEO


 

How to create dynamic signiture images?

This is a discussion on How to create dynamic signiture images? within the Programming Articles forums, part of the Webmaster Articles/Tutorials category; NOTE:I have only tryed this script on phpBB forums, and i do not know if it works on any other ...


Go Back   UK Webmaster Talk - Online Marketing - SEO > Webmaster Articles > Webmaster Articles/Tutorials > Programming Articles

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Notices

Reply

 

LinkBack Thread Tools Display Modes
Old 26-06-2005, 19:30   #1 (permalink)
Moderator
 
Join Date: Jan 2005
Location: post is there >>
Posts: 1,586
iTrader: 0 / 0%
robertall is just really nice
Send a message via AIM to robertall Send a message via MSN to robertall
Default How to create dynamic signiture images?

NOTE:I have only tryed this script on phpBB forums, and i do not know if it works on any other forums.

In this tutorial i will teach you how to make a simple dymanic signiture using php. This contains a total of 4 files will be needed for this. There will be a .php files, a .jpeg.php file, and a .htaccess file. and a simple .jpeg image.

The the .htaccess file put the following:

Code:
Options Indexes FollowSymLinks MultiViews All
RewriteEngine on
RewriteBase /
RewriteRule (.+)/image.jpeg image.jpeg?forum=$1
What this basically does is create the image using common sense.

The next part you will have to save as image.jpeg.php, which basically gets information from the last part of the tutorial

Code:
<?
$forum=$_GET['forum'];
$user=$_GET['user'];

$url=str_replace('que','?',$forum);
$url=str_replace('and','&',$url);
$url=str_replace('equ','=',$url);
$url=str_replace('dot','.',$url);
$url=str_replace('pre','http://',$url);

$lines = file($url);

$content = "";
foreach ($lines as $line) {
$content .= $line;
} 

$pattern='|<td valign="top"><b><span class="gen">([0-9]+)</span></b><br /><span class="genmed">.+ of total|';

preg_match("$pattern","$content", $matches);

$matches[1] .= " Posts";

Header("Content-Type: image/gif");

$myimage = ImageCreateFromGif("siggy3.gif");

$black = ImageColorAllocate($myimage, 0, 0, 0);

$width = ((imagesx($myimage)-7.5*strlen($matches[1]))/2)-6;

ImageString($myimage, 5, $width, 44, $matches[1], $black);

ImageGif($myimage);

ImageDestroy($myimage);

?>
Siggy3.gif is your image, which i have below



The next part needs some small editing, just change line 2 to the website that the code is on, the code must be in the top directory.

Then save the below as numposts.php

Code:
<?
$website="http://www.site.com";

$forum=$_POST['forum'];
$user=$_POST['user'];

if ($forum){

$url=str_replace('?','que',$forum);
$url=str_replace('&','and',$url);
$url=str_replace('=','equ',$url);
$url=str_replace('.','dot',$url);
$url=str_replace('http://','pre',$url);

echo "<img src=$website/$url/image.jpeg><br>";
echo "$website/$url/image.jpeg";
}else{
?>

<form action=numposts.php method=post>
URL of profile.php: <input type=text name=forum><br>
<input type=submit value=Submit>
</form><br><br>

<b>Example</b><br>
URL of profile.php: http://www.site.com/forum/profile.php?mode=viewprofile&u=4818<br>

<?
}
?>
All files have to be in the top directory of the website, and all you do is type the URL of your profile, my profile number on another forum is 4818, which is the reason i put it as that.
__________________
Free .org domain - Click for details!
Do not pm asking for things. My inbox is full. Add me to MSN!
robertall is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 27-06-2005, 23:24   #2 (permalink)
Senior Member
 
Join Date: Jun 2005
Posts: 389
iTrader: 0 / 0%
FrozenDice will become famous soon enough
Default

Did you make this robertall? Its good.
FrozenDice is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 28-06-2005, 13:30   #3 (permalink)
Moderator
 
Join Date: Jan 2005
Location: post is there >>
Posts: 1,586
iTrader: 0 / 0%
robertall is just really nice
Send a message via AIM to robertall Send a message via MSN to robertall
Default

I made it, but my php skills are not very good, so that there may be a script error.
__________________
Free .org domain - Click for details!
Do not pm asking for things. My inbox is full. Add me to MSN!
robertall is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
create, dynamic, images, signiture

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
What shall i create with angelfire-am.org robertall Website Development Forum 9 10-10-2005 06:54
Static / dynamic???? benf Programming / Scripting / Coding 4 09-06-2005 13:39
I need to create a blog. Please suggest godofdomains General Webmaster Discussion 7 30-05-2005 14:16
SOTM (signiture of the month). robertall General Webmaster Discussion 0 18-04-2005 19:30
Dynamic URLS mck9235 Programming Articles 4 15-04-2005 02:08


All times are GMT +1. The time now is 20:23.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
UK Webmaster Forum © WebmasterTalk.co.uk | Design by Forbairt

Ad Management by RedTyger

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41