Forum Settings
Forums

Tutorial: Generating scripted-signatures (Version 2)

New
Pages (9) « First ... « 2 3 [4] 5 6 » ... Last »
Mar 22, 2009 10:13 AM

Offline
Jan 2008
419
LordKail said:
Gratz,Will be looking forward to see your sig :P


Ok :3

One last question. There is a ''@'' in front of the ''watching'' and ''reading'' part. Dunno how to remove it.
And the # behind the episodes I watched.
Mar 22, 2009 10:36 AM

Offline
Mar 2009
205
Oh,sry for taking long to answer,Maybe you found already but you will change that easily by opening settings.php

And finding the line : $pre_watch = @watching (atleast I think that's how it should look).

And to remove the # you have to find line
$after_watch = ''#'' that's how it looks I think :D

Try out and let me know :)
Apparantly Kimi to Boku will always be my last-anime-watched, until you check my profile :3~


Mar 22, 2009 10:44 AM

Offline
Jan 2008
419
LordKail said:
Oh,sry for taking long to answer,Maybe you found already but you will change that easily by opening settings.php

And finding the line : $pre_watch = @watching (atleast I think that's how it should look).

And to remove the # you have to find line
$after_watch = ''#'' that's how it looks I think :D

Try out and let me know :)


Omg thank you so much~ *-*
My first self-made signature x'DD
Well, some friends told me they could not see the picture because of the webhost.
I saved it so you can see :3
http://i44.tinypic.com/sm4mmg.png
Mar 22, 2009 11:03 AM

Offline
Mar 2009
205
Wow thats a really nice one :D.I like the color of the font and font itself.Suits the pic.But now you're gonna help me :P.How did you put 2 animes there :P?Mine only shows one and I don't know how to add them xD.(What program you use to edit the .php files btw?)
Apparantly Kimi to Boku will always be my last-anime-watched, until you check my profile :3~


Mar 22, 2009 11:13 AM

Offline
Jan 2008
419
LordKail said:
Wow thats a really nice one :D.I like the color of the font and font itself.Suits the pic.But now you're gonna help me :P.How did you put 2 animes there :P?Mine only shows one and I don't know how to add them xD.(What program you use to edit the .php files btw?)


The second one is a Manga :)
But here is something about putting a second one in:
ehrgeiz said:
imagefttext($image,14,0,118,48,$colour,$font,$titles[0][0]);


* $titles[0][0] outputs the very first anime title of your rss-feed
* $titles[0][1] outputs the second anime title of your rss-feed and so on


Would look like this way I guess:


I edit the files at the webhost. Says ''edit'' at the right side of the file :)
http://i41.tinypic.com/syxzx4.png
Mar 22, 2009 11:16 AM

Offline
Mar 2009
205
Oh o.O,kkay I will try that

Thx

Edit: Okay I got it thx much! :D
LordKailMar 22, 2009 11:46 AM
Apparantly Kimi to Boku will always be my last-anime-watched, until you check my profile :3~


Mar 23, 2009 5:38 AM

Offline
Jan 2009
1379
thank you for this easy scripting 8D
i kinda confuse with some part but i figure it myself 8]
thanks again!! i honor you!!
Mar 23, 2009 11:42 PM

Offline
Jul 2008
96
Just had to give my thanks. <3 My new sig, and I even had fun making it unlike my last one. Now to figure out this Cron Job, 000webhost seems to be able to confuse me a lot. Doesn't help I've been up all day messing with all this stuff.
Mar 23, 2009 11:57 PM

Offline
Nov 2006
5545
suzuka_pew said:
thank you for this easy scripting 8D
i kinda confuse with some part but i figure it myself 8]
thanks again!! i honor you!!
love it!!
Mar 24, 2009 12:33 AM

Offline
Jan 2008
419
LordKail said:
Oh o.O,kkay I will try that

Thx

Edit: Okay I got it thx much! :D


I'm glad it worked :D
Looks great x3
Mar 24, 2009 12:58 AM

Offline
Feb 2009
185
Nice tutorial. I'll definitely give it a shot when I have the time.
Mar 24, 2009 1:20 AM

