Theme switch (mobile mode) plugin for cpg1.5.x Theme switch (mobile mode) plugin for cpg1.5.x
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Theme switch (mobile mode) plugin for cpg1.5.x

Started by Αndré, April 26, 2012, 02:21:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Αndré

This plugin will automatically detect mobile devices and will display Coppermine with a different (preferably optimized for mobile devices) theme. Additionally, if a mobile device is detected, a new button will be displayed to let the user choose to switch between the "normal" and "mobile" view.

1.) Upload and install the plugin as described in the docs
2.) Open the plugin's configuration screen (you can find it in the plugin's box at the plugin manager after you installed the plugin) and choose a proper theme.

For a start I created two mobile themes, mobile_light and mobile_dark.

Afonso

the first translation, portuguese.[/font]
Afonso de Bragança - RJ
PhotoAves

pixstreet

Polish language file
I love this plugin thanks a lot  :)

Αndré

Added Portuguese and Polish language files in SVN revision 8386. Thank you for your contributions!

arabhw

I would like to thank you a lot :)

As you gave us this product I just translate the language file to arabic (support UTF-8 Without BOM)

I couldn't attach the file.

arabhw


Αndré

Arabic language file added in SVN revision 8387. Thank you for your contribution!

flapane

Flapane
www.flapane.com

Gallery
www.gallery.flapane.com

Αndré

Added Italian language file in SVN revision 8429. Thank you for your contribution.

timberguy

Is there a way for me to exclude the custom header include function in the mobile mode?  I have a very wide banner there and would like to exclude it in a mobile view.

lurkalot

Quote from: timberguy on August 11, 2012, 05:30:22 PM
Is there a way for me to exclude the custom header include function in the mobile mode?  I have a very wide banner there and would like to exclude it in a mobile view.

Are you using one of the mobile themes as per the as per Andre's first post above?
Running SMF 2.1.4  / Tinyportal 3.0.1, bridged with Coppermine 1.6.25, plus cpmfetch 2.0.0

timberguy


Αndré

Copy the function pageheader from themes/sample/theme.php to your theme's theme.php file if it doesn't exist. Then, find
$custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);
and replace with
    if (defined('MOBILE_VIEW')) {
        $custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);
    }

flapane

I don't know how the plugin works because I'm slowling working on my version (which regards the whole website and not only the gallery, so it's not a cpg-only mod), but I'd like to give a contribution.
There still are a few glitches left on the gallery only (as shown in the screenshoot, the third column images still overflow. I guess a two column layout on mobile devices would be better, but I still didn't figure out how to use 2column-layout on mobile devices only), anyway just in case, here's the conditional css syntax I used, and it seems that it can succesfully detects both iPad/iPhones, Android devices, 320x240 devices.

@media only screen and (min-device-width : 320px) and (max-device-width : 480px), only screen and (min-device-width : 480px) and (max-device-width : 800px) and (orientation : landscape), only screen and (device-width: 768px), only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5), only screen and (-moz-min-device-pixel-ratio: 1.5)
{
[do stuff...]
}
Flapane
www.flapane.com

Gallery
www.gallery.flapane.com

Αndré

The plugin itself won't affect the layout. Instead, you have to choose a theme which will be displayed for mobile devices. My two example themes both force a 1 column layout (i.e. they overwrite config values).

ogimages

works great, http://ogimages.com

thanks
mobile photo sharing website up in running in minutes...

adult stuff..


Artin

Hi,

Whenever I try to install the plugins after uploading it, it says:

Critical error
There was an error while processing a database query


When I upgraded to the latest version, I ran the update.php script and everything.

Coppermine version: 1.5.24

Any ideas?

Thank you.

Αndré

Please enable debug mode in the Coppermine config and try again to install the plugin. Please post the extended error message.


gmc

The error message you are getting:
QuoteWhile executing query 'INSERT INTO cpg14x_config (name, value) VALUES ('theme_switch_mobile_theme', 'water_drop')' in plugins/theme_switch/codebase.php on line 141
 
mySQL error: Duplicate entry 'theme_switch_mobile_theme' for key 'PRIMARY'
is trying to insert a setting into the config file that already exists... Either already inserted during a prior failed install, or not properly uninstalled..

You can either delete the row from cpg14x_config (via a tool like phpMyAdmin) or edit plugins/theme_switch/codebase.php on line 141 and change the INSERT to INSERT IGNORE. There may be additional inserts in same area that previously ran as well? I can't download the plugin at the moment to check. INSERT IGNORE will insert the value if it can, but tells MySQL to  ignore a failure like key already exists, and continue.

Of course can't tell what your original error was, but once you get past the duplicate inserts, again post your error from debug.
(direct paste or attach preferred - as that information will remain... External links disappear and won't help others that have a similar issue in the future.)

Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money