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

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

0 Members and 2 Guests are viewing this topic.

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #585 on: January 31, 2009, 12:00:37 AM »
na perfect ;)
lass sehen.
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 Trev

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #586 on: February 02, 2009, 08:58:37 AM »
Hallo Nicky,

vielen Dank für den Kategorie Namen, dieser wird angezeigt, doch leider wird der Thumbnail nicht angezeigt!
Könntest Du mal schauen?

Dankeschön.

(Gelöst, es fehlte das
$cat_id = $row['cat_id'];)
« Last Edit: February 02, 2009, 09:19:18 AM by Trev »

Offline Trev

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #587 on: February 09, 2009, 10:29:45 AM »
Hallo

ich habe anstatt die Thumbnails zu benutzen, die eigentlichen Bilder als Vorscheu genommen. Meine Bilder sind nicht sehr groß (400px breit und so 6okb)
Momentan werden die Fotos ja skaliert (150x125 oder so).
Aber ich habe ja auch breite und hohe Bilder und mit dem Randomimage Script wird ja das Bild dann verzerrt - zu breit oder zu hoch.
Wie kann ich es ändern?

Danke

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #588 on: February 09, 2009, 12:13:43 PM »
hi Trev,

hmm...

du hast es doch selber so eingestellt:
Code: [Select]
echo "<img src=\"".$full_src."\" height=\"125\" width=\"150\" border=\"2\" alt=\"$image_name\"></a><br>\n";
nehme halt
Code: [Select]
height=\"125\" width=\"150\"
wieder raus.. dann hast es in der original grösse
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 Trev

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #589 on: February 09, 2009, 03:39:49 PM »
Hi Nicky

Ja, das weiß ich :-)
Kann ich es evtl prozentual ausgeben?

Grüße von
Trev

Hey Du magst wohl auch Basketball?

Offline nhomauhoaphuong

  • Newbie
  • *
  • Posts: 35
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #590 on: May 20, 2009, 01:45:20 PM »
i have a problem using this random images javascript... i tried to make these thumbnails expando when mouseover while it's marquee from the right to left... will stop and expand the image to a bigger size when mouseover ... the crawler script is working but the expando is still not working... can anyone please help me with this ....

Quote
<?php
if ((!defined('NV_SYSTEM')) AND (!defined('NV_ADMIN'))) {
    Header("Location: ../index.php");
    exit;
}
$content  .= "<head>\n";
$content  .= "<style type=\"text/css\">\n";
$content  .= "img.expando{ /*sample CSS for expando images. Not required but recommended*/\n";
$content  .= "border: none;\n";
$content  .= "vertical-align: top; /*top aligns image, so mouse has less of a change of moving out of image while image is expanding*/\n";
$content  .= "}\n";
$content  .= "</style>\n";
$content  .= "</head>\n";
$content  .= "<script type=\"text/javascript\" src=\"../js/expando.js\"></script>\n";
$content  .= "<script type=\"text/javascript\" src=\"../js/crawler.js\"></script>\n";
$content  .= "<div class=\"marquee\" id=\"mycrawler2\">\n";
$content  .= "<p><p align=\"center\">&nbsp;&nbsp;&nbsp;&nbsp;<SCRIPT language=\"JavaScript\" class=\"expando\" src=\"http://chuahuongdao.org/hinhanh/random.php?1\" width=\"140\" height=\"110\"></SCRIPT>\n";
$content  .= "&nbsp;<SCRIPT language=\"JavaScript\" class=\"expando\" src=\"http://chuahuongdao.org/hinhanh/random.php?2\" width=\"140\" height=\"110\"></SCRIPT>\n";
$content  .= "&nbsp;<SCRIPT language=\"JavaScript\" class=\"expando\" src=\"http://chuahuongdao.org/hinhanh/random.php?3\" width=\"140\" height=\"110\"></SCRIPT>\n";
$content  .= "&nbsp;<SCRIPT language=\"JavaScript\" class=\"expando\" src=\"http://chuahuongdao.org/hinhanh/random.php?4\" width=\"140\" height=\"110\"></SCRIPT>\n";
$content  .= "&nbsp;<SCRIPT language=\"JavaScript\" class=\"expando\" src=\"http://chuahuongdao.org/hinhanh/random.php?5\" width=\"140\" height=\"110\"></SCRIPT>\n";
$content  .= "&nbsp;<SCRIPT language=\"JavaScript\" class=\"expando\" src=\"http://chuahuongdao.org/hinhanh/random.php?6\" width=\"140\" height=\"110\"></SCRIPT>\n";
$content  .= "&nbsp;<SCRIPT language=\"JavaScript\" class=\"expando\" src=\"http://chuahuongdao.org/hinhanh/random.php?7\" width=\"140\" height=\"110\"></SCRIPT>\n";
$content  .= "</div></p>\n";
$content  .= "<script type=\"text/javascript\">\n";
$content  .= "marqueeInit({\n";
$content  .= "   uniqueid: 'mycrawler2',\n";
$content  .= "   style: {\n";
$content  .= "      'padding': '2px',\n";
$content  .= "      'width': '600px',\n";
$content  .= "      'height': '180px'\n";
$content  .= "   },\n";
$content  .= "   inc: 3, //speed - pixel increment for each iteration of this marquee's movement\n";
$content  .= "   mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)\n";
$content  .= "   moveatleast: 2,\n";
$content  .= "   neutral: 150,\n";
$content  .= "   savedirection: true\n";
$content  .= "});\n";
$content  .= "</script>\n";
?>


