gdsrAdmDB::get_combo_categories($filter_cats); ?> <input class="button-secondary delete" type="submit" name="gdsr_filter" value="<?php _e("Filter", "gd-star-rating"); ?> " /> </div> <div class="tablenav-pages"> <?php echo $pager; ?> </div> </div> <br class="clear"/> <?php $sql = gdsrAdmDBMulti::get_stats($set_id, $select, ($page_id - 1) * $posts_per_page, $posts_per_page, $filter_date, $filter_cats, $search); $rows = $wpdb->get_results($sql, OBJECT); ?> <table class="widefat"> <thead> <tr> <th class="check-column" scope="col"><input type="checkbox" onclick="checkAll(document.getElementById('gdsr-articles'));"/></th> <th scope="col"><?php _e("Title", "gd-star-rating"); ?> </th> <th scope="col" style="width: 36px; text-align: center;"><?php _e("View", "gd-star-rating"); ?> </th>
function init_operations() { $msg = ""; if (isset($_POST["gdsr_multi_review_form"]) && $_POST["gdsr_multi_review_form"] == "review") { $mur_all = $_POST['gdsrmulti']; foreach ($mur_all as $post_id => $data) { if ($post_id > 0) { foreach ($data as $set_id => $mur) { $set = gd_get_multi_set($set_id); $values = explode("X", $mur); $record_id = GDSRDBMulti::get_vote($post_id, $set_id, count($set->object)); GDSRDBMulti::save_review($record_id, $values); GDSRDBMulti::recalculate_multi_review($record_id, $values, $set); } } } $this->custom_actions('init_save_review'); wp_redirect_self(); exit; } if (isset($_POST["gdsr_editcss_rating"])) { $rating_css = STARRATING_XTRA_PATH . "css/rating.css"; if (is_writeable($rating_css)) { $newcontent = stripslashes($_POST['gdsr_editcss_contents']); $f = fopen($rating_css, 'w+'); fwrite($f, $newcontent); fclose($f); } wp_redirect_self(); exit; } if (isset($_POST['gdsr_debug_clean'])) { wp_gdsr_debug_clean(); wp_redirect_self(); exit; } if (isset($_POST['gdsr_cache_clean'])) { GDSRHelper::clean_cache(substr(STARRATING_CACHE_PATH, 0, strlen(STARRATING_CACHE_PATH) - 1)); $this->o["cache_cleanup_last"] = date("r"); update_option('gd-star-rating', $this->o); wp_redirect_self(); exit; } if (isset($_POST['gdsr_preview_scan'])) { $this->g = gdsrAdmFunc::gfx_scan(); update_option('gd-star-rating-gfx', $this->g); wp_redirect_self(); exit; } if (isset($_POST['gdsr_t2_import'])) { gdsrAdmDB::insert_extras_templates(STARRATING_XTRA_PATH, false); wp_redirect_self(); exit; } if (isset($_POST['gdsr_reset_db_tool'])) { gdsrAdmDB::reset_db_tool(); gdsrAdmDBMulti::reset_db_tool(); wp_redirect_self(); exit; } if (isset($_POST['gdsr_upgrade_tool'])) { require_once STARRATING_PATH . "/gdragon/gd_db_install.php"; gdDBInstallGDSR::delete_tables(STARRATING_PATH); gdDBInstallGDSR::create_tables(STARRATING_PATH); gdDBInstallGDSR::upgrade_tables(STARRATING_PATH); gdDBInstallGDSR::alter_tables(STARRATING_PATH); gdDBInstallGDSR::alter_tables(STARRATING_PATH, "idx.txt"); $this->o["database_upgrade"] = date("r"); update_option('gd-star-rating', $this->o); wp_redirect_self(); exit; } if (isset($_POST['gdsr_updatemultilog_tool'])) { GDSRDBMulti::recalculate_multi_rating_log(); wp_redirect_self(); exit; } if (isset($_POST['gdsr_mulitrecalc_tool'])) { $set_id = $_POST['gdsr_mulitrecalc_set']; if ($set_id > 0) { GDSRDBMulti::recalculate_set($set_id); } else { GDSRDBMulti::recalculate_all_sets(); } wp_redirect_self(); exit; } if (isset($_POST['gdsr_cleanup_tool'])) { if (isset($_POST['gdsr_tools_clean_invalid_log'])) { $count = gdsrTlsDB::clean_invalid_log_articles(); if ($count > 0) { $msg .= $count . " " . __("articles records from log table removed.", "gd-star-rating") . " "; } $count = gdsrTlsDB::clean_invalid_log_comments(); if ($count > 0) { $msg .= $count . " " . __("comments records from log table removed.", "gd-star-rating") . " "; } } if (isset($_POST['gdsr_tools_clean_invalid_trend'])) { $count = gdsrTlsDB::clean_invalid_trend_articles(); if ($count > 0) { $msg .= $count . " " . __("articles records from trends log table removed.", "gd-star-rating") . " "; } $count = gdsrTlsDB::clean_invalid_trend_comments(); if ($count > 0) { $msg .= $count . " " . __("comments records from trends log table removed.", "gd-star-rating") . " "; } } if (isset($_POST['gdsr_tools_clean_old_posts'])) { $count = gdsrTlsDB::clean_dead_articles(); if ($count > 0) { $msg .= $count . " " . __("dead articles records from articles table.", "gd-star-rating") . " "; } $count = gdsrTlsDB::clean_revision_articles(); if ($count > 0) { $msg .= $count . " " . __("post revisions records from articles table.", "gd-star-rating") . " "; } $count = gdsrTlsDB::clean_dead_comments(); if ($count > 0) { $msg .= $count . " " . __("dead comments records from comments table.", "gd-star-rating") . " "; } } if (isset($_POST['gdsr_tools_clean_old_posts'])) { $count = GDSRDBMulti::clean_dead_articles(); if ($count > 0) { $msg .= $count . " " . __("dead articles records from multi ratings tables.", "gd-star-rating") . " "; } $count = GDSRDBMulti::clean_revision_articles(); if ($count > 0) { $msg .= $count . " " . __("post revisions records from multi ratings tables.", "gd-star-rating") . " "; } } $this->o["database_cleanup"] = date("r"); $this->o["database_cleanup_msg"] = $msg; update_option('gd-star-rating', $this->o); wp_redirect_self(); exit; } if (isset($_POST['gdsr_post_lock'])) { $lock_date = $_POST['gdsr_lock_date']; gdsrAdmDB::lock_post_massive($lock_date); $this->o["mass_lock"] = $lock_date; update_option('gd-star-rating', $this->o); wp_redirect_self(); exit; } if (isset($_POST['gdsr_rules_set'])) { gdsrAdmDB::update_settings_full($_POST["gdsr_article_moderation"], $_POST["gdsr_article_voterules"], $_POST["gdsr_comments_moderation"], $_POST["gdsr_comments_voterules"], $_POST["gdsr_artthumb_moderation"], $_POST["gdsr_artthumb_voterules"], $_POST["gdsr_cmmthumbs_moderation"], $_POST["gdsr_cmmthumbs_voterules"]); wp_redirect_self(); exit; } }