Offline
Jan 2009
1379
windy said:
suzuka_pew said:
thank you for this easy scripting 8D
i kinda confuse with some part but i figure it myself 8]
thanks again!! i honor you!!
love it!!

thank you 8] yours are nice to (:
Mar 28, 2009 11:07 AM

Offline
Nov 2008
103
Okay, a few pages back I said I added an error message for when MAL is temporarily down, but when it was down yesterday (or was it the day before?) it didn't show up. What do I need to add for the if statement then?
Mar 29, 2009 4:53 AM

Offline
Apr 2008
78
the easiest way to do this would be:


if(isset($titles[0][0])){
imagefttext($image,14,0,118,48,$colour,$font,$titles[0][0]);
imagefttext($image,12,0,170,60,$colour,$font,$status[0][0]);
imagefttext($image,14,0,222,72,$colour,$font,$dates[0][0]);
////////////////////////////////////////
///////////manga-text output////////////////
imagefttext($image,14,0,258,75,$colour,$font,$titles[1][0]);
imagefttext($image,12,0,290,90,$colour,$font,$status[1][0]);
imagefttext($image,14,0,222,72,$colour,$font,$dates[1][0]);
}else{
imagefttext($image,14,0,118,48,$colour,$font,"down");}
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.
Apr 1, 2009 1:42 AM

Offline
Jul 2008
541
Really nice tut. thanks.
punkvol1Apr 1, 2009 3:17 AM

Apr 1, 2009 11:03 AM

Offline
Oct 2007
61
Thanks ! It works perfectly.
Edit : Well, not perfectly !
Instead of ', I get a "%apos;". I hope it will get fixed.
iKjiApr 2, 2009 1:37 PM
Apr 3, 2009 1:52 PM

Offline
Feb 2009
127
Is there any possible way in this script to make anime title to be uppercase?
incognitApr 3, 2009 3:33 PM
Apr 3, 2009 7:31 PM

Offline
Dec 2007
180
NETRiP26 said:
Is there any possible way in this script to make anime title to be uppercase?


Just figured it out (except with lowercase.) Go to sig.php and scroll down to the for loop which gets the title's information. Find the first line that updates the $ncnt variable:
$ncnt = str_replace($title, "", $cnt);
And replace it with:
$ncnt = strtoupper(str_replace($title, "", $cnt));

A question of my own - is it possible to control the amount of spacing between characters?
Apr 3, 2009 7:36 PM

Offline
Sep 2008
630
Helix said:
NETRiP26 said:
Is there any possible way in this script to make anime title to be uppercase?


Just figured it out (except with lowercase.) Go to sig.php and scroll down to the for loop which gets the title's information. Find the first line that updates the $ncnt variable:
$ncnt = str_replace($title, "", $cnt);
And replace it with:
$ncnt = strtoupper(str_replace($title, "", $cnt));

A question of my own - is it possible to control the amount of spacing between characters?

o.o. sweet, lol. if only i had this for previous sigs. lol. thanks for the find.
Apr 4, 2009 12:44 AM

Offline
Feb 2009
127
Helix said:
NETRiP26 said:
Is there any possible way in this script to make anime title to be uppercase?


Just figured it out (except with lowercase.) Go to sig.php and scroll down to the for loop which gets the title's information. Find the first line that updates the $ncnt variable:
$ncnt = str_replace($title, "", $cnt);
And replace it with:
$ncnt = strtoupper(str_replace($title, "", $cnt));

Thanks.
Apr 4, 2009 4:22 AM

Offline
Aug 2008
2262
Helix said:
A question of my own - is it possible to control the amount of spacing between characters?
As far as I know, not with a function. You have to manually put every character on the image with your chosen spacing. I have a script that does something similar with words (justifies text), that probably could be modified.
Apr 4, 2009 11:34 PM

Offline
Apr 2008
8333
Thanks for the tutorial. I have a couple of questions/problems:

1) Is it possible to center-justify text? Right now, the text is left-justified, and it works for long text, but for short titles, like K-ON, it looks bad.

2) For anime that have an unknown amount of episodes, the progress bar of the I-pod can't be calculated, since the int casting fails for num2
Edit: solved #2 with a simple if/else check.

any suggestions for how I can correct this?
SaitoeApr 5, 2009 12:38 PM

