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 - GeXX

Pages: [1]
2
Mods & Plugins (Requests & Discussions) / Re: Random pictures
« on: September 27, 2005, 03:53:37 PM »
just add to the line

Code: [Select]
WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").") AND i.cat_id IN (".implode(", ", $cat_in).")
this:
Code: [Select]
AND i.image_votes > 8
thats all...

by the way: your site looks nice!

3
Mods & Plugins (Requests & Discussions) / Re: Random pictures
« on: September 27, 2005, 01:26:41 PM »
try this:

Code: [Select]
$cat_in = array(2,7,8,11,12,15,16,18); //list of category ids // *** TO FILTER RANDOM IMAGES ***

$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
       FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
       LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
       WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").") AND i.cat_id IN (".implode(", ", $cat_in).")
       ORDER BY RAND()
       LIMIT $num_new_images";

4
Mods & Plugins (Requests & Discussions) / Re: Random pictures
« on: September 27, 2005, 10:06:28 AM »
Maybe this will help:

Vielleicht hilft Dir das ja ein wenig weiter:

http://www.4homepages.de/forum/index.php?topic=9774.0

5
Quote
whatever is works for you. for some people is easier remove few categories from the list for others is easier to use only few specific categories...
right  :wink:

Quote
anyway, as Хyu BAM said in her(?) last reply, the only line should be changed is in this block:
it's not working, same situation. e.g.: i have 10 categories and with this example it works for the categories 1-3, but the most time (7/10) there is no random-image (empty).

Code: [Select]
    $number = ($total_images > 1) ? mt_rand(0, $total_images - 1) : 0;

    $sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name".get_user_table_field(", u.", "user_name")."
            FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
            LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
            WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id AND i.cat_id IN (".implode(", ", $cat_in).")
            LIMIT $number, 1";
    $random_image_cache[0] = $site_db->query_firstrow($sql);

maybe i'm wrong, but what's up with the variable "$number"?
this $number is generated of the total-images. but the value of total-images is lower in combination of filtered categories.

so if i do following and it works good, maybe there is a better solution:

find:
Code: [Select]
mt_srand((double)microtime() * 1000000);

insert before:
Code: [Select]
      $sql = "SELECT COUNT(*) as total_images
              FROM ".IMAGES_TABLE."
              WHERE image_active = 1 AND cat_id NOT IN ($cat_id_sql) AND cat_id IN (".implode(", ", $cat_in).")";
      $row = $site_db->query_firstrow($sql);
      $total_images = $row['total_images'];

this will calculate the real total_images for the filtered random-images.
it was just a test so i hope this will help to solve this problem with a better solution instead this one :roll:  :D

G.

6
Nice work, if this could work...

I think a good solution would be to deactive categories for random pictures.
Code: [Select]
WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id AND i.cat_id NOT IN (".implode(", ", $cat_in).")
and to configure at the backand->categories->show this category as random

but i have the same prob here. the code works, but for all other categories (there where it should be another picture and not from the random generated category) the randompicture is still not shown.

a solution there?

7
Mods & Plugins (Requests & Discussions) / Re: Activate and deactivate
« on: September 16, 2005, 10:20:15 AM »
Same situation here...

how can i find deactivated images?!?

8
Language Packs / Korrektur Deutsch
« on: August 01, 2005, 11:06:14 AM »
Im main.php sind zwei Rechtschreibfehler: Leuchkasten statt Leuchtkasten:

$lang['lightbox_delete_success'] = "Leuchkasten erfolgreich gelöscht.";
$lang['delete_lightbox_confirm'] = "Wollen Sie Ihren Leuchkasten wirklich loeschen?";

Gruß, G.

Pages: [1]