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.


Topics - 1Newbie

Pages: [1]
1
Hi.
First off, sorry I don't know to much about editing scripts but I'm trying to learn more and more everyday.
I'm trying to create the random.php file to display a random image on another page.

What part of the random.txt file gets edited with my information?

Quote
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: random.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', './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'] : ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];

echo "<a href=\"".ROOT_PATH."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";
?>


***************************************************************

So Please,... could someone help me with this and maybe just copy and paste the sections of this script that I need to edit?
I've done so many searches on this topic and everyone who ever answers to a thread about topic seems to always tell that person to read the F.A.Q's or is directed to this thread in the MOD area: http://www.4homepages.de/forum/index.php?topic=1020.0  Which believe me I've read all 24 pages and only a few are in english.

I've attached the Original random.txt file to this thread incase someone else wanted it.


Please and TIA.
1Newbie.


2
Help Please,....
I made an IFRAME on my Main Index.htm Page, How do I get the Random Image to display in that IFRAME?

Which page is it that presents that random image on the front page of the gallery?

TIA.
1Newbie.

3
Hi,.. When ever i try to upload a video from my computers hardrive, The gallery acts as if it's uploading the file then IExplorer goes to a Page cannot be displayed screen and the video doesnt upload.

It works if the Video is already on the internet somewhere just fine but not when trying to upload it.
Anyone got any suggestions?

TIA
1Newb.

4
Hi all.  I'm wondering which Conversion tool for thumbnails is the Best.
ImageMagick, GD or NetPBM ?

It seems like most the scripts I've tried to install like ImageMagick or have ImageMagick as it's default.
Is there a difference between all of these or do they all do the same thing?

TIA.
1Newb.

5
Chit Chat / Sorry But What is LIGHTBOX ?
« on: December 17, 2006, 08:58:41 PM »
Hi All. Sorry for the maybe stupid question but What is Lightbox and What is it used for?

TIA.
1Newbie.

Pages: [1]