NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

Post a reply

Write your message and submit
Options
Humanity test

What is six + ten?

Go back

Topic review (newest first)

Kameloh X)
04-13-2006 12:10:37

Don't worry - the gallery is going to be private (aka approved by administrators) - thanks though big_smile

-- Off Topic --
Mariano is looking for someone to recode his site to php (check out the keh-moh-noh site XD)
Dunno - thought that might interest you X)

Waccoon
04-13-2006 05:09:07

After some careful (and lazy) reading of paintsave.php (in wacintaki of course) I finally made it so that it'll rename the image to op_##username.type XD

Be careful, because usernames may contain characters that are illegal for filenames.  OekakiPoteto doesn't filter this stuff very well.

(feels silly - but he has now learned how to use global variables (are they global variables? XD))

By default, variables are not global.  You have to "import" a variable into a function by using the "gloabal" keyword.  I'm not sure if there's a way to define superglobals.

Kamelohx__X
04-12-2006 22:47:40

After some careful (and lazy) reading of paintsave.php (in wacintaki of course) I finally made it so that it'll rename the image to op_##username.type XD

(feels silly - but he has now learned how to use global variables (are they global variables? XD))

Rawr XD Thanks for helping again big_smile - *creates new online site* o_O

Kameloh o_O
04-12-2006 13:49:10

Rawr! The only problem I'm having right now is that I'm not using waxpoteto - but wacintaki instead XD. Sorry if it looked like waxpoteto o_O

I'm comparing the two functions right now and they're a bit differen't big_smile (well, after the function deletes the last image)

Any thoughts? XD

Waccoon
04-12-2006 07:30:14

DANGER:  There are good reasons why filenames are not used directly.  But, since this is your own gallery, I guess you know better than to upload two images with the same name.  wink

This code should not be used for anything that may involve public submissions.

In functions.php, scroll down to where you see this (Wax poteto):

Code:

// Wac: OK, we can write, now.
$image_filename = $OPpics.'/'.$resno.'.png';
$image_filenamejpg = $OPpics.'/'.$resno.'.jpg';

Change that to this:

Code:

// Wac: Filter filename
$base_filename = $_FILES['picture']['name'];

$sc = array (' ', '+', '&', '?', '*', '~', '$', ':', '/', '\\', '|', '<', '>');
$re = array ('_', 'plus', 'and', '', '', '-', '-', '', '-', '-', '-', '(', ')');
$base_filename = str_replace ($sc, $re, $base_filename);

$exp = "^([0-9a-zA-Z,%'`@!#{}\(\)\^\=._-])+";
ereg ($exp, $base_filename, $reg_filename);
$base_filename = $reg_filename[0];

if ($base_filename[0] != '.') {
    $pos = strrpos ($base_filename, '.');
    $base_filename = substr ($base_filename, 0, $pos);
} else {
    report_err ('Bad filename');
}

$image_filename = $OPpics.'/'.$base_filename.'.png';
$image_filenamejpg = $OPpics.'/'.$base_filename.'.jpg';

In Wax, paintsave.php is really only used for thumbnails.  The thumbnail generator already uses the actual filename to make the thumbnail, so you don't need to change make_thumbnail().  You will, of course, have to change the index to use the filename you store in the database, instead of PIC_ID.  Having written this nifty regex filter for you, I'll leave the rest up to you.  wink

Well, unless you really get stuck.  Hint:  use VARCHAR(255) as the field type when adding the filename field to the database.

The str_replace() ensures there are no illegal characters in the name that would conflict with the filesystem.  Spaces are converted to underscores just to be sure.

The ereg() strips any unknown and non-english characters.

The substr() strips the file extension, ensuring that the proper extension is always used.

Kameloh ECKS DEE
04-11-2006 20:17:57

The gallery I'm making is almost complete - but I'm trying to figure out one little thing right now o-O

I'm trying to make the upload have unique filenames to them instead of an increment of op_###.type. The first thing I did was create a new column in the oekakidta database - called 'imgname' - which will contain the name of the image (aka: 32Kameloh.png)

The only problem i'm having right now is trying to figure out paintsave.php to make it save as the filename ##USERNAME.TYPE - but I'm completely clueless as it is XD

Instead of modifying the whole code, I was hoping to insert $OekakiU somewhere in the code.. though I'm not sure how global variables work in paintsave.php (nor how they work in general.. well, perhaps a little XD)

I've already checked functions.php and I've concluded that paintsave.php is the key for doing this - any suggestions? XD

Kameloh
04-07-2006 17:21:51

Woo - fixed that - darn header + a seperate php file with teh same 'header' = disaster XD

I fixed em.. sorta, I cheated actually if you ever look at the code XD

Thanks for helping - I'll run to you if I ever screw something up again o_O

WOo! *creates teh gallery*

Waccoon
04-07-2006 06:54:22

Well, for starters, you've got two !DOCTYPE declarations, two head tags, two body tags... that's not good.  smile

Also, when using HTML (but not XHTML), there has to be a space between the last attribute and tag terminator.  So <img src="blah"/> is wrong, but <img src="blah" /> is right (sort of).

Anyway, welcome to the wonderful land of browser compliance problems, or rather, the W3C's inability to make up their damn mind.  My guess is your use of <div align="center"> tags to center tables is to blame.  The tables will not actually center properly, but in IE, each <td> will inherit the center property of the <div>, so all content will be centered everywhere.  Firefox will not inherit the center properties.

As a general rule, you should only use a proper !DOCTYPE declaration if you're sure you're conforming to the standard.  Browsers assume that any page that has this declaration was written by someone who really wants the page to be fully W3C compliant.

First, get rid of the dupilacate headers and stuff.  Then, get rid of the squashed "/>" terminators, so it won't cause parsing issues.  Then, delete the !DOCTYPE declaration, so the page will render in quirks mode in IE.  Finally, go to wwww3schools.com and spend weeks of your life reading about HTML and learning why it is probably one of the worst non-binary document standards ever made.  wink

Kameloh
04-07-2006 02:59:53

I'm having a bit-o-problems with wacintaki gallery (it's something I'm making at the moment XD)

http://www.oekakiart.com/gallery/viewimage.php?id=8
http://www.oekakiart.com/gallery/galler … er=Kameloh

It looks fine in FireFox.. but it becomes ghey in IE! I'm guessing it's because of nifty-convert.. but who knows o__O

Though.. the gallery looks fine on the mainpage:

http://www.oekakiart.com/gallery/

Is there any way to fix it? XD

Also, is there anything I should be worried about for the 'comments' area in the profile section? I already know <? php?> doesn't work on it... but HTML does XD

Thanks :3

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB