Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Problem: coppermine's "rate this file" doesn't work with my theme  (Read 45938 times)

0 Members and 1 Guest are viewing this topic.

vikler

  • Coppermine newbie
  • Offline Offline
  • Posts: 12

Hi there! When using custom theme i can't seem to get function "rate this file" to work. The "stars" don't appear.
It may be a possible javascript conflict. Does anyone have any idea on how to fix it?
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Problem: coppermine's "rate this file" doesn't work with my theme
« Reply #1 on: May 26, 2014, 06:47:12 am »

If you use two version of jquery on the same page then rating stars won't show.
It happend to me.I just give up using two jquery on the same page.

Maybe this thread can help you: http://forum.coppermine-gallery.net/index.php/topic,76858.0.html. Most important is reply#47,reply#48,reply#54.

I think reply#54 is saying to add this code to the function that needs a diffrent jquery version:

Code: [Select]
global $CPG_PHP_SELF;
if ($CPG_PHP_SELF != 'displayimage.php') {
     js_include('themes/your_theme_name/jquery-1.11.0.min.js');
}

and this jQuery.noConflict official page http://api.jquery.com/jquery.noconflict/

If you tell me exacty what you try to do (for wath you need a diffrent jquery version I can definitly help you).
Logged

vikler

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Problem: coppermine's "rate this file" doesn't work with my theme
« Reply #2 on: May 26, 2014, 01:11:38 pm »

I need jquery to display a slider on my page. I'll try to check your solutions but I'm afraid I know php too bad to be able to fix it :'(
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Problem: coppermine's "rate this file" doesn't work with my theme
« Reply #3 on: May 26, 2014, 01:57:55 pm »

I worked a lot a themes and with Andre's help (I asked a lot of questions on the forum) I learned a lot.
I'm sure I can help you.Where the slider showed show? On every page or just displayiamge.php? In the header, footer or middle page or is for the image?

When you use a jquery plugin you don't have to add jquery because coppermine alredy has jquery-1.3.2.js Add jquery only if your plugin is not working with 1.3.2.

Did you tryed to see if is working with 1.3.2?

A link to your gallery will be great.This way I can help you in 10 minutes.
If you don't want to post it on the forum then email me at allvip.us@gmail.com
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Logged
It is a mistake to think you can solve any major problems just with potatoes.

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Problem: coppermine's "rate this file" doesn't work with my theme
« Reply #5 on: May 26, 2014, 03:36:33 pm »

I don't know why I said I can help.It's an impossible thing to do for me.I tryed a lot and nothing.Loding to versions of jquery on the same page is impossible for me.
Sorry vikler.

Reason for editing: the plugin works great http://forum.coppermine-gallery.net/index.php/topic,76858.40.html
« Last Edit: May 26, 2014, 09:12:43 pm by allvip »
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Problem: coppermine's "rate this file" doesn't work with my theme
« Reply #6 on: May 26, 2014, 04:07:49 pm »

I FOUND A SOLUTION: loding the slider in iframe tag.

add the code to template.html where you want the slider to show:

Code: [Select]
   
<iframe src="themes/your_theme_name/slider_folder/index.html" style="width:600px;height:385px;max-width:100%;overflow:hidden;border:none;padding:0;margin:0 auto;display:block;" marginheight="0" marginwidth="0"></iframe>

If you want the slider to show only on displayimage.php

1.add this code to function pageheader before $template_vars = CPGPluginAPI::filter('theme_pageheader_params', $template_vars);(if the function is not in your theme.php copy it from themes/sample/theme.php):

Code: [Select]
    global $CPG_PHP_SELF;
    $superCage = Inspekt::makeSuperCage();
    if ($CPG_PHP_SELF == 'displayimage.php') {
        $template_vars['{SLIDER}'] = <<< EOT
    <!-- Start WOWSlider.com -->
    <iframe src="themes/your_theme_name/slider_folder/index.html" style="width:600px;height:385px;max-width:100%;overflow:hidden;border:none;padding:0;margin:0 auto;display:block;" marginheight="0" marginwidth="0"></iframe>
    <!-- End WOWSlider.com -->
EOT;
    } else {
        $template_vars['{SLIDER}'] = '';
    }

2. add {SLIDER} to template.html where you want the slider to show.

3.You can replace width and height of the iframes with your values.

IF you want to show only on index page replace:

Code: [Select]
if ($CPG_PHP_SELF == 'displayimage.php') {
with:

Code: [Select]
if ($CPG_PHP_SELF == 'index.php' && !count($superCage->get->_source)) {
ON all index pages: index?cat=102 etc

displayimage.php with index.php


ONLY on thumbnails.php:

displayimage.php with thumbnails.php




Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Problem: coppermine's "rate this file" doesn't work with my theme
« Reply #7 on: May 26, 2014, 04:09:54 pm »

The iframe has style overflow hidden so it wont show ugly scroll bars.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Problem: coppermine's "rate this file" doesn't work with my theme
« Reply #8 on: May 26, 2014, 04:24:28 pm »

If you want it to show in a more specific page like above the image just add the iframe only (no need for the code for function pageheader) in function $template_display_media before {IMAGE}.In themes/sample/theme.php you can find all the function for diffrent coppermine sections.

If the function does not have table and tr just php code like function theme_display_image (let's say you want it between filmstrip and image) add it like this: 

Code: [Select]
    echo <<< EOT
    PASTE THE IFRAME CODE HERE
EOT;
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Problem: coppermine's "rate this file" doesn't work with my theme
« Reply #9 on: May 26, 2014, 04:53:15 pm »

You can add even a slider to the left of the image.Anywhere you want.In the breadcumb like a news slider etc.
If you need help just tell me where you want it to show and I will tell you wich function to edit and how step by step.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Problem: coppermine's "rate this file" doesn't work with my theme
« Reply #10 on: May 26, 2014, 04:56:36 pm »

When I will have more time I will learn how to use jQuery.noConflict.I really need it too.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Problem: coppermine's "rate this file" doesn't work with my theme
« Reply #11 on: May 26, 2014, 04:59:09 pm »

Another jquery plugin http://forum.coppermine-gallery.net/index.php/topic,74696.0.html.
I think it has a no conflict option.I use it but I do not remember much.
Logged

vikler

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Problem: coppermine's "rate this file" doesn't work with my theme
« Reply #12 on: May 26, 2014, 07:40:11 pm »

Maybe you could help me further with gallery link?:)
http://dane-dehaan.org/photos/index.php?theme=dane
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Problem: coppermine's "rate this file" doesn't work with my theme
« Reply #13 on: May 26, 2014, 07:47:09 pm »

The slider is the header?
Logged

vikler

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Problem: coppermine's "rate this file" doesn't work with my theme
« Reply #14 on: May 26, 2014, 07:49:17 pm »

The slider is the header?
yeah, right below it!
Logged

vikler

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
Re: Problem: coppermine's "rate this file" doesn't work with my theme
« Reply #15 on: May 26, 2014, 08:00:09 pm »

You are using this slider: http://tympanus.net/codrops/2011/09/12/elastislide-responsive-carousel/ ?
yeah, I think so. Actually, I think it will be easier to talk via email, I'll email you my theme code there:) thanks for being such a help!
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Problem: coppermine's "rate this file" doesn't work with my theme
« Reply #16 on: May 26, 2014, 09:47:55 pm »

OK. Was solved.
Removed the embed jquery version (1.8.2) from template.html and installed jquery update plugin made by Andre (see Reply #4).
Coppermine and the slider works fine with jquery-1.11.1.min.js
Logged
Pages: [1]   Go Up
 

Page created in 0.037 seconds with 20 queries.