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

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

0 Members and 2 Guests are viewing this topic.

Offline Joe.Emre

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #45 on: August 29, 2002, 05:45:17 PM »
Sorry für das doppel poste! :oops: ok ich veruch es mal!




Mfg
Joe.emre

Offline Joe.Emre

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #46 on: August 29, 2002, 06:05:26 PM »
kannst du mich mal koriegieren?
 
Code: [Select]
*                                                                        *
 *************************************************************************/

// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', 'http://www.joeemre.de/random.php');

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)) ? 1 : 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'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

echo "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
?>

Mfg
Joe.Emre

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #47 on: August 29, 2002, 06:14:05 PM »
ja kann ich ;)

wenn die random.php hier ist:
http://www.joeemre.de/random.php


Code: [Select]

define('ROOT_PATH', './4images/');

define('SCRIPT_URL', 'http://www.joeemre.de/4images/');


und wennst die random.php ind dein apportal integrieren willst
dann ist es:
Code: [Select]

<?php 
include("../random.php"); // .. = verzeichnis höher . = gleicher verzeichnis
?>

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 Joe.Emre

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #48 on: August 29, 2002, 06:43:58 PM »
kannst du mich wieder koriegieren :)
Code: [Select]
*************************************************************************/

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

define('SCRIPT_URL', 'http://www.joeemre.de/4images/');
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)) ? 1 : 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'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

echo "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo "<b>$image_name</b><br>\n";
echo "Comments: $image_comments<br>\n";
?>

ist das richtig?


Mfg
Joe.Emre

Offline Joe.Emre

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #49 on: August 29, 2002, 07:09:19 PM »
schau mal bitte!
http://www.joeemre.de/apportal/


was mache ich falsch? :(




Mfg
Joe.Emre

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #50 on: August 29, 2002, 07:15:16 PM »
includen mit

../random.php

nicht
./random.php
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 Joe.Emre

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #51 on: August 29, 2002, 07:43:15 PM »
geht nicht!
Code: [Select]
<?php 
include&#40;"../random.php"&#41;; 
?>

hab ich eingegeben aber wenn ich dann auf meine seite geh kommt immer das hier
Code: [Select]
Warning: Unable to access ./random.php in /home/www/htdocs/joeemre.de/apportal/inc/navi_links.inc(36) : eval()'d code on line 88

Warning: Failed opening './random.php' for inclusion (include_path='.:/usr/lib/php') in /home/www/htdocs/joeemre.de/apportal/inc/navi_links.inc(36) : eval()'d code on line 88



Mfg
Joe.Emre


P.S.bitte gib nicht auf mir zu helfen! :wink:
http://www.joeemre.de/apportal/

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #52 on: August 29, 2002, 07:51:30 PM »
hmmm...

wie schauts mit
<?php
include("../../random.php");
?>
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 Joe.Emre

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #53 on: August 29, 2002, 08:16:27 PM »
ähmmm nein geht auch nicht!  :?
was kann das noch sein?


Mfg
Joe.Emre

Offline Joe.Emre

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #54 on: August 29, 2002, 08:17:32 PM »
so wie der code ist einfach kopieren richtig?!

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Re: [Mod] Random image / Zufallsbild
« Reply #55 on: August 29, 2002, 08:35:38 PM »
Wenn ich mich mal kurz einmischen darf. Deine Fehlermeldung sagt, dass Du immer noch
./random.php
drinstehen hast. Es muss aber
../random.php
sein.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Joe.Emre

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #56 on: August 29, 2002, 08:43:37 PM »
jede hilfe ist mir recht Jan!
ich sitze schon fast den ganzen tag drann!also habt ihr icq dann könnt ihr euch mal selber vergewissern!was mich natürlich freuen wird, wenn ich das mal geschaft habe!




Mfg
Joe.Emre


P.S.
habe ich aber so rein kopiert
Code: [Select]
<?php 
include&#40;"../../random.php"&#41;; 
?>


und so ausprobiert
Code: [Select]
<?php 
include("../random.php"); 
?>

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Re: [Mod] Random image / Zufallsbild
« Reply #57 on: August 29, 2002, 08:46:10 PM »
Hier: http://www.4homepages.de/forum/viewtopic.php?p=7012#7012
hast Du behauptet
Code: [Select]
../random.php
genommen zu haben.

Die Fehlermeldung sagt aber, dass Du
Code: [Select]
./random.php
drinstehen hast.
Also, irgendwas machst Du falsch. Kann ja eigentlich nicht so schwer sein ;)

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #58 on: August 29, 2002, 10:41:17 PM »
okay..
in der random.php ändere diese zeile:
von
define('ROOT_PATH', './4images/');

auf

define('ROOT_PATH', '../4images/');
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 Joe.Emre

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #59 on: August 29, 2002, 11:02:13 PM »
ohhhhhhhhh man endlich vielen,vielen dank an Nicky und Jan für den echt super tollen suport.
ich kann mich nur vor euch verbeugen ! 8)
jetzt kann ich endlich beruhigt schlafen gehen!






Mfg
Joe.Emre


P.S.ihr seid SPITZE :!: