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 eight + four?

Go back

Topic review (newest first)

Sammykins
05-21-2006 01:27:22

Oh awesome! smile Thank you so much! ♥

Waccoon
05-20-2006 23:58:54

Sure.  All you have to do is select regular posts instead of archives.  Right under "Get Pictures", change the line to:

Code:

// Get pictures
$result = mysql_query ("SELECT PIC_ID FROM {$OekakiPoteto_Prefix}oekakidta WHERE postlock=1");
Sammykins
05-20-2006 21:33:46

I'm also stealing this code. At my oekaki however we have no 'archives', so is there any way I could have it just show all images in my oekaki randomly?

Maxx
05-18-2006 00:03:28

Thanks that worked!

Waccoon
05-17-2006 04:39:06

Oops.  That code is for Wacintaki.  Here's the code for Wax:

Code:

<?php

// Path must end with a slash, or blank if no path needed.
$path = './oekaki/';
include ($path.'dbconn.php');
include ($path.'config.php');
$pic_path = $path.$OPpics.'/';

// Get pictures
$result = mysql_query ("SELECT PIC_ID FROM {$OekakiPoteto_Prefix}oekakidta WHERE archive=1 AND postlock=1");
$total = mysql_num_rows ($result);

// Get random number from 0 to $total
$random = rand (0, $total - 1);

$pic_id = mysql_result ($result, $random);
$result = mysql_query ("SELECT * FROM {$OekakiPoteto_Prefix}oekakidta WHERE PIC_ID={$pic_id}");
$pic = mysql_fetch_array ($result);

mysql_close ($dbconn);

?>

<!-- To display picture: -->
<a href="<?=$pic_path.$pic['PIC_ID'].'.png';?>"><img src="<?=$pic_path.$pic['PIC_ID'].'.png';?>" alt="" border="0" /></a>

The reference to $OPpics is so the script knows where the pictures are stored on the server (pictures folder).  It is not used for getting information from the database.

If you want to show thumbnails instead of the full-sized pictures, turn on JPEG compression on your board, and use "jpg" instead of "png" in the picture display code.  On an OekakiPoteto or Wax Poteto board, all JPEG files except uploads are thumbnails.  Note I pointed out that uploads are not thumbnails!  If your board has lots of uploads, you may have to explicitly size all pictures by using width="300", or some similar HTML to display the picture, or else it will show up full-size.  Note that if you only set the width of a file in an HTML document, the height is automaticly kept proportional.

Maxx
05-16-2006 19:01:46

I tried and no luck.

Are you sure the code is right? Because there is no table titled "op_pics"

So let me know!

Waccoon
05-16-2006 04:39:12

The splash page must be a PHP script, so first, make sure that it ends with ".php" instead of ".html"

Then, add this code:

SLIGHT ERROR: THIS CODE IS FOR WACINTAKI.
USE CODE IN NEXT POST FOR WAX POTETO


Code:

<?php

// Path must end with a slash, or blank if no path needed.
$path = './oekaki/';
include ($path.'dbconn.php');
include ($path.'config.php');
$pic_path = $path.$cfg['op_pics'].'/'.$cfg['op_pre'];

// Get pictures
$result = mysql_query ("SELECT PIC_ID FROM {$OekakiPoteto_Prefix}oekakidta WHERE archive=1 AND postlock=1");
$total = mysql_num_rows ($result);

// Get random number from 0 to $total
$random = rand (0, $total - 1);

$pic_id = mysql_result ($result, $random);
$result = mysql_query ("SELECT * FROM {$OekakiPoteto_Prefix}oekakidta WHERE PIC_ID={$pic_id}");
$pic = mysql_fetch_array ($result);

mysql_close ($dbconn);

?>

<!-- To display picture: -->
<a href="<?=$pic_path.$pic['PIC_ID'].'.'.$pic['ptype'];?>"><img src="<?=$pic_path.$pic['PIC_ID'].'.'.$pic['ptype'];?>" alt="" border="0" /></a>

Please note that thumbnails are more difficult to process, and require testing if $pic['rtype'] and/or $pic['ttype'] are empty.  If they are, then the thumbnail is not available.  Also, thumbnails have the character "r" or "t" before the number but after the prefix, so a valid thumbnail name is "OP_t234.jpg"

Maxx
05-15-2006 19:08:26

Archives troubles



I want archives to show on a different wep-page that isn't in the oekaki folder. Pretty much on the oekaki's splash page. And I want to show a random archive.

Any help with the correct code?

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB