/** * Triggers saving GD Star Rating data for post. * * @param int $post_id ID of the post saving */ function saveedit_post($post_id) { if (isset($_POST["post_ID"]) && $_POST["post_ID"] > 0) { $post_id = $_POST["post_ID"]; } if (isset($_POST['gdsr_post_edit']) && $_POST['gdsr_post_edit'] == "edit" || isset($_POST['gdsr_post_edit_mur']) && $_POST['gdsr_post_edit_mur'] == "edit") { if ($this->o["integrate_post_edit"] == 1 && isset($_POST["gdsrmultiactive"])) { $set_id = intval($_POST["gdsrmultiactive"]); if ($set_id > 0) { $mur = $_POST['gdsrmulti']; $mur = isset($mur[$post_id]) ? $mur[$post_id][$set_id] : $mur[0][$set_id]; $values = explode("X", $mur); $set = gd_get_multi_set($set_id); $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->o["mur_review_set"] = $_POST["gdsrmultiset"]; update_option('gd-star-rating', $this->o); } } $old = gdsrAdmDB::check_post_review($post_id); $review = $_POST['gdsr_review']; if ($_POST['gdsr_review_decimal'] != "-1") { $review .= "." . $_POST['gdsr_review_decimal']; } GDSRDatabase::save_review($post_id, $review, $old); $old = true; GDSRDatabase::save_article_rules($post_id, isset($_POST['gdsr_vote_articles']) ? $_POST['gdsr_vote_articles'] : "A", isset($_POST['gdsr_mod_articles']) ? $_POST['gdsr_mod_articles'] : "N", isset($_POST['gdsr_recc_vote_articles']) ? $_POST['gdsr_recc_vote_articles'] : "A", isset($_POST['gdsr_recc_mod_articles']) ? $_POST['gdsr_recc_mod_articles'] : "N"); if ($this->o["comments_active"] == 1) { GDSRDatabase::save_comment_rules($post_id, isset($_POST['gdsr_cmm_vote_articles']) ? $_POST['gdsr_cmm_vote_articles'] : "A", isset($_POST['gdsr_cmm_mod_articles']) ? $_POST['gdsr_cmm_mod_articles'] : "N", isset($_POST['gdsr_recc_cmm_vote_articles']) ? $_POST['gdsr_recc_cmm_vote_articles'] : "A", isset($_POST['gdsr_recc_cmm_mod_articles']) ? $_POST['gdsr_recc_cmm_mod_articles'] : "N"); } if (isset($_POST['gdsr_timer_type'])) { $timer = $_POST['gdsr_timer_type']; GDSRDatabase::save_timer_rules($post_id, $timer, GDSRHelper::timer_value($timer, isset($_POST['gdsr_timer_date_value']) ? $_POST['gdsr_timer_date_value'] : "", isset($_POST['gdsr_timer_countdown_value']) ? $_POST['gdsr_timer_countdown_value'] : "", isset($_POST['gdsr_timer_countdown_type']) ? $_POST['gdsr_timer_countdown_type'] : "")); } if (isset($_POST['gdsr_timer_type_recc'])) { $timer = $_POST['gdsr_timer_type_recc']; GDSRDatabase::save_timer_rules_thumbs($post_id, $timer, GDSRHelper::timer_value($timer, isset($_POST['gdsr_recc_timer_date_value']) ? $_POST['gdsr_recc_timer_date_value'] : "", isset($_POST['gdsr_recc_timer_countdown_value']) ? $_POST['gdsr_recc_timer_countdown_value'] : "", isset($_POST['gdsr_recc_timer_countdown_type']) ? $_POST['gdsr_recc_timer_countdown_type'] : "")); } } }
} if ($_POST["gdsr_delete_comments_recc"] != "") { GDSRDatabase::delete_votes($ids, $_POST["gdsr_delete_comments_recc"], $gdsr_items, true); } if ($_POST["gdsr_review_rating"] != "") { $review = $_POST["gdsr_review_rating"]; if ($_POST["gdsr_review_rating_decimal"] != "" && $_POST["gdsr_review_rating"] < $options["review_stars"]) { $review .= "." . $_POST["gdsr_review_rating_decimal"]; } gdsrAdmDB::update_reviews($ids, $review, $gdsr_items); } if ($_POST["gdsr_timer_type"] != "") { gdsrAdmDB::update_restrictions($ids, $_POST["gdsr_timer_type"], GDSRHelper::timer_value($_POST["gdsr_timer_type"], $_POST["gdsr_timer_date_value"], $_POST["gdsr_timer_countdown_value"], $_POST["gdsr_timer_countdown_type"])); } if ($_POST["gdsr_timer_type_recc"] != "") { gdsrAdmDB::update_restrictions_thumbs($ids, $_POST["gdsr_timer_type_recc"], GDSRHelper::timer_value($_POST["gdsr_timer_type_recc"], $_POST["gdsr_timer_date_value_recc"], $_POST["gdsr_timer_countdown_value_recc"], $_POST["gdsr_timer_countdown_type_recc"])); } gdsrAdmDB::update_settings($ids, $_POST["gdsr_article_moderation"], $_POST["gdsr_article_voterules"], $_POST["gdsr_comments_moderation"], $_POST["gdsr_comments_voterules"], $_POST["gdsr_article_moderation_recc"], $_POST["gdsr_article_voterules_recc"], $_POST["gdsr_comments_moderation_recc"], $_POST["gdsr_comments_voterules_recc"], $gdsr_items); gdsrAdmDB::upgrade_integration($ids, $_POST["gdsr_integration_active_std"], $_POST["gdsr_integration_active_mur"], $_POST["gdsr_integration_mur"]); } } if ($filter_cats != '' || $filter_cats != '0') { $url .= "&cat=" . $filter_cats; } if ($filter_date != '' || $filter_date != '0') { $url .= "&date=" . $filter_date; } if ($search != '') { $url .= "&s=" . $search; } if ($select != '') {
if ($_POST["gdsr_delete_articles"] != '') { GDSRDatabase::delete_votes($ids, $_POST["gdsr_delete_articles"], $gdsr_items); } if ($_POST["gdsr_delete_comments"] != '') { GDSRDatabase::delete_votes($ids, $_POST["gdsr_delete_comments"], $gdsr_items); } if ($_POST["gdsr_review_rating"] != "") { $review = $_POST["gdsr_review_rating"]; if ($_POST["gdsr_review_rating_decimal"] != "" && $_POST["gdsr_review_rating"] < $options["review_stars"]) { $review .= "." . $_POST["gdsr_review_rating_decimal"]; } GDSRDatabase::update_reviews($ids, $review, $gdsr_items); } GDSRDatabase::update_settings($ids, $_POST["gdsr_article_moderation"], $_POST["gdsr_article_voterules"], $_POST["gdsr_comments_moderation"], $_POST["gdsr_comments_voterules"], $gdsr_items); if ($_POST["gdsr_timer_type"] != "") { GDSRDatabase::update_restrictions($ids, $_POST["gdsr_timer_type"], GDSRHelper::timer_value($_POST["gdsr_timer_type"], $_POST['gdsr_timer_date_value'], $_POST['gdsr_timer_countdown_value'], $_POST['gdsr_timer_countdown_type'])); } } } if ($filter_cats != '' || $filter_cats != '0') { $url .= "&cat=" . $filter_cats; } if ($filter_date != '' || $filter_date != '0') { $url .= "&date=" . $filter_date; } if ($search != '') { $url .= "&s=" . $search; } if ($select != '') { $url .= "&select=" . $select; }