NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

#1 10-28-2007 17:39:31

Pinkie
Member

Colorin oekaki

I hope you can help me out on this, I really do appreciate it.


Firstly, I'm wishing to create a colorin oekaki in Wacintaki; basically, where artists are able to color in other's outlines.

I have managed to set up a separate table, named colorin_pinkcolour_book, which is almost the same as the oekakidta table. It stores all the outlines.

I have also managed to set up a page where users can select the outline they wish to colour. All outlines are stored in a directory which is at ./book/lineart_NUMBER.EXT

The two applets which I will use are PaintBBS and ShiPainter. (I'm not worried about creating animations that'll work for both applets interchangeably).



Firstly, what is the difference between noteBBS.php and paintBBS.php ?


Two links that are created in my coloring book page:

noteBBS2.php?edit=73825847&artist=Eclipse
shiBBS2.php?edit=77993397&artist=magicalpyrodragon

(the applet depends on the data type, which is stored in the new table I created)


My questions:

1. what do I need to delete to get rid of (in both applets) so that the error message:

"Incorrect password to retouch!

Use your browser button to go back."


So that EVERYONE with the D and M flag can edit the loutlines?


2. How can I set it so that the image is posted as a new image?


Thank you for you help and support.

Offline

#2 10-28-2007 22:13:50

Waccoon
Administrator

Re: Colorin oekaki

Firstly, what is the difference between noteBBS.php and paintBBS.php?

The HTML.  "NoteBBS" is the color palette system on the right side of the screen, while PaintBBS is the name of the applet.  The only difference between the two scripts is whether the palette is available.

1. what do I need to delete to get rid of (in both applets) so that the error message:  "YUCKY"
2. How can I set it so that the image is posted as a new image?

Let's kill both with one stone.  The bottom line is that you need to import the canvas, rather than try to edit an older picture.

There are three variables in each paint script used to get an existing picture called $app_import, $import, and $edit.

$edit is the only variable passed as CGI, and is a control variable.  If zero, a new picture will be posted.  If not zero, the board will copy $edit to $import and then test if the picture being edited is owned by the member, or if the password is OK.  If the password is "public", $edit is set to zero, so the board will post the imported canvas into a new slot.  $edit is also passed to the exit code.

$import is the duplicate of $edit.  Unlike $edit, its value never changes throughout the script.  $import is used to set $app_import.  If set, $import is also passed to the exit code.

$app_import is the actual canvas sent to the applet.  It is a direct path.  This is what you want to change to allow for a coloring board.

The "public" flag already allows people to recolor pictures.  I assume you want to recolor pictures from a special folder.

To do this, create a new control variable, such as $recolor, which would be the filename of the picture you want to import.  $edit and $import should be blank.  If $recolor is set, then you need to convert that canvas name into a full path, then get the image size.  Post that code before the canvas size verification:

Code:

// Recolor
if (empty ($edit) && empty ($import)) {
    // Name, such as "pic.png"
    $recolor = w_gpc('recolor');

    if (!empty ($recolor)) {
        // Clean, add path
        $file_illegal = array ('"', '?', '*', '/', '\\', ':', '|', '<', '>');
        $app_import = './recolor/'.str_replace ($file_illegal, '', $recolor);

        if (file_exists ($app_import)) {
            $size = @GetImageSize ($app_import);
            $xcord = $size[0];
            $ycord = $size[1];
        } else {
            $recolor = '';
        }
    }
}


// Verify that canvas sizes fit min/max
$xcord = fix_range($cfg['min_x'], $cfg['canvas_x'], $xcord);
$ycord = fix_range($cfg['min_y'], $cfg['canvas_y'], $ycord);

Then, update the applet parameter:

Code:

<? if ($import || $recolor) { ?>
        <param name="image_canvas" value="<?=$app_import?>" />
<? } ?>

Now, to edit any recolor, just use this URL:  paintBBS.php?recolor=image.png  You don't need any of the other stuff, like x and y size, anim, or other junk.

That will allow recoloring.  In fact, I think I'll make this code official in a future release.  smile

The only issue is uploading files to the recolor folder and making them available via a separate screen, the notice, or on the draw screen.  I'll leave that up to you for now.

Offline

#3 10-29-2007 13:34:24

Pinkie
Member

Re: Colorin oekaki

Thank you so much for your speedy reply and the help.

I have tried to edit noteBBS.php, exactly like you said. However, when trying to recolor the outline, a blank canvas appears in IE 7 whilst Firefox abruptly crashes.

I edited "./recolor/" to suit my directory, and I am sure the path is correct and that no files are corrupt in the folder.

I think I know the source of the problem: the "image_canvas" parameter is not being loaded at all in the HTML of the page. I can't work out why it does that though....

Offline

#4 10-30-2007 03:34:38

Waccoon
Administrator

Re: Colorin oekaki

Works for me.  It might be a copy/paste issue.

