Overly Chatty Penguins

The Ready Room => Media => Topic started by: devicenull on August 30, 2004, 05:54:22 PM

Title: So, Anyone Wanna Make Me A Sig?
Post by: devicenull on August 30, 2004, 05:54:22 PM
Basically I know what I'm looking for, I just suck with image stuff
very light grey background, silverish cylinders on the left and bottom, with some kind of ball at the joint, dunno about color, whatever.  "devicenull" in the bottom left corner, the rest will be filled in by my php stuff :)

So anyone who wants to make this for me, that would be nice :p
Title: So, Anyone Wanna Make Me A Sig?
Post by: Legionnaired on August 30, 2004, 09:46:34 PM
Working now Grimm, hands off.

KK, done. Lossless PNG for the win. Can export to any format, still have the source, and can play with the lighting whenever.
Title: So, Anyone Wanna Make Me A Sig?
Post by: devicenull on August 31, 2004, 05:51:19 PM
Very nice, exactly what I wanted, except for one minor thing
The stuff outside the cylinders, can that be transparent?
Title: So, Anyone Wanna Make Me A Sig?
Post by: Satiagraha on August 31, 2004, 07:29:52 PM
Hey dev, could you send me that script? I'd like to take a look at it ^_^
Title: So, Anyone Wanna Make Me A Sig?
Post by: devicenull on August 31, 2004, 08:32:21 PM
Once I figure out how to wrap the stuff better (It works on my local server, not on my test server)
Here's the code though

Code: [Select]
<?php
//Released under GPL
//Copyright (C) 2004 devicenull (darkmage at snet dot net)
header("Content-type: image/png");
$sql_host = "127.0.0.1";
$sql_user = "";
$sql_pass = "";
$sql_db = "";

$sql_user = "root";
$sql_pass = "starfox";
$sql_db = "site";

$font = "./verdana.ttf";
$y_start = 0;
$fsize = 8;
$max_width = 400;

//Open connection for post count
$link = mysql_connect($sql_host, $sql_user, $sql_pass)
    or die("Could not connect : " . mysql_error());
mysql_select_db($sql_db,$link)
  or die("Could not select database");
//If the table doesnt exist, create it
$query = "CREATE TABLE IF NOT EXISTS `ip_log` (`id` INT(11) NOT NULL auto_increment, `ipaddress` VARCHAR(64) NOT NULL, `count` INT(11) NOT NULL, PRIMARY KEY (`id`)) TYPE=MyISAM;";
mysql_query($query,$link);  

$ip = $_SERVER['REMOTE_ADDR'];
  
//Get random quote
$quotes_array = file("./quotes.txt");
$quote = array_rand($quotes_array);
if ($quotes_array[$quote] == "IP_ADDR") {
  $quotes_array[$quote] = "Hi ".$ip;
}

//Get IP count
$res = mysql_query("SELECT * FROM `ip_log` WHERE ipaddress='".$ip."'",$link);
if (mysql_num_rows($res) == 0) {
  mysql_query("INSERT INTO `ip_log` VALUES ('','".$ip."',1)",$link);
  
  $count = 1;
} else {
  $row = mysql_fetch_row($res);
  $count = (int)$row[2];
  $count++;
  $id = $row[0];
  $query = "UPDATE `ip_log` SET count='".$count."' WHERE id='".$id."'";
  mysql_query($query,$link);
  mysql_free_result($res);
}

$text = "You have read ".$count." of my posts";


//----------------------------------------------------------------------
//      Image Generation
//----------------------------------------------------------------------

//imagettfbbox ( float size, float angle, string fontfile, string text)
// 6,7-----------------4,5
// |     |
// 0,1-----------------2,3
//imagefilledrectangle (image, int x1, int y1, int x2, int y2, int color)
//imagettftext (image, float size, float angle, int x, int y, int color, string fontfile, string text)
//$im  = imagecreate($width, $height);

$quotes_array[$quote] = wordwrap($quotes_array[$quote],65,"\n");

