Exemplo n.º 1
0
 function update_reviews($ids, $review, $ids_array)
 {
     global $wpdb, $table_prefix;
     GDSRDatabase::add_defaults($ids, $ids_array);
     $dbt_data_article = $table_prefix . 'gdsr_data_article';
     $wpdb->query(sprintf("update %s set review = %s where post_id in %s", $dbt_data_article, $review, $ids));
 }
Exemplo n.º 2
0
 function update_settings($ids, $upd_am, $upd_ar, $upd_cm, $upd_cr, $upd_am_rcc, $upd_ar_rcc, $upd_cm_rcc, $upd_cr_rcc, $ids_array)
 {
     global $wpdb, $table_prefix;
     GDSRDatabase::add_defaults($ids, $ids_array);
     $dbt_data_article = $table_prefix . 'gdsr_data_article';
     $update = array();
     if ($upd_am != '') {
         $update[] = "moderate_articles = '" . $upd_am . "'";
     }
     if ($upd_cm != '') {
         $update[] = "moderate_comments = '" . $upd_cm . "'";
     }
     if ($upd_ar != '') {
         $update[] = "rules_articles = '" . $upd_ar . "'";
     }
     if ($upd_cr != '') {
         $update[] = "rules_comments = '" . $upd_cr . "'";
     }
     if ($upd_am_rcc != '') {
         $update[] = "recc_moderate_articles = '" . $upd_am_rcc . "'";
     }
     if ($upd_cm_rcc != '') {
         $update[] = "recc_moderate_comments = '" . $upd_cm_rcc . "'";
     }
     if ($upd_ar_rcc != '') {
         $update[] = "recc_rules_articles = '" . $upd_ar_rcc . "'";
     }
     if ($upd_cr_rcc != '') {
         $update[] = "recc_rules_comments = '" . $upd_cr_rcc . "'";
     }
     if (count($update) > 0) {
         $updstring = join(", ", $update);
         $wpdb->query(sprintf("update %s set %s where post_id in %s", $dbt_data_article, $updstring, $ids));
     }
 }