Forum Settings
Forums

Tutorial: Generating scripted-signatures (Version 2)

New
Pages (9) « First ... « 7 8 [9]
Dec 27, 2009 3:35 PM

Offline
May 2008
4052
with talon's you might as well use the xml format and then change the content in the example... ie <content>[name:1] [current:1] / [total:1]</content> would be something like Bleach 150/?

If you're using the traditional class structure (which I actually prefer), then it's not so easy changing it since it's buried in Signature.class.php.... however after poking around a bit I found you can manipulate the functions and make one:

	function writeCustomDescription($nr,$x,$y,$rule,$format="[status] - [current] / [total]",$rotation=0,$length=45,$align="l")
{
$nr--;
$Text=$this->descriptionPart($nr,$format);
if(strlen($Text)>$length) $Text=substr($Text,0,$length)."...";

$this->writeText($Text,$x,$y,$rule,$rotation,$align);
}


...that should be added wherever you like within the Signature class in lib/Signature.class.php -- then you can call it in your main sig file like this:

$Signature->writeCustomDescription(1,100,50,$rule,"[current] / [total]");

you can use the other optional arguments and such also... it's the same as writeDescription() except with a format string after the $rule. It will substitute for [status], [current], and [total].... doesn't support units, but you didn't want them any way. If you did, you could add the extra str_replace() to the descriptionPart() function also in the Signature class.

I didn't test it, but it should work... heh.

I am a banana.
Dec 27, 2009 6:31 PM

Offline
Jan 2009
1127
I getting an error somewhere. I've checked but nothing seems to be wrong. Could someone help me troubleshoot? Thanks. I'm using saka's script.

domain: pressit.webege.com

image_output.php


settings.php


sig.php

Many thanks to whoever bothered to read this. Its tedious checking i know :[
PRESSitDec 27, 2009 6:58 PM
Dec 27, 2009 7:02 PM

Offline
May 2008
4052
looks like only the last few bits of my script got pasted.... I guessed the directory and found the files in http://pressit.webege.com/signature/ but since you're under admin review there's not much I can do.

I guess I'll just adapt your old settings to a fresh copy of my script after dinner. ;)

I am a banana.
Dec 27, 2009 7:09 PM

Offline
Jan 2009
1127
Thanks ^^. yep i noticed that and updated my post, but i guess u saw the old post.
Dec 27, 2009 7:47 PM

Offline
May 2008
4052
for some reason the one you posted has ";.$user; on the anime and manga urls... not sure if that's in your script or the mal forums are adding stuff (as they sometimes do), but when i change that to the correct lines it works:



^ the text is way down at the bottom of the image, but it is working correctly.


edit..... and indeed mal adds semicolons for some reason.... ~.~ ..... should look like this at the top, but otherwise the code is correct:


btw, mal's usernames are not case sensitive.... just did it for caution ;)
sakaDec 27, 2009 7:50 PM

I am a banana.
Dec 27, 2009 8:25 PM

Offline
Jan 2009
1127
I'm not sure whats wrong, but sig.png isn't generated.
Also, if I were to change my angles to -49.5, with the '-' symbol, would it affect the script?
Sorry for the trouble ><
Dec 27, 2009 10:21 PM

Offline
May 2008
4052
make sure there's an empty directory called 'cache' and that you make it writable after you upload it (777 permissions).

the dialog when you right click on the cache folder and choose File Permissions should look like this:


and yes, negative works fine for angle.... though I did notice you tend to use decimal numbers for the x,y coordinates a lot... those get rounded to the whole number anyway so you shouldn't bother. I think the angles are floats though.

I am a banana.
Dec 28, 2009 6:11 AM

Offline
Jan 2009
1127
Thats the problem i have. The cache folder permissions have been enabled, yet sig.png isn't generated.
I wasn't sure if it was a problem with the file locations, so i moved them around a bit too. Same result. I was wondering if it might be a problem with the parent directory(file_html) file permissions?

Edit:
PRESSitDec 28, 2009 7:03 AM
Dec 28, 2009 8:53 AM

Offline
May 2008
4052
you're missing the top part of the script (the opening <?php and the license) and because of that it isn't recognizing your file as php. add this to the very beginning of your file:


btw, there's no need for settings.php and image_output.php anymore, since it's all in sig.php ;)

I am a banana.
Dec 28, 2009 10:05 AM

Offline
Jan 2009
1127
That solved the problem. Its done! Thanks saka ^^
Jan 29, 2010 10:21 PM

Offline
Dec 2009
531
Sorry to ask, but what is it suppose to look like after we set our chmods? I can't see the image in the guide =/.
Feb 6, 2010 6:26 AM

Offline
May 2008
207
my head hurts im not geting any of this
Feb 6, 2010 6:45 AM

Offline
Feb 2009
1585
I would suggest you saka's minimal script, its quite easier than ehrgeiz's and quite a lot people use it, me included. :)

http://myanimelist.net/forum/?topicid=84446
Mar 5, 2010 10:52 AM

Offline
Sep 2008
176
Thanks, ehrgeiz! That helped me make my 1st php sig (I used saka's script though).

I have some questions for upcoming signatures:
-It was a real pain adjusting the text position, is there an easier way to figure its exact coordinates without trying multiple times, sometimes with a 5-8 min waiting interval in-between for the changes to appear?
I tried Paint, but it only helped me with x-pos.

-How can I use more than one font? Say, one for the series name and one for the status?

-In general, is it possible to warp text, apply different blending options and character palette options?

Sorry, if any of those were asked before…
Sesame-chanMar 5, 2010 11:08 AM


Mar 22, 2010 7:26 PM
OG Rewriter

Offline
Aug 2009
1558
I'm having trouble getting the image to display. Every time I try to navigate to the site, it doesnt work. I configured the Chmod the way it was supposed to be for each of the files, including my own sig picture, and I just left the font alone b/c this is just a test sig

Also, will my sig update at all without a cronjob?

any help would be awesome
Mar 23, 2010 1:38 PM

Offline
May 2008
4052
Yes it will update without a cronjob and return the image directly from the php. You can use a cronjob to make it slightly more efficient, but it's completely optional and really unnecessary unless you have a very very complicated sig that takes a while to generate.

btw, in response to your pm, I'm making a couple minor fixes and writing up a tutorial for configuring my minimal script that I'll post soon. It should be easier with detailed instructions. ;)

I am a banana.
Mar 24, 2010 3:05 PM

Offline
Sep 2008
176
That wasn't nice! :/


Mar 24, 2010 4:18 PM

Offline
May 2008
4052
lol sorry i somehow overlooked you.... didn't mean to ignore. ;)

Sesame-chan said:
-It was a real pain adjusting the text position, is there an easier way to figure its exact coordinates without trying multiple times, sometimes with a 5-8 min waiting interval in-between for the changes to appear?

For positioning, I find it helpful to mock up everything in photoshop first (including the text) so that I can use photoshop to measure the coordinates beforehand. If you want to do this, go to Edit>Preferences>Units & Rulers to make sure your measurements for Rulers and Type are in pixels; Now use the F8 key on your keyboard to toggle the Info Panel, which gives you pixel measurements of the width, height, and position of the element you're working with.

It's odd that your script isn't updating after you change it... the check_cache() function should check to see if your script has been modified and cause it to make a new one, but if it's being stubborn you can comment out the check_cache(...); line near the top. Just put '//' in front like this:
//check_cache(10);

and take the /'s back out when you've gotten it to your liking.

Sesame-chan said:
-How can I use more than one font? Say, one for the series name and one for the status?

All of the text functions take just the path to the font... so it's just a string and you can use as many as you want.
$font = 'font.ttf';
$font2 = 'font2.ttf';
$font3 = 'font3.ttf';
...
and change to $font2 or whichever in the imagettftextalign() functions below that.

Sesame-chan said:
-In general, is it possible to warp text, apply different blending options and character palette options?

