Forum Settings
Forums

Tutorial: Generating scripted-signatures (Version 2)

New
Pages (9) « First ... « 3 4 [5] 6 7 » ... Last »
May 8, 2009 2:40 PM

Offline
Dec 2007
106
Gif is cool for little animation but as saka said do you really need it for sig? plus gif doesnt really like transparency:



May 10, 2009 3:51 AM

Offline
Oct 2008
462
saka said:

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.
May 10, 2009 10:07 AM

Offline
May 2008
4052
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 am a banana.
May 10, 2009 12:15 PM

Offline
May 2008
617
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?
May 10, 2009 12:35 PM

Offline
May 2008
4052
assuming your base graphic is a 24-bit PNG, and the image you're overlaying is also, you can do something like this:



just adapt those lines to your own code, and it should work out. You don't need the first line to load the base image, since it's already loaded. ;)

I am a banana.
May 10, 2009 12:49 PM

Offline
May 2008
617
working 100% fine. thanks^^
May 10, 2009 7:46 PM

Offline
Sep 2007
530
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

help?
May 10, 2009 7:58 PM

Offline
May 2008
4052
@Roxkis... make sure you uploaded into the public_html folder?

I am a banana.
May 10, 2009 8:02 PM

Offline
Sep 2007
530
saka said:
@Roxkis... make sure you uploaded into the public_html folder?

No I did not....

It works now thanks so much..
May 10, 2009 8:30 PM

Offline
Sep 2007
530
Is there a way to remove the word "episodes" out of the text?
May 10, 2009 9:14 PM

Offline
May 2008
4052
there is indeed. something like this:
str_replace(' episodes','',$somestringcontainingthefullstatus);

I am a banana.
May 10, 2009 10:01 PM

Offline
Sep 2007
530
saka said:
there is indeed. something like this:
str_replace(' episodes','',$somestringcontainingthefullstatus);



Thanks alot i'll try it after they get done reveiwing my site...
May 11, 2009 2:38 AM

Offline
Apr 2008
78
To all of you who are using this script right now or are on the brink of using it:

i recommend using sakas verion. It's slim, clean and simple and should be very easy to use and setup.
Find sakas version here: http://myanimelist.net/forum/?topicid=84446

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.
Jun 7, 2009 3:24 PM
Offline
Jul 2018
561867
Hey, I'm following the stickied tutorial on creating scripted signatures and getting the following appear instead of a signature:



I'm using 000webhost (as suggested) + filezilla

Here is the code for settings.php and image_output.php

settings:


image_output:


Don't believe I changed that much around... anyways, thanks for any help :)


edit: my bad, was opening image_output.php instead of sig.php xD
removed-userJun 7, 2009 3:37 PM
Jun 7, 2009 3:34 PM

Offline
May 2008
4052
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*

I am a banana.
Jun 7, 2009 3:38 PM
Offline
Jul 2018
561867
gr33nhippo said:


edit: my bad, was opening image_output.php instead of sig.php xD


yea I figured it out... was a silly mistake :(
Jun 7, 2009 3:46 PM

Offline
May 2008
4052
glad you figured it out. ;)

interesting that it is valid image output... it outputs your background image without the updates. ;)

I am a banana.
Jun 9, 2009 3:43 AM
Offline
Dec 2007
20
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.
Jun 9, 2009 7:40 AM

Offline
May 2008
4052
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.
sakaJun 9, 2009 8:29 AM

I am a banana.
Jun 9, 2009 9:53 AM
Offline
Dec 2007
20
Thanks for replying me!

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?
Jun 9, 2009 10:11 AM

Offline
May 2008
4052
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:

$filecontents = file_get_contents("http://www.google.com");

is all you need to download the html from google's home page.

...but in cURL it's this:
$curl_handle = curl_init();
curl_setopt( $curl_handle, CURLOPT_URL, "http://www.google.com" );
curl_setopt( $curl_handle, CURLOPT_HEADER, 0 );
curl_setopt( $curl_handle, CURLOPT_RETURNTRANSFER, true );

$filecontents = curl_exec( $curl_handle ); // download!
curl_close( $curl_handle );


Curl gives you a lot more control over the http request, but it's a bit more legwork. I use this wrapper function in my own script:
sakaJun 9, 2009 10:14 AM

I am a banana.
Jun 12, 2009 1:27 PM

Offline
May 2008
4052
hmmm interesting idea.

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.

I am a banana.
Jun 19, 2009 11:00 AM

Offline
Apr 2008
254
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:


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?
SilmorenJun 19, 2009 11:05 AM
Jun 19, 2009 12:04 PM

Offline
May 2008
4052
erm... it's filled with #'s possibly?

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.
sakaJun 19, 2009 12:28 PM

I am a banana.
Jun 20, 2009 9:03 AM

Offline
Jun 2008
505
thanks for the tot ^_^
it helped a lot

although the www.000webhost.com is under review at the moment... and i hope it doesnt happen a lot cuz the signature is dead when this happens -_-'

oh well, im just greatful that its a free site :P so i wont weep about this.


Jun 20, 2009 9:23 AM

Offline
May 2008
4052
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)

I am a banana.
Jun 20, 2009 9:39 AM

