View Single Post
Old 2012-04-13, 09:02 AM   #1
jollyhumper
That's what she said
 
jollyhumper's Avatar
 
Join Date: Feb 2012
Location: Norway
Posts: 2,627
Send a message via ICQ to jollyhumper
Pulling pics from dated folders, works - but how about?

Hi guys and else..

I have this code. It works fine.
First snippet "defines" the rule. Next snippet are put into "for instance" the various tables that builds up the site.


Code:
<?php
$date = date('Y-m-d');
if(!is_dir("gallery/".$date)){$date="default";}
function fcheck($name){
if(@file_exists("gallery/".$date."/".$name)){
return "gallery/".$date."/".$name;
}else{
return "gallery/".$date."/".$name;
}}

?>
Here's the short snipppet that adds "todays" pictures

Code:
<td align="center"><a href="xpic01.php"><img src="gallery/<?php echo $datetoday; ?>/001.jpg"></a></td>
Still works. I *EVEN* have a fallback-routine, so if nothing is found within a gallery it falls back to one which has something in it.

OK; HERE COMES THE QUESTION
I am not good at PHP.
What if I want each dated folder to include a textfile where PHP reads and publish on appropriate placement on webpage?

Hope I ask a understandable question.

cheers
MRten

PS, according my User-status-name-title
"Rock stars ... is there anything they don't know?"
No, we know everything. Absolutely. Except this about reading a text and put it into a html/php page.
jollyhumper is offline   Reply With Quote