this is the image expando script site... http://www.dynamicdrive.com/dynamicindex4/expandoimage.htm

Offline yousaf

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #591 on: June 08, 2009, 03:21:19 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

@ Nicky, sorry for pulling out an old post as a Quote reference
but i would like to ask for a little help, since by applying your code we get multi images in a vertical column, could you please just make a tweak and change it to horizontal position.

the current positions of images are like this

image1
image2
image3

i want them to be like .... image1  image2  image3

...........
Edited: Oops i didnt know a guy named bergblume already solved this issue on the previous page(i saw it lately and i had to translate his post lolz, i dont know German, hope to learn it from benny some day :P )
anyways. i made it to work with the help of Nicky and bergblume
and i am now able to show 4 random images on a different Domain powered by Wordpress
example: http://www.pashtosms.com see the front page
« Last Edit: June 08, 2009, 09:57:23 PM by yousaf »

Offline CorFie

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #592 on: June 10, 2009, 10:01:41 PM »
Ich liebe den Mod, aber ich habe eine Problem.

Bei Zirkelbilder.de haben wir zwei Galerien.
Einmal eine für die großen Bilder, einmal eine für die Avatare (unsere Avatarbase).
Ich möchte auf dem Blog von beiden Galerien die Zufallbilder zeigen.

Von der Hauptgalerie macht er es perfekt, so wie ich möchte.
Nun hab ich das ganze versucht zusätzlich mit der "Avatarbase" einzubauen und da haut er mir immer diese Fehlermeldung raus:

Code: [Select]
Warning: main(../galerie/includes/db_mysql_new.php) [function.main]: failed to open stream: No such file or directory in /www/htdocs/w0090b99/zirkelbilder/avatare.php on line 33

Warning: main(../galerie/includes/db_mysql_new.php) [function.main]: failed to open stream: No such file or directory in /www/htdocs/w0090b99/zirkelbilder/avatare.php on line 33

Warning: main() [function.include]: Failed opening '../galerie/includes/db_mysql_new.php' for inclusion (include_path='.:/usr/share/php:..') in /www/htdocs/w0090b99/zirkelbilder/avatare.php on line 33

Fatal error: Cannot redeclare is_remote() (previously declared in /www/htdocs/w0090b99/zirkelbilder/random.php:37) in /www/htdocs/w0090b99/zirkelbilder/avatare.php on line 38

Irgendwie versteh ich nicht, warum er immer auf die Galerie versucht zuzugreifen bei der db_mysql_new.php.
Denn schließlich gebe ich in der avatar.php (umbenannte random.php) vor, dass er auf die avatare zugreifen soll.
Trotzdem verweigert sich das System und ich verzweifel.

Kann mir jemand helfen?
Code: [Select]
<?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''../avatars/');

include(
ROOT_PATH.'config.php');
include(
ROOT_PATH.'includes/db_mysql_new.php');
include(
ROOT_PATH.'includes/constants.php');
define('SCRIPT_URL''http://avatare.zirkelbilder.de/');

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


echo 
"<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=\"_new\"><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";
?>