I know this one works, so compare this to what you have now:  noteBBS.php (1.3.11)

Offline

#5 10-31-2007 17:50:14

Pinkie
Member

Re: Colorin oekaki

Hmmm.. it's still not working. I uploaded your version of noteBSS straight to the server

Do you mind registering on my oekaki and having a look? http://pichus-world.com/oekakis/colourin/

It has auto-registration so you won't have to wait to be unpended. Then just click "Colouring book" from the header.

Thank you so much for your help.

Offline

#6 11-01-2007 06:35:21

Waccoon
Administrator

Re: Colorin oekaki

Well, for one thing, your filenames are incorrect.  Files in the book folder begin with "lineart_", but that prefix is not in your coloring book script.

Also, you're using a folder called "book", so make sure you've edited the path correctly:

Code:

$app_import = './recolor/'.str_replace ($file_illegal, '', $recolor);

TO

$app_import = './book/'.str_replace ($file_illegal, '', $recolor);

Offline

#7 11-04-2007 04:15:52

Pinkie
Member

Re: Colorin oekaki

How silly of me not to notice! XD It works fine now.

I have 2 more question.


1) How does notebbs load the animation?

I've got <param name="thumbnail_type" value="animation" /> to appear in the HTML if the associated animation file exists.

The pch file still won't load though.




2) I've set up so the export URL looks like so:

http://pichus-world.com/oekakis/colouri … ist2=Ebony

I want "artist2" to be inserted into the oekakidta db; I've already set up the field.


In functions.php,

I added the bottom line in this section of code:

Code:

// First post normal pic
if ($action == 'res_msg') {
    $picno      = w_gpc('picno', 'i+');
    $name       = w_gpc('name'); // Guest
    $email      = w_gpc('email', 'html'); // Guest
    $url        = w_gpc('url', 'html'); // Guest
    $adult      = w_gpc('adult', 'i');
    $title      = w_gpc('title', 'html');
    $comment    = w_gpc('comment', 'html');
    $share      = w_gpc('share', 'i');
    $share_pass = trim (w_gpc('share_pass'));
    $trans_pass = trim (w_gpc('trans_pass'));
    $wip        = w_gpc('wip', 'i');
    $artist2      = w_gpc['artist2'];

And then I added {$artist2} to the database code:

Code:

        // Update DB
        $result = mysql_query ("UPDATE {$OekakiPoteto_Prefix}oekakidta SET comment='$comment', hostname='$hostname', IP='$address', title='{$title}', artist='{$artist2}', adult='$adult', postlock='{$lock_stat}', password='{$share_pass}'{$bump_me} WHERE PIC_ID='{$picno}'");

However, it still doesn't add to the database. But if I replace {$artist2} with some text, it is added to the db.

I'm presming $artist2 is blank. How can I fix this?

Last edited by Pinkie (11-04-2007 04:55:56)

Offline

#8 11-04-2007 21:45:50

Waccoon
Administrator

Re: Colorin oekaki

How does notebbs load the animation?

The "thumbnail_type" parameter tells the applet to send animation data with the thumbnail header.  This is required to save animations.  It's possible to make the applet send a scaled thumbnail instead, for servers that don't have an image library like GDlib.

The setting you have now should work.

NoteBBS requires that you give the PCH file for the "image_canvas" parameter -- you are not able to provide an image.  ShiBBS wants a PCH file under the "pch_file" parameter, but you should only use either an image or an animation.  Providing both may cause the animation to not load properly.  For both applets, you must make sure the applet is sized properly to match the animation.  You should get the measurements $xcord and $ycord from the image, and then simply import the animation instead of the image.  If you don't provide the exact width and height, the applets will not load the animations.

w_gpc['artist2'];

Wrong syntax.  Brackets are used to access keyed arrays, parentheses are used for functions.

Use w_gpc('artist2'); instead.

Offline

#9 12-07-2007 13:21:31

Pinkie
Member

Re: Colorin oekaki

Well, everything's working like a charm; it's importing the animation perfectly.

I do have one slight problem though. When the person submits the picture, the animation is not saved and posted. How can I fix this?

Offline

#10 12-08-2007 06:48:25

Waccoon
Administrator

Re: Colorin oekaki

One nag with the Shi applets... they won't append animations.  So, once people import an animation to retouch it, the animation data is clipped.

This is why I put that hack at the bottom of the ShiPainter screen that lets you import a canvas instead of an animation.  Unfortunately, all kinds of weird things can happen when retouching from animations.

Offline

#11 12-11-2007 12:23:10

Pinkie
Member

Re: Colorin oekaki

But what about paintBBS? Because I believe it could be updated and uploaded to the server just like with retouch.

Offline

#12 12-12-2007 06:06:21

Waccoon
Administrator

Re: Colorin oekaki

ShiPainter has different animation code to handle the extra tools and brushes, so it has its own quirks compared to PaintBBS.  However, both applets have problems with appending animations.

Offline

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB