Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - timblount

Pages: [1]
1
Thanks I must have put those in in Dreamweaver somewhere along the line.   :wink:

2
Hmm I'm not sure what I'm doing wrong.

Here's the code:

$sql = "SELECT COUNT(*) as total_images
        FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
        WHERE a.image_active=1
        AND a.cat_id=2
        AND b.auth_viewcat=".AUTH_ALL."
        AND b.auth_viewimage=".AUTH_ALL."<br>
        ";
$row = $site_db->query_firstrow($sql);
$total_images = $row['total_images'];

mt_srand((double)microtime() * 1000000);
$number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;

$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments
        FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
        WHERE a.image_active=1
        AND a.cat_id=2
        AND b.auth_viewcat=".AUTH_ALL."
        AND b.auth_viewimage=".AUTH_ALL."<br>
        LIMIT $number, 1";

and here's the error:

DB Error: Bad SQL Query: SELECT COUNT(*) as total_images FROM 4images_images a, 4images_categories b WHERE a.image_active=1 AND a.cat_id=2 AND b.auth_viewcat=0 AND b.auth_viewimage=0<br>
You have an error in your SQL syntax near '' at line 7

DB Error: Bad SQL Query: SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments FROM 4images_images a, 4images_categories b WHERE a.image_active=1 AND a.cat_id=2 AND b.auth_viewcat=0 AND b.auth_viewimage=0<br> LIMIT 0, 1
You have an error in your SQL syntax near 'LIMIT 0, 1' at line 7


 :?:

-Tim

3
Can I modify this code to select a random image from just one category of my gallery? If so, how?

Thanks,

Tim

4
Discussion & Troubleshooting / not exactly
« on: July 10, 2002, 04:36:19 PM »
please help  :(

5
Discussion & Troubleshooting / Exporting the Random Image Function
« on: July 09, 2002, 11:57:25 PM »
I think someone's asked this already.

Will this do what I need?

http://www.4homepages.de/forum/viewtopic.php?t=543

6
Discussion & Troubleshooting / Exporting the Random Image Function
« on: July 09, 2002, 11:42:44 PM »
I'd like to display a random image from my 4images gallery outside of the directory in another part of my site.

                             It would preferably appear along with the image name and number of comments posted just like it does in the regular
                             4images page.

                             I'm also less than a novice at coding; can anyone help me with this?

7
Mods & Plugins (Requests & Discussions) / 4images mit phpBB2-Login
« on: July 09, 2002, 11:41:19 PM »
Does anyone know how much programming expertise would be involved in this? I'm developing a site at a University and am assuming that our resident webmasters will know how to do it.

8
Discussion & Troubleshooting / if i have about 10000 images
« on: July 09, 2002, 07:47:01 PM »
I'd guess that the fastest way to do that would be to edit the sql tables by hand along with putting the images in their respective categories in the "data" folder. I know nothing about editing sql tables, though.

9
I'd like to display a random image from my 4images gallery outside of the directory in another part of my site.

It would preferably appear along with the image name and number of comments posted just like it does in the regular 4images page.

I'm also less than a novice at coding; can anyone help me with this?

Pages: [1]