brianjw
Newbie

Posts: 9
|
 |
« on: June 05, 2007, 11:20:03 PM » |
|
I would love to use this dynamic signature thing on my website. I have modified my gamer card and would like it to do something like this: -Where it says '-Username Here-' it actually displays the members display name (not username). -Where it says 'Rep' put the + and - karma of that member. -Where it says 'Posts' put the number of posts the member has made on the website. -Where it says 'Gender' put the image for the male or the female. -Where it says '-Latest 4 Arcade Games Played-' Put the 4 biggest images of arcade games possible and show the latest the member has played. -Where you see that avatar, put the members avatar. If they have no avatar display an image that says No Avatar and that goes with the colors of the sig. It looks like this.  I've already added the powered by in it and I am willing to pay for this. Let me know what you can do with this. I also would like this sig to be added to their signature automatically when they register and they can take it off if they want.  THANKS SO MUCH  Brianjw
|
|
|
|
« Last Edit: July 02, 2007, 10:13:00 PM by brianjw »
|
Logged
|
|
|
|
|
Daniel15
|
 |
« Reply #1 on: July 07, 2007, 08:58:04 PM » |
|
So, you want a custom-coded signature system for your site? It wouldn't really be powered by Dynamic-Sig.com anymore, would it? 
|
|
|
|
|
Logged
|
|
|
|
brianjw
Newbie

Posts: 9
|
 |
« Reply #2 on: July 08, 2007, 02:20:24 AM » |
|
So, you want a custom-coded signature system for your site? It wouldn't really be powered by Dynamic-Sig.com anymore, would it?  Yes I would like a custom coded signature. Ok, so should I remove the powered by? I will pay for this if you'd like as well 
|
|
|
|
|
Logged
|
|
|
|
Jacen
Newbie

Posts: 25
|
 |
« Reply #3 on: July 08, 2007, 02:37:40 PM » |
|
So, you want a custom-coded signature system for your site? It wouldn't really be powered by Dynamic-Sig.com anymore, would it?  It would if it's hosted here  (which defeats the purpose if I get what he wants  ) But other then that, I don't think it'd be too hard to write a mod/addon for SMF to do something like that, would it?
|
|
|
|
|
Logged
|
|
|
|
|
Daniel15
|
 |
« Reply #4 on: July 08, 2007, 04:23:28 PM » |
|
I made a post on the SMF Community Forum about this a while ago... My original post (from http://www.simplemachines.org/community/index.php?topic=173099.msg1105614#msg1105614) Here you go, an example script that does exactly this  . You'll need to save the "Verdana" font in your SMF directory as "verdana.ttf" (if you don't have it, get it from http://www.dynamic-sig.com/fonts/verdana.ttf). All the text it uses is in an array at the top (I did it this way to simplify the code, and to make the code easy to understand  ). To display more information, just add more elements to the array (check Sources/Load.php under // What a monstrous array... for a full list of everything you could use) <?php error_reporting(E_ALL); require('SSI.php');
// From php.net // Convert the results returned by imagettfbbox into useful results :). function fixbbox($bbox) { $xcorr = 0 -$bbox[6]; // northwest X $ycorr = 0 - $bbox[7]; // northwest Y $tmp_bbox['left'] = $bbox[6] + $xcorr; $tmp_bbox['top'] = $bbox[7] + $ycorr; $tmp_bbox['width'] = $bbox[2] + $xcorr; $tmp_bbox['height'] = $bbox[3] + $ycorr;
return $tmp_bbox; }
// Make sure we have a numeric ID. $_GET['id'] = (int) $_GET['id']; // Load this user's information. loadMemberData($_GET['id']); loadMemberContext($_GET['id']); // OK, I'm a little lazy... This is too hard to type out all the time :P $user = &$memberContext[$_GET['id']];
$text = array( // A line. array( // Segment of the line. array( 'colour' => array(0, 0, 255), 'text' => 'Username: ', ), array( 'colour' => array(0, 0, 0), 'text' => $user['name'], ), ),
array( array( 'colour' => array(0, 0, 255), 'text' => 'Member group: ', ), array( 'colour' => array(0, 0, 0), 'text' => $user['group'], ), ), array( array( 'colour' => array(0, 0, 255), 'text' => 'Registered: ', ), array( 'colour' => array(0, 0, 0), 'text' => $user['registered'], ), ), array( array( 'colour' => array(0, 0, 255), 'text' => 'Last Login: ', ), array( 'colour' => array(0, 0, 0), 'text' => strip_tags($user['last_login']), ), ), array( array( 'colour' => array(0, 0, 255), 'text' => 'Post count: ', ), array( 'colour' => array(0, 0, 0), 'text' => $user['posts'], ), ), );
// Font to use. $font = '/var/www/smf/1-1/verdana.ttf'; // Font size. $size = 9;
// Start with a blank image. $im = imagecreate(600, 300); // Or, start with a background image (comment line above, uncomment line below) //$im = imagecreatefrompng('frihost-irc-1.png');
// The background colour. // Whilst this will not be seen, it's used for antialiasing. $back = imagecolorallocate($im, 255, 255, 255);
// Make the image transparent. imagecolortransparent($im, $back); imagealphablending($im, true);
$y = 15; // Bounding box of sample line in this font $mainBound = fixbbox(imagettfbbox($size, 0, $font, "test text 123456789 QWERTYUIIOPASDFGHJKKLZXCVBNM")); // Get the height of the tallest letter in this font $incY = $mainBound['height'] + 1; // Loop through every line... foreach ($text as $line) { $nextPos = 0; $x = 10; // Every bit in this line. foreach ($line as $piece) { // The colour we need. $colour = imagecolorallocate($im, $piece['colour'][0], $piece['colour'][1], $piece['colour'][2]); // Output this bit of text. imagettftext($im, $size, 0, $x + $nextPos, $y, $colour, $font, $piece['text']); // Get its bounding box. $imageBound = fixbbox(imagettfbbox($size, 0, $font, $piece['text'])); // The next position. $nextPos += $imageBound['width']; } $y += $incY; }
// Disable caching header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past // A GIF is used so that the transparency works in IE. header ("Content-type: image/gif"); imagegif($im); imagedestroy($im); ?>
Access it like: http://yoursite.com/forum/signature.php?id=1If you want nice URLs, add this to a .htaccess file in your forum directory: RewriteEngine on RewriteRule ^sigs/([0-9]+).gif$ signature.php?id=$1
And then access it via http://yoursite.com/forum/sigs/1.gif  (the code is a hugely simplified version of the code used for the signatures on Dynamic-Sig.com, by the way  ) You could probably modify this to do what you want (I don't really have time to do that, though  ). Hope this helps you! 
|
|
|
|
« Last Edit: July 08, 2007, 04:25:08 PM by Daniel15 »
|
Logged
|
|
|
|
brianjw
Newbie

