NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

#1 10-28-2005 05:50:03

Pinkie
Member

A colorin oekaki

OK... I am currently having trouble with the getimage size in paintBBS animated. What I want is for users to be able to choose a lineart from a selection already submitted, and to be able to color it in and sumbit it to the front page. If you log in using 'test' as the user and the same for the password at http://www.pichu.mihopa.com/oekakis/colorin/ you'll see a 'Color a lineart page'.

Becuase I don't know much about mySQL and php coding, I wouldn't want for the gallery to be driven by a database, unless you have to time to code somethign for me.

Here is what I have done:

1) I have created an ../outlines/ directory under the colorin oekaki.
2) I have added all the picture to a gallery page named linearts.php.
3) I have made a copy on noteBBS.php, (and named it noteBBS2.php) and re-coded a few parts:

Code:

<? if ($edit != '') { ?>
                <param name="image_canvas" 

value="http://pichu.mihopa.com/oekakis/colorin/outlines/<?=$edit?>.pch">
                <param name="url_save" 

value="paintbbsget.php?username=<?=urlencode($OekakiU)?>&edittimes=<?=time()?>">
                <param name="url_exit" value="index.php?mode=ani_msg&datatype=0">

and this:

Code:

    $size = GetImageSize('http://pichu.mihopa.com/oekakis/colorin/outlines/<?=$edit?>.png');

So then I have linked the thumbnails on the linearts page using <a href=../noteBBS2.php?edit=(picture number)

But when I click on the thumbnail I get:

Warning: getimagesize(http://pichu.mihopa.com/oekakis/colorin/outlines/.png): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/pinkie/domains/pichu.mihopa.com/public_html/oekakis/colorin/noteBBSa2.php on line 37

and a blank canvas. I think it's something to do with the GetImageSize string, but I'm not sure how I can fix it; it's not adding in the <?$edit?>.

Help would be greatly appreciated.

Offline

#2 10-28-2005 07:03:15

Waccoon
Administrator

Re: A colorin oekaki

GetImageSize() is a script library, and should point to a local path.  Using it with HTTP requests is very bad.  Just use ./outlines/{$edit}.png' as the path, assuming the rest of the script is fine.

There are bigger problems, though...

First, PHP uses tags to tell when HTML ends and PHP begins.  If you're writing HTML, you use the entry short tag <? to start a section of PHP, and the closing short tag ?> to go back to HTML mode.  Technically, the correct way to echo a variable within HTML is <?php echo $varaible; ?>, but this can be shortened to an echo short tag: <?= $varaible ?>.  You should not use short tags within PHP functions.  Instead, the variable has to be used as part of the statement as if it is PHP code.

Second, PHP uses two types of quotes.  Parsed quotes (double quotes) interprets an entire statement and changes all variables to values.  So, if $name is set to "Marc", the statement echo "My name is $name";, will print "My name is Marc".  You can also use brackets around variables for clarity, so the statement can also be echo "My name is {$name};".  There are also unparsed quotes (single quotes) which treat statements literally.  So, if $name is set to "Marc", the statement echo 'My name is $name';, will print "My name is $name".  Make sure you use the correct quotes.

Here is the corrected GetImageSize() code:

Code:

$size = GetImageSize("./outlines/{$edit}.png");

The code to set the "image_canvas" parameter of the applet looks fine, assuming there is always an animation available.

I have created an ../outlines/ directory under the colorin oekaki.

You mean, the ./outlines directory.  Putting two periods in front of the path will mess-up the script.

A single period means to use the current working directory (/coloring) as the root.  Therefore, the full path is ./oekakis/colorin/outlines

Two periods means to go back one directory.  So the path would be ./oekakis/outlines, and the script will complain that the directory dosn't exist.  Use a single period to access stuff from the coloring directory.

Offline

#3 10-28-2005 08:22:39

Pinkie
Member

Re: A colorin oekaki

Thank you so much for the super fast reply....but It still doesn't work....

when I go to: http://www.pichu.mihopa.com/oekakis/col … hp?edit=13
(13.pch & 13.png does exist in the outlines directory for certain)

I get the following error:

Warning: getimagesize(./outlines/2.png): failed to open stream: No such file or directory in /home/pinkie/domains/pichu.mihopa.com/public_html/oekakis/colorin/noteBBSa2.php on line 37

Why is it 2.png? It's throwing errors becuase there isn't a 2.png in the outlines directory. But where on earth did 2.png get from? I changed everything like you told me to.


An interestign thing also... when going to http://www.pichu.mihopa.com/oekakis/col … php?edit=9 everythign works perfectly fine.

Just to make sure... in the applet parameter is this correct?

Code:

<param name="image_canvas" value="./outlines/<?=$edit?>.pch">

One day I think I'll decide to learn PHP. After I get some coursework over and done with in december I will borrow books from the library on PHP. It seems like a very useful language to learn; I've been very lazy ever since I learnt the basics of HTML at the age of 10 or 11 (yes.. XD that young). Since then I learnt how to do more advanced stuff and CSS.. but that's about it.

Offline

#4 10-29-2005 00:08:34

Waccoon
Administrator

Re: A colorin oekaki

An interestign thing also... when going to http://www.pichu.mihopa.com/oekakis/col … php?edit=9 everythign works perfectly fine.

It doesn't work for me.  You might have a syntax error that is either clearing the $edit varialble or is not using it at all.

If you're really having a hard time getting it to work, e-mail the file to me and I'll check it out.  It's probably just something little.

Code:

<param name="image_canvas" value="./outlines/<?=$edit?>.pch">

Nope.  The dot slash at the beginning lets a server know that this is a local path, pointing to the current directory.  Applets don't like them unless you specify a codebase.  Just use outlines/<?=$edit?>.pch

Note that the path in the original noteBBS.php file is <?=$OPpics?>/<?=$edit?>.pch, which produces something like pictures/100.pch

One day I think I'll decide to learn PHP.

Though I have a lot of experience with Perl and other programming languages, I learned PHP from scratch by working on OekakiPoteto and reading the PHP website.  It's pretty easy to learn once you know the syntax basics (though the PHP website doesn't teach you the basics very well).

The best thing to do is to install an Apache webserver and PHP on your home computer so you can test stuff.  That's pretty frustrating, though, so only do that if you're really serious about learning how to program.  Keep in mind that this is mostly UNIX software, and you can't just run an installer that will do everything for you.  A good text editor is recommended for HTML and PHP, too.  I use EditPlus, and absolutely love it because it does all the basics and has no extra junk or bells attached.  NotePad isn't going to get you very far.  smile

Offline

#5 10-30-2005 04:58:48

Pinkie
Member

Re: A colorin oekaki

It must be something with permissions, people seem to be only able to edit their own pictures. I'll e-mail you all the files...

Thanks for the advise! BTW.... by installing an apache web server, does that insatll things like mySQL? and is it easy to uninstall since my mum might complain once she finds out how much "rubbish" I have insalled on my computer. I think I found a tutorial somewhere about installing php and mySQL on your computer... I better check it out.

Last edited by Pinkie (10-30-2005 05:08:12)

Offline

#6 10-31-2005 01:21:37

Waccoon
Administrator

Re: A colorin oekaki

Got the files.  I'll e-mail the fixed ones to you.

Installing Apache isn't that hard, but will require tweaking some text files to get it working.  It's not a point-and-click installation, that's for sure.

PHP and MySQL must be installed seperately.  PHP is easy, MySQL is a pest.

Offline

#7 11-05-2005 04:52:48

Pinkie
Member

Re: A colorin oekaki

Anyway, I'd just liek to say a BIG thank you! The colorin oekakis workds like a charm. I'll be sure to leave a note of credit in teh footer.

Offline

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB