Plugin Directory

Changeset 755230


Ignore:
Timestamp:
08/12/2013 06:55:01 PM (12 years ago)
Author:
shauno
Message:

minor tweak to voting urls to work in WP installs in sub dirs, as well as NGG v2 compatibility fix.

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

Legend:

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

    r740007 r755230  
    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.6
     6Version: 2.6.1
    77Author: Shaun Alberts
    88Author URI: http://shauno.co.za
     
    15331533         */
    15341534        function addNewImage($image) {
    1535             if($image['id']) {
    1536                 $post = array();
    1537                 $post['nggv_image'] = array();
    1538                 $post['nggv_image'][$image['id']] = array();
    1539                
    1540                 $criteria = $this->getImageCriteria();
    1541                 foreach ((array)$criteria as $key=>$val) {
    1542                     $post['nggv_image'][$image['id']][$val->id] = array();
    1543                     $post['nggv_image'][$image['id']][$val->id]['enable'] = get_option('nggv_image_enable');
    1544                     $post['nggv_image'][$image['id']][$val->id]['force_login'] = get_option('nggv_image_force_login');
    1545                     $post['nggv_image'][$image['id']][$val->id]['force_once'] = get_option('nggv_image_force_once');
    1546                     $post['nggv_image'][$image['id']][$val->id]['user_results'] = get_option('nggv_image_user_results');
    1547                     $post['nggv_image'][$image['id']][$val->id]['voting_type'] = get_option('nggv_image_voting_type');
    1548                 }
    1549                
    1550                 $this->onGalleryUpdate($image['galleryID'], $post);
     1535            if(defined('NEXTGEN_GALLERY_PLUGIN_VERSION') && NEXTGEN_GALLERY_PLUGIN_VERSION >= 2) {
     1536                if($image->id() && $image->__get('galleryid')) {
     1537                    $pid = $image->id();
     1538                    $post = array();
     1539                    $post['nggv_image'] = array();
     1540                    $post['nggv_image'][$pid] = array();
     1541                   
     1542                    $criteria = $this->getImageCriteria();
     1543                    foreach ((array)$criteria as $key=>$val) {
     1544                        $post['nggv_image'][$pid][$val->id] = array();
     1545                        $post['nggv_image'][$pid][$val->id]['enable'] = get_option('nggv_image_enable');
     1546                        $post['nggv_image'][$pid][$val->id]['force_login'] = get_option('nggv_image_force_login');
     1547                        $post['nggv_image'][$pid][$val->id]['force_once'] = get_option('nggv_image_force_once');
     1548                        $post['nggv_image'][$pid][$val->id]['user_results'] = get_option('nggv_image_user_results');
     1549                        $post['nggv_image'][$pid][$val->id]['voting_type'] = get_option('nggv_image_voting_type');
     1550                    }
     1551                    $this->onGalleryUpdate($image->__get('galleryid'), $post);
     1552                }
     1553            }else{
     1554                if($image['id']) {
     1555                    $post = array();
     1556                    $post['nggv_image'] = array();
     1557                    $post['nggv_image'][$image['id']] = array();
     1558                   
     1559                    $criteria = $this->getImageCriteria();
     1560                    foreach ((array)$criteria as $key=>$val) {
     1561                        $post['nggv_image'][$image['id']][$val->id] = array();
     1562                        $post['nggv_image'][$image['id']][$val->id]['enable'] = get_option('nggv_image_enable');
     1563                        $post['nggv_image'][$image['id']][$val->id]['force_login'] = get_option('nggv_image_force_login');
     1564                        $post['nggv_image'][$image['id']][$val->id]['force_once'] = get_option('nggv_image_force_once');
     1565                        $post['nggv_image'][$image['id']][$val->id]['user_results'] = get_option('nggv_image_user_results');
     1566                        $post['nggv_image'][$image['id']][$val->id]['voting_type'] = get_option('nggv_image_voting_type');
     1567                    }
     1568                   
     1569                    $this->onGalleryUpdate($image['galleryID'], $post);
     1570                }
    15511571            }
    15521572        }
  • nextgen-gallery-voting/trunk/readme.txt

    r748902 r755230  
    44Tags: nextgen-gallery, nextgen, gallery, voting, rating, ratings, nextgen-gallery-voting
    55Requires at least: 2.9.1
    6 Tested up to: 3.5.2
    7 Stable tag: 2.6
     6Tested up to: 3.6
     7Stable tag: 2.6.1
    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.6.1 =
     81* Changed the way voting URLs are generated for better compatibility with sub directory installs
     82* Tweak new image catch to work with NextGEN Gallery 2
    7983
    8084= 2.6 =
     
    207211== Upgrade Notice ==
    208212
     213= 2.6.1 =
     214Minor updates to improve NextGEN Gallery version 2 compatibilty, and installs in a sub directory
     215
    209216= 2.6 =
    210217Minor update adding hooks and filters for next Premium add-on version to use.
Note: See TracChangeset for help on using the changeset viewer.