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...
:(
I blame PB.
I may be talking completely out of my hat here:
Could it be integrated into Beehive in any way?
At the moment when I go to attachments I can see everything i've uploaded. Maybe using this people can browse each others attachments (if given permission).
For example, Fozza attaches torrent files for teh podcast. While attaching the file is put in his storage, which could even be on another server that uses Teh for authentication in some way. As long as they're in his storage you don't even have to look for the thread they were originally posted in. You just go to his profile and look in his storage.
And he can select who on the forum can see his files, creating groups from the user list. Mods could then share files of world domination without the common people having access.
I don't know if you can do this with dropbox but having the capability to do it on your own server instead of trusting someone else might come in useful for some people - even if it isn't useful for us it helps distinguish Beehive from other Forum software.
</possibly useless thought>