Forum Settings
Forums
New
Jul 23, 2008 2:32 PM
#1

Offline
Jun 2008
55
KHobbits' signature script was entirely designed for the purpose of providing myself with a signature and wasn't really designed for ease of use. That said for the most part, the signature generation is dynamic, you can change one variable to edit the default user. It will automatically pull the images out of a folder, and should be more or less self explanatory.

Features:
*Dynamic signature, the data is pulled from a MAL XML file intended for use with MAL Updater.
*Rotating images, the script supports an unlimited amount of random images placed in a sub folder.
*The example in the rar file, has my *bad* attempt at making a glowish outline.
*Log file.

Known issues:
*The script currently has an input of 3 static images + random. Due to the way I originally cut the image rather than anything else, the current script needs at least 4 images, anyone playing with the options should be able to fix this, I might correct it myself in later releases.
*XML Cache, the mal data is fetched only once per 15 mins.
*Image Cache, images are generated no sooner than once every 10 mins.
*Readfile, because the cache is PHP based, the image still needs processed by PHP and that adds some overheads.

File list:
/01/ - folder containing rotating component
02.png, 03.png, 04.png - the static images
all.php - a file that displays all possible signatures
*.ttf - fonts used to make the image
gentime.php - displays the logfile
malparse.class.php - file dealing with xml feed
sig.php - image generation code
.htaccess - redirect to php

Usage:
visit '/s.png' for signature
visit '/gentime.txt' for logfile
visit '/user/s.png' to generate for a non default user

Version history:
1.5 - Added glow/outline
1.2 - Added log
1.1 Added rotating images
1 - Added xml data to static signature

Download:
http://s.khhq.net/sig1.7.rar (contains working setup including images)
KHobbitsApr 29, 2009 7:51 PM
Reply Disabled for Non-Club Members
Jul 23, 2008 2:33 PM
#2

Offline
Jun 2008
55
All the different images:
http://s.khhq.net/all.php

Generation log: http://s.khhq.net/gentime.txt
Debug output: http://s.khhq.net/debug.php
Jul 23, 2008 2:39 PM
#3

Offline
Jun 2008
55
Thoughts for the future.

I was considering creating a signature generator. Using some sort of wizard to walk users through the creation of the code, or maybe to allow users to host the signatures with me. There are quite a few details that need to be worked out, I know I wouldn't be able to host many signatures that are as resource hungry as the one I have set up for myself but if an image was only generated once every half an hour (compared to a current possible 8 in a 10 min period), I would probably be able to host 100 or so without many problems.

For this idea to take off I'd probably want a bit of external support, and I'm hoping to work with Bard. Bard has already coded support for a lot more data than I have (I currently only parse one feed), and is trying to get a version available which can be hosted on free hosts. Ideally I want a generator that allows users to host on my services but also allows the generation of code which can be modified by the user and hosted on free hosts.
KHobbitsJul 23, 2008 2:49 PM
Jul 25, 2008 7:56 PM
#4

Offline
May 2008
4052
I took at look at your code and it's pretty functional. I might use a bit of it as reference for my own script, although the way I structure it is completely different.... There's lots of stuff you do for every sig that can be more gracefully handled in a class constructor for example.

I'm not sure you could easily setup a way to auto-generate sigs from your setup since each sig file is really huge. I think a structure like Niroko's lends itself better to such an endeaver (a compact sig.php for each user could be generated).

I suppose you could do it if you store the data in files (or a database) for each user and loaded that up. I think you would need to restructure things a bit, but maybe you have a method in mind.... :-/

I am a banana.
Jul 25, 2008 8:24 PM
#5

Offline
Jun 2008
55
It is pretty clear the code would be unsuited for mass use, if purely for the resources needed, running anything more than 50 users with the current rotating images system would grind to a halt due to the amount of image generation needed. Once that is said, I could quite easily hack the current code into a usable system in less than 10 minutes simply replacing the image path to contain a username, and a db lookup for coords/fonts/colours. Although a decent wizard with validation would take a little longer.

I will be hoping to make something quite complex, a wizard walking users through uploading images, selecting the placement of text (was thinking imagemap), previews, multiple sources of data including xfire/mal feeds/malapp. In the end I'm hoping to propose a choice, either host the sig as defined by the wizard on server, or offer a custom simplified download version that can be hosted immediately or easily edited before hosting.

