Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

lost on the random function
https://www.tinywebgallery.com/forum/viewtopic.php?f=1&t=109
Page 1 of 1

Author:  novw [ 29. Nov 2005, 00:50 ]
Post subject:  lost on the random function

I am trying to get hold of the level TWG has reached. Please update your docs as soon as possilbe ! I am by no means a novice, but the learning curve is EXTREMELY high as it stands now !
---
assuming:

pictures/folder1
pictures/folder2
---

This is what I wanted: I have several albums, I want to add a random picture of that album on the thumbs page of that album. So I tried this:

[code]
<img src="image.php?twg_album=folder1&twg_random=1&twg_type=random&twg_random_size=200">
[/code

in a file called thumb.htm in the folder folder1. Nothing happens

So I rename the file to footer.htm. Guessed good: nothing happens

So I rename the file to folder.txt. Oi, presto: one thumbnail. Wrong postition though. I want it to be below the thumbnails. I am lost. Completely

Suggestion: allow for html like this to be used in the footer.htm. allow footer.htm to be in any directory ?

Author:  TinyWebGallery [ 29. Nov 2005, 15:37 ]
Post subject: 

Hi,

Answer is pretty easy - you assume stuff twg just can't do out of the box ;).

all html includes (footer, header, overview, thumb and image.htm) have to be in the main directory and therefore are the same for all albums!.
Therefore the stuff you tried cannot work ;).

folder.txt is for each directory and intended to display a nice extra text for an album.

Below the thumbnails is no extra include right now!

But you can to this easy by yourself!

use the thumbs.htm (in the main folder) - put the code for your random image in there and replace the album with

<?php echo $twg_album ?>
if you have fancy album names use urlencode($twg_album)

e.g.
<img src="image.php?twg_album=<?php echo urlencode($twg_album) ?>&twg_random=1&twg_type=random&twg_random_size=200">

;).

Have fun using TWG.

/Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/