Welcome Guest [Log In] [Register]
Welcome to Fearless Few [Forums]. We hope you enjoy your visit.


You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Sig Generation script; soon to be in main site.
Topic Started: Feb 3 2007, 11:17 PM (131 Views)
kanno41
Stuff..
Admin
Here is all of the code that it takes to make a sig generation script. I would recommend you not use it because it won't work anywhere else. :P

You will see a preview of it in use soon enough :wink:

Just proof that a LOT of work goes into something really simple.

Generation Form:
Code:
 

<form name='siggen'>


Name to go on sig:<input type="text" name="onsig"><br />
<input type="button" onClick="makeSig();" value="Create Signature">




</form>
<br /><br />
<div id="sig"></div>

<script>

function Request() {
if (window.XMLHttpRequest ) { return new XMLHttpRequest(); }
else if (window.ActiveXObject) {
try {
return new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
return new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
return false;
}
}
}
}

newrequest=Request();



function makeSig() {


var name = document.siggen.onsig.value;

var data = "name="+escape(name);
var opener = "/uploads/gens.php?" + data;
newrequest=Request();
newrequest.open("GET",opener,true);
newrequest.send(null);
showSig();
}


function showSig(){
newrequest=Request();
var url = 'http://site.fearlessfew.com/uploads/getfile.php';
newrequest.onreadystatechange = grabJaxData;
newrequest.open("GET",url,true);
newrequest.send(null);

}



function grabJaxData(){
if(newrequest.readyState == 4 && newrequest.status == 200){
var addedjax = newrequest.responseText;
var jaxhold2 = document.getElementById('sig');
jaxhold2.innerHTML = addedjax;
}
}


</script>



Create the sig:
Code:
 

<?php


$im = imagecreatefrompng("membertagbrown.png");
$font = 'visitor1.ttf';
$text = $_GET['name'];

// Create some colors
$white = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);
$blue = imagecolorallocate($im, 0, 128, 128);



imagettftext($im,7, 0, 121, 12, $black, $font, $text);
imagettftext($im,7, 0, 119, 12, $black, $font, $text);
imagettftext($im,7, 0, 120, 12, $black, $font, $text);
imagettftext($im,7, 0, 120, 15, $black, $font, $text);
imagettftext($im,7, 0, 120, 13, $white, $font, $text);


header("Content-type: image/png");


for ($i=1; file_exists("sig".$i.".png"); $i++) {}

imagepng($im,"sig".$i.".png");
imagepng($im);




imagedestroy($im);
?>


Display the sig just made:
Code:
 

<?php



for ($i=0; file_exists("sig".$i.".png"); $i++) {}
$b = $i-1;
echo "<img src='http://site.fearlessfew.com/uploads/sig".$b.".png' /><br />";
echo "BBCode:[img]http://site.fearlessfew.com/uploads/sig".$b.".png[/img]";

?>
Offline Profile Quote Post Goto Top
 
iheartNJ
Unregistered

You should add previews and multiple sigs on a page so people don't always get the one that I saw earlier. That's just my two cents though.
Quote Post Goto Top
 
kanno41
Stuff..
Admin
iheartNJ
Feb 4 2007, 12:15 am
You should add previews and multiple sigs on a page so people don't always get the one that I saw earlier. That's just my two cents though.

I know. I was just testing the basics off it just to see if it would actually generate the image.


Thanks though.
Offline Profile Quote Post Goto Top
 
Lostgamer
Unregistered

I dont understand any of that do I need too?
Quote Post Goto Top
 
Anti-Bunny
Unregistered

php and java... and action scripting... all eat my brain alive.

This is a sign that I must learn you're gibberish.
Quote Post Goto Top
 
kanno41
Stuff..
Admin
Anti-Bunny
Feb 4 2007, 01:41 pm
php and java... and action scripting... all eat my brain alive.

This is a sign that I must learn you're gibberish.

No, I don't do action scripting, that's flash :wink:

You are good with CSS though. It takes me forever to get it to look right.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Web-Design · Next Topic »
Add Reply