What I do, or if I even attempt it at all will probably depend on bard's or others actions. I don't really feel like running such a service but rather interested in how it could be produced and coded. I can do that without coming close to a version suitable for public access.
Jul 26, 2008 12:23 AM
#6

Offline
May 2008
4052
As long as the sigs are properly cached, I don't forsee the actual image generation being a big issue. Rather, the bandwidth would be the main concern. Then you're just hosting an image, with an occasional rss fetch and conditional image creation (if feed is new). The GD functions are actually pretty efficient, so I think a decent server could handle a few hundred users without a problem.

You're right that eventually these special scripts should have some kind of scripted generation for non-techies--basically like the one mal already uses, but with more options (font upload, text/image effects, text rotation and pixel coordinates, and possibly animation effects).

If the server power did end up being an issue, I think a script that just generates a small php file that includes the class would be easy to code (the second option you mentioned, or similar). Just generate from a template by populating settings, list out a few image overlay and effect rules according to whatever the interface can offer them, then put the php in a zip with the class and images, and let them host it themselves.

I am a banana.
Jul 26, 2008 8:09 AM
#7

Offline
Jun 2008
55
As long as images don't change too often server power wouldnt be an issue, whereas if you had 100 users with 10 rotating images each, then you have 1000 images that could be generated within an short period, (an hour or less). With rotating images its even worse, I've failed to find a good way of dealing with the issue. Currently I have php use 'readfile' to output the cached image, but it still means php has to parse the output, which slows the process down. Accessing the same image through php's readfile takes double the time it takes to directly through apache, and a lot more processing power (but still less than generating it from scratch).

If I were to host such a service I would probably use a different technique using apache conditions or directives. I have quite a few ideas how it would be possible to reduce the load. Apache is quite a bit more powerful than people think with things like mod_rewrite.
Jul 26, 2008 2:02 PM
#8

Offline
May 2008
4052
why is it necessary to generate 10 images on the fly? I was assuming that the list image generated was based on the last-watched anime..... so you only get one image generated for each new xml update. One update, one image....

...you are just randomly loading one at each script access? In that case, I don't see much of a point to making it so dynamic, just generate one image at random and load a different random image at every update, instead of every access. I don't imagine people wanting to refresh the page over and over just to get a chance to see the other versions.... it's enough to let it change occasionally. Plus the work would then be divided by the number of rotating images you have.

I am a banana.
Jul 26, 2008 9:35 PM
#9

Offline
Jun 2008
55
I would have to disagree, the idea of it changing is the whole reason I made the sig the way it is. When browsing a thread every time you skip to the next page, its probably a different image. It's fairly similar to what quite a few websites have for their banners, it's a similar idea.

I never intended the rotating images to be part of the public system, but rather as some form of more unique feature. Although having it switch image on generation wouldn't cause any problems. Also you keep coming back to the point about xml updating, as it happens the current script only uses one xml, but it not going to stay that way. I'll probably be adding support for xfire, and other mal rss feeds.
Jul 26, 2008 11:00 PM

Offline
May 2008
4052
KHobbits said:
Also you keep coming back to the point about xml updating, as it happens the current script only uses one xml, but it not going to stay that way. I'll probably be adding support for xfire, and other mal rss feeds.


I only meant it updates the image cache from the xml. Each rss/xml download is cheap, image generation is the most expensive action. Just making some observations as to how server resources could be conserved. ;)

I am a banana.
Reply Disabled for Non-Club Members

More topics from this board

» saka's minimal signature script (with merged anime/manga feeds) ( 1 2 3 4 5 ... Last Page )

saka - May 10, 2009

430 by Mathes »»
Oct 5, 2017 2:43 PM

» Scripted Signature Showcase

KHobbits - Jul 9, 2008

23 by KHobbits »»
Oct 21, 2014 6:42 PM

» MAL Signature Designer

Apocist - Mar 11, 2014

10 by Apocist »»
Aug 6, 2014 3:01 PM

» iSignature

i906 - Dec 11, 2009

9 by USKurosaki »»
Apr 10, 2013 8:40 PM

» Animated Signatures

koleare - Jan 3, 2013

1 by Rezurrekt »»
Jan 10, 2013 4:13 PM
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login