Gif is cool for little animation but as saka said do you really need it for sig? plus gif doesnt really like transparency:
in opposite to APNG ^_^
But Thanks God not all browsers support it and even PNG Team abandoned it. This is fast example how you can abuse animation and make people blind or worse ! :P
There's probably some errors or warnings that are trying to display, but the browser sees the image data and buries it in the broken image. Try commenting out the imagepng($image, "aikiku.png"); line and see if you get any text output.
Also, make sure the png's you are using are 24-bit pngs so they have true color. Functions like imagecolorexact() that i see around here can fail on palletted images (like 256 color pngs). I recommend to all users of this script to replace imagecolorexact() with imagecolorallocate(), which works identically and is more dependable.
I've tried open the file with Firefox, and it did tell me the image has some errors. But i don't really get what you say, does commenting do anything to the script ? I also used imagecolorallocate but nothing happens. Tried using this tut but still failed.
the script you're using doesn't have particulary good error reporting... If it spits out an error or warning that isn't fatal, it might still return some image data (after the error).
since the browser sees the image data there, it still tries to display it as an image, even though the error string corrupted it...
commenting out the image output temporarily should help you figure out what the error was. Just put the imagepng(...) line back again after you fix the error (when you just get a blank page without errors).
i have little problem... i want to add overlay to the output image but idont know how. i tried to add this after manga-output: $image = imagecreatefrompng("overlay.png"), but its not working. anybody have idea how to do this?
Open a browser of your choice and open the url: 'yoursite.com/signature/sig_creator.php'
If your host matches all requirements, and you have done everything right, you should see something like this:
I keep getting file not found.
I ftp the files to signature and I did the chmods.....
my site roxkis.comuf.com/signature/sig_creator.php
All of you who don't know to code and don't want to go through the trouble finding a decent 'free' hoster and setting up a script on their own: use dygnatus.......it's if not perfect a good, solid solution that will satisfy you're basic needs.
regards
Luck is the last dying wish of those who wanna believe that winning can happen by accident, sweat on the other hand is for those who know it's a choice, so decide now because destiny waits for no man.
gr33nhippo said: Don't believe I changed that much around... anyways, thanks for any help :)
I bet that period at the very end is screwing up the output. Anything outside the <?php ... ?> tags is considered straight text output. Delete the period and firefox should be able to properly recognize that it's image data.
edit: nevermind, i guess those mark the newlines. *looks closer*
Cezska said: Um...Can someone teach me how to enable allow_url_fopen? I'm new to php. I'm using the web44.co.cc free hosting.
you cannot enable it... it is a setting in the php.ini for the entire server and only your host can set it for you. If it's not already on, though, they will almost certainly not enable it for you since it can be a security risk when used improperly.
Your host might only allow cURL, in which case you can use Talon or Bard's script instead... you may want to ask your host if they allow outgoing connections for RSS feeds and such using cURL and/or fopen, or switch to a host that does.
edit: I just made an account there. They do in fact allow cURL.
also, I can confirm that fopen is disabled there. So you can still run a signature script, but you cannot use shiteiru/ehrgeiz's script. I would recommend Talon's: http://myanimelist.net/forum/?topicid=32704
...or you can just make an account on a service that does allow remote fopen(), like 000webhost for example.
I originally wanted to use 000webhost but I end up not using it because I have to download something just for ip confirmation. And I'm afraid that the "ip_comfirm.exe" might contain malware or something. I found a blog talking about 000webhost "ip_comfirm.exe". http://hype-free.blogspot.com/2009/01/000webhostcom-trying-to-install-malware.html
Btw, how does allow_url_fopen do or help in signature script?
>< I'm a total newbie!
Anyone know a hosting site that fulfill all the requirements?
000webhost is not so bad... but a cheap paid host is better. I don't think the ip program thingy has any malware on it.... I signed up before they required it so i never had the problem.
it's just easier on the programmer to use fopen... because you can open a url like a file... for example:
It won't be horribly simple, but it's doable. You'll have to have some way to tell whether an update is from the manga feed or anime feed....
Option 1: you can keep a $type[] array or marker for each feed that just stores whether each update is anime or manga. every time you add an entry, add it's type (anime/manga) to the array before merging the feeds together. Then you can use that to select which image to use later after you merge them.
Option 2: since you've only got one update, it's easiest to just parse each feed separately, then compare the timestamps on each to see which one is newer. If anime feed has newer time on first element, use anime image.... else use manga image.
you can use php's strtotime() to convert the dates in the rss feed to timestamps for comparison.
either way you have to modify how the feed is parsed, so I don't recommend this script.... even my minimal script would need some modification... It's an neat idea, so I'd be willing to help you accomplish it.
Well I'm trying for few days to create my custom sig, but still I end failing. Today I saw "saka's minimal script" and I decided to create my sig using this (it's very well written, especially for PHP noob like me). Yet still I end up getting error, when I try to run my sig. Here's my code:
#
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);
#
return $image;
#
}
#
function check_cache($minutes) {
#
global $cachedpath;
#
if (file_exists($cachedpath) and time() - @filemtime($cachedpath) < 60*$minutes) {
#
header("Content-type: image/png");
#
echo file_get_contents($cachedpath);
#
exit(0);
#
}
#
}
#
?>
And now I'm just stupid, am I doing something wrong in scrypt, or is the hoster crashing my sig? (I'm using 000webhost.com) Could any more experienced user look through my code and tell me what's wrong, please?
you're probably getting a parsing error.... just remove all the #'s in your code if they are actually there (global replace in your text editor should handle it).
btw... it's better to just ask in the thread for my script if you have questions.
edit: also... there are various other things wrong with it the way you posted... the $url and $font have to point to actual file locations. You need a font in the same directory, and the $url needs to point to a valid mal rss feed.
000webhost admin reviews usually don't last more than a couple hours. Also, they only really happen if you trip one of their "that might be suspicious" sensors... usually after you've uploaded a lot of code. Once it's over, you should not experience them again until next time you make a lot of changes.
The review process does disable the running of php code during the review... which is one reason I link my signature directly to my signature's cached output image. This way if my site goes under review for whatever reason, my sig still works (but just doesn't update until the review is over)
saka said: 000webhost admin reviews usually don't last more than a couple hours. Also, they only really happen if you trip one of their "that might be suspicious" sensors... usually after you've uploaded a lot of code. Once it's over, you should not experience them again until next time you make a lot of changes.
The review process does disable the running of php code during the review... which is one reason I link my signature directly to my signature's cached output image. This way if my site goes under review for whatever reason, my sig still works (but just doesn't update until the review is over)
oh ok... well i did a lot of updates thats for sure XD
and how do i find the link to the cached signature? O_O
SoraQuasar said: how do i find the link to the cached signature? O_O
Your script has to be set to save a copy. At the end of your script there should be a line similar to....
imagepng($image);
I believe it's in image_output.php in ehrgeiz's script. This line outputs the image data to the browser. If you add a filepath as a second parameter, the script can try to save the signature image as a file instead. Just make a copy of that line and change it to look like this:
imagepng($image); // copy for the browser when accessing sig.php
imagepng($image,"cache/sig.png"); // try to save a copy to file as well
and the script will try to save the png image to a cache folder in the same directory.
The tricky part is that you have to make sure that the location you're trying to save to is writable by the webserver. You can set this using an FTP client like FileZilla by connecting to your server and right clicking on the folder--choose file permissions, and set it writable by everyone (numeric code 777). I made an empty cache folder and set 777 permissions on that, but you could just make a blank sig.png file in the same directory as your script and set the 777 permissions just on that single image file.
If you've followed me this far, then now every time you visit your main sig.php.... your script should save a copy of the image. We can now just set our forum options to use the image for our signature... so that
The only remaining problem is that our PNG version won't get updated unless something visits sig.php to update it.... :(
To do that, we can setup a cronjob to visit the php location every 10 minutes or so.... or if you use mal updater, you can utilize its PHP Signature plugin to access the url each time you watch a new episode.
...sorry you asked? ;P
Doing it this way is a little bit more work (since you need a writable folder and cronjob).... but it's a lot easier on both MAL and the host since otherwise you download the rss feed and generate the image every single time somebody loads a forum thread you've posted in.... not good.
the GD image library does not have built in support for animated gifs. You'll have to learn how to use ImageMagick (assuming your host supports it) or the gifsicle executable to merge the frames together outside of php.
There is also an image library in native php on phpclasses.net, but I don't recommend it as it's not as efficient.
If the background won't be constantly changing, then the easiest solution is just to overlay all the gifs beforehand into separate files using photoshop or any gif editor, and then just return the final image data based on the random number. Something like:
I would be wiling to help you out. I'm buried in busy work atm, but I'd like to make something even nicer than dygnatus, based on my own signature library. I've found dygnatus a bit underwhelming, though it is handy for users who are not php-savvy.
I have some kind of layered interface in mind where you could just choose the next objects to overlay, and you can reorder them with drag and drop. Just start with a background, then overlay a text layer, a small image, or anything else. I would certainly be willing to collaborate with others to make it a reality.
It's unfortunate that we have duplicate skillsets, but it'd be great if we could work together sometime. Keep me in mind if you decide to go through with it.
If I start on it, what I'll do is have the backend done, and stick everything in a standard html form set, then we can get the javascript going to manipulate the form values.
"if the show is good i couldn't care less if hitler directed it and the production values was a banana." - Salsk
I've already got a decent signature library going, and nice and modular. That's not so hard to do.... It's the interface that's the most difficult to do right (and also the most important). If it's not graphical, I don't think it's worth building. I want a real-time preview, or at least something close. Otherwise, just leave it to GreatS and dygnatus.
I could more easily make a script to make 'sliced' signatures graphically and output the needed mal settings and slices. That might be a good leadup project to test the waters. Then at least people wouldn't need to go out and pirate photoshop just for a slice tool.
(Note:with a standard ftp-client you can change a files/folders chmod like that: right click on a file or folder, choose 'chmod' in the appearing contextmenu.The rest should be self-explanatory)
Open a browser of your choice and open the url: 'yoursite.com/signature/sig_creator.php'
In the first/earlier version it is called sig_creator.php... For the newer version (v2) you should point your forum signature to sig.php instead. So probably something like this:
saka said: I've already got a decent signature library going, and nice and modular. That's not so hard to do.... It's the interface that's the most difficult to do right (and also the most important). If it's not graphical, I don't think it's worth building. I want a real-time preview, or at least something close. Otherwise, just leave it to GreatS and dygnatus.
I could more easily make a script to make 'sliced' signatures graphically and output the needed mal settings and slices. That might be a good leadup project to test the waters. Then at least people wouldn't need to go out and pirate photoshop just for a slice tool.
Ah, I see. Hm could we use Python for the graphical interface, and just have it output PHP for the signature? I know I could do that in a desktop application, but I'm not sure how exactly I'd make it work on a server.
"if the show is good i couldn't care less if hitler directed it and the production values was a banana." - Salsk
There are ways to use python as cgi, but it's not as well supported. I think php and JQuery or mootools for the interface should work quite nicely. No download hassle, GD calls are nice and simple... and my library is already in php. :-/
I'm having problems with my signature, I'm able to use the script and managed to make my signature to update correctly but it doesn't seem to be able to direct/link people to my anime list. So I wanted to know how to fix this, can someone help me please?
saka said: There are ways to use python as cgi, but it's not as well supported. I think php and JQuery or mootools for the interface should work quite nicely. No download hassle, GD calls are nice and simple... and my library is already in php. :-/
Yeah I'm not THAT big of a Python fan to begin with anyways. Unfortunately I'd really not be much help with this though, I know very little about JQuery.
"if the show is good i couldn't care less if hitler directed it and the production values was a banana." - Salsk
Thanks so much for this awesome tutorial! :]
I was able to make my very first PHP sig:
But I have a question.
For one of my future sigs, I'm planning to make one where the text is like sideways kinda.
So can anyone tell me how to change the angel of the text in your PHP sigs?
iMeasy said:
But I have a question.
For one of my future sigs, I'm planning to make one where the text is like sideways kinda.
So can anyone tell me how to change the angel of the text in your PHP sigs?
I think to change the angle go to the imagefttext part, and it's after font size. I just put in 90 and tested it a while ago and it worked. I'm really new at this though... I would post a screenshot if my site wasn't under review.
Does anyone know of an alternative to 000webhost? Or should I just make a new account?
kyroriJul 20, 2009 11:49 AM
?_?||Mo <3: squrrriles kidnapped her let's eat theree nuts||♪♫♪
iMeasy said:
But I have a question.
For one of my future sigs, I'm planning to make one where the text is like sideways kinda.
So can anyone tell me how to change the angel of the text in your PHP sigs?
I think to change the angle go to the imagefttext part, and it's after font size. I just put in 90 and tested it a while ago and it worked. I'm really new at this though... I would post a screenshot if my site wasn't under review.
Does anyone know of an alternative to 000webhost? Or should I just make a new account?
Thank you Thank you Thank you! :3 It worked
(took me a while to get the right angel I wanted though) xD