Forum Settings
Forums
New
Pages (4) « 1 [2] 3 4 »
Jan 1, 2009 5:32 AM

Offline
Oct 2008
390
Thanks for help everyone.

@cloud: You must replace several lines mentioned above not just add them at bottom.

This how final code should look like:

<?php
header("Content-Type: image/png");

//specify the url that shall be read
$url = "http://myanimelist.net/rss.php?type=rw&u=Ripaz";
//generate a readable file out of the specified url for our parser to read
$file = @fopen ("$url","r");
//starting and ending strings needed to get the valuable information out of the file
//do not modify this unless you know what you are doing
$title = "<title>";
$ptw = "<description>Plan to Watch -";
$watching = "<description>Watching -";
$completed = "<description>Completed -";
$onhold = "<description>On-Hold -";
$dropped = "<description>Dropped -";
$titleend = "</title>";
$descend ="</description>";
//set variables
$t = 0;
$z = 0;

//rss-parser(Anime-Titles)
if (trim($file) == "") {
echo "Service out of order"; //if we can't create a file MAL is supposed to be down
} else {
$i=0;
//this while-loop will run until the end of the file and read it line per line
//every single read line will be save in an array (in this case $buffer[$i]
while (!feof($file)) {
//1024 bytes per line will be read until the end of file has been reached
//every single line will be saved in the array $buffer
//example: line 1 would be saved in $buffer[0]; line 2 would be saved in $buffer[1] and so on
$buffer[$i] = fgets($file,1024);
$i++;
}
fclose($file);//close the file
}

//now we have to prepare the information we cached in the $buffer array earlier
//for this we are going to use a for-loop
//this for-loop just extracts the anime_title information
for ($j=1;$j<$i;$j++) {
if ($cnt = strstr($buffer[$j],$title)) { //strstr('string to be searched', 'string to search')
//if the specified string has been found do...
//str_replace('found string', 'replace with', 'replace it in')
//and save it in the variable $ncnt
$ncnt = str_replace($title, "", $cnt);
$end = strstr($ncnt, $titleend); //strstr('string to be searched', 'string to search')
//once again replace a part of the string and save the outcome in a new arrai
$cutter = str_replace($end,"",$ncnt);
If (strlen($cutter) > 32)
{
$titles[$t] = substr($cutter, 0, 32);
$titles[$t] .= "...";
}
else{
$titles[$t] = str_replace($end,"",$ncnt);
}
$t++;
}
}


//this for-loop just extracts the anime_episode information
for ($j=1;$j<$i;$j++) { //episodes
if ($cnt = strstr($buffer[$j],$ptw)) {
$status[$z] = "plan to watch";
$z++;
}
if ($cnt = strstr($buffer[$j],$completed)) {
$status[$z] = "completed";
$z++;
}
if ($cnt = strstr($buffer[$j],$onhold)) {
$status[$z] = "on hold";
$z++;
}
if ($cnt = strstr($buffer[$j],$dropped)) {
$status[$z] = "dropped";
$z++;
}
if ($cnt = strstr($buffer[$j],$watching)) {
$ncnt = str_replace($watching, "", $cnt);
$end2 = strstr($ncnt, $descend);
$status[$z] = str_replace($end2,"",$ncnt);
$z++;
}
}

//generate the image
$blub = ImageCreateFromPng("blueye.png");
$font = 'hero';
//imagecolorexact(image, red(between 0 and 255), green, blue)
//imagecolorexact($blub,0,0,0) = black font | imagecolorexact($blub,255,255,255) = white font
$colour = imagecolorexact($blub,210,201,194);
//imagefttext(image, font size, angle, x-pos(relative to the image in px), y-pos, font color, fontfile, text output)
imagefttext($blub,12,0,195,95,$colour,$font,$titles[0]);
imagefttext($blub,9,0,200,112,$colour,$font,$status[0]);
imagepng ($blub); //we want our final image to be in the png format
//imagepng ($blub, "sig.png") //imagepng (image, save as)
//imagedestroy ($sig);
?>
RipazJan 1, 2009 5:36 AM
Jan 1, 2009 6:06 AM

Offline
Jul 2007
2780
K thanks it works fine now :)
Jan 2, 2009 10:24 AM

Offline
Sep 2008
630
been trying to figure out whats wrong with it for awhile, but i cant get the 'sig_creator.php' to load on the website. keep getting 'not found'
any ideas on what's the problem?

using 000webhost
signature folder is 777 and the 'sig_creator.php' & 'sig.png' are both 755.
also in the signature folder is the 'Capture_it.tff' and 'dark_sig.png'