Apr 6, 2009 12:34 AM

Offline
Feb 2009
127
I have another question.

Is there any possible way in this script to make random image? I mean when I reload the page my image would change each time and reverse (look spoiler).

incognitApr 6, 2009 12:40 AM
Apr 6, 2009 12:51 AM

Offline
Apr 2008
8333
NETRiP26 said:
I have another question.

Is there any possible way in this script to make random image? I mean when I reload the page my image would change each time and reverse (look spoiler).


ehh, this is roughly what you have to do:


Also, it would be lovely if somebody could figure out how to solve my problem ^^

Apr 6, 2009 2:46 AM

Offline
Aug 2008
2262
^ It's easier to do the image randomization with a switch case, but yeah, that is the general concept.
For example:

As for Saito's problem:
I'm not all that familiar with the version 2 script, so this is a general solution.

Add this function:

Then what you can do is this:
$box = calculateTextBox($fontsize, 0, $font,$titles[0][0]);

In the imagefttext(..) part change the $x parameter to the following:
leftmarginoftheiPod + (rightmarginoftheiPod - leftmarginoftheiPod - $box["width"])/2

If you want the longer titles to be put in to several rows, that can be arranged with some extra code too.
Apr 6, 2009 3:08 AM

Offline
Apr 2008
8333
Thanks!

edit: bleh, it's being stupid, but I'll work it out after I get some sleep
SaitoeApr 6, 2009 3:33 AM

Apr 6, 2009 5:48 AM

Offline
Feb 2009
127
Thanks to both of you.
Apr 17, 2009 9:57 PM

Offline
Feb 2009
150
I did it!!!
Apr 25, 2009 9:59 AM

Offline
Nov 2008
103
It's been a while, but I have a new question.

How can I make the text a different color depending on the random background chosen?
Apr 25, 2009 11:45 AM

Offline
Dec 2007
218
^I tried something on one of my sigs and it worked. I will post the code here:

$num = rand(0,1);
switch($num)
{
case 0:
$src = imagecreatefrompng ('image1.png');
$color1 = imagecolorexact($src, 0, 0, 0);
imagefttext($src,14,0,7,118,$color1,$font,$titles[0]);
break;
case 1:
$src = imagecreatefrompng ('image2.png');
$color2 = imagecolorexact($src, 255, 36, 41);
imagefttext($src,14,0,7,118,$color2,$font,$titles[0]);
break;
}
imagecopy($image, $src, 0, 0, 0, 0, 600, 140);
imagepng ($image);

I hope this helps. When the first picture is loaded it will use color stored in $color1 and for second picture it would use the color stored in $color2.

see here: http://fara7.site90.com/test/crreator.php
Apr 25, 2009 12:03 PM

Offline
Apr 2009
900
Hmm It seems my signature sometimes does
display and other times it seems 'unavailable' (?) or something
(AKA I get a white rectangle w/ the well-known red little cross in the upper-left corner).
Is this something caused by the hosting site - I, like many others, have taken the advice and signed up at 000webhost - or is it something I have done wrong?

I'm sorry if this has been posted already, it seems that I have read past it then.
Great tutorial!

- Lith.

P.S. gg user 'MasterNova', I sees a resemblance :3
Apr 25, 2009 12:10 PM

Offline
Nov 2008
103
Fara7 said:
^I tried something on one of my sigs and it worked. I will post the code here:

$num = rand(0,1);
switch($num)
{
case 0:
$src = imagecreatefrompng ('image1.png');
$color1 = imagecolorexact($src, 0, 0, 0);
imagefttext($src,14,0,7,118,$color1,$font,$titles[0]);
break;
case 1:
$src = imagecreatefrompng ('image2.png');
$color2 = imagecolorexact($src, 255, 36, 41);
imagefttext($src,14,0,7,118,$color2,$font,$titles[0]);
break;
}
imagecopy($image, $src, 0, 0, 0, 0, 600, 140);
imagepng ($image);

I hope this helps. When the first picture is loaded it will use color stored in $color1 and for second picture it would use the color stored in $color2.

see here: http://fara7.site90.com/test/crreator.php

Hmm... I think I have to revamp just about the entirety of image_output to make that work.

