Changeset 1472151
- Timestamp:
- 08/11/2016 09:48:15 AM (10 years ago)
- Location:
- rating-system
- Files:
-
- 153 added
- 3 deleted
- 13 edited
-
assets/screenshot-1.png (modified) (previous)
-
assets/screenshot-10.png (modified) (previous)
-
assets/screenshot-2.png (modified) (previous)
-
assets/screenshot-6.png (modified) (previous)
-
tags/2.7.6 (added)
-
tags/2.7.6/Changelog.md (added)
-
tags/2.7.6/LICENSE (added)
-
tags/2.7.6/README.md (added)
-
tags/2.7.6/admin (added)
-
tags/2.7.6/admin/documentation.html (added)
-
tags/2.7.6/admin/framework (added)
-
tags/2.7.6/admin/framework/Sse.class.php (added)
-
tags/2.7.6/admin/framework/Sse_basic.class.php (added)
-
tags/2.7.6/admin/framework/Sse_checkbox.class.php (added)
-
tags/2.7.6/admin/framework/Sse_color.class.php (added)
-
tags/2.7.6/admin/framework/Sse_image_select.class.php (added)
-
tags/2.7.6/admin/framework/Sse_number.class.php (added)
-
tags/2.7.6/admin/framework/Sse_select.class.php (added)
-
tags/2.7.6/admin/framework/Sse_switch.class.php (added)
-
tags/2.7.6/admin/framework/Sse_text.class.php (added)
-
tags/2.7.6/admin/framework/autoload.php (added)
-
tags/2.7.6/admin/framework/demo (added)
-
tags/2.7.6/admin/framework/demo/demo.php (added)
-
tags/2.7.6/admin/framework/demo/doc.html (added)
-
tags/2.7.6/admin/framework/demo/images (added)
-
tags/2.7.6/admin/framework/demo/images/1.png (added)
-
tags/2.7.6/admin/framework/demo/images/10.png (added)
-
tags/2.7.6/admin/framework/demo/images/11.png (added)
-
tags/2.7.6/admin/framework/demo/images/12.png (added)
-
tags/2.7.6/admin/framework/demo/images/13.png (added)
-
tags/2.7.6/admin/framework/demo/images/14.png (added)
-
tags/2.7.6/admin/framework/demo/images/2.png (added)
-
tags/2.7.6/admin/framework/demo/images/3.png (added)
-
tags/2.7.6/admin/framework/demo/images/4.png (added)
-
tags/2.7.6/admin/framework/demo/images/5.png (added)
-
tags/2.7.6/admin/framework/demo/images/6.png (added)
-
tags/2.7.6/admin/framework/demo/images/7.png (added)
-
tags/2.7.6/admin/framework/demo/images/8.png (added)
-
tags/2.7.6/admin/framework/demo/images/9.png (added)
-
tags/2.7.6/admin/framework/demo/images/index.php (added)
-
tags/2.7.6/admin/framework/demo/index.php (added)
-
tags/2.7.6/admin/framework/helpers.js (added)
-
tags/2.7.6/admin/framework/index.php (added)
-
tags/2.7.6/admin/framework/style.css (added)
-
tags/2.7.6/admin/framework/vendor (added)
-
tags/2.7.6/admin/framework/vendor/array_column.php (added)
-
tags/2.7.6/admin/framework/vendor/index.php (added)
-
tags/2.7.6/admin/framework/vendor/jAlert-functions.min.js (added)
-
tags/2.7.6/admin/framework/vendor/jAlert-v4.css (added)
-
tags/2.7.6/admin/framework/vendor/jAlert-v4.min.js (added)
-
tags/2.7.6/admin/framework/vendor/select2.full.min.js (added)
-
tags/2.7.6/admin/framework/vendor/select2.min.css (added)
-
tags/2.7.6/admin/framework/vendor/spectrum.css (added)
-
tags/2.7.6/admin/framework/vendor/spectrum.js (added)
-
tags/2.7.6/admin/images (added)
-
tags/2.7.6/admin/images/1.png (added)
-
tags/2.7.6/admin/images/10.png (added)
-
tags/2.7.6/admin/images/11.png (added)
-
tags/2.7.6/admin/images/12.png (added)
-
tags/2.7.6/admin/images/13.png (added)
-
tags/2.7.6/admin/images/14.png (added)
-
tags/2.7.6/admin/images/2.png (added)
-
tags/2.7.6/admin/images/3.png (added)
-
tags/2.7.6/admin/images/4.png (added)
-
tags/2.7.6/admin/images/5.png (added)
-
tags/2.7.6/admin/images/6.png (added)
-
tags/2.7.6/admin/images/7.png (added)
-
tags/2.7.6/admin/images/8.png (added)
-
tags/2.7.6/admin/images/9.png (added)
-
tags/2.7.6/admin/images/index.php (added)
-
tags/2.7.6/admin/index.php (added)
-
tags/2.7.6/admin/vortexlikedislike.php (added)
-
tags/2.7.6/assets (added)
-
tags/2.7.6/assets/css (added)
-
tags/2.7.6/assets/css/index.php (added)
-
tags/2.7.6/assets/css/style.css (added)
-
tags/2.7.6/assets/font (added)
-
tags/2.7.6/assets/font/fontello.eot (added)
-
tags/2.7.6/assets/font/fontello.svg (added)
-
tags/2.7.6/assets/font/fontello.ttf (added)
-
tags/2.7.6/assets/font/fontello.woff (added)
-
tags/2.7.6/assets/font/index.php (added)
-
tags/2.7.6/assets/icon-128x128.png (added)
-
tags/2.7.6/assets/index.php (added)
-
tags/2.7.6/assets/js (added)
-
tags/2.7.6/assets/js/index.php (added)
-
tags/2.7.6/assets/js/like-or-dislike-comments.js (added)
-
tags/2.7.6/assets/js/like-or-dislike.js (added)
-
tags/2.7.6/assets/js/login-comments.js (added)
-
tags/2.7.6/assets/js/login.js (added)
-
tags/2.7.6/assets/js/no-dislike-comments.js (added)
-
tags/2.7.6/assets/js/no-dislike.js (added)
-
tags/2.7.6/assets/js/toucheventsdetect.js (added)
-
tags/2.7.6/buddypress.php (added)
-
tags/2.7.6/comments.php (added)
-
tags/2.7.6/epoch.php (added)
-
tags/2.7.6/index.php (added)
-
tags/2.7.6/languages (added)
-
tags/2.7.6/languages/index.php (added)
-
tags/2.7.6/languages/vortex_system_ld-ar.mo (added)
-
tags/2.7.6/languages/vortex_system_ld-ar.po (added)
-
tags/2.7.6/languages/vortex_system_ld.pot (added)
-
tags/2.7.6/metabox.php (added)
-
tags/2.7.6/mycredcomments.php (added)
-
tags/2.7.6/mycredposts.php (added)
-
tags/2.7.6/posts-pages.php (added)
-
tags/2.7.6/rating-system.php (added)
-
tags/2.7.6/readme.txt (added)
-
tags/2.7.6/widget (added)
-
tags/2.7.6/widget/dashboard-widget.php (added)
-
tags/2.7.6/widget/index.php (added)
-
tags/2.7.6/widget/widget.php (added)
-
trunk/Changelog.md (modified) (1 diff)
-
trunk/activation.php (deleted)
-
trunk/admin/documentation.html (added)
-
trunk/admin/framework (added)
-
trunk/admin/framework/Sse.class.php (added)
-
trunk/admin/framework/Sse_basic.class.php (added)
-
trunk/admin/framework/Sse_checkbox.class.php (added)
-
trunk/admin/framework/Sse_color.class.php (added)
-
trunk/admin/framework/Sse_image_select.class.php (added)
-
trunk/admin/framework/Sse_number.class.php (added)
-
trunk/admin/framework/Sse_select.class.php (added)
-
trunk/admin/framework/Sse_switch.class.php (added)
-
trunk/admin/framework/Sse_text.class.php (added)
-
trunk/admin/framework/autoload.php (added)
-
trunk/admin/framework/demo (added)
-
trunk/admin/framework/demo/demo.php (added)
-
trunk/admin/framework/demo/doc.html (added)
-
trunk/admin/framework/demo/images (added)
-
trunk/admin/framework/demo/images/1.png (added)
-
trunk/admin/framework/demo/images/10.png (added)
-
trunk/admin/framework/demo/images/11.png (added)
-
trunk/admin/framework/demo/images/12.png (added)
-
trunk/admin/framework/demo/images/13.png (added)
-
trunk/admin/framework/demo/images/14.png (added)
-
trunk/admin/framework/demo/images/2.png (added)
-
trunk/admin/framework/demo/images/3.png (added)
-
trunk/admin/framework/demo/images/4.png (added)
-
trunk/admin/framework/demo/images/5.png (added)
-
trunk/admin/framework/demo/images/6.png (added)
-
trunk/admin/framework/demo/images/7.png (added)
-
trunk/admin/framework/demo/images/8.png (added)
-
trunk/admin/framework/demo/images/9.png (added)
-
trunk/admin/framework/demo/images/index.php (added)
-
trunk/admin/framework/demo/index.php (added)
-
trunk/admin/framework/helpers.js (added)
-
trunk/admin/framework/index.php (added)
-
trunk/admin/framework/style.css (added)
-
trunk/admin/framework/vendor (added)
-
trunk/admin/framework/vendor/array_column.php (added)
-
trunk/admin/framework/vendor/index.php (added)
-
trunk/admin/framework/vendor/jAlert-functions.min.js (added)
-
trunk/admin/framework/vendor/jAlert-v4.css (added)
-
trunk/admin/framework/vendor/jAlert-v4.min.js (added)
-
trunk/admin/framework/vendor/select2.full.min.js (added)
-
trunk/admin/framework/vendor/select2.min.css (added)
-
trunk/admin/framework/vendor/spectrum.css (added)
-
trunk/admin/framework/vendor/spectrum.js (added)
-
trunk/admin/vortexlikedislike.php (modified) (27 diffs)
-
trunk/buddypress.php (modified) (6 diffs)
-
trunk/comments.php (modified) (20 diffs)
-
trunk/documentation.md (deleted)
-
trunk/epoch.php (modified) (5 diffs)
-
trunk/metabox.php (modified) (1 diff)
-
trunk/posts-pages.php (modified) (29 diffs)
-
trunk/rating-system.php (modified) (6 diffs)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/tgmpa (deleted)
Legend:
- Unmodified
- Added
- Removed
-
rating-system/trunk/Changelog.md
r1298069 r1472151 1 ## [2.7.6] 2 ### Fixed ip and cookie tracking. 3 ### Fixed custom text when voting. 4 ### Removed ReduxFramework. 5 ### Removed some options. 1 6 ## [2.7.3] 2 7 ### Fixed Custom text being displayed when cancelling vote. -
rating-system/trunk/admin/vortexlikedislike.php
r1338933 r1472151 1 1 <?php 2 2 3 if ( ! class_exists( ' Redux' ) ) {3 if ( ! class_exists( 'Sse' ) ) { 4 4 return; 5 5 } … … 12 12 13 13 $args = array( 14 // TYPICAL -> Change these values as you need/desire 15 'opt_name' => $opt_name, 16 // This is where your data is stored in the database and also becomes your global variable name. 17 'display_name' => 'Rating System', 18 // Name that appears at the top of your panel 19 'display_version' => '2.7.5', 20 // Version that appears at the top of your panel 21 'menu_type' => 'menu', 22 //Specify if the admin menu should appear or not. Options: menu or submenu (Under appearance only) 23 'allow_sub_menu' => true, 24 // Show the sections below the admin menu item or not 25 'menu_title' => __( 'Rating System', $domain ), 26 'page_title' => __( 'Rating System', $domain), 27 // You will need to generate a Google API key to use this feature. 28 // Please visit: https://developers.google.com/fonts/docs/developer_api#Auth 29 'google_api_key' => '', 30 // Set it you want google fonts to update weekly. A google_api_key value is required. 31 'google_update_weekly' => false, 32 // Must be defined to add google fonts to the typography module 33 'async_typography' => true, 34 // Use a asynchronous font on the front end or font string 35 //'disable_google_fonts_link' => true, // Disable this in case you want to create your own google fonts loader 36 'admin_bar' => false, 37 // Show the panel pages on the admin bar 38 'admin_bar_icon' => 'dashicons-portfolio', 39 // Choose an icon for the admin bar menu 40 'admin_bar_priority' => 50, 41 // Choose an priority for the admin bar menu 42 'global_variable' => '', 43 // Set a different name for your global variable other than the opt_name 44 'dev_mode' => false, 45 // Show the time the page took to load, etc 46 'update_notice' => false, 47 // If dev_mode is enabled, will notify developer of updated versions available in the GitHub Repo 48 'customizer' => false, 49 // Enable basic customizer support 50 //'open_expanded' => true, // Allow you to start the panel in an expanded way initially. 51 //'disable_save_warn' => true, // Disable the save warning when a user changes a field 52 53 // OPTIONAL -> Give you extra features 54 'page_priority' => null, 55 // Order where the menu appears in the admin area. If there is any conflict, something will not show. Warning. 56 'page_parent' => 'themes.php', 57 // For a full list of options, visit: http://codex.wordpress.org/Function_Reference/add_submenu_page#Parameters 58 'page_permissions' => 'manage_options', 59 // Permissions needed to access the options panel. 60 'menu_icon' => '', 61 // Specify a custom URL to an icon 62 'last_tab' => '', 63 // Force your panel to always open to a specific tab (by id) 64 'page_icon' => 'icon-themes', 65 // Icon displayed in the admin panel next to your menu_title 66 'page_slug' => 'rating_system_options', 67 // Page slug used to denote the panel 68 'save_defaults' => true, 69 // On load save the defaults to DB before user clicks save or not 70 'default_show' => false, 71 // If true, shows the default value next to each field that is not the default value. 72 'default_mark' => '', 73 // What to print by the field's title if the value shown is default. Suggested: * 74 'show_import_export' => false, 75 'forced_dev_mode_off' => false, 76 // Shows the Import/Export panel when not used as a field. 77 78 // CAREFUL -> These options are for advanced use only 79 'transient_time' => 60 * MINUTE_IN_SECONDS, 80 'output' => true, 81 // Global shut-off for dynamic CSS output by the framework. Will also disable google fonts output 82 'output_tag' => true, 83 // Allows dynamic CSS to be generated for customizer and google fonts, but stops the dynamic CSS from going to the head 84 // 'footer_credit' => '', // Disable the footer credit of Redux. Please leave if you can help it. 85 86 // FUTURE -> Not in use yet, but reserved or partially implemented. Use at your own risk. 87 'database' => '', 88 // possible: options, theme_mods, theme_mods_expanded, transient. Not fully functional, warning! 89 90 'use_cdn' => true, 91 // If you prefer not to use the CDN for Select2, Ace Editor, and others, you may download the Redux Vendor Support plugin yourself and run locally or embed it in your code. 92 93 //'compiler' => true, 94 95 // HINTS 96 'hints' => array( 97 'icon' => 'el el-question-sign', 98 'icon_position' => 'right', 99 'icon_color' => 'lightgray', 100 'icon_size' => 'normal', 101 'tip_style' => array( 102 'color' => 'light', 103 'shadow' => true, 104 'rounded' => false, 105 'style' => '', 106 ), 107 'tip_position' => array( 108 'my' => 'top left', 109 'at' => 'bottom right', 110 ), 111 'tip_effect' => array( 112 'show' => array( 113 'effect' => 'slide', 114 'duration' => '500', 115 'event' => 'mouseover', 116 ), 117 'hide' => array( 118 'effect' => 'slide', 119 'duration' => '500', 120 'event' => 'click mouseleave', 121 ), 122 ), 123 ) 14 "page-title"=>"Rating System", 15 "menu-title"=>"Rating System", 16 "capability"=>'manage_options', 17 "menu-slug"=>$opt_name, 18 "icon"=>"dashicons-admin-generic", 19 "position"=>"81" // set your owm possition 124 20 ); 125 126 // SOCIAL ICONS -> Setup custom links in the footer for quick links in your panel footer icons. 127 $args['share_icons'][] = array( 128 'url' => 'https://github.com/AlexAlexandru/rating-system', 129 'title' => 'Visit us on GitHub', 130 'icon' => 'el el-github' 131 //'img' => '', // You can use icon OR img. IMG needs to be a full URL. 132 ); 133 134 if ( ! isset( $args['global_variable'] ) || $args['global_variable'] !== false ) { 135 if ( ! empty( $args['global_variable'] ) ) { 136 $v = $args['global_variable']; 137 } else { 138 $v = str_replace( '-', '_', $args['opt_name'] ); 139 } 140 $args['intro_text'] = ''; 141 } else { 142 $args['intro_text'] = ''; 143 } 144 145 // Add content after the form. 146 $args['footer_text'] = ''; 147 148 Redux::setArgs( $opt_name, $args ); 149 21 22 Sse::setArgs($opt_name,$args); 23 150 24 // -> START Basic Fields 151 Redux::setSection( $opt_name, array(25 Sse::setSection( $opt_name, array( 152 26 'title' => __( 'Settings for posts and pages', $domain ), 153 27 'id' => 'basic', … … 293 167 'subtitle' => __('Turn on this if you want like button only.',$domain), 294 168 'default' => false, 295 )/*,array( 296 'id' => 'v-switch-tooltip', 297 'type' => 'switch', 298 'required' => array('v-switch-posts','equals','1'), 299 'title' => __('Enable tooltips', $domain), 300 'default' => false, 301 )*/,array( 169 ),array( 302 170 'id' => 'v-switch-anon', 303 171 'type' => 'switch', … … 316 184 ),array( 317 185 'id' => 'vortex-buttons-size', 318 'type' => ' typography',186 'type' => 'number', 319 187 'required' => array('v-switch-posts','equals','1'), 320 188 'title' => __('Buttons size', $domain), 321 'google' => false, 322 'font-backup' => false, 323 'font-size' => true, 324 'text-align' => false, 325 'font-weight' => false, 326 'line-height' => false, 327 'font-style' => false, 328 'font-family' => false, 329 'color' => false, 330 'output' => array('.vortex-container-like , .vortex-container-dislike'), 331 'units' =>'px', 332 'subtitle' => __('Here you can change the buttons size with a preview.', $domain), 333 'default' => array( 334 'font-size' => '16px', 335 ), 336 'preview' => array( 337 'text' => __('The buttons will have the same size as this text.You can use this as a preview for the size.',$domain), 338 ) 189 'subtitle' => __('Here you can change the buttons size in pixels(px).', $domain), 190 'default' => "16", 339 191 ),array( 340 192 'id' => 'v_default_color', 341 193 'type' => 'color', 342 194 'required' => array('v-switch-posts','equals','1'), 343 'output' => array('.vortex-p-like, .vortex-p-dislike'),344 195 'title' => __('Default color', $domain), 345 196 'subtitle' => __('Default color of buttons', $domain), 346 'validate' => 'color',347 197 'default' => '#828384', 348 198 ),array( … … 351 201 'required' => array('v-switch-posts','equals','1'), 352 202 'title' => __('Like button ',$domain), 353 'output' => array('.vortex-p-like:hover'),354 203 'subtitle' => __('Like button mouse over color', $domain), 355 'validate' => 'color',356 204 'default' => '#4898D6', 357 205 ),array( … … 359 207 'type' => 'color', 360 208 'required' => array('v-switch-posts','equals','1'), 361 'output' => array('.vortex-p-like-active'),362 209 'title' => __('Like button ', $domain), 363 210 'subtitle' => __('Like button active color', $domain), 364 'validate' => 'color',365 211 'default' => '#1B7FCC', 366 212 ),array( … … 368 214 'type' => 'color', 369 215 'required' => array('v-switch-posts','equals','1'), 370 'output' => array('.vortex-p-dislike:hover'),371 216 'title' => __('Dislike button ', $domain), 372 217 'subtitle' => __('Dislike button mouse over color', $domain), 373 'validate' => 'color',374 218 'default' => '#0a0101', 375 219 ),array( … … 377 221 'type' => 'color', 378 222 'required' => array('v-switch-posts','equals','1'), 379 'output' => array('.vortex-p-dislike-active'),380 223 'title' => __('Dislike button ', $domain), 381 224 'subtitle' => __('Dislike button active color', $domain), 382 'validate' => 'color',383 225 'default' => '#0a0101', 384 226 ),array( … … 400 242 'data' => 'post_types', 401 243 ),array( 402 'id' => 'v_start_post_like',403 'type' => 'text',404 'required' => array('v-switch-posts','equals','1'),405 'title' => __('Number of likes by default', $domain),406 'subtitle' => __('Number of likes by default to new post.', $domain),407 'validate' => 'numeric',408 'default' => '0'409 ),array(410 'id' => 'v_start_post_dislike',411 'type' => 'text',412 'required' => array('v-switch-posts','equals','1'),413 'title' => __('Number of dislikes by default', $domain),414 'subtitle' => __('Number of dislikes by default to new post.', $domain),415 'validate' => 'numeric',416 'default' => '0'417 ),array(418 244 'id' => 'v_custom_text', 419 245 'type' => 'switch', … … 425 251 'id' => 'v_custom_text_post_like', 426 252 'type' => 'text', 427 'validate' => 'no_html',428 253 'required' => array(array('v-switch-posts','equals','1'),array('v_custom_text','equals','1')), 429 254 'title' => __('Custom text for like', $domain), … … 432 257 'id' => 'v_custom_text_post_dislike', 433 258 'type' => 'text', 434 'validate' => 'no_html',435 259 'required' => array(array('v-switch-posts','equals','1'),array('v_custom_text','equals','1')), 436 260 'title' => __('Custom text for dislike', $domain), … … 469 293 'title' => __('Number of dislikes:', $domain), 470 294 'subtitle' => __('Auto delete post at a given number of dislikes', $domain), 471 'validate' => 'numeric',472 295 'default' => '10' 473 296 ) … … 477 300 ) ); 478 301 479 Redux::setSection( $opt_name, array(302 Sse::setSection( $opt_name, array( 480 303 'title' => __( 'Settings for comments', $domain ), 481 304 'id' => 'comments', … … 590 413 'default' => false, 591 414 ),array( 592 'id' => 'v-switch-order-comment',593 'type' => 'switch',594 'required' => array('v-switch-comments','equals','1'),595 'title' => __('Order comments', $domain),596 'subtitle' => __('Order comments by the number of likes they have.No Epoch support.',$domain),597 'default' => false,598 ),array(599 415 'id' => 'v-switch-dislike-comment', 600 416 'type' => 'switch', … … 620 436 ),array( 621 437 'id' => 'vortex-buttons-size-comment', 622 'type' => ' typography',438 'type' => 'number', 623 439 'required' => array('v-switch-comments','equals','1'), 624 440 'title' => __('Buttons size', $domain), 625 'google' => false, 626 'font-backup' => false, 627 'font-size' => true, 628 'text-align' => false, 629 'font-weight' => false, 630 'line-height' => false, 631 'font-style' => false, 632 'font-family' => false, 633 'color' => false, 634 'units' =>'px', 635 'subtitle' => __('Here you can change the buttons size with a preview.',$domain), 636 'default' => array( 637 'font-size' => '16px', 638 ), 639 'preview' => array( 640 'text' => __('The buttons will have the same size as this text.You can use this as a preview for the size.',$domain), 641 ) 441 'subtitle' => __('Here you can change the buttons size in pixels (px).',$domain), 442 'default' => "16", 642 443 ),array( 643 444 'id' => 'v_default_color_comment', … … 646 447 'title' => __('Default color', $domain), 647 448 'subtitle' => __('Default color of buttons', $domain), 648 'validate' => 'color',649 449 'default' => '#828384', 650 450 ),array( … … 654 454 'title' => __('Like button ', $domain), 655 455 'subtitle' => __('Like button mouse over color',$domain), 656 'validate' => 'color',657 456 'default' => '#4898D6', 658 457 ),array( … … 662 461 'title' => __('Like button ', $domain), 663 462 'subtitle' => __('Like button active color', $domain), 664 'validate' => 'color',665 463 'default' => '#1B7FCC', 666 464 ),array( … … 670 468 'title' => __('Dislike button ', $domain), 671 469 'subtitle' => __('Dislike button mouse over color', $domain), 672 'validate' => 'color',673 470 'default' => '#0a0101', 674 471 ),array( … … 678 475 'title' => __('Dislike button ', $domain), 679 476 'subtitle' => __('Dislike button active color',$domain), 680 'validate' => 'color',681 477 'default' => '#0a0101', 682 478 ),array( … … 698 494 'data' => 'post_types', 699 495 ),array( 700 'id' => 'v_start_comment_like',701 'type' => 'text',702 'required' => array('v-switch-comments','equals','1'),703 'title' => __('Number of likes by default', $domain),704 'subtitle' => __('Number of likes by default to new comment.', $domain),705 'validate' => 'numeric',706 'default' => '0'707 ),array(708 'id' => 'v_start_comment_dislike',709 'type' => 'text',710 'required' => array('v-switch-comments','equals','1'),711 'title' => __('Number of dislikes by default', $domain),712 'subtitle' => __('Number of dislikes by default to new comment.', $domain),713 'validate' => 'numeric',714 'default' => '0'715 ),array(716 496 'id' => 'v_custom_text_com', 717 497 'type' => 'switch', … … 723 503 'id' => 'v_custom_text_com_like', 724 504 'type' => 'text', 725 'validate' => 'no_html',726 505 'required' => array(array('v-switch-comments','equals','1'),array('v_custom_text_com','equals','1')), 727 506 'title' => __('Custom text for like', $domain), … … 730 509 'id' => 'v_custom_text_com_dislike', 731 510 'type' => 'text', 732 'validate' => 'no_html',733 511 'required' => array(array('v-switch-comments','equals','1'),array('v_custom_text_com','equals','1')), 734 512 'title' => __('Custom text for dislike', $domain), … … 752 530 )); 753 531 754 Redux::setSection( $opt_name, array(532 Sse::setSection( $opt_name, array( 755 533 'title' => __( 'Translation', $domain ), 756 534 'id' => 'translation', 757 535 'desc' => __( 'Here you can translate some basic text.', $domain ), 758 'icon' => 'el el-home',759 536 'fields' => array( 760 537 array( … … 763 540 'title' => __('Singular like for widget', $domain), 764 541 'subtitle' => __('This appers next to the number of likes in the widget only when the likes equals to 1.', $domain), 765 'validate' => 'text',766 542 'default' => 'like' 767 543 ),array( … … 770 546 'title' => __('Plural like for widget', $domain), 771 547 'subtitle' => __('This appers next to the number of likes in the widget only when the likes is equals to 2 or bigger.', $domain), 772 'validate' => 'text',773 548 'default' => 'likes' 774 549 ),array( … … 777 552 'title' => __('Require user to login', $domain), 778 553 'subtitle' => __('This appears when the user is not logged in and the anonymous user voting is not allowed.', $domain), 779 'validate' => 'text',780 554 'default' => 'You must be logged in to vote.' 781 ),/*array( 782 'id' => 'v-like-text-yes', 783 'type' => 'text', 784 'title' => __('Tooltip already liked text', $domain), 785 'validate' => 'text', 786 'default' => 'Unlike' 787 ),array( 788 'id' => 'v-dislike-text', 789 'type' => 'text', 790 'title' => __('Tooltip disliked text', $domain), 791 'validate' => 'text', 792 'default' => 'I dislike this' 793 ),array( 794 'id' => 'v-dislike-yes', 795 'type' => 'text', 796 'title' => __('Tooltip already disliked text', $domain), 797 'validate' => 'text', 798 'default' => 'Undislike' 799 )*/ 555 ) 800 556 ) 801 557 )); 802 if ( file_exists( dirname( __FILE__ ) . '/../documentation.md' ) ) { 803 $section = array( 804 'icon' => 'el el-list-alt', 805 'title' => __( 'Documentation', 'redux-framework-demo' ), 806 'fields' => array( 807 array( 808 'id' => '17', 809 'type' => 'raw', 810 'markdown' => true, 811 'content_path' => dirname( __FILE__ ) . '/../documentation.md', // FULL PATH, not relative please 812 //'content' => 'Raw content here', 813 ), 814 ), 815 ); 816 Redux::setSection( $opt_name, $section ); 558 559 if(file_exists(plugin_dir_path(__FILE__).'documentation.html')){ 560 Sse::setSection( $opt_name, array( 561 'title' => __( 'Documentation', $domain ), 562 'id' => 'documentation', 563 'fields' => array(), 564 'html' => plugin_dir_path(__FILE__).'documentation.html', 565 )); 817 566 } -
rating-system/trunk/buddypress.php
r1338338 r1472151 1 1 <?php 2 global $vortex_like_dislike;2 $vortex_like_dislike = get_option("vortex_like_dislike"); 3 3 function vortex_system_add_dislike_class_buddypress($id){ 4 global $vortex_like_dislike;4 $vortex_like_dislike = get_option("vortex_like_dislike"); 5 5 6 6 if(is_user_logged_in()){ … … 38 38 function vortex_system_dislike_counter_buddypress($id){ 39 39 40 global $vortex_like_dislike;40 $vortex_like_dislike = get_option("vortex_like_dislike"); 41 41 if ($vortex_like_dislike['v_custom_text_post_keep'] && vortex_system_add_dislike_class_buddypress($id) == 'vortex-p-dislike-active'){ 42 42 if(!$vortex_like_dislike['v-switch-anon-counter'] || is_user_logged_in()){ … … 64 64 65 65 function vortex_system_add_like_class_buddypress($id){ 66 global $vortex_like_dislike;66 $vortex_like_dislike = get_option("vortex_like_dislike"); 67 67 68 68 if(is_user_logged_in()){ … … 100 100 function vortex_system_like_counter_buddypress($id){ 101 101 102 global $vortex_like_dislike;102 $vortex_like_dislike = get_option("vortex_like_dislike"); 103 103 if ($vortex_like_dislike['v_custom_text_post_keep'] && vortex_system_add_like_class_buddypress($id) == 'vortex-p-like-active'){ 104 104 if(!$vortex_like_dislike['v-switch-anon-counter'] || is_user_logged_in()){ … … 113 113 114 114 function vortex_buddypress_render($id){ 115 global $vortex_like_dislike;115 $vortex_like_dislike = get_option("vortex_like_dislike"); 116 116 117 117 if(!$vortex_like_dislike['v-switch-dislike']){ … … 163 163 } 164 164 165 global $vortex_like_dislike;165 $vortex_like_dislike = get_option("vortex_like_dislike"); 166 166 if($vortex_like_dislike['v_button_visibility'][1] && $vortex_like_dislike['v_button_visibility'][2] ){ 167 167 add_filter('bp_get_activity_content_body','vortex_buddypress_after'); -
rating-system/trunk/comments.php
r1338933 r1472151 1 1 <?php 2 2 3 global $vortex_like_dislike;3 $vortex_like_dislike = get_option("vortex_like_dislike"); 4 4 5 5 if($vortex_like_dislike['v-switch-comments']){ … … 8 8 function vortex_system_comment_like_button(){ 9 9 10 global $vortex_like_dislike;10 $vortex_like_dislike = get_option("vortex_like_dislike"); 11 11 12 12 $nonce = $_POST['nonce']; … … 128 128 } 129 129 130 global $vortex_like_dislike;130 $vortex_like_dislike = get_option("vortex_like_dislike"); 131 131 if(!$vortex_like_dislike['v-switch-anon-comment'] && !is_user_logged_in()){ 132 132 exit(); … … 238 238 239 239 function vortex_system_add_dislike_class_comment(){ 240 global $vortex_like_dislike;240 $vortex_like_dislike = get_option("vortex_like_dislike"); 241 241 $id = get_comment_ID(); 242 242 if(is_user_logged_in()){ … … 263 263 264 264 function vortex_system_add_like_class_comment(){ 265 global $vortex_like_dislike;265 $vortex_like_dislike = get_option("vortex_like_dislike"); 266 266 $id = get_comment_ID(); 267 267 if(is_user_logged_in()){ … … 310 310 311 311 function vortex_system_get_like_icon_comment(){ 312 global $vortex_like_dislike;312 $vortex_like_dislike = get_option("vortex_like_dislike"); 313 313 314 314 if($vortex_like_dislike['v_button_style_comment'] == '1'){ … … 345 345 346 346 function vortex_system_get_dislike_icon_comment(){ 347 global $vortex_like_dislike;347 $vortex_like_dislike = get_option("vortex_like_dislike"); 348 348 349 349 if($vortex_like_dislike['v_button_style_comment'] == '1'){ … … 382 382 function vortex_system_dislike_counter_comment(){ 383 383 384 global $vortex_like_dislike;385 if ($vortex_like_dislike['v_custom_text_com _keep'] && vortex_system_add_dislike_class_comment() == 'vortex-p-dislike-active-comment'){384 $vortex_like_dislike = get_option("vortex_like_dislike"); 385 if ($vortex_like_dislike['v_custom_text_com'] && $vortex_like_dislike['v_custom_text_com_keep'] && vortex_system_add_dislike_class_comment() == 'vortex-p-dislike-active-comment'){ 386 386 if(!$vortex_like_dislike['v-switch-anon-counter-comment'] || is_user_logged_in()){ 387 387 return '<span class="vortex-p-dislike-counter-comment '.get_comment_ID(). '">'.$vortex_like_dislike['v_custom_text_com_dislike'].'</span>'; … … 400 400 function vortex_system_like_counter_comment(){ 401 401 402 global $vortex_like_dislike; 403 if ($vortex_like_dislike['v_custom_text_com_keep'] && vortex_system_add_like_class_comment() == 'vortex-p-like-active-comment'){ 402 $vortex_like_dislike = get_option("vortex_like_dislike"); 403 404 if ($vortex_like_dislike['v_custom_text_com'] && $vortex_like_dislike['v_custom_text_com_keep'] && vortex_system_add_like_class_comment() == 'vortex-p-like-active-comment'){ 404 405 if(!$vortex_like_dislike['v-switch-anon-counter-comment'] || is_user_logged_in()){ 405 406 return '<span class="vortex-p-like-counter-comment '. get_comment_ID().'">'.$vortex_like_dislike['v_custom_text_com_like'].'</span>'; … … 412 413 413 414 function vortex_button_align_comment(){ 414 global $vortex_like_dislike;415 $vortex_like_dislike = get_option("vortex_like_dislike"); 415 416 416 417 if($vortex_like_dislike['vortex-button-align-comment'] == '1'){ … … 425 426 function vortex_render_for_comments($dislike = true){ 426 427 427 global $vortex_like_dislike;428 $vortex_like_dislike = get_option("vortex_like_dislike"); 428 429 429 430 if(!$vortex_like_dislike['v-switch-dislike-comment'] && $dislike){ … … 443 444 function vortex_system_insert_comments(){ 444 445 445 global $vortex_like_dislike;446 $vortex_like_dislike = get_option("vortex_like_dislike"); 446 447 447 448 function vortex_system_before_comment($comment_text){ 448 449 449 global $vortex_like_dislike;450 $vortex_like_dislike = get_option("vortex_like_dislike"); 450 451 451 452 if(!empty($vortex_like_dislike['v_exclude_category_comment'])){ … … 469 470 function vortex_system_after_comment($comment_text){ 470 471 471 global $vortex_like_dislike;472 $vortex_like_dislike = get_option("vortex_like_dislike"); 472 473 473 474 if(!empty($vortex_like_dislike['v_exclude_post_types'])){ … … 506 507 507 508 function vortex_print_styles_comments(){ 508 global $vortex_like_dislike;509 $vortex_like_dislike = get_option("vortex_like_dislike"); 509 510 ?> 510 <style>.vortex-container-like-comment,.vortex-container-dislike-comment{font-size:<?php echo $vortex_like_dislike['vortex-buttons-size-comment']['font-size']?>}.vortex-p-like-comment, .vortex-p-dislike-comment{color:<?php echo $vortex_like_dislike['v_default_color_comment'] ?>;}.vortex-p-like-comment:hover{color:<?php echo $vortex_like_dislike['v_like_color_comment'] ?>;}.vortex-p-like-active-comment{color: <?php echo $vortex_like_dislike['v_like_active_color_comment'] ?>;}.vortex-p-dislike-comment:hover{color: <?php echo $vortex_like_dislike['v_dislike_color_comment'] ?>;}.vortex-p-dislike-active-comment{color: <?php echo $vortex_like_dislike['v_dislike_active_color_comment'] ?>;}</style> 511 <style type="text/css"> 512 .vortex-container-like-comment, 513 .vortex-container-dislike-comment{font-size:<?php echo esc_html($vortex_like_dislike['vortex-buttons-size-comment'])?>px;} 514 .vortex-p-like-comment, 515 .vortex-p-dislike-comment{color:<?php echo esc_html($vortex_like_dislike['v_default_color_comment'])?>;} 516 .vortex-p-like-comment:hover{color:<?php echo esc_html($vortex_like_dislike['v_like_color_comment'])?>;} 517 .vortex-p-like-active-comment{color:<?php echo esc_html($vortex_like_dislike['v_like_active_color_comment'])?>;} 518 .vortex-p-dislike-comment:hover{color:<?php echo esc_html($vortex_like_dislike['v_dislike_color_comment'])?>;} 519 .vortex-p-dislike-active-comment{color:<?php echo esc_html($vortex_like_dislike['v_dislike_active_color_comment'])?>;} 520 </style> 511 521 <?php 512 522 } … … 514 524 515 525 function vortex_system_styles_scripts_comments(){ 516 global $vortex_like_dislike;526 $vortex_like_dislike = get_option("vortex_like_dislike"); 517 527 518 528 if(is_user_logged_in() || $vortex_like_dislike['v-switch-anon-comment']){ … … 552 562 553 563 function vortex_epoch_css(){ 554 global $vortex_like_dislike;564 $vortex_like_dislike = get_option("vortex_like_dislike"); 555 565 echo "<link rel='stylesheet' href='".plugin_dir_url( __FILE__ ).'assets/css/style.css'."' type='text/css' media='all'>"; 556 566 ?> … … 686 696 } 687 697 function vortex_print_styles_comments(){ 688 global $vortex_like_dislike;698 $vortex_like_dislike = get_option("vortex_like_dislike"); 689 699 ?> 690 700 <style>.vortex-container-like-comment,.vortex-container-dislike-comment{font-size:<?php echo $vortex_like_dislike['vortex-buttons-size-comment']['font-size']?>}.vortex-p-like-comment, .vortex-p-dislike-comment{color:<?php echo $vortex_like_dislike['v_default_color_comment'] ?>;}.vortex-p-like-comment:hover{color:<?php echo $vortex_like_dislike['v_like_color_comment'] ?>;}.vortex-p-like-active-comment{color: <?php echo $vortex_like_dislike['v_like_active_color_comment'] ?>;}.vortex-p-dislike-comment:hover{color: <?php echo $vortex_like_dislike['v_dislike_color_comment'] ?>;}.vortex-p-dislike-active-comment{color: <?php echo $vortex_like_dislike['v_dislike_active_color_comment'] ?>;}</style> … … 694 704 695 705 function vortex_system_styles_scripts_comments(){ 696 global $vortex_like_dislike;706 $vortex_like_dislike = get_option("vortex_like_dislike"); 697 707 698 708 if(is_user_logged_in() || $vortex_like_dislike['v-switch-anon-comment']){ … … 739 749 function vortex_system_columns_comments( $columns ) { 740 750 741 global $vortex_like_dislike;751 $vortex_like_dislike = get_option("vortex_like_dislike"); 742 752 $domain = 'vortex_system_ld'; 743 753 $columns['likes'] = '<span class="dashicons dashicons-thumbs-up"></span>'; … … 789 799 } 790 800 } 791 792 if($vortex_like_dislike['v-switch-order-comment']){ 793 function vortex_system_order_comments($comments) { 794 unset($comments); 795 global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage; 796 797 if ( !(is_single() || is_page() || $withcomments) || empty($post) ) 798 return; 799 800 if ( empty($file) ) 801 $file = '/comments.php'; 802 803 $req = get_option('require_name_email'); 804 805 /* 806 * Comment author information fetched from the comment cookies. 807 */ 808 $commenter = wp_get_current_commenter(); 809 810 /* 811 * The name of the current comment author escaped for use in attributes. 812 * Escaped by sanitize_comment_cookies(). 813 */ 814 $comment_author = $commenter['comment_author']; 815 816 /* 817 * The email address of the current comment author escaped for use in attributes. 818 * Escaped by sanitize_comment_cookies(). 819 */ 820 $comment_author_email = $commenter['comment_author_email']; 821 822 /* 823 * The url of the current comment author escaped for use in attributes. 824 */ 825 $comment_author_url = esc_url($commenter['comment_author_url']); 826 827 $comment_args = array( 828 'order' => 'DESC', 829 'orderby' => 'meta_value_num', 830 'meta_key' => 'vortex_system_likes', 831 'status' => 'approve', 832 'post_id' => $post->ID, 833 ); 834 835 if ( $user_ID ) { 836 $comment_args['include_unapproved'] = array( $user_ID ); 837 } elseif ( ! empty( $comment_author_email ) ) { 838 $comment_args['include_unapproved'] = array( $comment_author_email ); 839 } 840 841 $comments = get_comments( $comment_args ); 842 return $comments; 843 } 844 add_filter ('comments_array', 'vortex_system_order_comments'); 845 } 801 846 802 } -
rating-system/trunk/epoch.php
r1338338 r1472151 2 2 3 3 function vortex_system_add_dislike_class_comment_epoch($id){ 4 global $vortex_like_dislike;4 $vortex_like_dislike = get_option("vortex_like_dislike"); 5 5 6 6 if(is_user_logged_in()){ … … 26 26 27 27 function vortex_system_add_like_class_comment_epoch($id){ 28 global $vortex_like_dislike;28 $vortex_like_dislike = get_option("vortex_like_dislike"); 29 29 30 30 if(is_user_logged_in()){ … … 74 74 function vortex_system_dislike_counter_comment_epoch($id){ 75 75 76 global $vortex_like_dislike;76 $vortex_like_dislike = get_option("vortex_like_dislike"); 77 77 if ($vortex_like_dislike['v_custom_text_com_keep'] && vortex_system_add_dislike_class_comment_epoch($id) == 'vortex-p-dislike-active-comment'){ 78 78 if(!$vortex_like_dislike['v-switch-anon-counter-comment'] || is_user_logged_in()){ … … 86 86 function vortex_system_like_counter_comment_epoch($id){ 87 87 88 global $vortex_like_dislike;88 $vortex_like_dislike = get_option("vortex_like_dislike"); 89 89 if ($vortex_like_dislike['v_custom_text_com_keep'] && vortex_system_add_like_class_comment_epoch($id) == 'vortex-p-like-active-comment'){ 90 90 if(!$vortex_like_dislike['v-switch-anon-counter-comment'] || is_user_logged_in()){ … … 105 105 function vortex_render_for_comments_epoch($id){ 106 106 107 global $vortex_like_dislike;107 $vortex_like_dislike = get_option("vortex_like_dislike"); 108 108 109 109 if(!$vortex_like_dislike['v-switch-dislike-comment']){ -
rating-system/trunk/metabox.php
r1338338 r1472151 28 28 $post_types['page'] = 'page'; 29 29 30 global $vortex_like_dislike;30 $vortex_like_dislike = get_option("vortex_like_dislike"); 31 31 32 32 $array = array(); -
rating-system/trunk/posts-pages.php
r1338338 r1472151 1 1 <?php 2 global $vortex_like_dislike;3 2 $vortex_like_dislike = get_option("vortex_like_dislike"); 3 4 4 if($vortex_like_dislike['v-switch-posts']){ 5 5 … … 8 8 function vortex_system_like_button() { 9 9 10 global $vortex_like_dislike;10 $vortex_like_dislike = get_option("vortex_like_dislike"); 11 11 12 12 $nonce = $_POST['nonce']; … … 37 37 38 38 $user_key = 'vortex_system_user_'.$user_ip; 39 40 if(vortex_ra_read_cookie('likepost',$post_id) == 'found'){ 41 $response = array( 42 'likes' => "exit" 43 ); 44 45 echo json_encode($response); 46 exit(); 47 } 48 49 if(vortex_ra_read_cookie('dislikepost',$post_id) == 'found'){ 50 $response = array( 51 'dislikes' => "exit" 52 ); 53 54 echo json_encode($response); 55 exit(); 56 } 39 57 40 58 }else wp_die(); … … 69 87 $login_number = apply_filters('vortex_login_number',1); 70 88 $logout_number = apply_filters('vortex_logout_number',1); 89 90 if(!is_user_logged_in() && $vortex_like_dislike['v-switch-anon']){ 91 if($current_user_liked == 'noliked'){ 92 $response = array( 93 'likes' => "exit", 94 ); 95 96 echo json_encode($response); 97 exit(); 98 } 99 100 101 if($current_user_liked == 'nodisliked'){ 102 $response = array( 103 'dislikes' => "exit", 104 ); 105 106 echo json_encode($response); 107 exit(); 108 } 109 } 110 71 111 //END custom 72 if($current_user_liked == 'liked' && $disliked_value == 'nodisliked' || vortex_ra_read_cookie('dislikepost',$post_id) == 'found' && vortex_ra_read_cookie('likepost',$post_id) == 'notfound'){112 if($current_user_liked == 'liked' && $disliked_value == 'nodisliked'){ 73 113 $current_likes = get_post_meta($post_id,$likes,true); 74 114 if(!is_user_logged_in()){ … … 88 128 do_action("vortex_post_dislike",'+likes','-dislikes',$current_user_id,$post_id); 89 129 /* 90 global $vortex_like_dislike;130 $vortex_like_dislike = get_option("vortex_like_dislike"); 91 131 if($vortex_like_dislike['v-switch-tooltip']){ 92 132 $response = array( … … 121 161 exit(); 122 162 123 }elseif($current_user_liked == 'liked' || vortex_ra_read_cookie('likepost',$post_id) == 'notfound'){163 }elseif($current_user_liked == 'liked'){ 124 164 //he likes the post add +1 to likes 125 165 //change the liked value so when he clicks again we can undo his vote … … 134 174 do_action("vortex_post_dislike",'+likes','nothing',$current_user_id,$post_id); 135 175 136 }elseif($current_user_liked == 'noliked' || vortex_ra_read_cookie('likepost',$post_id) == 'found'){176 }elseif($current_user_liked == 'noliked' ){ 137 177 //he doesn't like the post anymore let's undo his vote and change his meta so we can add his vote back 138 178 //if he changes his mind … … 191 231 192 232 193 global $vortex_like_dislike;233 $vortex_like_dislike = get_option("vortex_like_dislike"); 194 234 195 235 if(!$vortex_like_dislike['v-switch-anon'] && !is_user_logged_in()){ … … 212 252 213 253 $user_key = 'vortex_system_user_'.$user_ip; 254 255 256 if(vortex_ra_read_cookie('dislikepost',$post_id) == 'found'){ 257 $response = array( 258 'dislikes' => "exit" 259 ); 260 261 echo json_encode($response); 262 exit(); 263 } 264 265 if(vortex_ra_read_cookie('likepost',$post_id) == 'found'){ 266 $response = array( 267 'likes' => "exit" 268 ); 269 270 echo json_encode($response); 271 exit(); 272 } 273 214 274 215 275 }else wp_die(); … … 248 308 //END custom 249 309 250 if($current_user_disliked == 'disliked' && $liked_value == 'noliked' || vortex_ra_read_cookie('likepost',$post_id) == 'found' && vortex_ra_read_cookie('dislikepost',$post_id) == 'notfound'){ 310 if(!is_user_logged_in() && $vortex_like_dislike['v-switch-anon']){ 311 if($current_user_liked == 'noliked'){ 312 $response = array( 313 'likes' => "exit", 314 ); 315 316 echo json_encode($response); 317 exit(); 318 } 319 320 if($current_user_liked == 'nodisliked'){ 321 $response = array( 322 'dislikes' => "exit", 323 ); 324 325 echo json_encode($response); 326 exit(); 327 } 328 329 } 330 331 if($current_user_disliked == 'disliked' && $liked_value == 'noliked'){ 251 332 252 333 $current_likes = get_post_meta($post_id,$likes,true); … … 291 372 exit(); 292 373 293 }elseif($current_user_disliked == 'disliked' || vortex_ra_read_cookie('dislikepost',$post_id) == 'notfound'){374 }elseif($current_user_disliked == 'disliked'){ 294 375 //he likes the post add +1 to likes 295 376 //change the liked value so when he clicks again we can undo his vote … … 308 389 } 309 390 310 }elseif($current_user_disliked == 'nodisliked' || vortex_ra_read_cookie('dislikepost',$post_id) == 'found'){391 }elseif($current_user_disliked == 'nodisliked'){ 311 392 //he doesn't like the post anymore let's undo his vote and change his meta so we can add his vote back 312 393 //if he changes his mind … … 356 437 357 438 function vortex_system_add_dislike_class(){ 358 global $vortex_like_dislike;439 $vortex_like_dislike = get_option("vortex_like_dislike"); 359 440 if(function_exists('bbp_get_reply_id')){ 360 441 if(bbp_get_reply_id() != null){ … … 389 470 390 471 function vortex_system_add_like_class(){ 391 global $vortex_like_dislike;472 $vortex_like_dislike = get_option("vortex_like_dislike"); 392 473 if(function_exists('bbp_get_reply_id')){ 393 474 if(bbp_get_reply_id() != null){ … … 461 542 462 543 function vortex_system_get_like_icon(){ 463 global $vortex_like_dislike;544 $vortex_like_dislike = get_option("vortex_like_dislike"); 464 545 465 546 if($vortex_like_dislike['v_button_style'] == '1'){ … … 497 578 498 579 function vortex_system_get_dislike_icon(){ 499 global $vortex_like_dislike;580 $vortex_like_dislike = get_option("vortex_like_dislike"); 500 581 501 582 if($vortex_like_dislike['v_button_style'] == '1'){ … … 533 614 534 615 function vortex_button_align(){ 535 global $vortex_like_dislike;616 $vortex_like_dislike = get_option("vortex_like_dislike"); 536 617 537 618 if($vortex_like_dislike['vortex-button-align'] == '1'){ … … 554 635 $id = get_the_ID(); 555 636 } 556 global $vortex_like_dislike;557 if ($vortex_like_dislike['v_custom_text _post_keep'] && vortex_system_add_dislike_class() == 'vortex-p-dislike-active'){637 $vortex_like_dislike = get_option("vortex_like_dislike"); 638 if ($vortex_like_dislike['v_custom_text'] && $vortex_like_dislike['v_custom_text_post_keep'] && vortex_system_add_dislike_class() == 'vortex-p-dislike-active'){ 558 639 if(!$vortex_like_dislike['v-switch-anon-counter'] || is_user_logged_in()){ 559 640 return '<span class="vortex-p-dislike-counter '.$id. '">'.$vortex_like_dislike['v_custom_text_post_dislike'].'</span>'; … … 597 678 } 598 679 599 global $vortex_like_dislike;600 if ($vortex_like_dislike['v_custom_text _post_keep'] && vortex_system_add_like_class() == 'vortex-p-like-active'){680 $vortex_like_dislike = get_option("vortex_like_dislike"); 681 if ($vortex_like_dislike['v_custom_text'] && $vortex_like_dislike['v_custom_text_post_keep'] && vortex_system_add_like_class() == 'vortex-p-like-active'){ 601 682 if(!$vortex_like_dislike['v-switch-anon-counter'] || is_user_logged_in()){ 602 683 return '<span class="vortex-p-like-counter '. $id.'">'.$vortex_like_dislike['v_custom_text_post_like'].'</span>'; … … 611 692 function vortex_render_for_posts($dislike = true , $counter = true){ 612 693 613 global $vortex_like_dislike;694 $vortex_like_dislike = get_option("vortex_like_dislike"); 614 695 $like_counter = ""; 615 696 if(function_exists('bbp_get_reply_id')){ … … 647 728 function vortex_system_columns( $columns ) { 648 729 649 global $vortex_like_dislike;730 $vortex_like_dislike = get_option("vortex_like_dislike"); 650 731 $domain = 'vortex_system_ld'; 651 732 $columns['likes'] = '<span class="dashicons dashicons-thumbs-up"></span>'; … … 696 777 697 778 function vortex_system_sortable_columns( $columns ) { 698 global $vortex_like_dislike;779 $vortex_like_dislike = get_option("vortex_like_dislike"); 699 780 700 781 $columns['likes'] = 'likes'; … … 718 799 $post_types = get_post_types( $args, $output, $operator ); 719 800 720 global $vortex_like_dislike;801 $vortex_like_dislike = get_option("vortex_like_dislike"); 721 802 722 803 $post_types['post'] = 'post'; … … 750 831 751 832 function vortex_system_before_post($content){ 752 global $vortex_like_dislike;833 $vortex_like_dislike = get_option("vortex_like_dislike"); 753 834 754 835 if(!empty($vortex_like_dislike['v_exclude_category'])){ … … 789 870 790 871 function vortex_system_after_post($content){ 791 global $vortex_like_dislike;872 $vortex_like_dislike = get_option("vortex_like_dislike"); 792 873 if(function_exists('bbp_get_reply_id')){ 793 874 if(bbp_get_reply_id() != null){ … … 825 906 }else return $content; 826 907 } 827 global $vortex_like_dislike;908 $vortex_like_dislike = get_option("vortex_like_dislike"); 828 909 if(!post_password_required()){ 829 910 if($vortex_like_dislike['v_button_visibility'][1] && $vortex_like_dislike['v_button_visibility'][2] ){ 830 911 add_filter('the_content','vortex_system_before_post'); 831 912 add_filter('the_content','vortex_system_after_post'); 832 if($vortex_like_dislike['v_enable_bbpress'] && is_plugin_active( 'bbpress/bbpress.php' )){913 if($vortex_like_dislike['v_enable_bbpress']){ 833 914 add_filter('bbp_get_reply_content','vortex_system_before_post'); 834 915 add_filter('bbp_get_reply_content','vortex_system_after_post'); … … 836 917 }elseif($vortex_like_dislike['v_button_visibility'][1]){ 837 918 add_filter('the_content','vortex_system_before_post'); 838 if($vortex_like_dislike['v_enable_bbpress'] && is_plugin_active( 'bbpress/bbpress.php' )){919 if($vortex_like_dislike['v_enable_bbpress']){ 839 920 add_filter('bbp_get_reply_content','vortex_system_before_post'); 840 921 } 841 922 }elseif($vortex_like_dislike['v_button_visibility'][2]){ 842 923 add_filter('the_content','vortex_system_after_post'); 843 if($vortex_like_dislike['v_enable_bbpress'] && is_plugin_active( 'bbpress/bbpress.php' )){924 if($vortex_like_dislike['v_enable_bbpress']){ 844 925 add_filter('bbp_get_reply_content','vortex_system_after_post'); 845 926 } … … 850 931 add_action('wp','vortex_system_insert'); 851 932 function vortex_system_styles_scripts(){ 852 global $vortex_like_dislike;933 $vortex_like_dislike = get_option("vortex_like_dislike"); 853 934 854 935 if(is_user_logged_in() || $vortex_like_dislike['v-switch-anon']){ … … 886 967 } 887 968 add_action('wp_enqueue_scripts','vortex_system_styles_scripts'); 969 970 function vortex_print_styles(){ 971 $vortex_like_dislike = get_option('vortex_like_dislike'); 972 973 ?> 974 <style type="text/css"> 975 .vortex-container-like, 976 .vortex-container-dislike { 977 font-size: <?php echo esc_html($vortex_like_dislike['vortex-buttons-size']);?>px !important; 978 } 979 .vortex-p-like, 980 .vortex-p-dislike{ 981 color:<?php echo esc_html($vortex_like_dislike['v_default_color']); ?>!important; 982 } 983 .vortex-p-like:hover{ 984 color:<?php echo esc_html($vortex_like_dislike['v_like_color']); ?>!important; 985 } 986 .vortex-p-like-active{ 987 color:<?php echo esc_html($vortex_like_dislike['v_like_active_color']); ?>!important; 988 } 989 .vortex-p-dislike:hover{ 990 color:<?php echo esc_html($vortex_like_dislike['v_dislike_color']); ?>!important; 991 } 992 .vortex-p-dislike-active{ 993 color:<?php echo esc_html($vortex_like_dislike['v_dislike_active_color']); ?>!important; 994 } 995 </style> 996 997 <?php 998 } 999 add_action('wp_print_styles','vortex_print_styles'); 888 1000 } -
rating-system/trunk/rating-system.php
r1338933 r1472151 4 4 * Plugin URI: http://github.com/AlexAlexandru/rating-system 5 5 * Description: The simple way to add like or dislike buttons. 6 * Version: 2.7. 56 * Version: 2.7.6 7 7 * Author: AlexAlexandru 8 8 * Author URI: https://github.com/AlexAlexandru … … 29 29 30 30 function vortex_ra_cookie($name,$postid,$name2){ 31 if(vortex_ra_read_cookie($name2,$postid) == 'found' && vortex_ra_read_cookie($name,$postid) == 'notfound'){ 32 33 $decode2 = json_decode($_COOKIE[$name2]); 34 $decode2 = array_diff($decode2, array($postid)); 35 $encode2 = json_encode(array_values($decode2)); 36 setcookie($name2,$encode2,time()+ 2419200,'/',COOKIE_DOMAIN,is_ssl(),true); 37 38 if(!isset($_COOKIE[$name])){ 39 $decode = array(); 40 }else{ 41 $decode = json_decode($_COOKIE[$name]); 42 } 43 44 array_push($decode,$postid); 45 $encode = json_encode($decode); 46 setcookie($name,$encode,time()+ 2419200,'/',COOKIE_DOMAIN,is_ssl(),true); 47 48 }elseif(!isset($_COOKIE[$name])){ 31 if(!isset($_COOKIE[$name])){ 49 32 $array = json_encode(array($postid)); 50 33 setcookie($name,$array,time()+ 2419200,'/',COOKIE_DOMAIN,is_ssl(),true); … … 55 38 $encode = json_encode($decode); 56 39 setcookie($name,$encode,time()+ 2419200,'/',COOKIE_DOMAIN,is_ssl(),true); 57 }else{ 58 $decode = json_decode($_COOKIE[$name]); 59 $decode = array_diff($decode, array($postid)); 60 $encode = json_encode(array_values($decode)); 61 setcookie($name,$encode,time()+ 2419200,'/',COOKIE_DOMAIN,is_ssl(),true); 62 } 63 } 64 } 65 66 function vortex_rating_require_tgmpa(){ 67 //tgmpa 68 include(plugin_dir_path( __FILE__).'tgmpa/class-tgm-plugin-activation.php'); 69 add_action( 'tgmpa_register', 'vortex_register_plugin' ); 70 71 function vortex_register_plugin() { 72 73 $plugins = array( 74 array( 75 'name' => 'Redux Framework', 76 'slug' => 'redux-framework', 77 'required' => true, 78 ), 79 ); 80 81 $config = array( 82 'id' => 'vortex-tgmpa', // Unique ID for hashing notices for multiple instances of TGMPA. 83 'default_path' => '', // Default absolute path to bundled plugins. 84 'menu' => 'vortex-install-plugins', // Menu slug. 85 'parent_slug' => 'plugins.php', // Parent menu slug. 86 'capability' => 'edit_plugins', // Capability needed to view plugin install page, should be a capability associated with the parent menu used. 87 'has_notices' => true, // Show admin notices or not. 88 'dismissable' => false, // If false, a user cannot dismiss the nag message. 89 'dismiss_msg' => __('Rating System','vortex_system_ld'), // If 'dismissable' is false, this message will be output at top of nag. 90 'is_automatic' => false, // Automatically activate plugins after installation or not. 91 'message' => '', // Message to output right before the plugins table. 92 93 94 'strings' => array( 95 'page_title' => __( 'Install Required Plugins', 'theme-slug' ), 96 'menu_title' => __( 'Install Plugins', 'theme-slug' ), 97 'installing' => __( 'Installing Plugin: %s', 'theme-slug' ), // %s = plugin name. 98 'oops' => __( 'Something went wrong with the plugin API.', 'theme-slug' ), 99 'notice_can_install_required' => _n_noop( 100 'This plugin requires the following plugin: %1$s.', 101 'This plugin requires the following plugins: %1$s.', 102 'theme-slug' 103 ), // %1$s = plugin name(s). 104 'notice_can_install_recommended' => _n_noop( 105 'This plugin recommends the following plugin: %1$s.', 106 'This plugin recommends the following plugins: %1$s.', 107 'theme-slug' 108 ), // %1$s = plugin name(s). 109 'notice_cannot_install' => _n_noop( 110 'Sorry, but you do not have the correct permissions to install the %1$s plugin.', 111 'Sorry, but you do not have the correct permissions to install the %1$s plugins.', 112 'theme-slug' 113 ), // %1$s = plugin name(s). 114 'notice_ask_to_update' => _n_noop( 115 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this plugin: %1$s.', 116 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this plugin: %1$s.', 117 'theme-slug' 118 ), // %1$s = plugin name(s). 119 'notice_ask_to_update_maybe' => _n_noop( 120 'There is an update available for: %1$s.', 121 'There are updates available for the following plugins: %1$s.', 122 'theme-slug' 123 ), // %1$s = plugin name(s). 124 'notice_cannot_update' => _n_noop( 125 'Sorry, but you do not have the correct permissions to update the %1$s plugin.', 126 'Sorry, but you do not have the correct permissions to update the %1$s plugins.', 127 'theme-slug' 128 ), // %1$s = plugin name(s). 129 'notice_can_activate_required' => _n_noop( 130 'The following required plugin is currently inactive: %1$s.', 131 'The following required plugins are currently inactive: %1$s.', 132 'theme-slug' 133 ), // %1$s = plugin name(s). 134 'notice_can_activate_recommended' => _n_noop( 135 'The following recommended plugin is currently inactive: %1$s.', 136 'The following recommended plugins are currently inactive: %1$s.', 137 'theme-slug' 138 ), // %1$s = plugin name(s). 139 'notice_cannot_activate' => _n_noop( 140 'Sorry, but you do not have the correct permissions to activate the %1$s plugin.', 141 'Sorry, but you do not have the correct permissions to activate the %1$s plugins.', 142 'theme-slug' 143 ), // %1$s = plugin name(s). 144 'install_link' => _n_noop( 145 'Begin installing plugin', 146 'Begin installing plugins', 147 'theme-slug' 148 ), 149 'update_link' => _n_noop( 150 'Begin updating plugin', 151 'Begin updating plugins', 152 'theme-slug' 153 ), 154 'activate_link' => _n_noop( 155 'Begin activating plugin', 156 'Begin activating plugins', 157 'theme-slug' 158 ), 159 ), 160 161 ); 162 163 tgmpa( $plugins, $config ); 164 } 165 } 166 add_action('plugins_loaded','vortex_rating_require_tgmpa'); 40 } 41 } 42 } 167 43 168 44 //require all usefull stuffs 169 45 function vortex_systen_main_function(){ 170 46 171 if(!function_exists('is_plugin_active')){172 include_once( ABSPATH . 'wp-admin/includes/plugin.php' );173 }174 47 if(class_exists('myCRED_Hook')){ 175 48 include(plugin_dir_path( __FILE__ ).'mycredcomments.php'); … … 185 58 } 186 59 187 if(function_exists('is_plugin_active')){ 188 if(is_plugin_active('redux-framework/redux-framework.php')){ 60 $vortex_like_dislike = get_option('vortex_like_dislike'); 189 61 load_plugin_textdomain( 'vortex_system_ld', FALSE, basename(plugin_dir_path( __FILE__ )). '/languages' ); 190 $ reduxoption = plugin_dir_path( __FILE__).'admin/vortexlikedislike.php';191 $ reduxframework = plugin_dir_path(plugin_dir_path( __FILE__ )).'redux-framework/ReduxCore/framework.php';192 193 if ( !class_exists( ' ReduxFramework' ) && file_exists($reduxframework) ) {194 include($ reduxframework);62 $sse = plugin_dir_path( __FILE__).'admin/framework/autoload.php'; 63 $options = plugin_dir_path( __FILE__).'admin/vortexlikedislike.php'; 64 65 if ( !class_exists( 'Sse' ) && file_exists($sse) ) { 66 include($sse); 195 67 }; 196 if ( !isset( $vortex_like_dislike ) && file_exists($reduxoption) ) { 197 include($reduxoption); 68 69 if ( file_exists($options) ) { 70 include($options); 198 71 }; 199 72 200 73 //donation button 201 74 function vortex_system_donation_button(){ … … 208 81 '; 209 82 } 210 add_action('redux/vortex_like_dislike/panel/before','vortex_system_donation_button'); 211 add_action('redux/vortex_like_dislike/panel/after','vortex_system_donation_button'); 212 213 Redux::init('vortex_like_dislike'); 214 215 global $vortex_like_dislike; 216 83 add_action('sse_footer_vortex_like_dislike','vortex_system_donation_button'); 84 85 $vortex_like_dislike = get_option("vortex_like_dislike"); 86 217 87 if($vortex_like_dislike['v-switch-posts'] && isset($vortex_like_dislike['v-switch-posts'])){ 218 88 include(plugin_dir_path( __FILE__ ).'posts-pages.php'); … … 223 93 if($vortex_like_dislike['v-switch-comments'] && isset($vortex_like_dislike['v-switch-comments'])){ 224 94 include(plugin_dir_path( __FILE__ ).'comments.php'); 225 } 226 227 //add custom fields when comment is submited 228 add_action('comment_post', 'vortex_system_add_likes_dislikes_comments'); 229 function vortex_system_add_likes_dislikes_comments($comment_ID) { 230 global $vortex_like_dislike; 231 $likes = 0; 232 $dislikes = 0; 233 234 if(isset($vortex_like_dislike['v_start_comment_like'])){ 235 $likes = $vortex_like_dislike['v_start_comment_like']; 236 } 237 238 if(isset($vortex_like_dislike['v_start_comment_dislike'])){ 239 $dislikes = $vortex_like_dislike['v_start_comment_dislike']; 240 } 241 add_comment_meta($comment_ID, 'vortex_system_likes', $likes, true); 242 add_comment_meta($comment_ID, 'vortex_system_dislikes', $dislikes, true); 243 } 244 245 //add custom fields when post is published 246 add_action( 'publish_post', 'post_published_notification' ); 247 function post_published_notification( $ID ) { 248 global $vortex_like_dislike; 249 $likes = 0; 250 $dislikes = 0; 251 252 if(isset($vortex_like_dislike['v_start_post_like'])){ 253 $likes = $vortex_like_dislike['v_start_post_like']; 254 } 255 256 if(isset($vortex_like_dislike['v_start_post_dislike'])){ 257 $dislikes = $vortex_like_dislike['v_start_post_dislike']; 258 } 259 add_post_meta($ID, 'vortex_system_likes', $likes, true); 260 add_post_meta($ID, 'vortex_system_dislikes', $dislikes, true); 261 } 262 } 263 } 95 } 264 96 } 265 97 -
rating-system/trunk/readme.txt
r1340008 r1472151 4 4 Tags: like, dislike, voting, rating, upvote, downvote, ajax, interactive, widget, comments, post, posts, page, widgets, jquery, custom post type, dashbord, bbpress 5 5 Requires at least: 4.1 6 Tested up to: 4. 4.17 Stable tag: 2.7. 56 Tested up to: 4.5.3 7 Stable tag: 2.7.6 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 12 12 13 13 == Description == 14 * ATTENTION!YOU NEED [REDUX FRAMEWORK](https://wordpress.org/plugins/redux-framework/)(FREE PLUGIN) INSTALLED AND ACTIVATED FOR THIS PLUGIN TO WORK.15 14 * Support for custom post type(WooCommerce etc). ✔ 16 15 * Support for bbPress. ✔ … … 27 26 * Shortcode [rating-system-posts](You must have turned on like or dislike for posts and pages and if you want you can disable display buttons on). ✔ 28 27 * Shortcode [rating-system-posts-disable-dislike](Displays only the like button, the above also applies here). ✔ 29 * Sort comments by likes. ✔30 28 * Check the screenshots tab we have a lot of cool features. 31 29 * If you finds bugs or need support go to the support tab. … … 108 106 > 109 107 == Changelog == 108 = 2.7.6 = 109 * Fixed ip and cookie tracking. 110 * Fixed custom text when voting. 111 * Removed ReduxFramework. 112 * Removed some options. 110 113 = 2.7.5 = 111 114 * Fixed comments rating errors.
Note: See TracChangeset
for help on using the changeset viewer.