https://www.dropbox.com/developers/reference/api
or
https://github.com/BenTheDesigner/Dropbox
I'll look into those.
I have now sorted the problem with a text file but a better solution would be nice.
echo '<a href="'.$drop.$data.'" class="fancybox"><img src="'.$drop.$data.'" width="190px" /></a>';
<a href="http://dl.dropbox.com/u/blah/photo1.JPG" class="fancybox"><img src="http://dl.dropbox.com/u/blah/photo1.JPG" width="190px" /></a> <a href="http://dl.dropbox.com/u/blah/photo2.JPG" class="fancybox"><img src="http://dl.dropbox.com/u/blah/photo2.JPG" width="190px" /></a> <a href="http://dl.dropbox.com/u/blah/photo3.JPG" class="fancybox"><img src="http://dl.dropbox.com/u/blah/photo3.JPG" width="190px" /></a> <a href="http://dl.dropbox.com/u/blah/photo4.JPG" class="fancybox"><img src="http://dl.dropbox.com/u/blah/photo4.JPG" width="190px" /></a> <a href="http://dl.dropbox.com/u/blah/photo5.JPG" class="fancybox"><img src="http://dl.dropbox.com/u/blah/photo5.JPG" width="190px" /></a>
<a href="http://dl.dropbox.com/u/blah/photo1.JPG
" class="fancybox"><img src="http://dl.dropbox.com/u/blah/photo1.JPG
" width="190px" /></a><a href="http://dl.dropbox.com/u/blah/photo2.JPG
" class="fancybox"><img src="http://dl.dropbox.com/u/blah/photo2.JPG
" width="190px" /></a><a href="http://dl.dropbox.com/u/blah/photo3.JPG
" class="fancybox"><img src="http://dl.dropbox.com/u/blah/photo3.JPG
" width="190px" /></a><a href="http://dl.dropbox.com/u/blah/photo4.JPG
" class="fancybox"><img src="http://dl.dropbox.com/u/blah/photo4.JPG
" width="190px" /></a><a href="http://dl.dropbox.com/u/blah/photo5.JPG" class="fancybox"><img src="http://dl.dropbox.com/u/blah/photo5.JPG" width="190px" /></a>
There's a stray linebreak on the end of each URL, so probably a stupid carriage return (\r), and thus I'd guess you're only splitting on newline (\n).
Either include an optional CR in your split (i.e. \r?\n if it's a regex), or better still set your text file (and any editors you have) to only use single-character newlines, so it doesn't even become an issue.
<?php $dropb = 'http://dl.dropbox.com/u/blah/'; $user_file = @fopen("gallery1.txt", "r"); if ($user_file) { while (!feof($user_file)) { $lines[] = fgets($user_file, 4096); } fclose($user_file); foreach($lines as $line => $data) { echo '<a href="'. $dropb .''. $data .'" class="fancybox"><img src="'. $dropb .''. $data .'" width="190px" /></a>'; } } ?>
$lines[] = trim(fgets($user_file, 4096);)
$lines = preg_split( '\r?\n' , trim(fread($user_file , filesize($user_file))) );
Now there's a blast from the past. Someone on here told me it was a pointless endeavour because anyone who wanted to put files on the Internet would have hosting :-(
I ought to be rich...