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

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

0 Members and 2 Guests are viewing this topic.

Offline stipko

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #195 on: April 26, 2005, 01:15:25 PM »
Is there a similar mod/php for 1.7.1 ?

I'd like to insert a random thumb and description into my webpages, on the same server, but outside of the 4images program.

Thanks!!

Offline stipko

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #196 on: April 26, 2005, 09:59:37 PM »
Hello,

Thanks for this mod. Exactly what I needed. May I ask; How can I modify this so that it displays images even when a user is not logged in or the category is only available to 'registered' users?

In other words, all of my images require registration, but I'd like to include this random.php in other webpages that non-users see. It's OK if they cant see the full 4images details page, but just the thumbnail and description. Does that make sense?

here we go:
http://www.nicky.net/4images/random_full.txt

have fun

Offline stipko

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #197 on: April 28, 2005, 09:28:11 AM »
Anyone?

Offline gallito

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #198 on: May 01, 2005, 11:18:16 PM »
Hello,

Thanks for this mod. Exactly what I needed. May I ask; How can I modify this so that it displays images even when a user is not logged in or the category is only available to 'registered' users?

In other words, all of my images require registration, but I'd like to include this random.php in other webpages that non-users see. It's OK if they cant see the full 4images details page, but just the thumbnail and description. Does that make sense?

here we go:
http://www.nicky.net/4images/random_full.txt

have fun



Yes... I have the same doubt   :cry:

Offline kashiftiwana

  • Pre-Newbie
  • Posts: 3
    • View Profile
    • JustPakistan
Re: [Mod] Random image / Zufallsbild
« Reply #199 on: May 17, 2005, 08:40:25 AM »
hi
thanx for the mod, working fine in test.php, but when i call this mod in postnuke php block i got this error
Code: [Select]
DB Error: Could not connect to the database server (, )..
any help?
i also tried to download postnuke module which is mention in this forum but its not avilable any more on the that site http://www.netforum.com, if any one have that mod plz, i want  :(

Offline Vincent

  • 4images Moderator
  • Addicted member
  • *****
  • Posts: 1.195
    • View Profile
    • www.foto-kocher.com
Re: [Mod] Random image / Zufallsbild
« Reply #200 on: May 17, 2005, 11:33:28 PM »
Hello
i have installed this mod - which is not working - but sins i install it - the checkimages.php is not working anymore?
i don't know if this is just unlucky or if the

<?php
include("./random.php");
?>

modifeyes something else
hope of feedback
vincent
Beati pauperi spiritus

4images 1.7 // My Installed Mods


Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [Mod] Random image / Zufallsbild
« Reply #201 on: May 18, 2005, 12:48:30 AM »
mmm....what this mod has anything to do with checkimages.php?
where did u include the random.php ??? 8O
perhaps u missunderstood the purpose of this mod - display a random image ON EXTERNAL PAGE (not on 4images-based pages) ?
and because of that there is no 4images files should be changed for this mod...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline kashiftiwana

  • Pre-Newbie
  • Posts: 3
    • View Profile
    • JustPakistan