Posts: 9
|
 |
« Reply #5 on: July 09, 2007, 07:02:14 AM » |
|
I am not too farmiliar with modifying stuff like this and getting exactly what I want. I will wait as long as it takes for eventually your schedule to be free 
|
|
|
|
|
Logged
|
|
|
|
|
Daniel15
|
 |
« Reply #6 on: July 09, 2007, 02:07:48 PM » |
|
I am not too farmiliar with modifying stuff like this and getting exactly what I want. I will wait as long as it takes for eventually your schedule to be free  That will take a long time - I've always got stuff to do (I really need to work on SMFShop, I really haven't done anything on it since January this year)
|
|
|
|
|
Logged
|
|
|
|
brianjw
Newbie

Posts: 9
|
 |
« Reply #7 on: July 14, 2007, 10:20:29 AM » |
|
Ok you do that.  But maybe when you have some time lol do this 
|
|
|
|
|
Logged
|
|
|
|
brianjw
Newbie

Posts: 9
|
 |
« Reply #8 on: August 10, 2007, 07:14:59 AM » |
|
Do you have time lol? I really want this 
|
|
|
|
|
Logged
|
|
|
|
Blaster
Jr. Member
 
Posts: 85
|
 |
« Reply #9 on: August 18, 2007, 03:01:28 AM » |
|
Some very interesting ideas and thoughts. But you have to understand how long it takes and how much time he has. Daniel has a life you know 
|
|
|
|
|
Logged
|
First person to test out a dynamic sig... before this site was even up.
|
|
|
Jacen
Newbie

Posts: 25
|
 |
« Reply #10 on: August 21, 2007, 01:47:44 AM » |
|
If you really want it, learn PHP and do it yourself  I'm assuming Daniel has a life, friends, family, work, outside of Dynamic-Sig.com so... he might not have the time to do anything for this site. I'm not trying to sound mean or rude or anything... but understand that as programmers, we are NOT gods... we do have other responsbilities. (Even worse if Daniel is married  )
|
|
|
|
|
Logged
|
|
|
|
|
Daniel15
|
 |
« Reply #11 on: August 24, 2007, 06:00:13 PM » |
|
Even worse if Daniel is married ) Haha  I guess you don't know how old I am? Check my profile  I'm assuming Daniel has a life, friends, family, work, outside of Dynamic-Sig.com so... he might not have the time to do anything for this site. Yeah, school takes up heaps of my time... I don't have much time to work on this site or any of my other sites.
|
|
|
|
|
Logged
|
|
|
|
brianjw
Newbie