edit: got it. man why do i always figure it out AFTER posting about it for most of the things i do x-x.

new edit:
ok, im starting to get the concept of it now. just wanted to know if theres a way to change the font style so that lowercase will be small caps (like my current signature title)
atruong18Jan 2, 2009 11:22 AM
Jan 3, 2009 7:49 AM

Offline
Dec 2007
218
Edited the code so it can change pictures according to the update. Like, if you are watching CLANNAD, then an image related to it will be displayed, or If you are watching Special A then another picture will be displayed and so on.

If anyone is interested, here is the code.

I used what kuroshiroi gave to change the picture randomly.
if (strstr($titles[0], "Clannad"))
{
$num = rand(0,2);
switch($num)
{
case 0:
$src = imagecreatefrompng ('clannad1.png');
break;
case 1:
$src = imagecreatefrompng ('clannad2.png');
break;
case 2:
$src = imagecreatefrompng ('clannad3.png');
}
}elseif (strstr($titles[0], "Special A")){
$src = imagecreatefrompng ('sa.png');
}elseif (strstr($titles[0], "Pani Poni Dash!")){
$src = imagecreatefrompng ('ppd.png');
}else{ $src = imagecreatefrompng ('default.png');
}

It will first search for CLANNAD in the title and if it was found it will create random number between 0 and 2, according to that number an image will be displayed.

If CLANNAD was not found it will move to the second condition (after elseif) and search for Special A which will display another picture. Again, if the condition was not met it will move to the next condition. If none of the conditions were met then it will move to else (last line) and will display another image (this can be the default image). I hope I was able to explain it properly. If you think anything is wrong with it then please point it out :)
Jan 3, 2009 10:29 AM

Offline
Oct 2008
390
Might be usefull when you are watching anime that is currently aring, other than that there is no point going trough to much trouble.
Jan 3, 2009 5:16 PM

Offline
Feb 2008
4295
Fara7 said:
Other than the fact that I don't think your Poni Poni Dash! check is working, why didn't you just use another switch :) It works the same way as all those if else conditions.
Jan 3, 2009 7:33 PM

Offline
Dec 2007
218
If you think it is not working because of the current signature I am using then it is because the code I wrote is not associated with my signature here on MAL :)


It worked for me :)
Jan 3, 2009 8:42 PM

Offline
Feb 2008
4295
Now that's just cruel, tricking me like that... :)
Jan 4, 2009 2:05 AM

Offline
Oct 2008
390
Is there any opacity code for font?
Jan 4, 2009 12:01 PM

Offline
Feb 2008
5089
atruong18 said:
been trying to figure out whats wrong with it for awhile, but i cant get the 'sig_creator.php' to load on the website. keep getting 'not found'
any ideas on what's the problem?

using 000webhost
signature folder is 777 and the 'sig_creator.php' & 'sig.png' are both 755.
also in the signature folder is the 'Capture_it.tff' and 'dark_sig.png'

Im having this problem, kind of. ;___;

Might I have some files in the wrong folder?

I have both my ".png" files, my font file, and my "sig_creator.png" file in the Signature folder. Is that wrong? The host Im using is Awardspace.com

Any help is appreciated.

http://cielodesign.awardspace.com/Signature/sig_creator.php

T_T

My script:

Jan 4, 2009 12:04 PM

Offline
Sep 2008
630
Drybananna said:
atruong18 said:
been trying to figure out whats wrong with it for awhile, but i cant get the 'sig_creator.php' to load on the website. keep getting 'not found'
any ideas on what's the problem?

using 000webhost
signature folder is 777 and the 'sig_creator.php' & 'sig.png' are both 755.
also in the signature folder is the 'Capture_it.tff' and 'dark_sig.png'

Im having this problem. ;___;

Might I have some files in the wrong folder?

I have both my ".png" files, my font file, and my "sig_creator.png" file in the Signature folder. Is that wrong? The host Im using is Awardspace.com

Any help is appreciated.

http://cielodesign.awardspace.com/Signature/sig_creator.php

T_T



first of all, did you set the signature folder as 777 and the php and png files to 755?

as in how i solved my problem, i (after quadruple checking the above, lol) move the folder into public, and it magically worked.
Jan 4, 2009 12:07 PM

Offline
Feb 2008
5089
When I put it to 777, it gives me this error: Error 500: Script Execution Failure

So I did what the above posts told me to do when getting that error and set it to 755. :<
Jan 4, 2009 12:11 PM

Offline
Sep 2008
630
Drybananna said:
When I put it to 777, it gives me this error: Error 500: Script Execution Failure

So I did what the above posts told me to do when getting that error and set it to 755. :<


