Everything posted by scaz182
-
books on html
I too used the book EggMan recommended, definitely worth working through. & agree with James, HTML/XHTML is definitely where you need to start when learning web design! btw HTML and XHTML are ultimately the same thing, the book will explain.
-
PHP - order readdir() files alphabetically
Ok well I'm gonna give this a go in the morning! Thanks v.much for your help I'm pretty certain it will work/ I understand what you are saying! I still have so much to learn with PHP! lol
-
PHP - order readdir() files alphabetically
Yeah lol, hate it when that happens! ok, forgive me if I am not entirely grasping your code but does that also assume (which it easily could be) that the thumbs are named tNAME_01.jpg, tNAME_02.jpg, tNAME_03.jpg and the main images are named NAME_01.jpg, NAME_02.jpg, NAME_03.jpg? Does the str_replace(); function essentially look for a 't' within the file name and then replace it with a space? what if the file contained a 't' elsewhere? e.g. NAME.tiff (this is not really an issue with my project but am just interested in the nature of str_replace();?) Cheers EDIT: oops I just read your edit which basically answers this!!
-
PHP - order readdir() files alphabetically
Ahh no there not, but now you mention it there is no real reason why they can't be the same, meaning I could use a foreach loop to print the array and use the variable given to the array elements twice (once for the thumbnail and once for the main image! but obviously with different folder paths.) mmm I think you may well have solved my problem! although this sorta feels like a coincidental solution and for some reason would still be interested in doing it using different file names for the thumbnails and the main images? but if you or anybody cannot work out how then this will more than suffice!
-
PHP - order readdir() files alphabetically
ff EDIT: god knows how I accidentally posted this
-
PHP - order readdir() files alphabetically
Thanks for the involved help Shaun, I have tried that (or similar) yesterday and the issue I had with it was that I need to echo out both the thumbnail name and the main image name within the same loop (I cannot work out how two separate arrays can be printed out within the same loop?) I need them to both be echoed out at the same time because the html code contains both the thumbnail and image name in the same line being the $file and $tfile variables: i.e. echo "<a href=\"/other/lightbox/images/rps/$file\" rel=\"lightbox[rps]\" title=\"RPS Photographs\"><img src=\"/other/lightbox/images/trps/$tfile\" width=\"85\" height=\"85\" alt=\"RPS_$num\" /></a>\n"; I might have the wrong end of your code though?
-
Review Site Design
URL? EDIT: Swear that wasn't there a second ago!
-
PHP - order readdir() files alphabetically
Yeh, whilst researching ways to do this I also came across putting it into an array then printing that but the trouble I have is that I have two readdir() functions going on in the same loop one for the thumbnail and one for the image. When I tried putting it into an array I could only print out one array at a time! This is my code (hope you can understand what I'm getting at!) // Define the path to folder $path = "./other/lightbox/images/rps"; $tpath = "./other/lightbox/images/trps"; // Open image folder $images = @opendir($path) or die("Unable to open folder"); // Open thumbnail folder $thumbnails = @opendir($tpath) or die("Unable to open folder"); //Print title echo "<h1>Royal Photographic Society</h1>\n"; // create alt attribute number $num = 1; // Loop through the files while (($file = readdir($images)) && ($tfile = readdir($thumbnails)) == TRUE) { //Prevent folders showing if($file == ".") continue; if($file == "..") continue; //Prevent thumb folders from showing if($tfile == ".") continue; if($tfile == "..") continue; // Display the results echo "<a href=\"/other/lightbox/images/rps/$file\" rel=\"lightbox[rps]\" title=\"RPS Photographs\"><img src=\"/other/lightbox/images/trps/$tfile\" width=\"85\" height=\"85\" alt=\"RPS_$num\" /></a>\n"; $num++; } here is a link to what I am producing - as you can see because the thumbnails and the main images are read using readdir() in a seemingly random order the thumnails do not correspond to the main images! Any more insight/help would be much appreciated
-
Nice font, whats yours?
Century Gothic is my current font of choice for headings/logo's etc. although I see myself over using it soon! For copy text I use Arial.
-
PHP - order readdir() files alphabetically
Hi people, I tried to ask this question the other day but was mega tired so don't think I made sense resulting in no replies. Basically what I want to know is; can you order readdir() files alphabetically? When I was on a Windows server the files in the directory were automatically returned in alphabetical order but now I've moved onto Linux I am getting a seemingly random order! Please help it is driving me crazy!
-
PHP readdir(); alphabetical order?
Hi people, I have made a simple photo gallery which reads all files within various directories and then spits out the thumbnails and the main image. In order for the thumnails to correspond to the correct image then there must be some order to the readdir() function. Windows server managed to loop through them in alphabetical order but now I have moved back to Linux it gives me them in a seemingly random order. Can anybody see why Linux would do this and if there is a method for sorting the readdir() function? I have been searching google and most places suggest putting the readdir() results into an array then sorting the array. This has proved difficult for me as I need two arrays - both the thumbnail and the main image that would need to be echoed at the same time? here is my code // Define the path to folder $path = "./other/lightbox/images/rps"; $tpath = "./other/lightbox/images/trps"; // Open image folder $images = @opendir($path) or die("Unable to open folder"); // Open thumbnail folder $thumbnails = @opendir($tpath) or die("Unable to open folder"); //Print title echo "<h1>Royal Photographic Society</h1>\n"; // create alt attribute number $num = 1; // Loop through the files while (($file = readdir($images)) && ($tfile = readdir($thumbnails)) == TRUE) { //Prevent folders showing if($file == ".") continue; if($file == "..") continue; //Prevent thumb folders form showing if($tfile == ".") continue; if($tfile == "..") continue; // Display the results echo "<a href=\"/other/lightbox/images/rps/$file\" rel=\"lightbox[rps]\" title=\"RPS Photographs\"><img src=\"/other/lightbox/images/trps/$tfile\" width=\"85\" height=\"85\" alt=\"RPS_$num\" /></a>\n"; $num++; } echo "<br/>"; // Close it closedir($images); closedir($thumbnails); If anybody has any idea what I am trying to say and knows of a solution then I would be one grateful guy!
-
Do 'Widows' Worry You?
Am I being stupid? what are windows?
-
PHP - copy() or move_uploaded_file()?
Ok, thanks people, I guess I will stick with using move_uploaded_file() when uploading files from an HTML form. Cheers.
-
PHP - copy() or move_uploaded_file()?
The names of the functions would suggest that but they actually both do the same thing (at least I have used them both to upload a local file to a specified directory on the server) I was just interested in why and when one should be used over the other?
-
PHP - copy() or move_uploaded_file()?
Hi people, I guess my question is in the title? Anybody know?
-
Web Gallery
Try Lightbox2 http://www.lokeshdhakar.com/projects/lightbox2/
-
PHP changing variable depending on which link is clicked?
Garry, you are a legend! I have never used the GET method before, looks like it's gonna prove very useful! Thanks. EDIT: And thanks ElanMan, that code is very similar to what I ended up using! cheers
-
PHP changing variable depending on which link is clicked?
Hi people, I think this is going to be a hard one to explain but I'm gonna give it a go. I better let you know I'm using PHP and MySQL. I currently have one page that spits out all records in my database (in my case each record is a project/website I have worked on) Here's the link I then want users to be able to click on each thumbnail of the project for a more detailed view. I currently have this set up so each thumbnail goes to a separate php page with a different query used. Essentially I would like to have all thumbnails go to one php page (so I don't have to create another page every time I upload a new project) and dish out a different query depending on the thumbnail that is clicked. (the variation in the query would be as simple as changing the WHERE to the correspoinding ID field value. so essentially WHERE id = $id_num would be what I want, $id_num would have to have a specific value depending on which thumbnail is clicked). So what I think I'm asking is, does anybody know how PHP can work out which link is clicked by the user in order for me to dynamically change a SQL query. Hope someone can understand where I'm coming from!
-
Dynamic photo gallery
Thanks ElanMan, I was typing as you replied, I have never really looked into flickr to be honest, I might have a look and see what it offers even so.
-
Dynamic photo gallery
Don't worry I have a solution, In case somone ends up here after searching for something similar this is what I used: <?php // Define path to folders $path = "./other/lightbox/images/wild"; $tpath = "./other/lightbox/images/twild"; // Open image folder $images = @opendir($path) or die("Unable to open folder"); // Open thumbnail folder $thumbnails = @opendir($tpath) or die("Unable to open folder"); // Loop through the files while (($file = readdir($images)) && ($tfile = readdir($thumbnails)) == TRUE) { //Prevent folders showing if($file == ".") continue; if($file == "..") continue; // Display the results echo "<a href=\"/other/lightbox/images/wild/$file\" rel=\"lightbox[wild]\" title=\"Wildlife Photographs\" class=\"floatright\"><img src=\"/other/lightbox/images/twild/$tfile\"/></a>"; } // Close it closedir($images); closedir($thumbnails); ?>
-
Dynamic photo gallery
Hi people, I'm looking into making my photo gallery dynamic. What I mean by this is I want to be able to upload an image to a specified directory and have it print out the code to them. So if the images in the directory change so will the the images that are displayed on my page. I am using lightbox2 to display my gallery here so I guess for every image in a folder I would have to print out: <a href="/other/lightbox/images/ny/ny_1.jpg" rel="lightbox[ny]" title="caption." id="ny_1">link1</a> I am only really familiar with PHP so that would be the language I would code it with. Anybody got any ideas?
-
Stylesheet In Directory Above
I'm not sure I entirely understand the directory structure you have but assuming you have somthing like this: /home /home/weather this should work <link href="/home/rusc_home_styles.css" rel="stylesheet" type="text/css"/> OR: <link href="../rusc_home_styles.css" rel="stylesheet" type="text/css"/> If your refering to root when you say 'home' then the following should work: <link href="/rusc_home_styles.css" rel="stylesheet" type="text/css"/> OR: <link href="../rusc_home_styles.css" rel="stylesheet" type="text/css"/> Hope this helps
-
Anybody else a student?
I'm in my second year in a FdSc Web Design course at the University of Bedfordshire, it's not even funny how bad it is. I will be going into the third year of BSc Computer Science next year so at least I will come out with a full degree. When choosing a course I found the that the issue with web design is whether it should be a BSc or BA, and clearly it is a huge mix. I chose BSc because I thought I would learn more practical and commercially viable things such as programming languages etc. I figured the design side can't necessarily be taught, only practised (I was originally on an Art and Design course but found their 'airy fairy' thinking to be irritating, didn't actually teach me anything I could go away with and say I know this or that.)
-
Web folder structure?
Oh right, How I didn't know that I don't know!!! So no matter where my html file is even if it is three directories deep, all I would need to do is put a forward slash in front of the path (to the css for example) and it will assume it starts form the root, now that's the answer I was looking for! I had used absolute linking to get the same effect at one point but that would have been a huge pain if I transferred the site to another domain. Cheers on another note, Does anybody separate each page into subdirectories and then include an index file in each of these (I have seen that used before, but never saw the point) It's not a wrong as such but I think it just keeps it neater and invokes the idea of css more so (style separate from content)
-
Web folder structure?
opps I don't capitalise them that's just a reaction when typing.