Posts: 9
|
 |
« Reply #12 on: September 17, 2007, 05:01:19 AM » |
|
Well I think I know a way to make it a little faster and easier on you. The following code looks almost exactly how I want my thing to work <?php error_reporting(E_ALL); require('SSI.php');
// From php.net // Convert the results returned by imagettfbbox into useful results :). function fixbbox($bbox) { $xcorr = 0 -$bbox[6]; // northwest X $ycorr = 0 - $bbox[7]; // northwest Y $tmp_bbox['left'] = $bbox[6] + $xcorr; $tmp_bbox['top'] = $bbox[7] + $ycorr; $tmp_bbox['width'] = $bbox[2] + $xcorr; $tmp_bbox['height'] = $bbox[3] + $ycorr; return $tmp_bbox; }
// Make sure we have a numeric ID. $_GET['id'] = (int) $_GET['id']; // Load this user's information. loadMemberData($_GET['id']); loadMemberContext($_GET['id']); // OK, I'm a little lazy... This is too hard to type out all the time :P $user = &$memberContext[$_GET['id']];
$text = array( // A line. array( // Segment of the line. array( 'colour' => array(0, 0, 255), 'text' => 'Username: ', ), array( 'colour' => array(0, 0, 0), 'text' => $user['name'], ), ),
array( array( 'colour' => array(0, 0, 255), 'text' => 'Member group: ', ), array( 'colour' => array(0, 0, 0), 'text' => $user['group'], ), ), array( array( 'colour' => array(0, 0, 255), 'text' => 'Registered: ', ), array( 'colour' => array(0, 0, 0), 'text' => $user['registered'], ), ), array( array( 'colour' => array(0, 0, 255), 'text' => 'Last Login: ', ), array( 'colour' => array(0, 0, 0), 'text' => strip_tags($user['last_login']), ), ), array( array( 'colour' => array(0, 0, 255), 'text' => 'Post count: ', ), array( 'colour' => array(0, 0, 0), 'text' => $user['posts'], ), ), );
// Font to use. $font = '/var/www/smf/1-1/verdana.ttf'; // Font size. $size = 9;
// Start with a blank image. $im = imagecreate(600, 300); // Or, start with a background image (comment line above, uncomment line below) //$im = imagecreatefrompng('frihost-irc-1.png');
// The background colour. // Whilst this will not be seen, it's used for antialiasing. $back = imagecolorallocate($im, 255, 255, 255);
// Make the image transparent. imagecolortransparent($im, $back); imagealphablending($im, true);
$y = 15; // Bounding box of sample line in this font $mainBound = fixbbox(imagettfbbox($size, 0, $font, "test text 123456789 QWERTYUIIOPASDFGHJKKLZXCVBNM")); // Get the height of the tallest letter in this font $incY = $mainBound['height'] + 1; // Loop through every line... foreach ($text as $line) { $nextPos = 0; $x = 10; // Every bit in this line. foreach ($line as $piece) { // The colour we need. $colour = imagecolorallocate($im, $piece['colour'][0], $piece['colour'][1], $piece['colour'][2]); // Output this bit of text. imagettftext($im, $size, 0, $x + $nextPos, $y, $colour, $font, $piece['text']); // Get its bounding box. $imageBound = fixbbox(imagettfbbox($size, 0, $font, $piece['text'])); // The next position. $nextPos += $imageBound['width']; } $y += $incY; }
// Disable caching header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past // A GIF is used so that the transparency works in IE. header ("Content-type: image/gif"); imagegif($im); imagedestroy($im); ?>
It just needs some modifying so it can display the arcade things and karma, etc. How would I modify the registration page so it autmatically has this sig when they register and they can take it off?
|
|
|
|
|
Logged
|
|
|
|
Jacen
Newbie

Posts: 25
|
 |
« Reply #13 on: September 19, 2007, 01:38:50 PM » |
|
Haha  I guess you don't know how old I am? Check my profile  Hey, I've known kids that got married about 14/15  (Rare through)
|
|
|
|
|
Logged
|
|
|
|
Blaster
Jr. Member
 
Posts: 85
|
 |
« Reply #14 on: September 23, 2007, 03:15:50 PM » |
|
I'm assuming Daniel has a life, friends, family, work, outside of Dynamic-Sig.com
yea he also has www.daniel15.com and www.dansoftaustralia.net
|
|
|
|
|
Logged
|
First person to test out a dynamic sig... before this site was even up.
|
|
|
|