NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

#1 10-08-2006 06:00:50

Pinkie
Member

Colouring book script

After learning a bit more PHP, I thought I'd set myself a challenge up. I'm creating a colouring book for Wacintaki which works like this:

-- User draws Picture
-- User clicks to submit the image and adds keywords, etc. which are added to the oekakidta table (I added some new fields). I then make it pending ("1" my new "pending" field)
-- Then, an admin looks up all the pending images, and has 2 options: "accept" or "Reject"
-- I've coded up reject to delete the lineart and notify the user

Next up is to code the "accept" function. It shoudl work like this:

I can just set up a bunch of variables for the orignal file and insert the most necessary ones into a brand new table, which will be quite easy to do.

But I need to copy (not move please) lets say, x.png, x.jpg (if avaliable) and x.pch from the directory /picture/ to the directory /colorinbook/, as well as generating filename for it such as lineart????? (where ? is a random number) in teh new directory. What PHP function will allow be to do that? I tried doing a search on google but found nothing. I've got GD library installed if that's needed too.

Also, what could I do if that function fails for soem reason (server timeout for example)? I pressume php would throw an error message and terminate there?

Thanks for your help. :3

Last edited by Pinkie (10-08-2006 06:02:59)

Offline

#2 10-08-2006 23:03:05

Waccoon
Administrator

Re: Colouring book script

Wacintaki isn't very friendly for copying data between different boards, or even tables.  You have to do everything yourself, hard-code paths, and so on.

I recommend having an accept/reject flag, where every time an admin logs in, pictures with the flag are scanned.  If the picture is accepted, the picture will be given public permissions, and the picture bumped.  If not, the password field is emptied.  In either case, the check flag would then be cleared.

Offline

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB