Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 29. Mar 2024, 01:12

This forum is readonly now. Please use the new forum if you don't find the answer to your question here. The new forum is at https://www.tinywebgallery.com/blog/forum/


All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: More random trouble
PostPosted: 21. Sep 2006, 21:16 
Offline

Joined: 4. Jan 2006, 19:22
Posts: 11
Two things:

First:
Click on random goes to gallery main page and not showing the random image. The link looks the same as the example on this site. But that link brings me right to the random image.

Second:
I have set up the gallery so other people can add their own pictures to the gallery (thats soo powerful) but those images do not turn up among the randomized images on the main page.

The site is http://www.falufotoklubb.se

I have uploaded all galleries by ftp except the folder "Peter Jaktlund". That folder has been populated by the admin pages and the flash uploader. I have cleared the cache and reloaded the main page/random image (like 40 times) but the pictures from folder "Peter Jaktlund" do NOT show up....

Could the be a permission issue?


Top
 Profile  
 
 Post subject:
PostPosted: 21. Sep 2006, 22:07 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
Hi,

You have enabled the session cache of TWG. When you upload pictures they are shown the next time you get a new session.

I just checked your site - 7 images in the folder you uploaded by twg uploader.

the random image is the thing I don't understand. can you please check the counter/_mydebug.out if is exists?
Normally all erors are shown there.

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 22. Sep 2006, 18:35 
Offline

Joined: 4. Jan 2006, 19:22
Posts: 11
I dont understand your answere, could you please clarify which question you are answering.

I have reloaded the first page with the randomized pic but te new pics never show up. Restarted browser and even tested on other computers.

The log file looks like this, its a bit bigger but that just more occurances fo thse entries :

09.20.2006 23:06:00 - 'pictures/Peter Jaktlund/Cliff in Clouds.jpg' does not exist

09.21.2006 7:37:37 - st:false

09.21.2006 7:38:00 - st:true

09.21.2006 7:45:45 - 'pictures/Peter Jaktlund/test_bild.jpg' does not exist

09.21.2006 7:46:14 - st:false

09.21.2006 8:12:18 - st:false


Top
 Profile  
 
 Post subject:
PostPosted: 22. Sep 2006, 19:00 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
the st are only debug - they can be ignored.
open inc/ajaxserver.inc.php and look for the debug where the st is printed - simply remove it.

and the other ones that images are not found - this normally happends when an url is changed manually

the first part was for question one

You have enabled the session cache of TWG. When you upload pictures they are shown the next time you get a new session.

I just checked your site - 7 images in the folder you uploaded by twg uploader.

- the second for question 2

seems like the image don't exist anymore - and I cannot set them - therfore maybe an old link.

The random does not work because you use an iframefor the gallery - but you call gallerie.php with the parameter - this is fine - but you have to give this parameter to the index.php of TWG - simply parse this parameter and add it to the call of the gallery


Top
 Profile  
 
 Post subject:
PostPosted: 23. Sep 2006, 20:01 
Offline

Joined: 4. Jan 2006, 19:22
Posts: 11
Thanx now all is solved.

Further I wonder:

In the random link it would be nice to have an option to include all images/dir s without having to change the link for each new folder added.

I will create the link dynamic by enumerate all folders. That will work fine with a few lines of code. But what about sub dirs ? Is it possible and if so what is the format in the link?

Like this ?
twg_album=TopFolder|SubFolder

Or like this?
twg_album=TopFolder|TopFolder/SubFolder


Top
 Profile  
 
 Post subject:
PostPosted: 24. Sep 2006, 13:54 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
the 2nd one.

Use the format yo see at the paramerter twg_album in the url.

Using subdfirs is on my dodo list for 1.6. It´s not that easy because passwordprotected folders have to be treated right as well.

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 27. Sep 2006, 08:05 
Offline

Joined: 4. Jan 2006, 19:22
Posts: 11
I have written code to dynamically build the code for viewing a random image. The problem is that sometimes no picture is displayed.

The URL generated loooks ok to me and the only diffrence to the hand coded one I used previously is that there are some empty folders included. Can that be the problem?

Must all folders specified in the Random URL contain images? I could guess that first a folder is picked by random and then a picture.

The PHP code for building the URL (free to use for anyone...):

<img src="galleri/image.php?twg_album=<?php
$dir_handle = @opendir("./galleri/pictures") or die("Unable to open $path");
// Loop through the folders
$folders = "";
while ($file = readdir($dir_handle))
{
if($file == "." || $file == ".." || $file == "index.php" )
continue;
$folders .= urlencode($file) . "|";
}
// Close
closedir($dir_handle);
$folders = rtrim($folders,"|");
echo $folders;
?>&twg_random=1&twg_type=random&twg_random_size=200" border="0">