A bit of a long shot, but is it possible to set something like '$color$num'?

Lithia said:
Hmm It seems my signature sometimes does
display and other times it seems 'unavailable' (?) or something
(AKA I get a white rectangle w/ the well-known red little cross in the upper-left corner).
Is this something caused by the hosting site - I, like many others, have taken the advice and signed up at 000webhost - or is it something I have done wrong?
I'm seeing it fine right now. Did you just register at 000webhost? If so, then they check your content for a while, making it invisible to others.
Joe4evrApr 25, 2009 12:13 PM
Apr 25, 2009 1:17 PM

Offline
Apr 2009
900
Joe4evr said:
I'm seeing it fine right now. Did you just register at 000webhost? If so, then they check your content for a while, making it invisible to others.


I registered the day before yesterday.
It's really a strange thing, I don't particulary mind, but having a sig IS all the rage, is it not?

- Lith.
May 1, 2009 9:21 PM

Offline
Nov 2007
85
Made my new sig with this code. :3 Feel free to put it in the top posts.

Oh, and I remember my Persona 4 OP one was up before the site crashed a while ago, you can put that up again if you want, it's here.
I am mongeesubs. If you can time/typeset and want to help sub Youkai Watch, let me know~
May 3, 2009 3:58 AM

Offline
Feb 2009
127
Why this script doesnt show re-watching status? I selected re-watching in anime but still it says completed.
May 3, 2009 11:24 PM
Offline
Jul 2008
3032
NETRiP26 said:
Why this script doesnt show re-watching status? I selected re-watching in anime but still it says completed.


You need to chose the script to parse 'Recent anime by episode' which is '1' in the settings.php.
See my sig...it works :D
May 3, 2009 11:28 PM
Offline
Dec 2008
4167
anyone have anywhere other than 000webhost.com to host these things?

They fucked me over and deleted my account, and they said its 24h to create a new one, its been more than 24 hours.

Can't seem to find one that has the right php hosting thingys..
May 4, 2009 4:18 AM

Offline
Sep 2007
2171
Did you make a website on the account? cos if you don't they surely will delete it, it's the same on almost every host.
May 4, 2009 11:36 AM
Offline
Dec 2008
4167
SunyiNyufi said:
Did you make a website on the account? cos if you don't they surely will delete it, it's the same on almost every host.


Yeah dude I made a placeholder index and a bunch of other stuff with it, and they deleted it..

I've tried to make another account, been way over their stupid 24 hours..

I'd assume they just ban by IP..grr.
123114334dMay 4, 2009 11:41 AM
May 4, 2009 11:12 PM
Offline
Jul 2008
3032
Is it possible to make this version 2 run with gif image?
May 5, 2009 8:44 AM

Offline
May 2008
4052
Meri said:
Is it possible to make this version 2 run with gif image?

It's easy to import gifs if you only want the first frame. Just change imagecreatefrompng() to imagecreatefromgif(). Depending on your image, you might have a limited color pallette, though.

I'm assuming since you want to use gifs, though, that you're looking for animation (since that's the only thing gif really offers). Animated is a bit harder... I'm probably the only one who understands how to do animated gifs in the actual sig around here... and it's not something you can do on 000webhost. :-/

You can always have an animated gif next to the generated sig, which is how it's usually done.

I am a banana.
May 5, 2009 9:42 AM

Offline
Feb 2008
4295
saka said:
Animated is a bit harder... I'm probably the only one who understands how to do animated gifs in the actual sig around here... and it's not something you can do on 000webhost. :-/
I don't understand exactly how it works but I'm using an animated gif class, the same one I believe you used for your TTGL sig; That one works on 000webhost:


It's not hard, just takes a bit of fenagling. In my case, I create 6 png frames, transform them to gif and then assemble.
May 5, 2009 10:13 AM

Offline
May 2008
4052
that gifmerge library can be used, but its slow and doesn't compress the gif at all. It's easy to get 1MB gifs if you're not careful. I don't recommend it for everyone, but it's fine for animations of a few frames if you know what you're doing. I even had to fix some silly typos in that class while I was using it, and the author has removed the fixed/expanded versions from his homepage now. The old versions on phpclasses.org have a typo in one of the arguments, and are missing some important stuff... so that's why I don't recommend it to others anymore.

The better method is to use gifsicle or ImageMagick executables to merge and compress the frames, instead of that php library. Regretfully this requires exec(), which just about every free server disallows.

I am a banana.
May 5, 2009 10:28 AM

Offline
Feb 2008
4295
I'm using GIFEncoder.class.php which apparently is a rewritten Gifmerge.class.php. I don't remember where the hell I got it from, probably google cache lol, but it seems to be very fast.
You're right about the compression though but what are you gonna do...

You could write your own compression code :P
May 5, 2009 10:50 AM

Offline
May 2008
4052
kuroshiroi said:
You could write your own compression code :P

tried that actually... not efficient or worth the time. I learned a lot about how gif works, though. :)

