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 5. Dec 2024, 04:23

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  [ 18 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: 19. Oct 2006, 14:50 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
not globals - make parameters,

I use a lot of globals but only for all parameters from the config and for language strings. (and some places where I hadn't have time to refactor them yet :).)

other globals really make code much harder to read because you never know where a parameter is modified and where it comes from :).

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 19. Oct 2006, 15:15 
Offline

Joined: 18. Oct 2006, 11:37
Posts: 9
Don't understand, I wrote:

function getPDF($filetype) // here I am searching for pdf's and show a link if there are
{
global $basedir;
global $twg_album;
$dir_handle = opendir($basedir."/".$twg_album);
while(false !== ($entryname = readdir($dir_handle)))
{
$splitentryname = explode(".", $entryname);
$sizesplitentryname = count($splitentryname);
$fileext = $splitentryname[$sizesplitentryname-1];
$fileext = strtolower($fileext);

if($filetype == $fileext)
{
echo "<a href='$basedir/$twg_album/$entryname'><font size='2'>Download $entryname</font></a><br>";
}
}
}
getPDF("pdf");

and it works, I know basedir is "pictures" but I really need twg_album to tell the album... or not?


Top
 Profile  
 
 Post subject:
PostPosted: 19. Oct 2006, 15:38 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
it's only nicer the other way - any yes 'picures' can be fix in your case.

/Michael


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 18 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