Slideshow (with iMobile and themedispatcher)

73 views
Skip to first unread message

Adrian London

unread,
Mar 1, 2024, 8:47:04 AM3/1/24
to Gallery 3 Users
There's a theme for Gallery3 which uses fotorama for a slideshow.  It's very minimalist (basically, just thumbnails and titles) but does the job.

In addition, the same developer wrote a module which will allow you to keep your usual theme, but switches to their mobile theme (or any other, actually) if it detects that the user is using a mobile or tablet.

NOTE:  "gallery.menalto.com" and "codex.galleryproject.org" are not working  today (2024-03-01).  They were recently.

Less up-to-date code is at: https://github.com/calleho/gallery3

theme - iMobile

mobule - themedispatcher


Adrian London

unread,
Mar 1, 2024, 8:54:56 AM3/1/24
to Gallery 3 Users
Theme Customisation

1) The theme is so minimalist, if you switch to it you'll need to manually enter the "admin" URL to change the theme back.

in:
views/album.html.php
add:
        <? if ($user->admin): ?>
            <li><a data-role="button" href="<?= url::site("admin") ?>" data-ajax="false" data-icon="gear" class="ui-nodisc-icon"><?= t("Settings") ?></a></li>
        <? endif; ?>

2) Add the correct favicon

in:
views/page.html.php
add:
          <link rel="shortcut icon"
          href="<?= url::file(module::get_var("gallery", "favicon_url")) ?>"
          type="image/x-icon" />

3) The Fotorama options are all available

in:
js/iMobile.js
add what you require from https://fotorama.io/customize/options/ here:
    fr.fotorama({
        width: '100%',
        height: '100%',
        allowfullscreen: 'native',
        nav: 'none',
navposion: 'bottom',
        fit: 'contain',
autoplay: '8000',
stopautoplayontouch: false,
        captions: true
    });


Adrian London

unread,
Mar 1, 2024, 9:14:03 AM3/1/24
to Gallery 3 Users
Module Customisation

This is the fun bit.  I wanted to also use the iMobile theme / slideshow on my laptop.  So I made the changes to the themedispatcher module to enable this.

By default, it switches to the slideshow theme if it detects a mobile or tablet using the browser's user-agent.  I added an option so that it can switch based on user-id too.  Then I created a user to use for slideshows and log in as that user when necessary.  This saves switching the active theme over to iMobile and back each time.

in:
views/admin_themedispatcher.html.php
helpers/MY_theme.php
helpers/themedispatcher.php
controllers/admin_themedispatcher.php

Duplicate all the code which handles user-agents (ua) and make it handle user-ids too.

The different thumbmail sizes etc for mobile phones, tablets, laptop screens and so on are made in the relevant CSS file in the iMobile theme.

Slideshow module

I'm not going to document it here as what I've done to my gallery installation is too heavily customised, but if you wanted a slideshow option directly from your main theme, you would need to create a slideshow module.  It would be as simple as setting a gallery variable which is also interpreted by the themedispatcher module.  The first thing that module would do is unset the cookie/variable, so that once you click on any option apart from a photo (which starts the fotorama slideshow) it then exits back to your main theme.





J.R.

unread,
Mar 1, 2024, 12:47:00 PM3/1/24
to gallery...@googlegroups.com
Adrian,

"gallery.menalto.com" and "codex.galleryproject.org" are not working for me today, either. So, um... what's the name of theme which uses fotorama, and can it be found somewhere else? Same for the mobile-switching module?

-- J.R.
--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gallery-3-users/10382948-5651-4f46-8271-ea9d8f8058a4n%40googlegroups.com.

Message has been deleted

Adrian London

unread,
Mar 1, 2024, 12:54:51 PM3/1/24
to gallery...@googlegroups.com
Let’s assume/hope those websites will come back.

theme: iMoblle
module: themedispatcher

The author has a github, although I'm not sure if he kept it up to date.





J.R.

unread,
Mar 1, 2024, 1:19:16 PM3/1/24
to gallery...@googlegroups.com
Adrian,

*sigh* ... on several occasions I wrote directly to the stalwart menalto who has kept the old
codex.galleryproject.org website active and offered to take it over but he always declined -- and he's well aware that we've been running this user group for many years not and that Brad and others have done the work to keep Galley 3 running in the changed world. I'll make that same offer publicly again here and now. I have the knowledge and capability to keep those websites running. Unfortunately I do not have the time to rebuild them from scratch, so I would need to be given access to the server in order to move them over to a new server, which I think was the sticking point. This offer does not apply to any github stuff, which is all kind of alien to me.