hmm, im not sure about this. double check to see if you put all the things in the right places?
im only an amateur in coding myself. but i do recognize terms so it helps alittle (arrays...*shudders*)
Jan 4, 2009 12:21 PM

Offline
Feb 2008
5089
Gracias for trying to help. <3

Bah, been messing around with it and still get errors.

New SCRIPTYY Im using:


Could it be the hosting site?
Jan 4, 2009 12:26 PM

Offline
Sep 2008
630
did you try it without your own added customizing? if his default didnt work, then its a problem with the inputting to the site.
if his default works, then its your change thats causing the problem.

try his default first to see if its your host's problem.
Jan 4, 2009 12:39 PM

Offline
Feb 2008
5089
His png files won't even upload in my ftp. =/ Im trying a new host now, though, so I hope that works. :D
Jan 4, 2009 12:40 PM

Offline
Sep 2008
630
Drybananna said:
His png files won't even upload in my ftp. =/ Im trying a new host now, though, so I hope that works. :D


might be limitations in that site i guess, try 000webhost?
Jan 4, 2009 2:05 PM

Offline
Feb 2008
5089
New host seemed to do the trick + big thanks to Scud for helping me out. <3

Now, I have one last question:


That is what I came out with, but I want that black edges to go away so it will be transparent. In other words, it was suppose to be "ovular" not square. Sorry if that made no sense.

Gracias ahead of time. :D
Jan 4, 2009 2:11 PM

Offline
Sep 2008
630
Drybananna said:
New host seemed to do the trick + big thanks to Scud for helping me out. <3

Now, I have one last question:


That is what I came out with, but I want that black edges to go away so it will be transparent. In other words, it was suppose to be "ovular" not square. Sorry if that made no sense.

Gracias ahead of time. :D


there was a thread where someone posted that code up. forgot which, look for it yourself, or wait until i find it and edit this message
Jan 4, 2009 2:12 PM

Offline
Feb 2008
5089
Been looking for it, thought there might be. Good to know it being confirmed that there actually is. Haven't found it yet, but I'll keep searching, you don't have to look if you don't want. Thanks for all the help. ♥
Jan 4, 2009 2:30 PM

Offline
Sep 2008
630
Drybananna said:
Been looking for it, thought there might be. Good to know it being confirmed that there actually is. Haven't found it yet, but I'll keep searching, you don't have to look if you don't want. Thanks for all the help. ♥


cant remember where the heck i seen it.
all i remember is the code has 'alpha' in it. well good luck finding it.
Jan 4, 2009 2:42 PM

Offline
Oct 2006
1569
I threw in these two lines ($img being my variable holding the image, to be replaced with $blub or whatever you might've called yours) and it worked fine for me:
imagealphablending($img,true);
imagesavealpha($img,true);

Jan 4, 2009 3:18 PM

Offline
Nov 2006
5545
yeah the transparent stuff was a question i asked here. :) well, that's one of the posts where i got help anyway.
Jan 4, 2009 3:20 PM

Offline
Sep 2008
630
windy said:
yeah the transparent stuff was a question i asked here. :)


that was the post!, lol.
i remembered something about jagged-ness
and it looks like your signature isnt jagged anymore. :)
Jan 4, 2009 3:21 PM

Offline
Nov 2006
5545
atruong18 said:
windy said:
yeah the transparent stuff was a question i asked here. :)


that was the post!, lol.
i remembered something about jagged-ness
and it looks like your signature isnt jagged anymore. :)
i actually haven't gotten around to editing it yet; i just made the image flat with rounded edges/white bg. it currently looks like crap to dark theme users but i'm so lazy. ;A;
Jan 4, 2009 3:50 PM

Offline
Sep 2008
630
windy said:
atruong18 said:
windy said:
yeah the transparent stuff was a question i asked here. :)


that was the post!, lol.
i remembered something about jagged-ness
and it looks like your signature isnt jagged anymore. :)
i actually haven't gotten around to editing it yet; i just made the image flat with rounded edges/white bg. it currently looks like crap to dark theme users but i'm so lazy. ;A;


ah i see. cant blame the laziness, lol. im lazy to animate + automate my sig, its one or the other, not both.
Jan 4, 2009 10:33 PM

Offline
Dec 2008
663
when i get my laptop back im gonna dedicated one weekend just to sit and make sigs :P


Thanks to FreedomWings for the sig!
Jan 5, 2009 3:32 AM
Offline
Oct 2008
125
Ok here is my first attempt at this.
*just something really basic so I can see the text and play with it*

I'm still trying to get the dates to work.. :?

