Advanced search  

News:

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

Pages: [1] 2   Go Down

Author Topic: Theme switch (mobile mode) plugin for cpg1.5.x  (Read 23849 times)

0 Members and 1 Guest are viewing this topic.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15428
Theme switch (mobile mode) plugin for cpg1.5.x
« on: April 26, 2012, 02:21:18 pm »

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.
« Last Edit: April 26, 2012, 03:38:45 pm by Αndré »
Logged

Afonso

  • Coppermine newbie
  • Country: br
  • Offline Offline
  • Gender: Male
  • Posts: 6
    • PhotoAves
Re: Theme switch (mobile mode) plugin for cpg1.5.x
« Reply #1 on: April 26, 2012, 08:40:58 pm »

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

pixstreet

  • Coppermine novice
  • *
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 25
    • pixstreet.co.uk
Re: Theme switch (mobile mode) plugin for cpg1.5.x
« Reply #2 on: April 26, 2012, 10:12:10 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15428
Re: Theme switch (mobile mode) plugin for cpg1.5.x
« Reply #3 on: April 27, 2012, 10:17:12 am »

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

arabhw

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Theme switch (mobile mode) plugin for cpg1.5.x
« Reply #4 on: April 29, 2012, 07:46:04 am »

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.
Logged

arabhw

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Theme switch (mobile mode) plugin for cpg1.5.x
« Reply #5 on: April 29, 2012, 07:48:58 am »

here is the file
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15428
Re: Theme switch (mobile mode) plugin for cpg1.5.x
« Reply #6 on: April 29, 2012, 08:55:58 am »

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

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: it
  • Offline Offline
  • Gender: Male
  • Posts: 249
    • Flavio's page
Re: Theme switch (mobile mode) plugin for cpg1.5.x
« Reply #7 on: May 15, 2012, 03:46:51 pm »

Here we are!

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15428
Re: Theme switch (mobile mode) plugin for cpg1.5.x
« Reply #8 on: May 16, 2012, 09:28:02 am »

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

timberguy

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: Theme switch (mobile mode) plugin for cpg1.5.x
« Reply #9 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.
Logged

lurkalot

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 824
  • +Tinyportal Support team.
Re: Theme switch (mobile mode) plugin for cpg1.5.x
« Reply #10 on: August 11, 2012, 05:49:18 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?
Logged
Running SMF 2.0.13  / Tinyportal 1.2, bridged with Coppermine 1.5.34, plus cpmfetch 2.0.0

timberguy

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: Theme switch (mobile mode) plugin for cpg1.5.x
« Reply #11 on: August 11, 2012, 06:14:48 pm »

Yes, from the first post.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15428
Re: Theme switch (mobile mode) plugin for cpg1.5.x
« Reply #12 on: August 11, 2012, 08:26:31 pm »

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

flapane

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: it
  • Offline Offline
  • Gender: Male
  • Posts: 249
    • Flavio's page
Re: Theme switch (mobile mode) plugin for cpg1.5.x
« Reply #13 on: September 11, 2012, 11:59:44 am »

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.

Code: [Select]
@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...]
}

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15428
Re: Theme switch (mobile mode) plugin for cpg1.5.x
« Reply #14 on: September 11, 2012, 12:25:09 pm »

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).
Logged

ogimages

  • Coppermine newbie
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6
Re: Theme switch (mobile mode) plugin for cpg1.5.x
« Reply #15 on: November 28, 2012, 05:32:23 pm »

works great, http://ogimages.com

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

adult stuff..

Artin

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Theme switch (mobile mode) plugin for cpg1.5.x
« Reply #16 on: November 27, 2013, 07:44:43 am »

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15428
Re: Theme switch (mobile mode) plugin for cpg1.5.x
« Reply #17 on: November 27, 2013, 09:54:26 am »

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

Artin

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Theme switch (mobile mode) plugin for cpg1.5.x
« Reply #18 on: November 27, 2013, 09:41:31 pm »

First bit part of the red box:
http://pastebin.com/64uYUs5J

Debug info:
http://pastebin.com/7T1MgxdS
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 723
    • GMC Design Photo Gallery
Re: Theme switch (mobile mode) plugin for cpg1.5.x
« Reply #19 on: November 28, 2013, 02:20:02 am »

The error message you are getting:
Quote
While 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.)

Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money
Pages: [1] 2   Go Up
 

Page created in 0.024 seconds with 22 queries.