I'm not sure what you mean by character palette, but you can use additional libraries (extra php files with functions in them) to add effects to your text and other dynamic content. I've already written functions to do 3d perspective rotation, skew, 2d rotation(with alpha support), and am working on perfecting a library that does all the photoshop blending modes (just a few minor quirks to work out with the alpha blending). Many people also use Niroko's glow library to add glow effects to my sig script. If you have specific questions, just ask... preferably in the thread for my minimal sig though.

I am a banana.
Mar 24, 2010 5:33 PM

Offline
Sep 2008
176
Wow! That was well explained, thank you so much!
I'll post my comment in your thread then :)


Mar 26, 2010 9:35 PM
OG Rewriter

Offline
Aug 2009
1558
saka said:
Yes it will update without a cronjob and return the image directly from the php. You can use a cronjob to make it slightly more efficient, but it's completely optional and really unnecessary unless you have a very very complicated sig that takes a while to generate.

btw, in response to your pm, I'm making a couple minor fixes and writing up a tutorial for configuring my minimal script that I'll post soon. It should be easier with detailed instructions. ;)


wow, awesome, thanks a lot! I'll be looking forward to it =)
May 2, 2010 10:33 PM

Offline
Apr 2008
279
It works perfectly =D
The only thing I don't get is how to get a PNG image at the end (i registered at cronjobs.org but -damn!- I got confused in two seconds). Could someone tell me how?
// Hearts are wasted, lives are broken.
Jul 18, 2010 2:34 PM

Offline
May 2009
9
can i make from this just a text output? i tried with $cutter vars to include in my script but it does't work properly. it displays rss last news (must show first)
I'm a Mog, half man half dog. I'm my own best friend (c) Spaceballs
Jul 18, 2010 7:15 PM

Offline
May 2008
4052
I highly recommend not using this script. There are better ones available that are more modular.

mine: http://myanimelist.net/forum/?topicid=84446
talon/niroko's: http://myanimelist.net/forum/?topicid=32704
scripter's club with more: http://myanimelist.net/clubs.php?cid=5076

If you're just looking for ways to parse rss, there are simple general ways to do it. Ask me privately what you need and maybe I can help.

I am a banana.
Aug 18, 2010 9:27 AM

Offline
Aug 2009
716
Very good tutorial, even I managed it now!^^
Jul 16, 2012 6:13 AM

Offline
Apr 2011
44
helpoemer07 said:
okay... I'm in a pinch... I'm done with almost everything... I have an image, I have edited the codes for image_output.php and settings.php (not sig.php), I have set the chmod for the folder containing them to 777, and I have set the chmod for all the files to 755...

Whenever I use http://helpoemer07.0fees.net/signature/sig.php inside a bbcode or even at the address bar, an image error occurs (a small broken image picture)... when I try to use http://helpoemer07.0fees.net/signature/image_output.php , my original image displays but without the list that I wanted to display...

What could I have done wrong?? (I have not edited the sig.php in any way aside the chmod)...

Is it because of my host (0fees) ??

I'm in dire need of your help... thanks... ^_^

~ and oh... just in case... I'll place the codes...

image_output.php


settings.php


sig.php


Hello..ive been working on my sginature for 7 hours and i have reached the same place he is..i am useing Freewebhosting.com and i saw it does allow allow_url_fopen...anyone know what i am doing wrong..if you want i can post my Codes..
Pages (9) « First ... « 7 8 [9]

More topics from this board

» Four Ages!

Robert_SS_Gordon - Feb 21

48 by Robert_SS_Gordon »»
4 hours ago

» New Android App – Shimeji Mascot Screen Pets

shimejimascot - 5 hours ago

2 by shimejimascot »»
4 hours ago

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

mewmewforever - Aug 30, 2024

209 by Absurdo_N »»
Yesterday, 5:48 PM

» AniTaste - cross-site anime list comparator

Mciej - Sep 21

1 by Retro8bit »»
Sep 21, 5:29 PM

» Saeryen's Songs!

Saeryen - Jul 25

5 by Saeryen »»
Sep 20, 1:54 PM
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login