Example #1
0
    /**
     * Close expired listings
     */
    public static function UpdateStatus()
    {
        $sql = 'UPDATE ' . TABLE_LISTINGS . '
				SET is_published = 0 
				WHERE is_published = 1 AND
				      finish_publishing != \'0000-00-00 00:00:00\' AND 
					  finish_publishing < \'' . date('Y-m-d H:i:s') . '\'';
        $result = database_void_query($sql, false, false);
        if ($result) {
            Categories::RecalculateListingsCount();
        }
        return $result;
    }
Example #2
0
                     } else {
                         $msg = draw_important_message($objCategories->error, false);
                     }
                     $mode = 'view';
                 } else {
                     if ($action == 'details') {
                         $mode = 'details';
                     } else {
                         if ($action == 'cancel_add') {
                             $mode = 'view';
                         } else {
                             if ($action == 'cancel_edit') {
                                 $mode = 'view';
                             } else {
                                 if ($action == 'recalculate') {
                                     if (Categories::RecalculateListingsCount()) {
                                         $msg = draw_success_message(_UPDATING_OPERATION_COMPLETED, false);
                                     } else {
                                         $msg = draw_important_message(Categories::GetStaticError(), false);
                                     }
                                     $mode = 'view';
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
 draw_title_bar(prepare_breadcrumbs(array(_LISTINGS_MANAGEMENT => '', _LISTINGS => '', _CATEGORIES_MANAGEMENT => '', $category_info['third']['name'] => '', $category_info['second']['name'] => '', $category_info['first']['name'] => '', ucfirst($action) => '')), $cid != '0' ? prepare_permanent_link('index.php?admin=mod_categories&cid=' . $category_info_parent_id, _BUTTON_BACK) : '');