• [Mod] Random image / Zufallsbild 5 0 5 1
Currently:  

Author Topic: [Mod] Random image / Zufallsbild  (Read 867370 times)

0 Members and 3 Guests are viewing this topic.

Offline koikonut

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
    • http://www.konradin.net
Re: [Mod] Random image / Zufallsbild
« Reply #345 on: November 27, 2006, 11:54:54 PM »
Hallo!

Bei mir hat das Script immer einwandfrei funktioniert. Aber plötzlich wird einfach kein Bild mehr angezeigt bzw. nichts mehr von der Datenbank geholt scheint mir:
www.konradin.net holt sich die /galerie/random.php die wie folt aussieht (exkl. Copyright):

Code: [Select]
<?php

// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH''galerie/');

include(
ROOT_PATH.'config.php');
include(
ROOT_PATH.'includes/db_mysql.php');
include(
ROOT_PATH.'includes/constants.php');

$site_db = new Db($db_host$db_user$db_password$db_name);
function 
is_remote($file_name) {
  return (
preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i'$file_name)) ? 0;
}

$sql "SELECT COUNT(*) as total_images
        FROM "
.IMAGES_TABLE." a, ".CATEGORIES_TABLE." b 
        WHERE a.image_active=1 
        AND a.cat_id = b.cat_id 
        AND b.auth_viewcat="
.AUTH_ALL.
        AND b.auth_viewimage="
.AUTH_ALL."
        "
;
$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 = b.cat_id 
        AND b.auth_viewcat="
.AUTH_ALL.
        AND b.auth_viewimage="
.AUTH_ALL.
        LIMIT 
$number, 1";
$row $site_db->query_firstrow($sql);
$image_id $row['image_id'];
$cat_id $row['cat_id'];
$image_name $row['image_name'];
$image_comments $row['image_comments'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

echo 
"<div style=\"float: left; background-color:#d3ca91;padding:1px\"><a href=\"".ROOT_PATH."img".$image_id.".htm\"><img src=\"".$thumb_src."\" border=\"0\" style=\"border: 6px solid white;\" alt=\"".$image_name."\" /></a></div><br style=\"clear:both;\"/>\n<br />\n";
echo 
"<b>".$image_name."</b><br />\n";
echo 
"Kommentare: ".$image_comments."<br />\n";
?>

Bitte helft mir - weiß keinen Lösungsansatz - vor allem weil ich nichts verändert habe und es einfach nicht mehr funktioniert. Als einzige Veränderung fällt mir der Einbau von Google Analytics ein aber weiß nicht ob der Fehler schon vorher war und kann ja eigentlich nichts zu bedeuten haben.

Vielen vielen Dank!

Gruß K,

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #346 on: November 28, 2006, 07:28:59 PM »
da steht komischerweise >
Quote
<a href="galerie/img.htm"><img src="galerie/data/thumbnails//" border="0" style="border: 6px solid white;" alt="" /></a>

Code: [Select]
        AND b.auth_viewcat=".AUTH_ALL."
        AND b.auth_viewimage=".AUTH_ALL."

Registriere dich, um dieses Bild groß; anzuschauen!

wird vielleicht das der grund sein?
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline koikonut

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
    • http://www.konradin.net
Re: [Mod] Random image / Zufallsbild
« Reply #347 on: November 28, 2006, 10:38:22 PM »
Du meinst, dass die Bilder gesperrt sind? Ich sehe das Zufallsbild auch nicht im eingeloggten Zustand und außerdem sind nur die Großansichten, nicht aber die Thumbs gesperrt. Hmm - was könnte noch die Möglichkeit sein? Kann auch noch andere Codes posten wenns hilft :-)

Bitte helfen! Danke!  :-)

Gruß K

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #348 on: November 28, 2006, 10:49:34 PM »
egal ob eingelogt oder ausgelogt, thumbnail oder nicht..

du verbietest das man auf die thumbnails klickt.. und damit zeigt random nichts.

cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline koikonut

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
    • http://www.konradin.net
Re: [Mod] Random image / Zufallsbild
« Reply #349 on: November 28, 2006, 10:59:00 PM »
Ich weiß allerdings nicht, woher du diesen Satz mit dem "Registriere dich, um ..." her hast - der kommt an diese Stelle der Galerie gar nicht vor - zumindest nicht bei mir?! Der sollte nur kommen, wenn ein Bild angezeigt wird, zu dem keine Berechtigung in der großen Version besteht - ich kann ihn auch nicht im Quellcode sehen..

Was müsste ich also tun, wenn du recht hast?

Vielen Dank nochmal!
Gruß

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #350 on: November 29, 2006, 07:18:02 PM »
wenn das grosse bild nicht angezeigt werden darf, wird auch der thumbnail nicht in der random angezeigt.

probiere dies aus beiden queries zu löschen
Code: [Select]
AND b.auth_viewimage=".AUTH_ALL."
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline koikonut

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
    • http://www.konradin.net
Re: [Mod] Random image / Zufallsbild
« Reply #351 on: November 29, 2006, 08:32:39 PM »
Vielen Dank! Es funktioniert tatsächlich :-) Freue mich, wie gut die Hilfe hier funktioniert :-)

Gruß

Offline ma3foos

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #352 on: December 15, 2006, 06:33:28 AM »
Please can any one upload this file again "random.txt"

becuase I'm in kuwait and here they blocked "www.Nicky.com"

So Please help, I need this command

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Re: [Mod] Random image / Zufallsbild
« Reply #353 on: December 15, 2006, 12:53:16 PM »
I've attached the random.txt to the first post.
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline ma3foos

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #354 on: December 15, 2006, 06:51:20 PM »
Thanks man

Offline Ricsca

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #355 on: January 03, 2007, 07:09:55 PM »
How it is possible to make to visualize alone photograph of a category? 

Thanks

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: [Mod] Random image / Zufallsbild
« Reply #356 on: January 03, 2007, 09:00:23 PM »
AND a.cat_id = b.cat_id replace this with the cat_id.... (2 times!!!)

Offline Ricsca

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #357 on: January 03, 2007, 09:32:40 PM »
I do not understand... my category is the 9 how I should put? 


$sql = "SELECT COUNT(*) as total_images
        FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
        WHERE a.image_active=1
        AND a.cat_id = b.cat_id 
        AND b.auth_viewcat=".AUTH_ALL."
        AND b.auth_viewimage=".AUTH_ALL."

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: [Mod] Random image / Zufallsbild
« Reply #358 on: January 04, 2007, 01:24:25 PM »
$sql = "SELECT COUNT(*) as total_images
        FROM ".IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
        WHERE a.image_active=1
        AND a.cat_id = 9
        AND b.auth_viewcat=".AUTH_ALL."
        AND b.auth_viewimage=".AUTH_ALL."

Try this....
But don't forget to change the another query...

Offline Ricsca

  • Jr. Member
  • **
  • Posts: 50
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #359 on: January 05, 2007, 01:45:47 AM »
It does not work...