Offline
Jun 2008
505
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


Jun 20, 2009 11:34 AM

Offline
May 2008
4052
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
[img]http://me.mydomain.com/signature/sig.php[/img]

...becomes....
[img]http://me.mydomain.com/signature/cache/sig.png[/img]

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.

I am a banana.
Jun 20, 2009 12:36 PM

Offline
Jun 2008
505
whaaaa

this sounded like jibrish to me right now XD

I think i need to learn a little more about scripting to actually undertand this LOL

thank you anyway. I will try it once i'll understand more :P


Jun 27, 2009 9:56 AM

Offline
May 2008
4052
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:
<?php

$num = rand(0,6);
header("Content-type: image/gif");
echo file_get_contents("smtds_deathclock_finished_$num.gif");

?>




edit: question was deleted :$

I am a banana.
Jun 29, 2009 6:31 AM

Offline
Jun 2007
22129
would anyone use a site with a wizard to make these dynamic sigs (for the php impaired) if I made it?

I could very easily put this whole process into a few form fields with a login system so~


Pardon if anyone's already done this.

"if the show is good i couldn't care less if hitler directed it and the production values was a banana." - Salsk
Jun 29, 2009 6:42 AM
Offline
Jul 2008
3032
@K_N
there is already a Dygnatus site
http://myanimelist.net/forum/?topicid=68554

but I'm sure if you could make something that would be simple to use..that would be great :)
Jun 29, 2009 7:19 AM

Offline
Jun 2007
22129
Well that's already done much better than I could, so I guess I'll skip that.

"if the show is good i couldn't care less if hitler directed it and the production values was a banana." - Salsk
Jun 29, 2009 7:55 PM

Offline
May 2008
4052
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've really been itching to learn some JQuery for the sake of implementing some graphical controls like this:
http://deepliquid.com/projects/Jcrop/demos.php?demo=handler

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.

I am a banana.
Jun 30, 2009 11:10 PM

Offline
Jun 2007
22129
Actually that sounds like a really nice idea.

Unfortunately I only know basic javascript, so I wouldn't be much help there. The PHP part I can handle, however, and would not mind doing.

"if the show is good i couldn't care less if hitler directed it and the production values was a banana." - Salsk
Jun 30, 2009 11:56 PM

Offline
May 2008
4052
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.

I am a banana.
Jul 1, 2009 12:59 PM

Offline
Jun 2007
22129
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
Jul 1, 2009 9:10 PM

Offline
May 2008
4052
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.
sakaJul 1, 2009 9:21 PM

I am a banana.
Jul 8, 2009 2:37 PM

Offline
Aug 2007
21
ehrgeiz said:

(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'
There is no file called sig_creator in the zip.

So is it supposed to be image_output instead?
Jul 8, 2009 4:36 PM

Offline
May 2008
4052
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:

http://www.yourdomain.com/signature/sig.php

You can also use my single-file script, which was designed as an alternative:
http://myanimelist.net/forum/?topicid=84446

I am a banana.
Jul 10, 2009 11:41 PM

Offline
Jun 2007
22129
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
Jul 11, 2009 3:50 PM

Offline
May 2008
4052
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 am a banana.
Jul 12, 2009 12:15 AM

Offline
Jun 2009
267
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?
Jul 12, 2009 1:58 AM

Offline
May 2008
4052
J3T, just copy/paste this bbcode for your forum signature. ;)
[center][url=http://myanimelist.net/animelist/J3T&sclick=1][img]http://gr3i.netau.net/sig.php[/img][/url][/center]

I am a banana.
Jul 12, 2009 2:34 AM

Offline
Jun 2009
267
Thanks for the help man, I didn't know it was this simple.
Jul 12, 2009 5:07 PM

Offline
Jun 2007
22129
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
Jul 19, 2009 6:10 PM
Offline
Feb 2009
1637
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?

Jul 20, 2009 11:39 AM

Offline
Jun 2007
1755
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 || ♪♫♪
Jul 20, 2009 9:09 PM
Offline
Feb 2009
1637
kyrori said:
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
Jul 22, 2009 12:09 PM

Offline
Oct 2007
3811
Anyone know of any webhosts as good as 000webhost?
Pages (9) « First ... « 3 4 [5] 6 7 » ... Last »

More topics from this board

» share your amv! ( 1 2 3 4 5 ... Last Page )

Animetwins - May 5, 2015

1029 by Stormey »»
6 hours ago

» 【 ART THREAD 】Let's share our art! ‪‪❤︎‬ ( 1 2 3 4 5 )

mewmewforever - Aug 30, 2024

215 by RetroCagliostro »»
Yesterday, 11:28 PM

» Four Ages! ( 1 2 )

Robert_SS_Gordon - Feb 21

51 by Robert_SS_Gordon »»
Yesterday, 8:03 AM

» Share Your YouTube Channel/Videos! ( 1 2 3 4 5 ... Last Page )

nin-tendo - Dec 16, 2022

595 by Retro8bit »»
Oct 9, 3:17 PM

» MY ANIMATED SHORT FILM

DiscloSalilokui - Oct 9

1 by Retro8bit »»
Oct 9, 3:03 PM
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login