Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - BC_Man

Pages: [1]
1
As always make backups before you make any of these alterations.

I managed to fix something up myself xxx: gallery. djbarney. silentflamexxx: /details. php?image_id=1620 , no mean feat since I know very little PHP. Look at the page source to see the links added, bottom of page. It is based on a 1.7.7 install. Line numbers may vary if you have installed other mods. Installation at your own risk, I can accept no responsibility for data loss or security problems.

Moderators and/or experienced PHP users - is my code correct / secure ? Thanks.

1. Install Fancybox xxx: fancybox. net into 4images. Alter "header.html" template to include Fancybox ...

Code: [Select]
<script type="text/javascript" src="jquery.fancybox/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="jquery.fancybox/jquery.fancybox-1.2.6.pack.js"></script>
<script type="text/javascript">
<!--
$(document).ready(function() {
   $("a.gallery").fancybox();
});
// -->
</script>

See here for more help xxx: groups. googlexxx: /group/fancybox/browse_thread/thread/45056ac7f0a71f02

2. Make sure all relevant media templates have "rel=" and "category=" elements.

Code: [Select]
<!-- Template file for JPG Files -->
<a rel="group" class="gallery" href="{media_src}"><img src="{media_src}" border="1" alt="{image_name}" title="Click to view this image in the category gallery (resizes large images to the window)"{width_height} /></a><br />

3 Go to line 247 of details.php, search for ...

Code: [Select]
"prev_thumb_file" => $prev_thumb_file
Add these two lines after it ...

Code: [Select]
//Fancybox Mod - Barney Holmes, 2009, http://djbarney.org - Set category ID for use in details html template
  "category_id" => $cat_id

4. Now find the file details.html - it will be in your template directory in whatever theme directory you are using - mine is in default. Go to line 250 or search for ...

Code: [Select]
{footer}
After line 250 ...

Code: [Select]
</table>
Add this ....

Code: [Select]
<!-- Fancybox Mod - Barney Holmes, 2009, http://djbarney.org - Set category ID for use in details html template -->
<div style="display:none;"> <!-- Hidden div layer not strictly necessary but thought I'd leave it in to be safe -->
<?php
$dir
="data/media/{category_id}"// The category directory variable set in details.php

if ($dir_list opendir($dir))
{
while((
$filename readdir($dir_list)) !== false)
{
if ((
$filename == '.')||($filename == '..')) // Exclude unix special files.
{
}
else
{
?>
<a rel="group" class="gallery" href="<?php echo $dir.'/'.$filename?>"></a> <?php
}
}
closedir($dir_list);
}
?>

</div>

That's it. This makes hidden links at the end of the details page that Fancybox uses. If you have Fancybox installed correctly then you should have a gallery for all media in the category with hover sensitive left and right arrows once you click on the details image.

Idea for next version: Provide a link from whatever image is being viewed in the Fancybox gallery back to it's details page.

2
Now a MOD - see next message.

Hello,

I've searched and read the FAQ and studied some PHP and templates but I can't see how to do this.

This is on my site, gallery.djbarney.silentflame.com,  so that I can use a Fancybox gallery, fancybox.net/example. Fancybox requires all the links to the images that you want it to include in a gallery to have ...

Code: [Select]
class="group" rel="group"
... like this ...

Code: [Select]
<strong>Image gallery</strong>

<br />

<a class="group" rel="group" title="Group title #1" href="/data/4_b.jpg"><img src="/data/4_s.jpg"></a>

<a class="group" rel="group" title="Group title #2" href="/data/5_b.jpg"><img src="/data/5_s.jpg"></a>

<a class="group" rel="group" href="/data/6_b.jpg"><img src="/data/6_s.jpg"></a>

The problem is actually listing on the page all the links to each image in the category directory. They would need to be hidden as well. I would guess that this is quite a trivial piece of PHP, I just don't know PHP well enough. Thanks.

3
It should, have you tried ? Ffmpeg can decode FLV.

If you have a host with SSH access then on some of them you can install programs in your home directory.

4
How is it done ? Maybe you could rephrase the question ?

Thinking about this problem, this morning ... I wonder if the Windows Media Player plugin is trying to stream the video on a particular port that my firewall is blocking. I suspect everything else is just downloading it, although this doesn't exactly make sense because I've had one other user reporting streaming problems ... I suppose they could be experiencing the same firewall problem.

Can anyone get this to stream ?

BC_Man

5
Hello,

Although I wrote a script to allow auto thumbnailing of video and generation of playlists, I've run across a very annoying problem. I don't think it has anything to do with 4images, although I could be wrong.

I have added links under embedded video to a playlist. Clicking on that immediately streams the file. I've also tested this using mplayer from the command line: instant stream !

But, I cannot get the embedded video to stream. For a start the whole thing, in Firefox on windows at least, is restricted to the MS Windows Media Player browser plugin. It just REFUSES to stream the file, although sometimes it downloads the whole thing and then plays it. I've tried adding an autostart="true" option, but it doesn't make any difference.

Here's my altered mpg.html file ...

Code: [Select]
<!-- Template file for MPEG Movies -->
<embed src="{media_src}" border="0" width="352" height="288" type="application/x-mplayer2" autostart="true"></embed><br />
<a href="{media_src}.pls">Open in external player (PLS)</a><br />
<a href="{media_src}.m3u">Open in external player (M3U)</a><br />

I've tried adding a ".m3u"

Here is an example gallery page.

BC_Man

6
Ug,

I was going to put this in the Mod forum, but wasn't sure if it really qualifies. First time I've posted here.

This is for MPEG video's, but could be adapted for other vid types (?).

Edit: 4images/templates/default/media/mpg.html

Code: [Select]
<!-- Template file for MPEG Movies -->
<embed src="{media_src}" border="0" width="352" height="288" type="application/x-mplayer2"></embed><br />
<a href="{media_src}.pls">Stream PLS</a><br />
<a href="{media_src}.m3u">Stream M3U</a><br />

Run this batch file (actually there are two). It will batch all the mpg's in the directory it is run in. You need to have Imagemagick and ffmpeg installed, and in your path.

makevidthumbs.bat
Code: [Select]
@echo off

echo You must include 4images media file path as command line option Example: http://djbarney.silentflame.com/4images/data/media/6/
echo "Continue?"
pause

:: Make thumbs AND playlists for all mpg video's in current directory by calling another batch file.

for %%i in (*.mpg) do makevidthumbs_1.bat %%~ni %1

makevidthumbs_1.bat

NOTE: "iconvert", is actually Imagemagick "convert". I renamed it because it conflicts with a Windows XP utility.

Code: [Select]
ffmpeg -i %1.mpg -an -ss 00:00::00 -t 00:00:01 -r 1 -y %1_%%d.png
del %1_2.png
iconvert %1_1.png -resize 200 -quality 80 %1.jpg
del %1_1.png

:: Make PLS

echo [playlist] > %1.mpg.pls
echo numberofentries=1 >> %1.mpg.pls
echo File1=%2%1.mpg >> %1.mpg.pls
echo Title1=%1 >> %1.mpg.pls
echo Version=2 >> %1.mpg.pls

:: Make M3U

echo %2%1.mpg > %1.mpg.m3u

Now upload videos to the usual /media/<id> directory. Also put the playlists in that directory.

Upload thumbnails to /thumbnails/<id> directory.

Check for new images and you should have video / thumb / playlists ready for each entry.

BC_Man

PS.. Note I corrected this message today (14/02/08). I changed the title sent to the playlist to "%1" instead of one of my games "Breed" ! ;)

Pages: [1]