Re: [Mod] Random image / Zufallsbild
« Reply #202 on: May 18, 2005, 11:50:22 PM »
Hi V@no
 :( what about my problem, a try many ways, but nothing happens on postnuke site, i crated a test.php page outside of postnuke root path, there it will show me random images, but when i call script in postnuke page , i got this message.
Code: [Select]
DB Error: Could not connect to the database server (, )..   :( any help plz, may be i miss something in this post, but i dont know german, i also tried to translate these german post into english, but cannot get help  :( :( :(, any one, any help

Offline mastidude

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #203 on: May 24, 2005, 09:24:16 PM »
Hello please

I installed the RANDOM MORE PIX MOD(allows more than 1 thumbnail) ,The problem is the  images are coming Vertically,how do I make them horizonatlly to be dispalyed on my web page?

Thanx in advance

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [Mod] Random image / Zufallsbild
« Reply #204 on: June 08, 2005, 08:14:29 PM »
Hi-

Ok, as I try to integrate this with wbb 2.3.2 I have a problem-

I have created this random.php and in it stands this

<?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黵       *
 *    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)) ? 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_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'];

print("
document.write('<a href=\"".SCRIPT_URL."/details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a>');
");
?>



my 4images directory

www.thecenterofthenet.com/4images/

my wbb

www.thecenterofthenet.com/ww2/

in my index template I have created this:

<SCRIPT language='JavaScript'  src='http://thecenterofthenet.com/wbb2/random.php'></SCRIPT>


The problem is that I get the link, however no image.

It seems to me somthing is wrong with the thumbnail source. However, since the paths seem to be correct why isnt it finding the thumbnail source?

I mean, if you want to see the error you can check out www.thecenterofthenet.com/wbb2/

underneath the login window you can see the correct link to the details.

Site is under heavy constriction.

Thanks-

Robert
As long as I can finish my site before I die.

Offline B.C

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #205 on: June 08, 2005, 08:19:37 PM »
hi ich bin neu hier und absoluter newbie und bräuchte hilfe. wäre SUPER wenn ihr mir helfen könntent

ich hab das auch probiert, das ein zufallsbild auf meiner seite erscheint.. weis jedoch nicht so recht wie genau das funktioniert... meine hauptseite ist eine html seite.. hoffe das macht nichts... sie ist im mom auch noch nicht hochgeladen, weil ich dafür noch ein bisschen brauche bis die fertig ist....

aber wie genau muss ich das anstellen..?
hab also diese random.php seite runtergeladen und geöffnet.. welche änderungen muss ich da genau vornehmen, damit dann ein Zufallsbild auf der hp erscheint?

Möchte das Zufallsbild mit Inlineframes unter meiner späteren navigation einbinden...

die random.php hab ich jetzt mal normal in meinen 4images ordner geladen (also in keinen unterordner).

wäre seeeeehhr dankbar wenn ihr auch mir helfen könntet

mfg

Offline glitzer

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • over 7000 E-Cards
Re: [Mod] Random image / Zufallsbild
« Reply #206 on: June 12, 2005, 11:35:53 AM »
Hello,

It works perfectly, but i want to show more than 1 random picture.
I would like to show 4 or 5 different random pictures next to each other

Can anybody help me??
Thanx a lot

Offline fotograf74

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #207 on: June 14, 2005, 10:31:20 PM »
Thank you for the Code.

I display 4random  images and want to show this images in horizontal form. Now I have it in vertical direction.

What must i do?

Offline trunky

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #208 on: June 26, 2005, 04:00:18 PM »
It works fine for me - BUT it shows only one "random" pic, always the same  :( After Reloading etc, every time the same pic  :(

Offline maikew

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
    • MW PhotoWorks & Templates
Re: [Mod] Random image / Zufallsbild
« Reply #209 on: June 26, 2005, 04:47:56 PM »
hi ich bin neu hier und absoluter newbie und bräuchte hilfe. wäre SUPER wenn ihr mir helfen könntent

ich hab das auch probiert, das ein zufallsbild auf meiner seite erscheint.. weis jedoch nicht so recht wie genau das funktioniert... meine hauptseite ist eine html seite.. hoffe das macht nichts... sie ist im mom auch noch nicht hochgeladen, weil ich dafür noch ein bisschen brauche bis die fertig ist....

aber wie genau muss ich das anstellen..?
hab also diese random.php seite runtergeladen und geöffnet.. welche änderungen muss ich da genau vornehmen, damit dann ein Zufallsbild auf der hp erscheint?

Möchte das Zufallsbild mit Inlineframes unter meiner späteren navigation einbinden...

die random.php hab ich jetzt mal normal in meinen 4images ordner geladen (also in keinen unterordner).

wäre seeeeehhr dankbar wenn ihr auch mir helfen könntet

mfg

hi,

also in der random.php folgende root einstellung eintragen define('ROOT_PATH', './'); da sich die random.php ja im 4images ordner befindet.

die index.html seite in index.php umbenennen(html funkt nicht) und mit diesem befehl einbinden

<?php
include("/4images/random.php");
?>

oder

<?php
include("../random.php");
?>

speicherst du die random.php in dem verzeichnis wo deine hauptseite ist (dort wo die pics erscheinen sollen dann reicht dieser befehl

<?php
include("random.php");
?>

und den root pfad define('ROOT_PATH', '/4images/'); so umbenennen

ich hoffe ich hab alles richtig erklärt  :oops: bin selbst noch recht neu auf diesem gebiet ;) falls etwas falsch sein sollte bitte berichtigt mich dann ruhig *g*