Its a start..
DrizzkaJan 5, 2009 2:55 PM
Jan 5, 2009 4:46 AM
Offline
Jul 2008
3032
Thank you guys, especially shiteiru,Krelian,Fara7, and Ripaz for discussing and making it possible for me to make this signature. I've learned from your tries ^^
Now I need to make a decent avatar :)
Jan 5, 2009 5:31 AM

Offline
Dec 2008
663
did u make that sig? thats fantastic


Thanks to FreedomWings for the sig!
Jan 5, 2009 7:04 AM

Offline
Dec 2007
218
deathafterkarma said:
Ok here is my first attempt at this.
*just something really basic so I can see the text and play with it*

I'm still trying to get the dates to work.. :?

Its a start..


We have already discussed about displaying the date here :) You can have a look.
Jan 5, 2009 2:54 PM
Offline
Oct 2008
125
Fara7 said:

We have already discussed about displaying the date here :) You can have a look.

I figured out my problem. It was a typo. I was using $date instead of $dates.
Jan 5, 2009 11:37 PM
Offline
Jul 2008
3032
Can you guys solve this for me:
I got January 5th on my sig when I updated my anime list, and it's January 6th for me.
I'm in GMT+1 zone. I'm using script from this tutorial.
How can I fix this?
Jan 6, 2009 6:37 AM

Offline
Sep 2008
630
Miyako-chan said:
Can you guys solve this for me:
I got January 5th on my sig when I updated my anime list, and it's January 6th for me.
I'm in GMT+1 zone. I'm using script from this tutorial.
How can I fix this?


from what im guessing, go to 'edit your profile'
on the personal tab, there should be a timezone section, change it to your own timezone.
that should link to everything in the update hopefully, or only the ones after it.
Jan 6, 2009 2:27 PM

Offline
Jul 2008
534
^that isn't it (the "profile timezone" decide only what shown on the MAL page, not what saved in the DB)

but maybe, the server you use have not your timezone
upload this as php file and look if the correct date shown
<?php
echo date("d M, G:i");//current date e.g. 06 Jan, 23:30
?>

if yes, post a snippet of the relevant code, for a closer look
Jan 6, 2009 9:17 PM

Offline
Feb 2008
5089
Does anyone know how to put a stroke around the text? Not a glow, just a stroke. I've been trying everything, nothing seems to do it. :<

Sorry for all of my questions.
Jan 6, 2009 10:13 PM

Offline
Jul 2008
1156
Drybananna said:
Does anyone know how to put a stroke around the text? Not a glow, just a stroke. I've been trying everything, nothing seems to do it. :<

Sorry for all of my questions.


I think a glow is all that anyone has been able to produce so far, but I'm not a complete PHP wiz so I can't really say if it's possible or not. A text stroke would be so sexy though, I would seriously fall in love with whoever could make it happen.

The closest I've seen is this as far as creating a stroke like effect.
Jan 6, 2009 11:26 PM

Offline
Oct 2006
1569
You could manage it, I'm sure, but I don't know of any easy way to do it. Especially with decent antialiasing. I've been puzzling over it a bit, but I'm thinking you'd have to create a blank image, write the text on that, and then step through pixel by pixel to add a stroke effect.
Jan 7, 2009 12:25 AM
Offline
Jul 2008
3032
atruong18 said:
Miyako-chan said:
Can you guys solve this for me:
I got January 5th on my sig when I updated my anime list, and it's January 6th for me.
I'm in GMT+1 zone. I'm using script from this tutorial.
How can I fix this?


from what im guessing, go to 'edit your profile'
on the personal tab, there should be a timezone section, change it to your own timezone.
that should link to everything in the update hopefully, or only the ones after it.

_Bael said:
^that isn't it (the "profile timezone" decide only what shown on the MAL page, not what saved in the DB)

but maybe, the server you use have not your timezone
upload this as php file and look if the correct date shown
<?php
echo date("d M, G:i");//current date e.g. 06 Jan, 23:30
?>

if yes, post a snippet of the relevant code, for a closer look


Bael was right :D thank you very much :)
I've put this:
date_default_timezone_set('Europe/Sarajevo');
and it's working :)
Jan 8, 2009 10:37 AM
Offline
Nov 2008
272
Kuroshiroi posted in other topic code to remove "- TV" bug

But when copied this line to my config I havent noticed any changes. Maybe I should replace this code with other in .php file?
Jan 8, 2009 10:49 AM

Offline
Dec 2007
218
Do this :)
$string = str_replace($end,"",$ncnt);
$titles[$t] = preg_replace('/ - (TV|Movie|ONA|OVA|OAD|Special)$/', '', $string);

