Forum Settings
Forums

Tutorial: Generating scripted-signatures (Version 2)

New
Pages (9) « First ... « 5 6 [7] 8 9 »
Aug 22, 2009 4:36 AM

Offline
Aug 2009
403
CharisMagic said:
Hi dur. Need some help xD
When ever I make a PHP sig, the manga updates with the chapter always have that "chapters" that appear at the end.
Like: "Reading @ 10/25 chapters". Does anybody know how I can get rid of the "chapters" at the end?


Edit the setttings.php file. At the very bottom there is the magna settings. For the setting $after_read = "chapters"; change it to $after_read = ""; and it will be gone. You can change the look of the whole thing by using settings.php
Aug 22, 2009 10:35 AM
Offline
Feb 2009
1637
mushwars said:
CharisMagic said:
Hi dur. Need some help xD
When ever I make a PHP sig, the manga updates with the chapter always have that "chapters" that appear at the end.
Like: "Reading @ 10/25 chapters". Does anybody know how I can get rid of the "chapters" at the end?


Edit the setttings.php file. At the very bottom there is the magna settings. For the setting $after_read = "chapters"; change it to $after_read = ""; and it will be gone. You can change the look of the whole thing by using settings.php


I've done that already. And before, everytime I made a PHP sig, I just erase the $after_read. The episodes go away, but not the chapters >__>
Aug 22, 2009 1:59 PM

Offline
Aug 2009
403
No, don't delete the whole line. Just delete the text episodes in the "" If you delete the whole line then the script will look for what $after_read is and It wont find anything. It works for me.
Aug 22, 2009 3:06 PM
Offline
Feb 2009
1637
mushwars said:
No, don't delete the whole line. Just delete the text episodes in the "" If you delete the whole line then the script will look for what $after_read is and It wont find anything. It works for me.


I did that already, and it still didn't work >.<
Aug 22, 2009 4:28 PM

Offline
Oct 2007
3811
It didn't work for me either >_>
Aug 22, 2009 6:14 PM
Offline
Feb 2009
1637
Temptation said:
It didn't work for me either >_>


Then we got the same problem lol
Aug 22, 2009 8:00 PM

Offline
Oct 2007
3811
CharisMagic said:
Temptation said:
It didn't work for me either >_>


Then we got the same problem lol
I tried a few things, but the chapters wouldn't go away.
Aug 22, 2009 8:30 PM

Offline
Jul 2008
97
the quick an dirty method is to change this:
imagefttext($image,6,0,345,106,$colour2,$font,$status[0][0]);

into this:
imagefttext($image,6,0,345,106,$colour2,$font,str_replace("chapters","",$status[0][0]));
Aug 22, 2009 8:49 PM

Offline
Jun 2007
1755
I've figured out how to make a rotating sig, but I was wondering how to make the font position, color, and size different for each sig?

?_? || Mo <3: squrrriles kidnapped her let's eat theree nuts || ♪♫♪
Aug 22, 2009 9:46 PM

Offline
Apr 2008
786
kyrori said:
I've figured out how to make a rotating sig, but I was wondering how to make the font position, color, and size different for each sig?


select case
Aug 22, 2009 10:13 PM

Offline
Jun 2007
1755
huyyy said:
kyrori said:
I've figured out how to make a rotating sig, but I was wondering how to make the font position, color, and size different for each sig?


select case

I wish I knew what that was. :/

?_? || Mo <3: squrrriles kidnapped her let's eat theree nuts || ♪♫♪
Aug 23, 2009 12:08 AM

Offline
May 2008
4052
kyrori said:
huyyy said:
kyrori said:
I've figured out how to make a rotating sig, but I was wondering how to make the font position, color, and size different for each sig?

select case

I wish I knew what that was. :/


The select keyword in php is just a shorthand way to write out a lot of if statements that compare against the same value. So if you're using a random number to rotate your sig, you could do something like this:

// do initial parsing and whatever setup
...

// pick random number to rotate
$rand = srand(1,3);
select($rand) {
case 1:
// do all the stuff you need different in sig 1
break;
case 2:
// do all the stuff you need different in sig 2
break;
case 3:
// do all the stuff you need different in sig 3
break;
}
// output the sig image and finish up
...