-- J.R.

On 3/1/24 12:49, Adrian London wrote:
Let’s assulleho"me/hope those websites will come back.

theme: iMoblle
module: themedispatcher

The author has a github, although I'm sure sure how current he kept it.





--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.

Adrian London

unread,
Mar 1, 2024, 2:01:18 PM3/1/24
to gallery...@googlegroups.com
Unless people delete their Git repositories, they stay forever.  

One can clone them, so if there was a repository that was in danger of being deleted by the owner, we could take a copy and re-upload it.

The problem is, as you’ve already mentioned, that there are themes and modules where the “.zip” files were uploaded to one of the two websites which have just died.  With access, we could download all the zip files, unzip them, and add them to the github owned by “bwdutton” (who I assume is Brad) where the 3.1.5 revival is currently hosted.  

Both “menalto.com” and “galleryproject.org” are hosted on the same server (I think).  Hopefully they’ll come back to life!  We need it, even if temporarily, to get the modules and themes from.

At the worst, I may have not-too-hacked copies lying around somewhere, but I hope it doesn’t come to that.  

*sigh* indeed.  fingers crossed.

J.R.

unread,
Mar 1, 2024, 8:00:25 PM3/1/24
to gallery...@googlegroups.com
Adrian,

I also have a lot of modules and themes which I downloaded from the original "gallery project" and the "gallery codex" websites. None of those have been modified. Brad and a couple of others also have  Github repositories for modules (not sure about themes), some of which were apparently modified to work with Gallery 3.1.5 running  under PHP 8.1 -- and now to some extent 8.3. So, much of the content from the old sites is around. But as I said, I've built enough websites to know I simply don't have the time to "recreate" them. I could host a site  and perhaps organize it a bit better is all. But at least they would be available and open online to Gallery users, not tucked away in the Hub with all of its arcane mysteries. No offense intended to Github users, of course. I sure they think it is all very obvious and easy, but unfortunately the rest of us don't find it to be so. Which is why it would be great if the original sites... designed for non-experts and people new to Gallery 3 to use... could still be up and running, but updated to the current situation.

The big, on-going problem is that Gallery 3.0.9 is *still* available on Source Forge. And according to that site, 160 people have downloaded it this past week alone(!) New people are trying to use this completely obsolete version and coming to the conclusion that Gallery just doesn't work. Those who persist usually find their way to this group and ask for help, information, clarification, etc. It's leading to a lot of confusion, frustration work for a lot of people.

According to Source Forge the Gallery 3 download page is run by two old time gallery3 people: "bharat" and "ckdake" -- I have attempted to contact them about getting version 3.1.5 placed on Source Forge, but never got any response. At the very least, they (or someone) should pull version 3.0.9 off of Source Forge. The one  bright spot in this is that Brad Dutton's website for version 3.1.5 and up (galleryrevival.com) -- has been up has up and running for long enough that an internet search usually turns up a link to it fairly high in the search results. But the confusion that results from 3.0.9 still being available at Source Forge and other locations remains.

-- J.R.
--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.

Adrian London

unread,
Mar 2, 2024, 6:07:24 AM3/2/24
to Gallery 3 Users
The Source Forge thing does clearly say the code hasn't been updated since 2013 or thereabouts.  I don't believe the "160 downloads" figure is real.  Maybe crawlers/bots but not all real people.

For anyone new who wants to showcase their photos, I suspect they'll go for a full hosting solution such as iCloud photos or Google Photos (or Piwigo's hosting option if they want to tailor the experience).  Those who show photos as part of a business are no doubt using Wordpress with an e-commerce plug-in.

I believe us Gallery3 users are a minority - people who want to host their photos under their own control.  IT people, or those who just like getting their hands dirty.

It would be good to get our hands on the above two websites just to extract all those non-core themes and modules hosted there, so they can be added to Brad's website.

Anyway, after all that, I just wanted to say there's a possibility to have a slideshow in Gallery3 :)


Gerardo L. Cahn

unread,
Mar 2, 2024, 10:24:20 AM3/2/24
to gallery...@googlegroups.com

Just an attaboy for Adrian for his technical successes and to JR for carrying the Gallery flag ...

I don't want you guys to think that nobody else is interested.  I wish I could do more than just listening from the periphery.  I am also still using Gallery and, incidentally, I would be interested in piggy-backing off of Adrian's modifications even if I am terrified of breaking my install through ignorance.