In place of $titles[$t] in your code, put another variable and then use the code that Kuroshiroi gave with $titles[$t].
Jan 8, 2009 11:00 AM
Offline
Nov 2008
272
Thanks! Working perfectly now :)
Jan 8, 2009 11:30 PM

Offline
Oct 2008
201
Thanks very much for this tutorial!! With the detailed step-by-step explanation I could make a simple one in a few hours ^^

Jan 9, 2009 6:28 AM

Offline
Sep 2008
630
Fara7 said:
Do this :)
$string = str_replace($end,"",$ncnt);
$titles[$t] = preg_replace('/ - (TV|Movie|ONA|OVA|OAD|Special)$/', '', $string);

In place of $titles[$t] in your code, put another variable and then use the code that Kuroshiroi gave with $titles[$t].


and a side note that i found
if you included the '...' into your title so it doesnt go long, add another one like:
$titles[$t] = preg_replace('/ - ...$/', '',
or something of the sort.
Jan 9, 2009 8:10 AM

Offline
Apr 2008
48
I can't remove "- TV" thing T_T I did how Fara7 wrote but still no changes >_<
I'm using talons script.. can any1 help me??
A True Man Never Dies...
Even When He's Killed!!!!


Jan 9, 2009 8:45 AM

Offline
Feb 2008
4295
nikmax said:
I can't remove "- TV" thing T_T I did how Fara7 wrote but still no changes >_<
I'm using talons script.. can any1 help me??
You'll need to find the relevant code that outputs the anime title. It's probably in the signature.class.php or something. Once you find that you'll need to add this line (if $title is the anime title variable)

$title = preg_replace('/ - (TV|Movie|ONA|OVA|OAD|Special)$/', '', $title);

Maybe Talon's anime title variable is an array and then you'll have to do something similar by replacing $title with something like $title[$i].


For the other people, using shiteiru's modified code from page 3 (msg #53), try using this (the first and last line should be the same as your code, so paste what's between them and revert if you already have made some other modifications to remove the TV etc.)
------------------------------------------------------------------------------------------
$cutter = str_replace($end,"",$ncnt);
$cutter = preg_replace('/ - (TV|Movie|ONA|OVA|OAD|Special)$/', '', $cutter);
If (strlen($cutter) > 12)
------------------------------------------------------------------------------------------
This should work for the long titles as well, in case they're just long enough to leave something like "- Spec...", which I gather is possible.

shiteiru: It's probably time for a new version :)
Jan 9, 2009 11:49 AM

Offline
Apr 2008
48
its still not changeing... here is the script.. http://myanimelist.net/forum/?topicid=32704 can you take a look please.. n_n
A True Man Never Dies...
Even When He's Killed!!!!


Jan 9, 2009 11:57 AM

Offline
Feb 2008
4295
Well, in Signature.class.php go to:
function writeTitle($nr,$x,$y,$rule,$rotation=0,$length=45,$align="l")

and add this line after $Text=$this->rssTitle[$nr][1];
$Text = preg_replace('/ - (TV|Movie|ONA|OVA|OAD|Special)$/', '', $Text);

That should take care of it.
Jan 9, 2009 12:07 PM

Offline
Apr 2008
48
whoa.. that was fast XD XD I mean the reply.. XD

it worked now.. \(^o^)/
thank you very much... ^^
nikmaxJan 9, 2009 12:10 PM
A True Man Never Dies...
Even When He's Killed!!!!


Jan 9, 2009 2:30 PM

Offline
Nov 2007
85


I saved the files a while ago and finally got an image and idea that I though I should try with this. I think it came out pretty good for my first~
I am mongeesubs. If you can time/typeset and want to help sub Youkai Watch, let me know~
Pages (4) « 1 [2] 3 4 »

More topics from this board

» New Clashing Feelings volume after a decade

Shiratori-san - Sep 27

4 by Shiratori-san »»
8 hours ago

» MyAnimeList x Honeyfeed Writing Contest 2025 Submission

Avarion - Yesterday

2 by Avarion »»
Yesterday, 11:09 PM

» MAL Analog Horror

Wendy-- - Sep 27

10 by Shizuna »»
Yesterday, 3:05 PM

» Vladimir Volfovich Zhirinovsky's MAL Diary of Kawai Memories

V_V_Zhirinovsky - Yesterday

1 by V_V_Zhirinovsky »»
Yesterday, 1:00 AM

» New Android App – Shimeji Mascot Screen Pets

shimejimascot - Sep 26

8 by hacker09 »»
Sep 26, 10:03 PM
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login