Plugin Directory

Changeset 868782


Ignore:
Timestamp:
03/03/2014 08:05:27 PM (12 years ago)
Author:
shauno
Message:

Disabled NGG v2.x's caching class when it calls the 'load module' hook. The cache creates issues with the dynamic user generated content the voting plugin adds to gallery pages.
I hope it doesn't massively affect performance, but then the NGG team will need to provide a way for 3rd parties to force the the reloading of certain cached items.

Location:
nextgen-gallery-voting
Files:
34 added
2 edited

Legend:

Unmodified
Added
Removed
  • nextgen-gallery-voting/trunk/ngg-voting.php

    r848470 r868782  
    44Plugin URI: http://shauno.co.za/wordpress/nextgen-gallery-voting/
    55Description: This plugin allows you to add user voting and rating to NextGEN Galleries and Images
    6 Version: 2.7.1
     6Version: 2.7.2
    77Author: Shaun Alberts
    88Author URI: http://shauno.co.za
     
    117117        //add_filter('ngg_show_gallery_content', array(&$this, 'showGallery'), 10, 2);
    118118        */
     119       
     120        add_action('load_nextgen_gallery_modules', array(&$this, 'nggLoadModules'));
    119121       
    120122        add_action('init', array(&$this, 'wpInit'));
     
    701703                    //TODO 2.0, consider using wpdb insert methods
    702704                    if($wpdb->query('INSERT INTO '.$wpdb->prefix.'nggv_votes (id, pid, gid, vote, user_id, ip, proxy, dateadded) VALUES (null, 0, "'.$wpdb->escape($config['gid']).'", "'.$wpdb->escape($config['vote']).'", "'.$current_user->ID.'", "'.$ip['ip'].'", "'.$ip['proxy'].'", "'.date('Y-m-d H:i:s', time()).'")')) {
    703                         C_Photocrati_Cache::flush('displayed_gallery_rendering'); //clear the entire 'displayed_gallery_rendering' cache (cache implemented from ngg 2.0.40). todo, try figure out the transient id, and clear the specific one
    704705                        return true;
    705706                    }else{
     
    745746                    $ip = $this->getUserIp();
    746747                    if($wpdb->query("INSERT INTO ".$wpdb->prefix."nggv_votes (id, gid, pid, criteria_id, vote, user_id, ip, proxy, dateadded) VALUES (null, 0, '".$wpdb->escape($config["pid"])."', '".$wpdb->escape($criteriaId)."', '".$wpdb->escape($config["vote"])."', '".$current_user->ID."', '".$ip["ip"]."', '".$ip["proxy"]."', '".date("Y-m-d H:i:s", time())."')")) {
    747                         C_Photocrati_Cache::flush('displayed_gallery_rendering'); //clear the entire 'displayed_gallery_rendering' cache (cache implemented from ngg 2.0.40). todo, try figure out the transient id, and clear the specific one
    748748                        return true;
    749749                    }else{
     
    806806        public static function msg($msg) {
    807807            return apply_filters('nggv_msg', $msg);
     808        }
     809       
     810        //remove NGG's caching, as we are adding user's dynamic content to the gallery templates
     811        function nggLoadModules($registry) {
     812            if(class_exists('C_Photocrati_Cache')) {
     813                C_Photocrati_Cache::$enabled = false;
     814            }
    808815        }
    809816    // }
  • nextgen-gallery-voting/trunk/readme.txt

    r848470 r868782  
    55Requires at least: 2.9.1
    66Tested up to: 3.8.1
    7 Stable tag: 2.7.1
     7Stable tag: 2.7.2
    88
    99Adds the ability for users to vote and rate your NextGEN Images. Simple options give you the ability to limit who can vote on what.
     
    7777
    7878== Changelog ==
     79
     80= 2.7.2 =
     81* Disabled NGG v2.x's caching class entirely.
    7982
    8083= 2.7.1 =
     
    218221== Upgrade Notice ==
    219222
     223= 2.7.2 =
     224I have disabled NGG v2.x caching class entirely. It creates many problems with the dynamic content the voting adds to gallery pages
     225
    220226= 2.7.1 =
    221227Added code to flush the NextGEN Gallery display template cache when vote is saved, so vote shows on next page refresh
Note: See TracChangeset for help on using the changeset viewer.