Gerardo

--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gallery-3-users/d5c6e396-f5c5-49f2-8e0a-58130211225cn%40googlegroups.com.
-- 
// Gerardo L. Cahn <ger...@niuk.org>
//  linux, mac ... and, well, yes,
//        ((windows too)).

Adrian London

unread,
Mar 2, 2024, 10:38:43 AM3/2/24
to Gallery 3 Users
Thanks, Geraldo.  If your installation breaks during any upgrade, or you're wondering how to make a certain modification, just start a new thread in this group and I'm sure someone will pick it up.  Probably me, for one :)

As for breaking your installation, taking a backup of the code before making changes is a good way of being able to recover. I usually duplicate any PHP file with ".orig" on the end before editing stuff, so I can always revert back if/when I reload my gallery and get that lovely "dang" message.

I created a php to zip up all the files (apart from the images).  Copy it into your gallery root, run it (as in add phpzippy.php to your URL in your browser) then copy the resulting .zip using sFTP or whatever onto your laptop. I always remove the php file afterwards, for security.


phpzippy.php

Adrian London

unread,
Mar 3, 2024, 3:00:21 PM3/3/24
to Gallery 3 Users
The websites in my first post are back working again!

Now's a good time to download whatever you need :)



J.R.

unread,
Mar 3, 2024, 4:11:31 PM3/3/24
to gallery...@googlegroups.com
Good News. So then, lots of stuff still to be found at:

http://codex.galleryproject.org/Gallery3:Themes

http://codex.galleryproject.org/

...and, of course, the ever-mysterious Github links  :)

-- J.R.

On 3/3/24 15:00, Adrian London wrote:
The websites in my first post are back working again!

Now's a good time to download whatever you need :)



--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.

Stian Lund

unread,
Mar 4, 2024, 11:57:44 AM3/4/24
to Gallery 3 Users
Hi all,
I've been using the Themedispatcher+iMobile on my gallery for a long time, and it works great. 
Only thing I had to do was add "android" to the detected user agents. 

I use the unmodified downloads from the Codex, the ones on Calleho's Github are older.
Themedispatcher: version = 6 
iMobile: version = 3.1

Here's a repo for the stuff I use on my Gallery install:
https://github.com/Pathduck/gallery3-themes-modules
Had to do some very minor modifications for PHP8 in some of them.

The gallery3-contrib repo is probably the best place to get *most* modules if the Codex goes down:

Fortunately, the Internet Archive has also archived most of it including the downloads :)

For testing the iMobile theme, a tip is to open the browser developer tools, then set the device to a mobile device.
I use the Vivaldi browser - it has a neat side panel where I can add websites, and it sends a mobile UA by default as well.

If anyone (Adrian?) can figure out how to use iMobile code for a general slideshow module, that would be awesome :)
It also uses JS from https://fotorama.io which probably should be updated and tested.
Unfortunately my PHP+JS skills are not up to snuff in this area...

Stian

Adrian London

unread,
Mar 4, 2024, 12:14:39 PM3/4/24
to gallery...@googlegroups.com
It’s a shame the project died; I’m sure “calleh” would have liked to know that there are some of us using his module and theme in 2024.

As I mentioned, I use the iMobile theme as a kind of slideshow option by letting “themedispatcher” check for a user-id as well as browser user-agent.  I then created a new Gallery user and log in as that when I want to use the iMobile theme on my laptop. 

These are the files I now have in the iMobile/js directory:

fotorama-4.6.4.min.js
imobile.js
jquery-3.7.1.min.js
jquery-migrate-3.4.0.min.js
jquery.mobile-1.4.5.min.js
jquery.unveil.min.js
staystandalone.min.js

I believe the stock iMobile theme was already using fotorama 464, which is the latest.

I upgraded jquery to the latest: 3.7.1.  That broke things, but luckily they provide that “migration” js which fixes everything. It’s all here: https://jquerymobile.com






J.R.

unread,
Mar 4, 2024, 10:17:22 PM3/4/24
to gallery...@googlegroups.com
Stian,

