Furry stuff, oekaki stuff, and other stuff.
You are not logged in.
Oh awesome! Thank you so much! ♥
Sure. All you have to do is select regular posts instead of archives. Right under "Get Pictures", change the line to:
// Get pictures $result = mysql_query ("SELECT PIC_ID FROM {$OekakiPoteto_Prefix}oekakidta WHERE postlock=1");
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?
Thanks that worked!
Oops. That code is for Wacintaki. Here's the code for Wax:
<?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.
I tried and no luck.
Are you sure the code is right? Because there is no table titled "op_pics"
So let me know!
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
<?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"
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?