GIFEncoder.class.php is the same class... if it's the one from phpclasses.org then it's got a misnamed argument and doesn't have support for frame offsets iirc so you cannot take a gif apart and put it back together. I suppose it still works for just merging a new gif, though.... The good version of it used to be at http://gifs.hu/ which was the author's page (László Zsidi), but it's been overwritten by some gawdy joomla reference site. Maybe there's still something there, but I don't speak hungarian...

I am a banana.
May 5, 2009 1:11 PM

Offline
Aug 2008
2262
saka said:
The good version of it used to be at http://gifs.hu/ which was the author's page (László Zsidi), but it's been overwritten by some gawdy joomla reference site. Maybe there's still something there, but I don't speak hungarian...
I do. Nothing there, it's now a homepage now for some webdesign comp.

But maybe you could write a guide about the ins and outs of using gif animation in php ^^ Teach us!
May 5, 2009 1:51 PM

Offline
Feb 2008
4295
Kvakond said:
saka said:
The good version of it used to be at http://gifs.hu/ which was the author's page (László Zsidi), but it's been overwritten by some gawdy joomla reference site. Maybe there's still something there, but I don't speak hungarian...
I do. Nothing there, it's now a homepage now for some webdesign comp.
Gotta love the internet, lol ^^

Please don't teach us the correct way to use gif animation in PHP, it will ruin MAL...
May 5, 2009 1:52 PM

Offline
Sep 2007
2171
kuroshiroi said:
Please don't teach us the correct way to use gif animation in PHP, it will ruin MAL...

lol...but kinda true :D

I was bored, so I googled: http://www.phpclasses.org/browse/author/283569.html
SunyiNyufiMay 5, 2009 2:27 PM
May 8, 2009 7:57 AM
Offline
Dec 2008
4167
So basically the "..." that's supposed to appear after you go over the specified cut off thing is appearing no matter what.

Right now you can just barely see one of the "..." below the W in watching.

I redownloaded the whole thing just to make sure I didn't change something stupid.

Any ideas? I love the "..." part so I would prefer not to be rid of it; I'd just love to know why it's decided to appear.
May 8, 2009 11:50 AM

Offline
Oct 2008
462
Sorry but i'm totally a n00b, and i've just started scripting yesterday. I've followed your tut, but from the first step using your example image, sig.php has shown nothing. It's not the error 'The image cannot be displayed because it contains errors', but a completely broken image. I used sig.png link as you said and it did bring me an outcome, so i continued to creat my own sig. Everything was finished, but sig.php still shows me a broken image. So how can i make it appear ??

I've only worked with image_output as you said, here is the code :

Pages (9) « First ... « 2 3 [4] 5 6 » ... Last »

More topics from this board

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

nin-tendo - Dec 16, 2022

362 by nin-tendo »»
8 hours ago

» Protect or punish?

DollzchanAi - Apr 18

4 by DollzchanAi »»
Today, 6:15 AM

» BL reference in Tomodachi Life

Kinspie13 - Yesterday

4 by Kinspie13 »»
Yesterday, 9:41 PM

» How to Export/Backup Your Anime List Automatically! (TamperMonkey Script)

hacker09 - May 18, 2020

3 by Vapor_AU »»
Yesterday, 8:41 PM

» advice for someone returning to art

Crystepsi - Apr 4

5 by haaku-san »»
Yesterday, 4:21 PM
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login