Thanks for posting all these helpful tips and tricks! I never would have thought to look in the Internet Archive for access to the old gallery project websites (and with working downloads, too? I had no idea...) Also appreciate info on Vivaldi. I have tried Vivaldi several times in the past and was always a bit frustrated with it, but it sounds like it may be a much better option theses days. I've been a FireFox devotee since day one, but lately they've been slipping new stuff into their upgrades without letting people what they are or what do with them (or without them if it turns out you don't want them).

-- J.R.
--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.

Adrian London

unread,
Mar 5, 2024, 4:38:59 AM3/5/24
to gallery...@googlegroups.com
The “waybackwhen” web.archive option was posted about quite a while ago.

However, it’s slow (to be expected) so it’s good we have the actual websites back, especially as the archive doesn’t follow all links.  I didn’t know it kept thn .zip files as well though; that’s really useful info, Stian!

I’m, like you JR, a Firefox user (MacOS) and have been for years.  I’m on the “nightly” betas.  I keep an eye on what gets configured, and so far seem to have been ok.  I’m not a web developer (despite what my posts here may accidentally imply) so simply use my iPhone if I want to see what my gallery looks like on a mobile :)

I’ve decided I have too many photos, so am consolidating nested albums and deleting some.  (Yes, I have full backups in multiple places!  JR is right - our photos are precious.). This was actually the trigger that re-awoke my interest in G3 and got me posting back here recently.

The “organise” module does a great job of moving albums and photos around, and G3 keeps the var/albums directory nicely in sync.  
Also, the “captionator” module is good for adding titles (and descriptions if required) to a whole album’s worth of photos at once - useful when I combine two albums and want titles to reflect which particular trip/event the photo belongs to.

Also, as I just searched for a 10 year old photo to send a friend, late last night I found and installed the “calendarview” module.  It’s kind of working.  That’s a task for today.

I have my slideshow module almost working how I want.  I’ll upload a zip of that to this thread at some point, but I also need to remember and post all the edits I had to make to the themedispatcher module to get it to work.  

— 
adrian


J.R.

unread,
Mar 7, 2024, 8:05:02 PM3/7/24
to gallery...@googlegroups.com
Adrian,

For a guy who's "not a programmer" you sure are cranking out some interesting stuff. I'd really like to see your slideshow. But I'm pretty sure googlegoups does not allow .zip files through as attachments. I could be wrong, so try it and see. If it doesn't work perhaps you could simply post the .zip file on a standard  html page on the same hosting server where your gallery lives and provide us the URL to that download page. Meanwhile, I'll look into what options we have with our googlegroups account. It's possible there is a "downloads" area available to us which has never been activated. Way back when we were a yahoo.group we had that capability.

-- J.R.
--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.

Adrian London

unread,
Mar 8, 2024, 5:51:13 AM3/8/24
to Gallery 3 Users
Slideshow module is working.  Note that all it does is temporarily switch into the iMobile theme and show the album there - click any photo to actually start the slideshow.

I've got an "exit slideshow" button to show, but that needs too many customisations to themedispatcher and iMobile to document here.  Plus, it's not really necessary.

1) Install the module

2) Amend the themedispatcher module

add
    // Select different theme based on wanting a slideshow
    if (module::get_var("themedispatcher", "slideshow") == $user) {
  module::set_var("themedispatcher", "slideshow", "none") ;
  self::$dispatch = true;
    }

before
    if ((self::$dispatch) && !($dispatchoverride)) {

Any improvements, please let me know.  Especially if anyone finds a way to drop directly into the iMobile fotorama slideshow.

The way to exit the slideshow is to simply do a browser reload, or click the left arrow once you're back at the album screen.

Attempting to upload ".zip" file here.  if it fails, I'll work out another way :)  Thanks for the warning, JR.



slideshow.zip

J.R.

unread,
Mar 8, 2024, 9:54:09 AM3/8/24
to gallery...@googlegroups.com
Adrian,

Great -- and thanks a lot. The zip file came through fine as an attachment, but it's great that you provided the text of the mods in your message with instructions on how to apply them -- which could be very beneficial to someone who comes along in the future looking for this kind of information. Now all I have to do if find time to install it and give it a whirl.

-- J.R.
--
WHEN USING AN EMAIL PROGRAM to reply to this message, click REPLY TO LIST or REPLY TO ALL so your reply goes out to everyone in the group. If you click REPLY or REPLY TO SENDER Google will *only* send your reply to the original author (not recommended).
 
To post a NEW MESSAGE to the group, send an new email to:
gallery...@googlegroups.com
 
To view or sign in to this group on the web, use this URL:
https://groups.google.com/forum/#!forum/gallery-3-users
---
You received this message because you are subscribed to the Google Groups "Gallery 3 Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallery-3-use...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages