ZenphotoCMS Forum
random images on other website - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: random images on other website (/thread-3048.html)



random images on other website - bill61 - 2008-06-06

hi fatman or developers

i did browse pages :
http://www.zenphoto.org/support/topic.php?id=243&replies=9
http://www.zenphoto.org/trac/ticket/555

now

i downloaded the "random.php" as it is into the zp-core

in my html test page i put:

%%Include.http://www.alankabout.com/mediabox/zp-core/random.php?
num=9&height=50&width=50&class=one-image&album=Lions')%%

lions album url is : http://mediabox.alankabout.com/Picture%20Galleries/Animals/Big_Cats/Lions/

in my html test page on my other website i am getting:

Zenphoto Error: the requested object was not found. Please go back and try again.

so what i did wrong??

thanks


random images on other website - fatman - 2008-06-06

The URL should be

http://www.alankabout.com/mediabox/zp-core/random.php?num=9&height=50&width=50&class=one-image&album=Picture%20Galleries/Animals/Big_Cats/Lions


random images on other website - bill61 - 2008-06-06

hi fatman

sorry fatman

the url should be:
http://mediabox.alankabout.com/zp-core/random.php?num=9&height=50&width=50&class=one-image&album=Picture%20Galleries/Animals/Big_Cats/Lions

because the site address is :
http://mediabox.alankabout.com/

now

i have this:

<table border="1" width="100%">
<tr>
<td>%%Include.http://mediabox.alankabout.com/zp-core/random.php?num=9&height=50&width=50&class=one-image&album=Picture%20Galleries/Animals/Big_Cats/Lions%%</td>
</tr>
</table>

but still not showing

so how can i include this code into html page??

http://mediabox.alankabout.com/zp-core/random.php?num=9&height=50&width=50&class=one-image&album=Picture%20Galleries/Animals/Big_Cats/Lions

in browser address it works

just confused still about how to make it showing in my html page

thanks


random images on other website - bill61 - 2008-06-06

hi fatman

it is getting a bit better now

i did search the net and i found this:
http://gallery.menalto.com/node/59563

i did have this now:
<table border="1" width="100%">
<tr>
<td><?php @readfile('http://mediabox.alankabout.com/zp-core/random.php?num=9&height=50&width=50&class=one-image&album=Picture%20Galleries/Animals/Big_Cats/Lions'); ?></td>
</tr>
</table>

the problem is the boxes are there but empty no images.

take a look pls at the bottom of this page:

http://www.alankabout.com/

thanks


random images on other website - bill61 - 2008-06-06

hi fatman or developers

how can i make the image open in new page also to make the "border 0" in this code bellow pls:

<?php

/*******************************************************************************
* random.php: return random image
*******************************************************************************
* URL Parameters:
* num - number of images
* width - width of random image.
* height - height of random image.
* class - css class for random image.
* album - album to get the random image, default is root.
*
*******************************************************************************
*/

define('OFFSET_PATH', true);
require_once("template-functions.php");

isset($_REQUEST['num']) ? $num = $_REQUEST['num'] : $num = 0;
isset($_REQUEST['width']) ? $width = $_REQUEST['width'] : $width = 50;
isset($_REQUEST['height']) ? $height = $_REQUEST['height'] : $height = 50;
isset($_REQUEST['class']) ? $class = $_REQUEST['class'] : $class = '';
isset($_REQUEST['album']) ? $album = $_REQUEST['album'] : $album = '';

header ('Content-Type: text/html; charset=' . getOption('charset'));

while ($num > 0) {
if ($album == '') {
$randomImage = getRandomImages();
} else {
$randomImage = getRandomImagesAlbum($album);
}

$randomImageURL = getURL($randomImage);
echo 'getTitle() . '" class="' . $class . '">' .
'<img src="' . getMainSiteURL() . $randomImage->getCustomImage(null, $width, $height, null, null, null, null) .
'" width="' . $width . '" height="' . $height . '" alt="'.$randomImage->getTitle().'"';
echo "/>\n";
$num--;
}

?>


random images on other website - bill61 - 2008-06-06

hi fatman or developers

how can i make the image open in new page also to make the "border 0" in this code bellow pls:

<?php

/*******************************************************************************
* random.php: return random image
*******************************************************************************
* URL Parameters:
* num - number of images
* width - width of random image.
* height - height of random image.
* class - css class for random image.
* album - album to get the random image, default is root.
*
*******************************************************************************
*/

define('OFFSET_PATH', true);
require_once("template-functions.php");

isset($_REQUEST['num']) ? $num = $_REQUEST['num'] : $num = 0;
isset($_REQUEST['width']) ? $width = $_REQUEST['width'] : $width = 50;
isset($_REQUEST['height']) ? $height = $_REQUEST['height'] : $height = 50;
isset($_REQUEST['class']) ? $class = $_REQUEST['class'] : $class = '';
isset($_REQUEST['album']) ? $album = $_REQUEST['album'] : $album = '';

header ('Content-Type: text/html; charset=' . getOption('charset'));

while ($num > 0) {
if ($album == '') {
$randomImage = getRandomImages();
} else {
$randomImage = getRandomImagesAlbum($album);
}

$randomImageURL = getURL($randomImage);
echo 'getTitle() . '" class="' . $class . '">' .
'<img src="' . getMainSiteURL() . $randomImage->getCustomImage(null, $width, $height, null, null, null, null) .
'" width="' . $width . '" height="' . $height . '" alt="'.$randomImage->getTitle().'"';
echo "/>\n";
$num--;
}

?>

thanks


random images on other website - Mammlouk - 2008-06-06

bill61,
To get rid of the border, just add border="0" at the end of your img tag like so:

'<img src="' . getMainSiteURL() . $randomImage->getCustomImage(null, $width, $height, null, null, null, null) .
'" width="' . $width . '" height="' . $height . '" alt="'.$randomImage->getTitle().'" border="0"';

The easiest way to open in a new window would be to change it on whatever page you are using to call the image, just link to it with target="_blank"

Hope that helps,
Jeremy


random images on other website - bill61 - 2008-06-06

hi Mammlouk

the border are ok now thanks for that

i still have problem with open in new window:

<table border="1" width="100%">
<tr>

<td><iframe
src ="http://mediabox.alankabout.com/zp-core/random.php?num=1&height=100&width=100&class=one-image&album=Picture%20Galleries/Animals/Big%20Cats/Lions"

width="100%">
</iframe> </td>
<td> <iframe
src ="http://mediabox.alankabout.com/zp-core/random.php?num=1&height=100&width=100&class=one-image&album=Picture%20Galleries/Geography/Americas"
width="100%">
</iframe>

</td>
</tr>
</table>


random images on other website - Mammlouk - 2008-06-06

bill61,

I downloaded random.php so I could look and find the information you needed. From what I'm seeing the code for hte link is on line 36 of the file. If it's not on that line for you, then it should be near there. It should look like this before it's changed:

echo 'getTitle() . '" class="' . $class . '">' .

Now you need to change it and add target="_blank" to the end of the code as follows:

echo 'getTitle() . '" class="' . $class . '" target="_blank">' .

That should take care of your problem.

-Jeremy


random images on other website - bill61 - 2008-06-07

hi Mammlouk

thanks a lot Mammlouk, work very well now.

however, any idea how to align the image from the same file like: align top, and align center ??

i set the align in the iframe but it did not work so it must be from the random.php file itself.

regards


random images on other website - Mammlouk - 2008-06-07

You have a few options to try. You can use center tags, or you can use CSS.

Center tags work by just placing them at the beginning and end of the image like so:
echo '<center>getTitle() . '" class="' . $class . '">' .
'<img src="' . getMainSiteURL() . $randomImage->getCustomImage(null, $width, $height, null, null, null, null) .
'" width="' . $width . '" height="' . $height . '" alt="'.$randomImage->getTitle().'"';
echo "/></center>\n";

CSS Styling should work if you do the following, but I can't promise because I haven't tested and I usually use it from external style sheets. Try this:

echo '<div style="display:block; margin-left:auto; margin-right:auto;">getTitle() . '" class="' . $class . '">' . '<img src="' . getMainSiteURL() . $randomImage->getCustomImage(null, $width, $height, null, null, null, null) . '" width="' . $width . '" height="' . $height . '" alt="'.$randomImage->getTitle().'"'; echo "/></div>\n";

One of those should do what you're looking for.

-Jeremy


random images on other website - bill61 - 2008-06-07

hi Mammlouk

thanks a lot Mammlouk it works very well on all magor browsers

the php file looks like that now:

<?php

/*******************************************************************************
* random.php: return random image
*******************************************************************************
* URL Parameters:
* num - number of images
* width - width of random image.
* height - height of random image.
* class - css class for random image.
* album - album to get the random image, default is root.
*
*******************************************************************************
*/

define('OFFSET_PATH', true);
require_once("template-functions.php");

isset($_REQUEST['num']) ? $num = $_REQUEST['num'] : $num = 1;
isset($_REQUEST['width']) ? $width = $_REQUEST['width'] : $width = 100;
isset($_REQUEST['height']) ? $height = $_REQUEST['height'] : $height = 100;
isset($_REQUEST['class']) ? $class = $_REQUEST['class'] : $class = '';
isset($_REQUEST['album']) ? $album = $_REQUEST['album'] : $album = '';

header ('Content-Type: text/html; charset=' . getOption('charset'));

while ($num > 0) {
if ($album == '') {
$randomImage = getRandomImages();
} else {
$randomImage = getRandomImagesAlbum($album);
}

$randomImageURL = getURL($randomImage);
echo '<div style="display:block; margin-top:-15px; margin-left:-10px; margin-right:auto;">getTitle() . '" class="' . $class . '" target="_blank">' .
'<img src="' . getMainSiteURL() . $randomImage->getCustomImage(null, $width, $height, null, null, null, null) .
'" width="' . $width . '" height="' . $height . '" alt="'.$randomImage->getTitle().'" border="0"';

echo "/></div>\n";
$num--;
}

?>

by the way

can i get your help on my other post if u can " nightly build fixes "

regards


random images on other website - Bilder-Freak - 2008-08-27

Great! Thank you very much.


random images on other website - bill61 - 2008-10-23

hi developers

any idea why this random link not working:

http://gallery.alankabout.com/zp-core/random.php?num=1&height=600&width=450&class=one-image&album=photo-gallery-arabic%2Frouya-raouf

this is the actual url:
http://gallery.alankabout.com/index.php?album=photo-gallery-arabic%2Frouya-raouf

sometimes it show one image than it go black when i re-load the page

i do have the random.php in zp-core folder and everything

thanks


random images on other website - acrylian - 2008-10-23

First, random.php is not a standard theme page, so I can't say what you are actually doing on that.