You can do the same thing using if ($rand == 1) { ... } else if ($rand == 2) {... etc, but the select-case layout is much cleaner when you're comparing one variable against a lot of values.

Basically though, if you want to make it so that the text is different for each sig, you will want to put the imagettftext() lines into the select (and define the imagettftext lines for each of the cases).

I am a banana.
Aug 23, 2009 4:37 PM
Offline
Feb 2009
1637
Niroko said:
the quick an dirty method is to change this:
imagefttext($image,6,0,345,106,$colour2,$font,$status[0][0]);

into this:
imagefttext($image,6,0,345,106,$colour2,$font,str_replace("chapters","",$status[0][0]));


Ah, thank you very much <3 It worked ^_^
Aug 29, 2009 3:00 PM

Offline
Apr 2007
1964
I'll try this out, thanks for the tutorial ^^

Question though, you said to set the chmods as 777 & 755, but if I don't set them like that will it still work? Cuse I'm currently using (or will be using) one of the sub domain huyyy has been offering and he said to keep all folders chmod as 755 and all files as 644...




Aug 29, 2009 3:08 PM

Offline
Jun 2007
1755
crystal_yuy said:
I'll try this out, thanks for the tutorial ^^

Question though, you said to set the chmods as 777 & 755, but if I don't set them like that will it still work? Cuse I'm currently using (or will be using) one of the sub domain huyyy has been offering and he said to keep all folders chmod as 755 and all files as 644...

Follow what he said and don't change the chmods at all for his hosting. I'm not changing them and it's all been ok for me. One less step anyways.

?_? || Mo <3: squrrriles kidnapped her let's eat theree nuts || ♪♫♪
Aug 29, 2009 3:09 PM

Offline
Feb 2008
6186
Everything will work. I am using subdomain from huyyy and this tutorial, and it works great! -Although I switched to saka's script now, but ehrgiz's worked fine yesterday- xD
.
Aug 29, 2009 3:29 PM

Offline
May 2008
4052
although my script does work without a cache, I still strongly recommend that you make sure your signature doesn't update every single time it loads... this means that at least the signature image that is output to $cachedpath should be writable by apache (656 on the image or 757 on the directory above)...

There are some uncommon server configurations where apache would not need write access on them... but they are very uncommon.

Edit: I'll try on huyyy's justhost hosting and verify if it's needed or not...
It looks like php runs as the username the script belongs to, so no chmod is necessary on huyyy's hosting.
sakaAug 29, 2009 3:42 PM

I am a banana.
Aug 29, 2009 3:47 PM

Offline
Apr 2007
1964
another question, if I don't want manga update can I just delete the manga parts in the settings.php & image_output.php script?




Aug 29, 2009 3:54 PM

Offline
May 2008
4052
crystal_yuy said:
another question, if I don't want manga update can I just delete the manga parts in the settings.php & image_output.php scipt?


not quite that simple... don't just delete variables in settings.php... you might even make it error or behave strangely.

if you decide that you want to take it out, then just comment out the manga text lines in image_output.php so they'll be ignored. Just put // at the beginning of the lines with imagefttext(). Then you can remove the // later down the road if you decide you want to add it back in.

I am a banana.
Aug 29, 2009 3:56 PM

Offline
Feb 2008
6186
Um.. You can set it..

Open Settings.php


And instead of $to_parse = "5" put $to_parse = "1"

That worked for me
.
Aug 29, 2009 4:10 PM

Offline
Apr 2007
1964
thanks, I'll try that out




Aug 29, 2009 4:19 PM

Offline
May 2008
4052
SabakuNoGaara said:

And instead of $to_parse = "5" put $to_parse = "1"

That worked for me


that only selects the feed though... the script will probably generate warnings because the manga text in image_output.php is not conditional on what you set there. Variables like $titles[1][0] don't get initialized if you don't parse the manga list...

when you try to access an uninitialized variable in php (or in this case an invalid array key), php will just default to an empty string and print that. That's fine, since it still doesn't print anything, but if the server is set with a high error level for some reason, php will try to print those warnings and break the image... though you'll probably get away with it on most servers. I still think it's safer to just comment out the lines.

of course, you should still have your $to_parse set to something non-manga... ;P

I am a banana.
Aug 29, 2009 4:35 PM

Offline
Feb 2008
6186
I did that and it worked.. But man, that script is so messed up.. It is divided and really a headache..
I totally encourage you,crystal to use saka's script.. So easier to use.. @_@
.
Aug 29, 2009 4:44 PM

Offline
Apr 2007
1964
Hum.. where do I go to see the final of the signature (with updates and all)?

I've try going to the "yoursite.com/signature/sig.php" thingy but I get "The Image „your-image“ cannot be displayed because it contains errors" but when I open "yoursite.com/signature/sig.png" I don't have the updates, it just show my pic... >.<

Gaar... I'm lost T_T




Aug 29, 2009 4:44 PM

Offline
Aug 2009
403
SabakuNoGaara (Male) said:
I did that and it worked.. But man, that script is so messed up.. It is divided and really a headache..
I totally encourage you,crystal to use saka's script.. So easier to use.. @_@

And it allows you to rewatch anime. If you do not use his, then it will show the status for the update before that rewatched anime, which will be wrong.
Aug 29, 2009 4:51 PM

Offline
Feb 2008
6186
crystal_yuy said:
Hum.. where do I go to see the final of the signature (with updates and all)?

I've try going to the "yoursite.com/signature/sig.php" thingy but I get "The Image „your-image“ cannot be displayed because it contains errors" but when I open "yoursite.com/signature/sig.png" I don't have the updates, it just show my pic... >.<

Gaar... I'm lost T_T


I had that problem, too.. I think it was something with the X and Y positions, but I don't remember.. PM saka, he will know what to do.
.
Aug 29, 2009 4:59 PM

Offline
Aug 2009
403
change your last line to:

header("Content-type: image/png");
imagepng($image);
@imagepng($image, sig.png);

and the error wont show up.
Aug 29, 2009 5:03 PM

Offline
May 2008
4052
just go to http://pastebin.com and paste in the contents of your sig.php.... send me the link and I'll see if i can spot any usual mistakes.

if you're getting the "cannot be displayed because it contains errors", then try opening that url in internet explorer and you'll probably be able to see what the php errors/warnings were (for once IE is useful for disobeying standards).

I am a banana.
Aug 29, 2009 5:20 PM

Offline
Apr 2007
1964
I didn't touch the sig.php so it's the same as the one ehrgeiz provide in the first post
& IE is being stupid and doesn't want to load the url >.<

@ mushwars: Where do I make those change? in the sig.php file?
crystal_yuyAug 30, 2009 12:24 PM




Aug 30, 2009 1:58 PM

Offline
May 2008
4052
i thought you were using my script, which is why i asked for sig.php... that won't be useful for me in ehrgeiz's script since like you said it's always the same in that script.

go ahead and post the settings.php and image_output.php also and send pastebin links for those.... and since you already have it uploaded somewhere just send the link via pm and I can read the warnings (it's buried in the broken image data).


Edit: after looking at crystal_yuy's code, I came to the conclusion that it was caused by some shoddy code in sig.php and is a bug in ehrgeiz's script in general. When it is testing that the feed was downloaded properly, ~line 83 in sig.php, it treats the file streams it opened as if they were strings.... and things break. It caused the script to think the feed did not download, although it did... and the error message could not display since they are sent out with echo instead of die() and the script continues running.

To fix this, find this block starting at line 83 of sig.php:

...and replace it with the code below:

...doing so should make it.... less horrible. At least it will work when there's only a single feed... and won't be trying to trim a file stream like it's a string.

I also strongly encourage people to switch to a better script, like my minimal one if you just need custom fonts, or Talon and Niroko's script if you need additional features like glow.
sakaAug 30, 2009 6:07 PM

I am a banana.
Aug 30, 2009 6:43 PM

Offline
Apr 2007
1964
I've made the change but it seems I'm still getting that error problem... I'll just switch script.. it'll be easier I think...

@ saka: does your minimal script replace the sig.php only or all three (sig, settings & image_output)?




Aug 30, 2009 10:43 PM

Offline
May 2008
4052
crystal_yuy said:
I've made the change but it seems I'm still getting that error problem... I'll just switch script.. it'll be easier I think...

@ saka: does your minimal script replace the sig.php only or all three (sig, settings & image_output)?


it's standalone... what you see there is the entire script -- just put the images and fonts in the same directory and edit to your needs. That's why it's minimal. ;)

I am a banana.
Aug 31, 2009 12:58 AM

Offline
Feb 2008
2028
Hmm...Is there a way to get long text from shows with long names and such after each space to appear under neath each other like this?
NSFW probably....


Then have the longer part cut on each line to a certain point, like it would normally happen with out having the lines cut after each space?
Aug 31, 2009 1:21 AM

Offline
Jul 2008
97
Sephor said:
Hmm...Is there a way to get long text from shows with long names and such after each space to appear under neath each other like this?
NSFW probably....


Then have the longer part cut on each line to a certain point, like it would normally happen with out having the lines cut after each space?

Yes, but you need to program that since it is not build in php ;)
Aug 31, 2009 9:36 AM

Offline
Aug 2009
19
thrown together quickly:

$text = 'Hakuto No Ken'; // the title
$title_array = explode(" ", $text); //create an array of the titles words seperated by a space

//You will most likely have a set number of rows you can display your title on
//For this example we will go with 3

$nWords = intval((count($title_array)/3)); // How many words per line

$row1 = implode(" ", array_slice($title_array, 0, $nWords));
$row2 = implode(" ", array_slice($title_array,$nWords, $nWords));
$row3 = implode(" ", array_slice($title_array,$nWords*2));
echo $row1."<br>".$row2."<br>".$row3;
Sep 1, 2009 4:11 AM

Offline
Feb 2008
2028
Thanks, but where/ which file would i put the text into?.. Uber nooby with this stuff, only know to to make normal scripted sigs. Just to make sure this would work for the name of the updates right?....
Sep 1, 2009 5:15 AM

Offline
Aug 2009
403
Sephor said:
Thanks, but where/ which file would i put the text into?.. Uber nooby with this stuff, only know to to make normal scripted sigs. Just to make sure this would work for the name of the updates right?....


You would put it in you output php the one that has where you place your text. And insted of having the lines of text be $titles[1] or whatever you would make it $row1 and make sure that you set things like Haterot said. Which he is a genius btw to have figured this out. Obviously not a nooby at php ^^
Sep 1, 2009 5:18 AM

Offline
Aug 2009
19
That code there is just showing how you would explode the title out cleanly. As far as where you get the information it would be coming from an RSS feed. Also depends on what script you are using to generate your sig with now.
Sep 1, 2009 7:27 AM

Offline
Feb 2008
2028
Ah, ok. Ill mess with this when i wake up after i decide to go to sleep. Using the script from the first page still.
Sep 1, 2009 8:10 AM

Offline
Aug 2009
19
I am using saka's variant of the sig script, which i have altered to allow multiple sigs, it just randomly chooses one. In that script the titles are contained in the array $titles

so with the code above it becomes:


I don't wanna muck up the thread with needless code, if you need more help send me a PM and I'll be happy to help.
Sep 1, 2009 8:19 AM

Offline
May 2008
4052
I think that's pretty much all the code that would need changing, except with imagettftext() and coordinates instead of just echo. Then it's done. ;)