Offline yousaf

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #593 on: June 22, 2009, 08:33:20 PM »
I've seen modification how to make random.php work with sertan categories, but is that possible use all categories and filter the ones I dont want to use?
if I have 200+ categories this way:
Code: [Select]
AND a.cat_id IN (4, 9, 15)would be just pain...if I dont want use 2 categories...
or it would be easier if I creat a new group, then set witch categories that group can access and use this code?:
Code: [Select]
AND b.auth_viewimage=2 or that code only works as 'guest','registered', or 'admin'? (sry, dont speak  german)

Hi Vano, Did you make it work?
sorry for digging out an old post as reference, but i am also looking for a way that a specific category is excluded in the random images on external pages.

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #594 on: June 22, 2009, 09:56:21 PM »
hi yousaf,

if you want to exlude some categories, then use insteaf of
Code: [Select]
AND a.cat_id IN (4, 9, 15)
this

Code: [Select]
AND a.cat_id NOT IN (4, 9, 15)
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 Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #595 on: June 22, 2009, 10:06:37 PM »
Ich liebe den Mod, aber ich habe eine Problem.

Bei Zirkelbilder.de haben wir zwei Galerien.
Einmal eine für die großen Bilder, einmal eine für die Avatare (unsere Avatarbase).
Ich möchte auf dem Blog von beiden Galerien die Zufallbilder zeigen.

Von der Hauptgalerie macht er es perfekt, so wie ich möchte.
Nun hab ich das ganze versucht zusätzlich mit der "Avatarbase" einzubauen und da haut er mir immer diese Fehlermeldung raus:

Code: [Select]
Warning: main(../galerie/includes/db_mysql_new.php) [function.main]: failed to open stream: No such file or directory in /www/htdocs/w0090b99/zirkelbilder/avatare.php on line 33

Warning: main(../galerie/includes/db_mysql_new.php) [function.main]: failed to open stream: No such file or directory in /www/htdocs/w0090b99/zirkelbilder/avatare.php on line 33

Warning: main() [function.include]: Failed opening '../galerie/includes/db_mysql_new.php' for inclusion (include_path='.:/usr/share/php:..') in /www/htdocs/w0090b99/zirkelbilder/avatare.php on line 33

Fatal error: Cannot redeclare is_remote() (previously declared in /www/htdocs/w0090b99/zirkelbilder/random.php:37) in /www/htdocs/w0090b99/zirkelbilder/avatare.php on line 38

Irgendwie versteh ich nicht, warum er immer auf die Galerie versucht zuzugreifen bei der db_mysql_new.php.
Denn schließlich gebe ich in der avatar.php (umbenannte random.php) vor, dass er auf die avatare zugreifen soll.
Trotzdem verweigert sich das System und ich verzweifel.

Kann mir jemand helfen?

hi CorFie,

schick mal deine FTP daten, per PN, an mich und wohin die avatar randoms gezeigt werden.
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 yousaf

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #596 on: June 23, 2009, 08:11:03 AM »
hi yousaf,

if you want to exlude some categories, then use insteaf of
Code: [Select]
AND a.cat_id IN (4, 9, 15)
this

Code: [Select]
AND a.cat_id NOT IN (4, 9, 15)

Thanks Nicky
i will give it a try when i get back home. you are always there with a solution :D

Offline Moinsen

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #597 on: July 26, 2009, 10:16:02 AM »
Kurze Frage:

Funktioniert das Random-Script auch dann, wenn das Zufallsbild auf einer externen Seite angezeigt werden soll, also auf einem anderen Webspace?

Wenn ja, müsste ich dann ganz oben im Script an dieser Stelle die vollständige Webadresse mit http://www. ... angeben?

Code: [Select]
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('ROOT_PATH', './bilder/');

Offline waynenort

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #598 on: August 13, 2009, 01:11:59 PM »
Hi Nicky,

Your mod works great, if I run the random.php from the web browser.
Problem is when I include it in my html page using  <?php  include("./random.php");  ?> .... It won't  link it the  random.php file. My webhost has disabled the use of php code in html files. Is there another way of making the random.php work with my html file.

Thanks, Wayne

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [Mod] Random image / Zufallsbild
« Reply #599 on: August 13, 2009, 01:22:41 PM »
@waynenort

... then use a iframe with random.php as content in your html-file ...
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 ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...