Top
 Profile  
 
 Post subject:
PostPosted: 27. Sep 2006, 09:26 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
yes - first the folder is picked then the image -

you have to exclude empty folders in your random code

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 28. Sep 2006, 10:48 
Offline

Joined: 4. Jan 2006, 19:22
Posts: 11
this is my result if anyone is intrested:

<img src="galleri/image.php?twg_album=<?php
function containsJpeg($dir)
{
$retval = false;
if (is_dir($dir))
{
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false)
{
if($file != "." && $file != "..")
{
//if(endswith )
if(ereg("jpg$", $file))
{
$retval = true;
break;
}
}
}
closedir($dh);
}
}
return $retval;
}

$galleryBasePath = "./galleri/pictures/";
$dir_handle = @opendir($galleryBasePath) or die("Unable to open $path");
$folders = "";
while ($file = readdir($dir_handle))
{
$isdir = is_dir($galleryBasePath . $file);
if($file != "." && $file != ".." && $file != "index.php" )
{
if($isdir)
{
if(containsJpeg($galleryBasePath . $file))
{
$folders .= urlencode($file) . "|";
}
}
}
}

closedir($dir_handle);
$folders = rtrim($folders,"|");
echo $folders;
?>&twg_random=1&twg_type=random&twg_random_size=200" border="0">


Top
 Profile  
 
 Post subject:
PostPosted: 19. Dec 2006, 01:05 
Offline

Joined: 5. Nov 2006, 15:30
Posts: 7
Hello!

Great script! BUT, always a but ;) I only get a random picture from the first picture folder that I created for a long time ago. The script dont seem to grab pictures from other folders. But when checking the "code" the folders are there.

Any one knows why this happens?

Regards from the kindom of Sweden.


Top
 Profile  
 
 Post subject:
PostPosted: 22. Dec 2006, 16:33 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
which code have you used to included?

You can try the 1.6 beta too - is does recusively go through all folders if you like - see the howto in the download.

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 2. Jan 2007, 12:21 
Offline

Joined: 5. Nov 2006, 15:30
Posts: 7
1. Happy New Year Michael!

2. Testpage for this task is this. #removed_broken_link

Thanks for your reply, used the code as above and used also your default soultion as : <img src="../foto/twg/image.php?twg_album=2006/Rock%20City+HLR&twg_random=1&twg_type=random&twg_random_size=200">



<img src="../foto/twg/image.php?twg_album=2006/<?php
function containsJpeg($dir)
{
$retval = false;
if (is_dir($dir))
{
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false)
{
if($file != "." && $file != "..")
{
//if(endswith )
if(ereg("jpg$", $file))
{
$retval = true;
break;
}
}
}
closedir($dh);
}
}
return $retval;
}

$galleryBasePath = "../foto/twg/pictures/2006/";
$dir_handle = @opendir($galleryBasePath) or die("Unable to open $path");
$folders = "";
while ($file = readdir($dir_handle))
{
$isdir = is_dir($galleryBasePath . $file);
if($file != "." && $file != ".." && $file != "index.php" )
{
if($isdir)
{
if(containsJpeg($galleryBasePath . $file))
{
$folders .= urlencode($file) . "|";
}
}
}
}

closedir($dir_handle);
$folders = rtrim($folders,"|");
echo $folders;
?>&twg_random=1&twg_type=random&twg_random_size=200" border="0">

END of code.

Thanxs for your effort!
/Steffo


Top
 Profile  
 
 Post subject:
PostPosted: 2. Jan 2007, 13:46 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
what is that much code for? to detect your folders?

because this is already done in 1.6 :)


Top
 Profile  
 
 Post subject:
PostPosted: 2. Jan 2007, 13:49 
Offline

Joined: 5. Nov 2006, 15:30
Posts: 7
Great!!

Is it green to "replace" twg with the new 1.6 version?

Looking forward to use the new version of your great program!


Top
 Profile  
 
 Post subject:
PostPosted: 2. Jan 2007, 14:00 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
basic functios - yes. couple of people already use it without any big problems.
(and updates are all really simple ;))

I only have to test Safari + the internationalization of the backend ist still in progress - but if you choose english for TWG Admin it's fine.

/Michael


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
powered by phpbb | Datenschutz/ Privacy policy