Problem: coppermine's "rate this file" doesn't work with my theme Problem: coppermine's "rate this file" doesn't work with my theme
 

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

Problem: coppermine's "rate this file" doesn't work with my theme

Started by vikler, May 26, 2014, 01:36:20 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

vikler

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?

allvip

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:


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

vikler

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 :'(

allvip

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

phill104

It is a mistake to think you can solve any major problems just with potatoes.

allvip

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

allvip

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





allvip

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

allvip

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;

allvip

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.

allvip

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

allvip



allvip



vikler

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/ ?
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!

allvip

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