Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 5th, 2012  |  syntax: None  |  size: 10.45 KB  |  views: 215  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. -------------------------------------------------------------------
  2. File to change: nextgen-gallery-voting\ngg-voting.php
  3. -------------------------------------------------------------------
  4.  
  5. 23 changes (if i did this correctly)
  6.  
  7. ----------
  8. Line 387
  9. ----------
  10.  
  11. Change this:
  12. function nggv_getVotingResults($gid, $type=array("avg"=>true, "list"=>true, "number"=>true, "likes"=>true, "dislikes"=>true)) {
  13.  
  14. To this:
  15. function nggv_getVotingResults($gid, $type=array("avg"=>true, "list"=>true, "number"=>true, "likes"=>true)) {
  16.  
  17.  
  18. ----------
  19. Line 403
  20. ----------
  21. Change this:
  22.  
  23. if($type["dislikes"]) {
  24.                                         $dislikes = $wpdb->get_row("SELECT COUNT(vote) AS num FROM ".$wpdb->prefix."nggv_votes WHERE gid = '".$wpdb->escape($gid)."' AND vote = 0 GROUP BY gid");
  25.                                 }
  26.  
  27.  
  28. To this:
  29. /*if($type["dislikes"]) {
  30.                                         $dislikes = $wpdb->get_row("SELECT COUNT(vote) AS num FROM ".$wpdb->prefix."nggv_votes WHERE gid = '".$wpdb->escape($gid)."' AND vote = 0 GROUP BY gid");
  31.                                 }*/
  32.  
  33.  
  34. ----------
  35. Line 407
  36. ----------
  37. Change this:
  38.  
  39. return array("avg"=>$avg->avg, "list"=>$list, "number"=>$num->num, "likes"=>($likes->num ? $likes->num : 0), "dislikes"=>($dislikes->num ? $dislikes->num : 0));
  40.  
  41.  
  42.  
  43. To this:
  44.  
  45. //return array("avg"=>$avg->avg, "list"=>$list, "number"=>$num->num, "likes"=>($likes->num ? $likes->num : 0), "dislikes"=>($dislikes->num ? $dislikes->num : 0));
  46. return array("avg"=>$avg->avg, "list"=>$list, "number"=>$num->num, "likes"=>($likes->num ? $likes->num : 0));
  47.  
  48.  
  49.  
  50.  
  51. ----------
  52. Line 423
  53. ----------
  54. Change this:
  55.  
  56. function nggv_getImageVotingResults($pid, $type=array("avg"=>true, "list"=>true, "number"=>true, "likes"=>true, "dislikes"=>true)) {
  57.  
  58.  
  59. To this:
  60.  
  61. //function nggv_getImageVotingResults($pid, $type=array("avg"=>true, "list"=>true, "number"=>true, "likes"=>true, "dislikes"=>true)) {
  62. function nggv_getImageVotingResults($pid, $type=array("avg"=>true, "list"=>true, "number"=>true, "likes"=>true)) {     
  63.  
  64.  
  65. ----------
  66. Line 439
  67. ----------
  68. Change this:
  69.  
  70. if($type["dislikes"]) {
  71.                                         $dislikes = $wpdb->get_row("SELECT COUNT(vote) AS num FROM ".$wpdb->prefix."nggv_votes WHERE pid = '".$wpdb->escape($pid)."' AND vote = 0 GROUP BY pid");
  72.                                 }
  73.  
  74. To this:
  75.  
  76. /*if($type["dislikes"]) {
  77.                                         $dislikes = $wpdb->get_row("SELECT COUNT(vote) AS num FROM ".$wpdb->prefix."nggv_votes WHERE pid = '".$wpdb->escape($pid)."' AND vote = 0 GROUP BY pid");
  78.                                 }*/
  79.  
  80.  
  81. ----------
  82. Line 443
  83. ----------
  84. Change this:
  85.  
  86. return array("avg"=>$avg->avg, "list"=>$list, "number"=>$num->num, "likes"=>($likes->num ? $likes->num : 0), "dislikes"=>($dislikes->num ? $dislikes->num : 0));
  87.  
  88. To this:
  89.  
  90. //return array("avg"=>$avg->avg, "list"=>$list, "number"=>$num->num, "likes"=>($likes->num ? $likes->num : 0), "dislikes"=>($dislikes->num ? $dislikes->num : 0));
  91. return array("avg"=>$avg->avg, "list"=>$list, "number"=>$num->num, "likes"=>($likes->num ? $likes->num : 0));
  92.  
  93. ----------
  94. Line 625
  95. ----------
  96. Change this:
  97.  
  98. <option value="3" <?php echo (get_option('nggv_gallery_voting_type') == 3 ? 'selected="selected"' : ''); ?>>Like / Dislike</option>
  99.  
  100. To this:
  101.  
  102. <option value="3" <?php echo (get_option('nggv_gallery_voting_type') == 3 ? 'selected="selected"' : ''); ?>>Like</option>
  103.  
  104.  
  105.  
  106. ----------
  107. Line 632
  108. ----------
  109. Change this:
  110.  
  111. <option value="3" <?php echo (get_option('nggv_image_voting_type') == 3 ? 'selected="selected"' : ''); ?>>Like / Dislike</option>
  112.  
  113. To this:
  114. <option value="3" <?php echo (get_option('nggv_gallery_voting_type') == 3 ? 'selected="selected"' : ''); ?>>Like</option>
  115.  
  116. ----------
  117. Line 761
  118. ----------
  119. Change this:
  120. $results = nggv_getVotingResults($_GET["gid"], array("avg"=>true, "num"=>true, "likes"=>true, "dislikes"=>true));
  121.  
  122. To this:
  123.  
  124. //$results = nggv_getVotingResults($_GET["gid"], array("avg"=>true, "num"=>true, "likes"=>true, "dislikes"=>true));
  125. $results = nggv_getVotingResults($_GET["gid"], array("avg"=>true, "num"=>true, "likes"=>true));
  126.  
  127. ----------
  128. Line 763
  129. ----------
  130. Change this:
  131.  
  132. echo "<script>
  133. var nggv_gid = parseInt(".$_GET["gid"].");
  134. var nggv_enable = parseInt(".$options->enable.");
  135. var nggv_login = parseInt(".$options->force_login.");
  136. var nggv_once = parseInt(".$options->force_once.");
  137. var user_results = parseInt(".$options->user_results.");
  138. var voting_type = parseInt(".$options->voting_type.");
  139. var nggv_avg = Math.round(".($results["avg"] ? $results["avg"] : 0).") / 10;
  140. var nggv_num_votes = parseInt(".($results["number"] ? $results["number"] : 0).");
  141. var nggv_num_likes = parseInt(".($results["likes"] ? $results["likes"] : 0).");
  142. var nggv_num_dislikes = parseInt(".($results["dislikes"] ? $results["dislikes"] : 0).");
  143.                                
  144. var nggv_more_url = '".$popup."';
  145. </script>";
  146.  
  147. To this:
  148. /*echo "<script>
  149. var nggv_gid = parseInt(".$_GET["gid"].");
  150. var nggv_enable = parseInt(".$options->enable.");
  151. var nggv_login = parseInt(".$options->force_login.");
  152. var nggv_once = parseInt(".$options->force_once.");
  153. var user_results = parseInt(".$options->user_results.");
  154. var voting_type = parseInt(".$options->voting_type.");
  155. var nggv_avg = Math.round(".($results["avg"] ? $results["avg"] : 0).") / 10;
  156. var nggv_num_votes = parseInt(".($results["number"] ? $results["number"] : 0).");
  157. var nggv_num_likes = parseInt(".($results["likes"] ? $results["likes"] : 0).");
  158. var nggv_num_dislikes = parseInt(".($results["dislikes"] ? $results["dislikes"] : 0).");
  159. var nggv_more_url = '".$popup."';</script>";
  160. */
  161.                                
  162.                                
  163. echo "<script>
  164. var nggv_gid = parseInt(".$_GET["gid"].");
  165. var nggv_enable = parseInt(".$options->enable.");
  166. var nggv_login = parseInt(".$options->force_login.");
  167. var nggv_once = parseInt(".$options->force_once.");
  168. var user_results = parseInt(".$options->user_results.");
  169. var voting_type = parseInt(".$options->voting_type.");
  170. var nggv_avg = Math.round(".($results["avg"] ? $results["avg"] : 0).") / 10;
  171. var nggv_num_votes = parseInt(".($results["number"] ? $results["number"] : 0).");
  172. var nggv_num_likes = parseInt(".($results["likes"] ? $results["likes"] : 0).");
  173. var nggv_more_url = '".$popup."';
  174. </script>";
  175.  
  176.  
  177. ----------
  178. Line 813
  179. ----------
  180. Change this:
  181. $results = nggv_getImageVotingResults($pid, array("likes"=>true, "dislikes"=>true));
  182.  
  183. To This:
  184. //$results = nggv_getImageVotingResults($pid, array("likes"=>true, "dislikes"=>true));
  185. $results = nggv_getImageVotingResults($pid, array("likes"=>true));
  186.  
  187.  
  188. ----------
  189. Line 818
  190. ----------
  191. Change this:
  192. echo $results['dislikes'].' ';
  193. echo $results['dislikes'] == 1 ? 'Dislike' : 'Dislikes';
  194.  
  195. To this:
  196.  
  197. //echo $results['dislikes'].' ';
  198. //echo $results['dislikes'] == 1 ? 'Dislike' : 'Dislikes';
  199.  
  200.  
  201. ----------
  202. Line 857
  203. ----------
  204. Change this:
  205.  
  206. <option value="3" <?php echo (get_option('nggv_gallery_voting_type') == 3 ? 'selected="selected"' : ''); ?>>Like / Dislike</option>
  207.  
  208. To this:
  209. <option value="3" <?php echo (get_option('nggv_gallery_voting_type') == 3 ? 'selected="selected"' : ''); ?>>Like</option>
  210.  
  211. ----------
  212. Line 1128
  213. ----------
  214.  
  215. Change this:
  216.  
  217. $out .= '<a href="'.$url.'gid='.$gid.'&r=0" class="nggv-link-dislike"><img src="'.WP_PLUGIN_URL."/".$dirName."/images/thumbs_down.png".'" alt="Dislike" /></a>';
  218.  
  219. To this:
  220. //$out .= '<a href="'.$url.'gid='.$gid.'&r=0" class="nggv-link-dislike"><img src="'.WP_PLUGIN_URL."/".$dirName."/images/thumbs_down.png".'" alt="Dislike" /></a>';
  221.  
  222.  
  223. ----------
  224. Line 1131
  225. ----------
  226.  
  227. Change this:
  228. $results = nggv_getVotingResults($gid, array("likes"=>true, "dislikes"=>true));
  229.  
  230. To this:
  231. //$results = nggv_getVotingResults($gid, array("likes"=>true, "dislikes"=>true));
  232. $results = nggv_getVotingResults($gid, array("likes"=>true));
  233.  
  234. ----------
  235. Line 1135
  236. ----------
  237.  
  238. Change this:
  239. $out .= $results['dislikes'].' ';
  240. $out .= $results['dislikes'] == 1 ? 'Dislike' : 'Dislikes';
  241.  
  242. To this:
  243. //$out .= $results['dislikes'].' ';
  244. //$out .= $results['dislikes'] == 1 ? 'Dislike' : 'Dislikes';
  245.  
  246.  
  247. ----------
  248. Line 1195
  249. ----------
  250.  
  251. Change this:
  252.  
  253. $results = nggv_getVotingResults($gid, array("likes"=>true, "dislikes"=>true));
  254.  
  255. To this:
  256. //$results = nggv_getVotingResults($gid, array("likes"=>true, "dislikes"=>true));
  257. $results = nggv_getVotingResults($gid, array("likes"=>true));
  258. ----------
  259. Line 1203
  260. ----------
  261.  
  262. Change this:
  263.  
  264. $bufferInner .= $results['dislikes'].' ';
  265. $bufferInner .= $results['dislikes'] == 1 ? 'Dislike' : 'Dislikes';
  266.  
  267. To this:
  268. //$bufferInner .= $results['dislikes'].' ';
  269. //$bufferInner .= $results['dislikes'] == 1 ? 'Dislike' : 'Dislikes';
  270.  
  271. ----------
  272. Line 1355
  273. ----------
  274.  
  275. Change this:
  276.  
  277. $out .= '<a href="'.$url.'ngg-pid='.$pid.'&r=0" class="nggv-link-dislike"><img src="'.WP_PLUGIN_URL."/".$dirName."/images/thumbs_down.png".'" alt="Dislike" /></a>';
  278.  
  279. To this:
  280. //$out .= '<a href="'.$url.'ngg-pid='.$pid.'&r=0" class="nggv-link-dislike"><img src="'.WP_PLUGIN_URL."/".$dirName."/images/thumbs_down.png".'" alt="Dislike" /></a>';
  281.  
  282. ----------
  283. Line 1358
  284. ----------
  285.  
  286. Change this:
  287.  
  288. $results = nggv_getImageVotingResults($pid, array("likes"=>true, "dislikes"=>true));
  289.  
  290. To this:
  291.  
  292. //$results = nggv_getImageVotingResults($pid, array("likes"=>true, "dislikes"=>true));
  293. $results = nggv_getImageVotingResults($pid, array("likes"=>true));
  294.  
  295. ----------
  296. Line 1362
  297. ----------
  298.  
  299. Change this:
  300.  
  301. $out .= $results['dislikes'].' ';
  302. $out .= $results['dislikes'] == 1 ? 'Dislike' : 'Dislikes';
  303.  
  304. To this:
  305.  
  306. //$out .= $results['dislikes'].' ';
  307. //$out .= $results['dislikes'] == 1 ? 'Dislike' : 'Dislikes';
  308.  
  309.  
  310. ----------
  311. Line 1427
  312. ----------
  313.  
  314. Change this:
  315. $results = nggv_getImageVotingResults($pid, array("likes"=>true, "dislikes"=>true));
  316.  
  317. To this:
  318. //$results = nggv_getImageVotingResults($pid, array("likes"=>true, "dislikes"=>true));
  319. $results = nggv_getImageVotingResults($pid, array("likes"=>true));
  320.  
  321.  
  322. ----------
  323. Line 1435
  324. ----------
  325. Change this:
  326. $bufferInner .= $results['dislikes'].' ';
  327. $bufferInner .= $results['dislikes'] == 1 ? 'Dislike' : 'Dislikes';
  328.  
  329. To this:
  330. //$bufferInner .= $results['dislikes'].' ';
  331. //$bufferInner .= $results['dislikes'] == 1 ? 'Dislike' : 'Dislikes';
  332.  
  333.  
  334.  
  335. -------------------------------------------------------------------
  336. File to change: nextgen-gallery-voting\js\gallery_options.js
  337. -------------------------------------------------------------------
  338.  
  339. There are 2 more areas (other than the change below) where dislikes appears in the javascript file, but i didnt change it, and mine works perfectly.
  340.  
  341.  
  342. ----------
  343. Line 36
  344. ----------
  345. Change this:
  346. str += nggv_num_dislikes+' ';
  347. str += nggv_num_dislikes == 1 ? 'Dislike' : 'Dislikes';
  348.  
  349. To this:
  350. //str += nggv_num_dislikes+' ';
  351. //str += nggv_num_dislikes == 1 ? 'Dislike' : 'Dislikes';
clone this paste RAW Paste Data