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

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

0 Members and 2 Guests are viewing this topic.

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #570 on: January 11, 2009, 03:20:22 PM »
@Harry,

here is it:
http://www.nicky.net/4images/random_more_pics.txt

for certain category add this: http://www.4homepages.de/forum/viewtopic.php?p=4360#4360

hi nicky,

vielen dank für deinen hinweis wie man mehrere bilder extern anzeigen kann... so wie es aktuell ist werden 4 bilder untereinander extern angezeigt ... wie kann ich 4 bilder nebeneinander angezeigt bekommen?

gruss, bergblume

Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #571 on: January 11, 2009, 03:55:38 PM »
ok, problem solved by myself...
if anyone should need it, here is the code:

Code: [Select]

<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: random_more_pics.php                                 *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.0 for 4images 1.6.1                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (http://www.4homepages.de/4images/lizenz.php) für       *
 *    weitere Informationen.                                              *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (http://www.4homepages.de/4images/lizenz_e.php) for further         *
 *    information.                                                        *
 *                                                                        *
 *************************************************************************/

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

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

define('SCRIPT_URL''http://www.YOUR-DOMAIN-NAME.com/');

$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;
}

// NUMBER OF THUMBNAILS TO DISPLAY / NUMMER DER GEWÜNSCHTEN THUMBNAILS
$num_images 4;

$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.
        ORDER BY RAND() 
        LIMIT 
$num_images";
$result $site_db->query($sql);

while (
$row $site_db->fetch_array($result)){
  
$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 
"<table border='0' width='133' bgcolor='#FFFFFF' Align=left>\n";
  echo 
"<TR>\n";
  echo 
"<TD><a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"> <img src=\"".SCRIPT_URL.$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
  echo 
"</TR>\n";
  echo 
"<TR>\n";
  echo 
"<TD bgcolor='#FFFFFF'> <a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"> <b>$image_name</b></a><br>\n";
  echo 
"</TR>\n";
  echo 
"<TR>\n";
  echo 
"<TD bgcolor='#FFFFFF'>Kommentare: $image_comments</TD>\n";
  echo 
"</TR>\n";
  echo 
"</table>\n";
}
?>


Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #572 on: January 11, 2009, 08:15:52 PM »
ich habe doch noch ne kurze frage:

was muss ich einstellen, damit ich
a) alle bilder ausgegeben bekomme
b) die bilder in einer tabelle  mit je 5 bildern pro zeile ausgegeben werden??
hier den code, den ich bisher verwende (zur darstellung der tabelle)
Code: [Select]
  echo "<table border='0' width='133' bgcolor='#FFFFFF' Align=left>\n";
  echo "<TR>\n";
  echo "<TD><a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"> <img src=\"".SCRIPT_URL.$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
  echo "</TR>\n";
  echo "<TR>\n";
  echo "<TD bgcolor='#FFFFFF'> <a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_blank\"> <b>$image_name</b></a><br>\n";
  echo "</TR>\n";
  echo "<TR>\n";
  echo "<TD bgcolor='#FFFFFF'>Kommentare: $image_comments</TD>\n";
  echo "</TR>\n";
  echo "</table>\n";
c) ich habe ein zusätzliches image field bei mir eingebaut --- z.b. image_fotostandort --- wie kann ich die bilder extern nur zu diesem thema angezeigt bekommen=?
folgendes habe ich schon probiert leider ohne erfolg:
Quote
$sql = "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_comments, a.image_photostandort
        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."
AND a.image_photostandort = ort1
        ORDER BY RAND()
        LIMIT $num_images";
$result = $site_db->query($sql);
« Last Edit: January 11, 2009, 08:59:15 PM by bergblume »

Offline Ninimaus

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Website unserer Tochter
Re: [Mod] Random image / Zufallsbild
« Reply #573 on: January 26, 2009, 09:31:15 PM »
Also bei dem Riesenthema blickt ja niemand mehr durch

Habe jetzt per Suchfunktion versuch etwas brauchbares herauszufinden, leider nicht !

Bin mit Php überhaupt nicht Vertraut habe es nun so eingerichtet:

die random.php liegt in meinem Galerie verzeichnis habe es auf der Hauptseite per

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

einbinden können - Es funktioniert


Nun zu meinem Problem :

Ich möchte es nun auf einer Unterseite einbinden Befindlich im Ordner /blog//wp-content/themes/Girl-Grafixx

Wie muss nun der korrekte Include-Befehl lauten ?


Offline bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #574 on: January 26, 2009, 10:04:55 PM »
am sichersten (wenn du keine php-kenntnisse hast) ist, wenn du den absoluten pfad á la
Code: [Select]
<?php
 
include("http://www.dein-domain.de/galerie/random.php");
?>
eingibst. probier´s mal so...

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #575 on: January 26, 2009, 10:15:04 PM »
am sichersten (wenn du keine php-kenntnisse hast) ist, wenn du den absoluten pfad á la
Code: [Select]
<?php
 
include("http://www.dein-domain.de/galerie/random.php");
?>
eingibst. probier´s mal so...

nur zur euer info
bergblume: dies ist eine URL.. kein PFAD

http://de.wikipedia.org/wiki/URL
http://de.wikipedia.org/wiki/Pfad#Dateisystem

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 Ninimaus

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Website unserer Tochter
Re: [Mod] Random image / Zufallsbild
« Reply #576 on: January 27, 2009, 10:17:50 AM »
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /mnt/web7/52/08/51792108/htdocs/blog/wp-content/themes/Girl-Grafixx/sidebar.php on line 56

Schade, so wirds nicht gehen


Offline Ninimaus

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Website unserer Tochter
Re: [Mod] Random image / Zufallsbild
« Reply #577 on: January 27, 2009, 10:43:07 PM »
Niemand eine Idee ?  :(


Offline Trev

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #578 on: January 28, 2009, 08:26:06 PM »
Hi all, hope you are fine !

I downloaded the random-image mod and would like to know:

how can I set this up to show the category of the picture?

Here is my code:
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: random_full.php                                      *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.0 for 4images 1.6.1                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (http://www.4homepages.de/4images/lizenz.php) für       *
 *    weitere Informationen.                                              *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (http://www.4homepages.de/4images/lizenz_e.php) for further         *
 *    information.                                                        *
 *                                                                        *
 *************************************************************************/

// PATH TO YOUR 4images Gallery
define('ROOT_PATH''./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)) ? 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_media_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'];
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];

echo 
"<img src=\"".$full_src."\" height=\"125\" width=\"150\" border=\"2\" alt=\"$image_name\"></a><br>\n";
echo 
'<font size="-2" face="Arial, Helvetica, sans-serif"><br>';

echo 
"$image_name\n";

?>

Thanks a lot

Trev

Offline Ninimaus

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Website unserer Tochter
Re: [Mod] Random image / Zufallsbild
« Reply #579 on: January 29, 2009, 09:59:52 PM »
Ich habe noch immer folgendes Problem:

4images läuft auf meinem Webspace im Ordner galerie , desweiteren nutze ich einen Wordpress-Blog, dieser befindet sich im Ordner Blog.

Nun möchte ich das Zufallsbild auf der Sidebar einbinden.

Der Pfad zu dieser Datei ist folgender : /blog/wp-content/themes/Girl-Grafixx/sidebar.php

Nun habe ich versucht das Script so einzubinden:

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

Leider funktioniert das so nicht.

Kann mir jemand den passenden include Befehl nennen oder hat eine Problemlösung parat ?


Offline Trev

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #580 on: January 30, 2009, 01:01:14 PM »
Hmmm,

hat keiner eine Antwort auf meine Frage (siehe oben) ???

Bidde....  :oops:

LG

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #581 on: January 30, 2009, 08:48:41 PM »
Hmmm,

hat keiner eine Antwort auf meine Frage (siehe oben) ???

Bidde....  :oops:

LG


hi,

probier es so

Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: random_full.php                                      *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.0 for 4images 1.6.1                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (http://www.4homepages.de/4images/lizenz.php) für       *
 *    weitere Informationen.                                              *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (http://www.4homepages.de/4images/lizenz_e.php) for further         *
 *    information.                                                        *
 *                                                                        *
 *************************************************************************/

// PATH TO YOUR 4images Gallery
define('ROOT_PATH''./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)) ? 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_media_file, a.image_comments, b.cat_name
        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_name $row['cat_name'];
$image_name $row['image_name'];
$image_name $row['image_name'];
$image_comments $row['image_comments'];
$full_src = (is_remote($row['image_media_file'])) ? $row['image_media_file'] : ROOT_PATH.MEDIA_DIR."/".$cat_id."/".$row['image_media_file'];

echo 
"<img src=\"".$full_src."\" height=\"125\" width=\"150\" border=\"2\" alt=\"$image_name\"></a><br>\n";
echo 
'<font size="-2" face="Arial, Helvetica, sans-serif"><br>';

echo 
"$image_name<br/>\n";
echo 
"$cat_name\n";
?>
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 Ninimaus

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Website unserer Tochter
Re: [Mod] Random image / Zufallsbild
« Reply #582 on: January 30, 2009, 11:15:00 PM »
Niemand hat eine Ahnung wegen dem Include Befehl  :cry:


Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #583 on: January 30, 2009, 11:45:48 PM »
Niemand hat eine Ahnung wegen dem Include Befehl  :cry:

hi Ninimaus,

würde dir gerne helfen aber hab kein wordpress installiert.
wenn mir die zeit zulässt gucke ich die nächsten paar tage.
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 Ninimaus

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • Website unserer Tochter
Re: [Mod] Random image / Zufallsbild
« Reply #584 on: January 30, 2009, 11:47:17 PM »
Hab jetzt wie wild rumprobiert und es geschafft