coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: vikler on May 26, 2014, 01:36:20 AM

Title: Problem: coppermine's "rate this file" doesn't work with my theme
Post by: vikler on May 26, 2014, 01:36:20 AM
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?
Title: Re: Problem: coppermine's "rate this file" doesn't work with my theme
Post by: allvip 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 (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:


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/ (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).
Title: Re: Problem: coppermine's "rate this file" doesn't work with my theme
Post by: vikler 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 :'(
Title: Re: Problem: coppermine's "rate this file" doesn't work with my theme
Post by: allvip 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
Title: Re: Problem: coppermine's "rate this file" doesn't work with my theme
Post by: phill104 on May 26, 2014, 02:46:07 PM
Did you try this plugin? - http://forum.coppermine-gallery.net/index.php/topic,76858.40.html
Title: Re: Problem: coppermine's "rate this file" doesn't work with my theme
Post by: allvip 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 (http://forum.coppermine-gallery.net/index.php/topic,76858.40.html)
Title: Re: Problem: coppermine's "rate this file" doesn't work with my theme
Post by: allvip 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:

   
<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):


    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:

if ($CPG_PHP_SELF == 'displayimage.php') {

with:

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




Title: Re: Problem: coppermine's "rate this file" doesn't work with my theme
Post by: allvip on May 26, 2014, 04:09:54 PM
The iframe has style overflow hidden so it wont show ugly scroll bars.
Title: Re: Problem: coppermine's "rate this file" doesn't work with my theme
Post by: allvip 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: 


    echo <<< EOT
    PASTE THE IFRAME CODE HERE
EOT;
Title: Re: Problem: coppermine's "rate this file" doesn't work with my theme
Post by: allvip 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.
Title: Re: Problem: coppermine's "rate this file" doesn't work with my theme
Post by: allvip 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.
Title: Re: Problem: coppermine's "rate this file" doesn't work with my theme
Post by: allvip on May 26, 2014, 04:59:09 PM
Another jquery plugin http://forum.coppermine-gallery.net/index.php/topic,74696.0.html (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.
Title: Re: Problem: coppermine's "rate this file" doesn't work with my theme
Post by: vikler 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
Title: Re: Problem: coppermine's "rate this file" doesn't work with my theme
Post by: allvip on May 26, 2014, 07:47:09 PM
The slider is the header?
Title: Re: Problem: coppermine's "rate this file" doesn't work with my theme
Post by: vikler on May 26, 2014, 07:49:17 PM
Quote from: allvip on May 26, 2014, 07:47:09 PM
The slider is the header?
yeah, right below it!
Title: Re: Problem: coppermine's "rate this file" doesn't work with my theme
Post by: vikler on May 26, 2014, 08:00:09 PM
Quote from: allvip on May 26, 2014, 07:55:34 PM
You are using this slider: http://tympanus.net/codrops/2011/09/12/elastislide-responsive-carousel/ (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!
Title: Re: Problem: coppermine's "rate this file" doesn't work with my theme
Post by: allvip 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