Author Topic: exporting random picture as ssi or phpinclude  (Read 10521 times)

0 Members and 1 Guest are viewing this topic.

Offline Western Rhythm

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • http://www.westernrhythm.com
exporting random picture as ssi or phpinclude
« on: May 25, 2002, 08:16:24 PM »
Hello

It is possible to export a random picture (like in the program) to the front page of my site?

can i just include a file?

cheers

Offline penum

  • Newbie
  • *
  • Posts: 46
    • View Profile
    • http://www.digicamfotos.de
exporting random picture as ssi or phpinclude
« Reply #1 on: May 25, 2002, 09:04:04 PM »
Put this coding in the first line of your php-page:

Code: [Select]

<?php 
//your path Pfad to 4images-directory 
$root_path "./"

define&#40;'ROOT_PATH', $root_path&#41;; 
include&#40;ROOT_PATH.'global.php'&#41;; 
$random_image $site_template->clean_template&#40;get_random_image&#40;0,0&#41;&#41;; 
?>



thatīs the coding, where you want to show the picture:

Code: [Select]

<?php 
echo $random_image
?>



Greetinx Peter
http://www.digicamfotos.de

Offline Western Rhythm

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • http://www.westernrhythm.com
exporting random picture as ssi or phpinclude
« Reply #2 on: May 26, 2002, 11:19:17 AM »
Thankyou very very much!!! :)

oops got an error

Code: [Select]
Fatal error: Cannot redeclare class session in /home/virtual/www.westernrhythm.com/photogallery/includes/sessions.php on line 25

Offline Western Rhythm

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • http://www.westernrhythm.com
exporting random picture as ssi or phpinclude
« Reply #3 on: May 26, 2002, 11:30:19 AM »
I also tried this and got a security error

<?php
//your path Pfad to 4images-directory
include "/home/virtual/www.westernrhythm.com/photogallery/global.php";

$random_image = $site_template->clean_template(get_random_image(0,0));
?>

Offline penum

  • Newbie
  • *
  • Posts: 46
    • View Profile
    • http://www.digicamfotos.de
exporting random picture as ssi or phpinclude
« Reply #4 on: May 26, 2002, 12:41:59 PM »
You must put this code at the first line!!!! of your php-file, before the HTML-Tags.
 
Code: [Select]

<?php 
//your path Pfad to 4images-directory 
$root_path "./"

define&#40;'ROOT_PATH', $root_path&#41;; 
include&#40;ROOT_PATH.'global.php'&#41;; 
$random_image $site_template->clean_template&#40;get_random_image&#40;0,0&#41;&#41;; 
?>



i have had the same problem, but so it works.

Greetings Peter

Offline Western Rhythm

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • http://www.westernrhythm.com
exporting random picture as ssi or phpinclude
« Reply #5 on: May 26, 2002, 04:35:24 PM »
thanks for your help, but my forum session is disagreeing with it, so i get a fatal error.

doesn't matter, cheers anyway :)

thanks :)

Offline Lost Ghost

  • Pre-Newbie
  • Posts: 1
    • View Profile
    • http://www.anime.me.uk
exporting random picture as ssi or phpinclude
« Reply #6 on: September 18, 2002, 09:15:25 PM »
I did everything you said, but I am getting the following message:

Quote

Fatal error: Call to a member function on a non-object in /pub/home/anime115/htdocs/gallery/includes/functions.php on line 172


Any ideas?

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Seen this thread?
« Reply #7 on: September 19, 2002, 12:44:03 AM »
Ummmm....

Have you guys looked here?

http://www.4homepages.de/forum/viewtopic.php?t=1020