KuroNoMango said: The most bad-ass Santa Claus has ever been depicted, Kyouran Kazoku Nikki's Santa can rip off his clothes by flexing his muscles, can survive a direct hit from a Stinger and has the ability to shoot energy balls created from his hands. It seems that the only thing that can defeat him is Kyouka, the omnipotent God.
You could add a stroke to it. Though a lot of my sigs have unreadable updates, so maybe I shouldn't be giving you ideas. :S
I'll try it. If doesn't turn out how I want to I think I'll just leave it alone.
Want the script thing for the stroke?
That would be nice :D
<?php
/********************************************************************
* saka's minimal signature script - v1.21
* http://myanimelist.net/forum/?topicid=84446
* This code may be reused under the terms of the Creative Commons License (Attribution+NonCommercial+ShareAlike)
* http://creativecommons.org/licenses/by-nc-sa/3.0/
*********************************************************************/
// specify the rss feed you want to use (see the bottom left of your MAL profile page)
$user = "kyrori"; // YOUR USERNAME
$url = "http://myanimelist.net/rss.php?type=rw&u=".$user;
// let's configure the cache
$cachedpath = "cache/sig.png"; // a temporary copy of your signature will be stored here at the end
check_cache(10); // time to cache signature in minutes, comment out this line for testing but put it back afterward!
// IMPORTANT: YOUR 'cache' DIRECTORY MUST EXIST AND BE WRITABLE ON THE SERVER!!! (chmod 777 or change file properties using FTP)
// * By default, the image only updates at most every ten minutes, but for testing/building your sig you may want to disable the cache by
// commenting out the check_cache(...) line above (just add two slashes at the beginning of the line). Once your sig is working how
// you'd like, put the cache check back in. I do not recommend leaving the cache disabled or setting it for less than 5 minutes, since
// too low a setting can bombard MAL with lots of RSS requests and may also piss off your host.
// * You can set your forum signature to use , and this file will output your signature image, or
// you can alternatively link to and have a cronjob visit the php url every few minutes
// try to correct environment path
@chdir(realpath(dirname($argv[0])));
///////////////////////////////////////////////////////////////////////////////////////////
// PARSING THE RSS FEED AND EXTRACTING DATA
$buffer = file_get_contents("$url"); // download the feed
if ( !($buffer) ) die("Could not download RSS feed");
// now we have to sanitize the information we saved to the buffer (no newlines/tabs and replace xml entities)
$buffer = strtr($buffer, array("\n" => '', "\r" => '', "\t" => '', '<' => '<', '>'=>'>', '&' => '&', '"' => '"', '''=>"'") );
// these lines just extract the anime title and status information into $titles[] and $status[] arrays, plus other info
preg_match_all("/<item><title>([^<]*)<\/title>/i", $buffer, $titlematches);
preg_match_all("/<description>([^<]*) - ([\d?]+) of ([\d?]+) (episodes?|chapters?)<\/description>/i", $buffer, $statusmatches);
$titles = $titlematches[1]; // $titles is now an array of titles
$status = $statusmatches[1]; // $status is now an array of statuses
$current = $statusmatches[2]; // $current is now an array of all the current episodes
$totals = $statusmatches[3]; // $totals is now an array of all the episode totals
// let's go through the whole list and format them how we want
for($i = 0; $i < count($titles); $i++) {
// FORMAT THE TITLE VALUES
// just remove all that junk at the end
$titles[$i] = preg_replace('/ - (TV|Movie|ONA|OVA|OAD|Special|Manga|Manhwa|Manhua|Novel|One Shot|Doujin|OEL)$/', '', $titles[$i]);
// limit the titles to 25 characters; you can adjust this to your needs
$titles[$i] = textlimit($titles[$i],18);
// FORMAT THE STATUS VALUES - you can change the format as you like
// lets format the strings to look like "watching @ 11/26" for watching, and only show status for the rest
if ($status[$i] == "Watching" or $status[$i] == "Rewatching") {
$status[$i] = "$status[$i] @ $current[$i]/$totals[$i]";
} else { // "Completed, "Plan to Watch", "Dropped", or "On Hold"
$status[$i] = "$status[$i]"; // doesn't do anything as is, but feel free to change it
}
$status[$i] = strtolower($status[$i]); // make all the statuses lowercase
}
///////////////////////////////////////////////////////////////////////////////////////////
// LET'S START GENERATING THE SIGNATURE IMAGE
$sigimage = open_image("sig.png"); // load your background image
// WRITE THE TEXT ONTO THE IMAGE
$font = 'visitor2_0.ttf'; // if you use another font, make sure you copy the *.ttf file into the same directory
// draw the text - the template is imagettftext(image, font size, angle, x-pos, y-pos, font color, fontfile, text output, 'c' or 'l' or 'r')
$border = imagecolorallocate($sigimage,244,238,214);
$orange = imagecolorallocate($sigimage,246,190,124);
imagettfborder($sigimage,10,0,262,13,$border,$font,$titles[0], 1,'l');
imagettftextalign($sigimage,10,0,262,13,$orange,$font,$titles[0],'l');
imagettfborder($sigimage,10,0,276,26,$border,$font,$status[0], 1,'l');
imagettftextalign($sigimage,10,0,276,26,$orange,$font,$status[0],'l');
// OVERLAY ANOTHER IMAGE over the font and background (optional)
//overlay_image("overlay.png");
// finally, let's output our pretty signature image to the browser
header("Content-type: image/png");
imagepng($sigimage);
@imagepng($sigimage, $cachedpath); // try to save a copy of our signature to the cache location we set earlier
///////////////////////////////////////////////////////////////////////////////////////////
// Don't modify below here... just a few helping functions that can be called in the above code
// textlimit($string, $length) takes any $string you pass it and returns it shortened to $length characters (use it to limit title length)
function textlimit($string, $length=12) {
return (strlen($string)>$length ? trim( substr($string,0,$length-3) )."..." : $string);
}
// overlay_image($baseimage,$overlaypath,$x,$y) opens the image at $imagepath and overlays it onto $sigimage at position ($x, $y)
// most image types should work, but 24-bit/true color PNG is recommended if you need transparency
function overlay_image($overlaypath,$x=0,$y=0) {
global $sigimage;
$overlay = open_image($overlaypath); // open any image
imagecopy($sigimage, $overlay, $x, $y, 0, 0, imagesx($overlay), imagesy($overlay)); // overlay onto our base image
@imagedestroy($overlay); // clean up memory, since we don't need the overlay image anymore
}
// open_image($path) will load an image into memory so we can work with it, and return an error if we fail
function open_image($path) {
$image = @imagecreatefromstring(file_get_contents($path));
if (!$image) die("could not open image ($path) make sure it exists");
imagealphablending($image,true); imagesavealpha($image,true); // preserve transparency
return $image;
}
// check_cache($minutes) returns a cached image and stops execution if $minutes has not passed since the last update
function check_cache($minutes) {
global $cachedpath;
if ( !( is_writable($cachedpath) or is_writable(dirname($cachedpath)) and !file_exists($cachedpath) ) )
die("The cache is not writable; please change it to 777 permissions using FTP.\n$cachedpath = {$cachedpath}");
if ( time() - @filemtime($cachedpath) < 60*$minutes ) {
header("Content-type: image/png");
echo file_get_contents($cachedpath);
exit(0);
}
}
// imagettftextalign() is basically a wrapper for imagettftext() to add the ability to center/right-align text to a point
// the $align argument can be 'c' for center, 'r' for right align, or 'l' for left align (default)
function imagettftextalign(&$img,$size,$angle,$x,$y,&$c,$font,$string,$align='l') {
$box = imagettfbbox($size,$angle,$font,$string);
$w = $box[2] - $box[0];
$h = $box[3] - $box[1];
switch (strtolower($align)) {
case 'r': $x -= $w; $y -= $h; break;
case 'c': $x -= $w/2; $y -= $h/2; break;
}
imagettftext($img,$size,$angle,$x,$y,$c,$font,$string);
}
?>
?_?||Mo <3: squrrriles kidnapped her let's eat theree nuts||♪♫♪
Uhmm yeah just change this part:
$border = imagecolorallocate($sigimage,244,238,214); border color
$orange = imagecolorallocate($sigimage,246,190,124); what the font color is
imagettfborder($sigimage,10,0,262,13,$border,$font,$titles[0], 1,'l'); make sure the x & y coordinates of the imagettfborder & imagettftextalign are the same
imagettftextalign($sigimage,10,0,262,13,$orange,$font,$titles[0],'l');
imagettfborder($sigimage,10,0,276,26,$border,$font,$status[0], 1,'l');
imagettftextalign($sigimage,10,0,276,26,$orange,$font,$status[0],'l');
?_?||Mo <3: squrrriles kidnapped her let's eat theree nuts||♪♫♪