I am a banana.
Sep 5, 2009 12:40 AM

Offline
Oct 2007
3811
Hi, I have several questions and I'm using ehrgeiz's script.

1. I like to use the glow effect, but where do I insert the script for that in image.php?

2. I like to have the updates on multiple sigs, but it chooses one over the others despite the many times I make a new directory. So, I can't separate each directory with image.php, setting.php, and sig.php. The coding is all correct, but sig.php has errors when I post another sig with updates.

3. What part in image.php would I be able to have the anime and manga updates with different colors and/or font style?

4. On post #294, where would I fill in the name, width, and height of the foreground image? What is the foreground image?

5. How do I make the updates don't show as much? For example, I want The Melancholy of Haruhi suzumiya to be showing as The Melancholy of Haru....

6. Is there a way to know the angles that I'm using? I kept going in reverse order, but I need to know which way I'm going because I spent hours on putting the updates on the right angle and it hurts my eyes.

Sorry for the questions that might have been asked before. I would appreciate the help. (eheh...protractor isn't nearby, so help please...)
Sep 5, 2009 12:56 AM
Offline
Feb 2009
1637
Temptation said:

2. I like to have the updates on multiple sigs, but it chooses one over the others despite the many times I make a new directory. So, I can't separate each directory with image.php, setting.php, and sig.php. The coding is all correct, but sig.php has errors when I post another sig with updates.
Hmm. Each time I wanna make a new sig, I make a folder for each sig. And in each folder, there's its own image_output, settings, and sig.php. So I don't know. Maybe try that, cause it's easier for me to do that.

Temptation said:
3. What part in image.php would I be able to have the anime and manga updates with different colors and/or font style?

For different font color, see post 301. I think you can do the same with font, except instead of $colour1 and $colour2 , use $font1 and $font2

Temptation said:
4. On post #294, where would I fill in the name, width, and height of the foreground image? What is the foreground image?

Foreground image is the image in the front. Any updates would show up behind it. My zerokichi sig is a good example.
http://charismagic.sorams.com/zerokichi/
Now, when you click on 'Foreground.png, you only see the girl there, not the sky and stuff. With that as the foreground image, the updates won't show up in front of the girl.

Now, I'm not sure what you're asking by "where" you put it. In that post, it says where you would fill in the name, height, and width already. o.O

Temptation said:
5. How do I make the updates don't show as much? For example, I want The Melancholy of Haruhi suzumiya to be showing as The Melancholy of Haru....

Go to settings.php
Find $cut_titles = "0"; // 1=yes or 0=no
$cut_title_after = "12"; //

Put "1" for $cut_titles.
Then, for $cut_title_after , put the amount of letters you want it to be limited to.

Temptation said:
6. Is there a way to know the angles that I'm using? I kept going in reverse order, but I need to know which way I'm going because I spent hours on putting the updates on the right angle and it hurts my eyes.

Working with angles can be difficult sometimes. All I know is that the end of the update line with head counter-clockwise (the higher the angle, the farther left it'll turn). The angle on my zerokichi sig is 45 degrees. Sometimes, I have to play around with the angles and keep on guessing until I get it right. >.<

Sorry for the questions that might have been asked before. I would appreciate the help. (eheh...protractor isn't nearby, so help please...)
rweqoiuSep 5, 2009 10:08 AM
Sep 5, 2009 1:13 AM

Offline
Oct 2007
3811
CharisMagic said:
Temptation said:

2. I like to have the updates on multiple sigs, but it chooses one over the others despite the many times I make a new directory. So, I can't separate each directory with image.php, setting.php, and sig.php. The coding is all correct, but sig.php has errors when I post another sig with updates.
Hmm. Each time I wanna make a new sig, I make a folder for each sig. And in each folder, there's its own image_output, settings, and sig.php. So I don't know. Maybe try that, cause it's easier for me to do that.
I tried that, but the first main directory would be used. I tried folders, but none of them work :/

I'll think of something.

Thanks for partially answering my questions though.
Sep 6, 2009 7:54 AM

Offline
Jul 2009
939
hi ive been tryin 2 figure out how do you upload my files to my webspace using the filezilla client as u say

sorry im a begginer at dis ^^
Sep 6, 2009 8:49 AM

Offline
Aug 2009
403
silver2k9 said:
hi ive been tryin 2 figure out how do you upload my files to my webspace using the filezilla client as u say

sorry im a begginer at dis ^^

You should have a user name and password. Then all you do is type the main website as the host. I.E. Mushwars.net then you type your username: root (or whatever you were given by your host) then your password: WTFiASSkick then you need to type your port. Usually it uses the default port, although mine uses a non standard port.

I can give you web-space for you sig if you have not gotten one already. I would recommend using 000webhost. I would also recommend using .png output instead of using the php because it will use more bandwidth I think.
Sep 6, 2009 2:42 PM

Offline
Sep 2008
230
There's a problem on 000webhost.com... i downloaded the ip_confirm.exe and entered the 6-digit code but it says the code is invalid... anyone here have thesame problem?



thx 2 Rinjii 4 d sigy^^
Sep 6, 2009 3:02 PM

Offline
Aug 2009
403
you shouldnt have to do something like that, all you have to do is upload your php file, I tried 000webhost and it worked fine. I never saw ip_confirm anywhere, it actually sounds like a virus.
Sep 6, 2009 3:23 PM

Offline
Sep 2008
230
i see... i clicked CP (control panel) and im just starting my way... i'll post again soon when i encounter problems ^^



thx 2 Rinjii 4 d sigy^^
Sep 6, 2009 3:42 PM

Offline
May 2008
4052
000webhost requires you now to download some ip_confirm.exe executable that is slightly shady... although hopefully they don't have bad intentions. Unless you already have an account, or maybe can just run the executable on a virtual machine, then I no longer recommend making new accounts there.

I have heard people have had success with http://x10hosting.com/ although they have a kind of broad anti-anime statement in their terms of service...

I am a banana.
Pages (9) « First ... « 5 6 [7] 8 9 »

More topics from this board

» MY ANIMATED SHORT FILM

DiscloSalilokui - Oct 9

3 by DiscloSalilokui »»
11 hours ago

» Four Ages! ( 1 2 )

Robert_SS_Gordon - Feb 21

52 by Retro8bit »»
Oct 11, 5:07 PM

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

mewmewforever - Aug 30, 2024

216 by Retro8bit »»
Oct 11, 5:06 PM

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

Animetwins - May 5, 2015

1029 by Stormey »»
Oct 11, 8:17 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
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login