$im = imagecreatefrompng("sig_img.png");
//$bg = imagecolorallocatealpha($im, 255, 255, 255, 127);
$fg = imagecolorresolve($im, 0, 0, 0);

imagettftext($im, $fsize, 0.0, 33, 15, $fg, $font, $quotes_array[$quote]);
imagettftext($im, $fsize, 0.0, 200, 48, $fg, $font, $text);

imagepng($im);
imagedestroy($im);
?>
Title: So, Anyone Wanna Make Me A Sig?
Post by: Legionnaired on August 31, 2004, 08:53:18 PM
Done.

Updated image in top post.
Title: So, Anyone Wanna Make Me A Sig?
Post by: devicenull on September 01, 2004, 05:49:59 PM
You forgot to click upload, I think
Title: So, Anyone Wanna Make Me A Sig?
Post by: Legionnaired on September 02, 2004, 12:34:42 AM
You can't prove that.
Title: So, Anyone Wanna Make Me A Sig?
Post by: devicenull on September 02, 2004, 01:39:25 PM
Thanks, that looks very good :)
Title: So, Anyone Wanna Make Me A Sig?
Post by: lolfighter on September 04, 2004, 07:24:40 AM
Today I have read two of your posts. Yesterday it was three, and a little while back it said nine. Your code-fu is weak, grasshopper.
Edit: And right after I made this post, your sig broke. GG. :p
Title: So, Anyone Wanna Make Me A Sig?
Post by: Malevolent on September 04, 2004, 10:05:08 AM
lolfighter, same for me. Except it's been 1 post forever. Don't know if Firefox is doing it or what. At least it's transparent?

EDIT: Wait no, it just went to 2! :p
Title: So, Anyone Wanna Make Me A Sig?
Post by: devicenull on September 04, 2004, 12:01:47 PM
I suspect firefox is blocking the referrer header, but I haven't really tested it though
Title: So, Anyone Wanna Make Me A Sig?
Post by: Satiagraha on September 04, 2004, 01:14:37 PM
The sig is working fine for me, and I use FireFox. I'm at 4. Before you reset it (before you had the image) I was up to 20 something
Title: So, Anyone Wanna Make Me A Sig?
Post by: lolfighter on September 05, 2004, 06:39:44 AM
The sig is down to 1 now for me. Looks like it's counting backwards. XD
Title: So, Anyone Wanna Make Me A Sig?
Post by: Dark on September 05, 2004, 09:03:30 AM
i'm at 12 now though before i was at 25 or so

anyways it looks great
Title: So, Anyone Wanna Make Me A Sig?
Post by: Clashen on September 05, 2004, 10:40:45 AM
I'm at 3, guess it is cause i always use Back on ze brovzer.
Title: So, Anyone Wanna Make Me A Sig?
Post by: Satiagraha on September 05, 2004, 05:48:43 PM
Eet's gawn :(

BRING IT BACK!

It was working properly for me. Maybe it's because I never use the back button :p
Title: So, Anyone Wanna Make Me A Sig?
Post by: devicenull on September 06, 2004, 09:49:04 AM
I never got rid of it.. I think my host had some dns problems in the last few days
Title: So, Anyone Wanna Make Me A Sig?
Post by: Black Mage on September 07, 2004, 08:42:43 AM
worked fine in ff, stuck at 1 in ie (different comp)

bm <3's your quotes list thing

edit: nevermind, ie's f5 doesn't bypass cache. works fine in ie and ff
Title: So, Anyone Wanna Make Me A Sig?
Post by: devicenull on September 07, 2004, 01:13:49 PM
It should not be cached at all
There are 3 headers in the image that *should* prevent it from ever being cached :)
Title: So, Anyone Wanna Make Me A Sig?
Post by: Black Mage on September 09, 2004, 09:15:27 AM
unless the school systems are just that fast, it was drawn almost as fast as the text (which implies a cached image) on f5. also, the counter does not increase on f5 in ie (works fine on reply and topic --> parent --> topic)