Beispiel #1
0
    $timezone = 'Europe/Madrid';
    if (ini_get('date.timezone') != '') {
        $timezone = ini_get('date.timezone');
    }
    if (date_default_timezone_get() != '') {
        $timezone = date_default_timezone_get();
    }
    $conn->osc_dbExec(sprintf("INSERT INTO %st_preference VALUES ('osclass', 'timezone', '%s', 'STRING')", DB_TABLE_PREFIX, $timezone));
    // alert table pages order improvement
    $conn->osc_dbExec(sprintf("ALTER TABLE %st_pages ADD COLUMN i_order INT(3) NOT NULL DEFAULT 0  AFTER dt_mod_date ;", DB_TABLE_PREFIX));
    // order pages
    $aPages = $conn->osc_dbFetchResults("SELECT pk_i_id FROM %st_pages WHERE b_indelible = 0", DB_TABLE_PREFIX);
    foreach ($aPages as $key => $page) {
        $conn->osc_dbExec(sprintf("UPDATE %st_pages SET i_order = %d WHERE pk_i_id = %d ;", DB_TABLE_PREFIX, $key, $page['pk_i_id']));
    }
    $conn->osc_dbExec(sprintf("INSERT INTO %st_pages (s_internal_name, b_indelible, dt_pub_date) VALUES ('email_item_validation_non_register_user', 1, '%s' )", DB_TABLE_PREFIX, date('Y-m-d H:i:s')));
    $conn->osc_dbExec(sprintf("INSERT INTO %st_pages_description (fk_i_pages_id, fk_c_locale_code, s_title, s_text) VALUES (%d, 'en_US', '{WEB_TITLE} - Validate your ad', '<p>Hi {USER_NAME},</p>\n<p>You\\'re receiving this e-mail because an ad has been published at {WEB_TITLE}. Please validate this item by clicking on the link at the end of this e-mail. If you didn\\'t publish this ad, please ignore this e-mail.</p>\n<p>Ad details:</p>\n<p>Contact name: {USER_NAME}<br />Contact e-mail: {USER_EMAIL}</p>\n<p>{ITEM_DESCRIPTION_ALL_LANGUAGES}</p>\n<p>Price: {ITEM_PRICE}<br />Country: {ITEM_COUNTRY}<br />Region: {ITEM_REGION}<br />City: {ITEM_CITY}<br />Url: {ITEM_URL}<br /><br />Validate your ad: {VALIDATION_LINK}</p>\n\n<p>You\\'re not registered at {WEB_TITLE}, but you can still edit or delete the item {ITEM_TITLE} for a short period of time.</p>\n<p>You can edit your item by following this link: {EDIT_LINK}</p>\n<p>You can delete your item by following this link: {DELETE_LINK}</p>\n\n<p>If you register as a user to post items, you will have full access to editing options.</p>\n<p>Regards,</p>\n{WEB_TITLE}</div>')", DB_TABLE_PREFIX, $conn->get_last_id()));
    $conn->osc_dbExec(sprintf("UPDATE %st_locale SET s_currency_format = '{NUMBER} {CURRENCY}'", DB_TABLE_PREFIX));
    $items = $conn->osc_dbFetchResults("SELECT pk_i_id, f_price FROM %st_item", DB_TABLE_PREFIX);
    foreach ($items as $item) {
        $conn->osc_dbExec("UPDATE %st_item SET s_price = '%s' WHERE pk_i_id = %d", DB_TABLE_PREFIX, 1000000 * $item['f_price'], $item['pk_i_id']);
    }
    //$conn->osc_dbExec("ALTER TABLE `%st_item` DROP `f_price`", DB_TABLE_PREFIX);
    //$conn->osc_dbExec("ALTER TABLE `%st_item` CHANGE `s_price` `f_price` VARCHAR( 100 ) NULL DEFAULT 0", DB_TABLE_PREFIX);
    osc_changeVersionTo(230);
}
if (Params::getParam('action') == '') {
    $title = 'OSClass &raquo; Updated correctly';
    $message = 'OSClass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>';
    osc_die($title, $message);
}
Beispiel #2
0
        } else {
            $mAlerts->update(array('s_search' => $s_search), array('pk_i_id' => $alert['pk_i_id']));
        }
    }
    unset($aAlerts);
}
if (osc_version() < 350) {
    osc_set_preference('marketURL', 'http://market.osclass.org/api/v2/');
    osc_set_preference('marketAPIConnect', '');
    osc_set_preference('marketCategories', '');
    osc_set_preference('marketDataUpdate', 0);
}
if (osc_version() < 352) {
    osc_set_preference('marketURL', 'http://market.osclass.org/api/v2/');
}
osc_changeVersionTo(360);
if (!defined('IS_AJAX') || !IS_AJAX) {
    if (empty($aMessages)) {
        osc_add_flash_ok_message(_m('Osclass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>'), 'admin');
        echo '<script type="text/javascript"> window.location = "' . osc_admin_base_url(true) . '?page=tools&action=version"; </script>';
    } else {
        echo '<div class="well ui-rounded-corners separate-top-medium">';
        echo '<p>' . __('Osclass &raquo; Updated correctly') . '</p>';
        echo '<p>' . __('Osclass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>') . '</p>';
        foreach ($aMessages as $msg) {
            echo "<p>" . $msg . "</p>";
        }
        echo "</div>";
    }
}
/**
Beispiel #3
0
        } else {
            $mAlerts->update(array('s_search' => $s_search), array('pk_i_id' => $alert['pk_i_id']));
        }
    }
    unset($aAlerts);
}
if (osc_version() < 350) {
    osc_set_preference('marketURL', 'http://market.osclass.org/api/v2/');
    osc_set_preference('marketAPIConnect', '');
    osc_set_preference('marketCategories', '');
    osc_set_preference('marketDataUpdate', 0);
}
if (osc_version() < 352) {
    osc_set_preference('marketURL', 'http://market.osclass.org/api/v2/');
}
osc_changeVersionTo(359);
if (!defined('IS_AJAX') || !IS_AJAX) {
    if (empty($aMessages)) {
        osc_add_flash_ok_message(_m('Osclass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>'), 'admin');
        echo '<script type="text/javascript"> window.location = "' . osc_admin_base_url(true) . '?page=tools&action=version"; </script>';
    } else {
        echo '<div class="well ui-rounded-corners separate-top-medium">';
        echo '<p>' . __('Osclass &raquo; Updated correctly') . '</p>';
        echo '<p>' . __('Osclass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>') . '</p>';
        foreach ($aMessages as $msg) {
            echo "<p>" . $msg . "</p>";
        }
        echo "</div>";
    }
}
/**
        }
        unset($aAlerts);

        $aAlerts = $mAlerts->findByType('WEEKLY');
        foreach($aAlerts as $alert) {
            $s_search = base64_decode($alert['s_search']);
            if(stripos(strtolower($s_search), 'union select')!==false || stripos(strtolower($s_search), 't_admin')!==false) {
                $mAlerts->delete(array('pk_i_id' => $alert['pk_i_id']));
            } else {
                $mAlerts->update(array('s_search' => $s_search), array('pk_i_id' => $alert['pk_i_id']));
            }
        }
        unset($aAlerts);
    }

    osc_changeVersionTo(343);

    if(!defined('IS_AJAX') || !IS_AJAX) {
        if(empty($aMessages)) {
            osc_add_flash_ok_message(_m('Osclass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>'), 'admin');
            echo '<script type="text/javascript"> window.location = "'.osc_admin_base_url(true).'?page=tools&action=version"; </script>';
        } else {
            echo '<div class="well ui-rounded-corners separate-top-medium">';
            echo '<p>'.__('Osclass &raquo; Updated correctly').'</p>';
            echo '<p>'.__('Osclass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>').'</p>';
            foreach($aMessages as $msg) {
                echo "<p>".$msg."</p>";
            }
            echo "</div>";
        }
    }
Beispiel #5
0
        } else {
            $mAlerts->update(array('s_search' => $s_search), array('pk_i_id' => $alert['pk_i_id']));
        }
    }
    unset($aAlerts);
}
if (osc_version() < 350) {
    osc_set_preference('marketURL', 'http://market.osclass.org/api/v2/');
    osc_set_preference('marketAPIConnect', '');
    osc_set_preference('marketCategories', '');
    osc_set_preference('marketDataUpdate', 0);
}
if (osc_version() < 352) {
    osc_set_preference('marketURL', 'http://market.osclass.org/api/v2/');
}
osc_changeVersionTo(357);
if (!defined('IS_AJAX') || !IS_AJAX) {
    if (empty($aMessages)) {
        osc_add_flash_ok_message(_m('Osclass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>'), 'admin');
        echo '<script type="text/javascript"> window.location = "' . osc_admin_base_url(true) . '?page=tools&action=version"; </script>';
    } else {
        echo '<div class="well ui-rounded-corners separate-top-medium">';
        echo '<p>' . __('Osclass &raquo; Updated correctly') . '</p>';
        echo '<p>' . __('Osclass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>') . '</p>';
        foreach ($aMessages as $msg) {
            echo "<p>" . $msg . "</p>";
        }
        echo "</div>";
    }
}
/**
Beispiel #6
0
        } else {
            $mAlerts->update(array('s_search' => $s_search), array('pk_i_id' => $alert['pk_i_id']));
        }
    }
    unset($aAlerts);
}
if (osc_version() < 350) {
    osc_set_preference('marketURL', 'http://market.osclass.org/api/v2/');
    osc_set_preference('marketAPIConnect', '');
    osc_set_preference('marketCategories', '');
    osc_set_preference('marketDataUpdate', 0);
}
if (osc_version() < 352) {
    osc_set_preference('marketURL', 'http://market.osclass.org/api/v2/');
}
osc_changeVersionTo(356);
if (!defined('IS_AJAX') || !IS_AJAX) {
    if (empty($aMessages)) {
        osc_add_flash_ok_message(_m('Osclass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>'), 'admin');
        echo '<script type="text/javascript"> window.location = "' . osc_admin_base_url(true) . '?page=tools&action=version"; </script>';
    } else {
        echo '<div class="well ui-rounded-corners separate-top-medium">';
        echo '<p>' . __('Osclass &raquo; Updated correctly') . '</p>';
        echo '<p>' . __('Osclass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>') . '</p>';
        foreach ($aMessages as $msg) {
            echo "<p>" . $msg . "</p>";
        }
        echo "</div>";
    }
}
/**
    $comm->query("ALTER TABLE " . DB_TABLE_PREFIX . "t_region ADD FOREIGN KEY (fk_c_country_code) REFERENCES " . DB_TABLE_PREFIX . "t_country (pk_c_code)");
    $comm->query("ALTER TABLE " . DB_TABLE_PREFIX . "t_country_stats ADD FOREIGN KEY (fk_c_country_code) REFERENCES " . DB_TABLE_PREFIX . "t_country (pk_c_code)");
    $comm->query("ALTER TABLE " . DB_TABLE_PREFIX . "t_item_location ADD FOREIGN KEY (fk_c_country_code) REFERENCES " . DB_TABLE_PREFIX . "t_country (pk_c_code)");
    $comm->query("ALTER TABLE " . DB_TABLE_PREFIX . "t_user ADD FOREIGN KEY (fk_c_country_code) REFERENCES " . DB_TABLE_PREFIX . "t_country (pk_c_code)");
    // hack
    $comm->query("SET FOREIGN_KEY_CHECKS = 1");
}
if (osc_version() < 241) {
    $comm->query(sprintf("INSERT INTO %st_preference VALUES ('osclass', 'use_imagick', '0', 'BOOLEAN')", DB_TABLE_PREFIX));
}
if (osc_version() < 300) {
    $comm->query(sprintf("ALTER TABLE %st_user DROP s_pass_answer", DB_TABLE_PREFIX));
    $comm->query(sprintf("ALTER TABLE %st_user DROP s_pass_question", DB_TABLE_PREFIX));
    osc_set_preference('marketURL', 'http://market.osclass.org/api/');
}
osc_changeVersionTo(301);
echo '<div class="well ui-rounded-corners separate-top-medium">';
echo '<p>' . __('OSClass &raquo; Updated correctly') . '</p>';
echo '<p>' . __('OSClass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>') . '</p>';
foreach ($aMessages as $msg) {
    echo "<p>" . $msg . "</p>";
}
echo "</div>";
/**
 * Convert alerts < 2.4, updating s_search with json encoded to based64.
 *
 * @param string $alert base64+serialized
 */
function convertAlert($alert)
{
    // decode search model
Beispiel #8
0
 * of the GNU Affero General Public License as published by the Free Software Foundation,
 * either version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public
 * License along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
if (!defined('ABS_PATH')) {
    define('ABS_PATH', dirname(dirname(dirname(__FILE__))) . '/');
}
require_once ABS_PATH . 'oc-load.php';
// UPDATE DATABASE
if (!defined('AUTO_UPGRADE')) {
    if (file_exists(osc_lib_path() . 'osclass/installer/struct.sql')) {
        $sql = file_get_contents(osc_lib_path() . 'osclass/installer/struct.sql');
        $conn = getConnection();
        $conn->osc_updateDB(str_replace('/*TABLE_PREFIX*/', DB_TABLE_PREFIX, $sql));
    }
}
$version = osc_version();
Preference::newInstance()->update(array('s_value' => time()), array('s_section' => 'osclass', 's_name' => 'last_version_check'));
osc_changeVersionTo(203);
if (Params::getParam('action') == '') {
    require_once LIB_PATH . 'osclass/helpers/hErrors.php';
    $title = 'OSClass &raquo; Updated correctly';
    $message = 'OSClass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>';
    osc_die($title, $message);
}
Beispiel #9
0
    $comm->query("ALTER TABLE " . DB_TABLE_PREFIX . "t_region ADD FOREIGN KEY (fk_c_country_code) REFERENCES " . DB_TABLE_PREFIX . "t_country (pk_c_code)");
    $comm->query("ALTER TABLE " . DB_TABLE_PREFIX . "t_country_stats ADD FOREIGN KEY (fk_c_country_code) REFERENCES " . DB_TABLE_PREFIX . "t_country (pk_c_code)");
    $comm->query("ALTER TABLE " . DB_TABLE_PREFIX . "t_item_location ADD FOREIGN KEY (fk_c_country_code) REFERENCES " . DB_TABLE_PREFIX . "t_country (pk_c_code)");
    $comm->query("ALTER TABLE " . DB_TABLE_PREFIX . "t_user ADD FOREIGN KEY (fk_c_country_code) REFERENCES " . DB_TABLE_PREFIX . "t_country (pk_c_code)");
    // hack
    $comm->query("SET FOREIGN_KEY_CHECKS = 1");
}
if (osc_version() < 241) {
    $comm->query(sprintf("INSERT INTO %st_preference VALUES ('osclass', 'use_imagick', '0', 'BOOLEAN')", DB_TABLE_PREFIX));
}
if (osc_version() < 300) {
    $comm->query(sprintf("ALTER TABLE %st_user DROP s_pass_answer", DB_TABLE_PREFIX));
    $comm->query(sprintf("ALTER TABLE %st_user DROP s_pass_question", DB_TABLE_PREFIX));
    osc_set_preference('marketURL', 'http://market.osclass.org/api/');
}
osc_changeVersionTo(302);
echo '<div class="well ui-rounded-corners separate-top-medium">';
echo '<p>' . __('OSClass &raquo; Updated correctly') . '</p>';
echo '<p>' . __('OSClass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>') . '</p>';
foreach ($aMessages as $msg) {
    echo "<p>" . $msg . "</p>";
}
echo "</div>";
/**
 * Convert alerts < 2.4, updating s_search with json encoded to based64.
 *
 * @param string $alert base64+serialized
 */
function convertAlert($alert)
{
    // decode search model
Beispiel #10
0
    @unlink(osc_base_path() . 'main.php');
    @unlink(osc_base_path() . 'page.php');
    @unlink(osc_base_path() . 'register.php');
    @unlink(osc_base_path() . 'search.php');
    @unlink(osc_base_path() . 'user-non-secure.php');
    @unlink(osc_base_path() . 'user.php');
    @unlink(osc_base_path() . 'readme.php');
    @unlink(osc_lib_path() . 'osclass/plugins.php');
    @unlink(osc_lib_path() . 'osclass/feeds.php');
    $comm->query(sprintf('UPDATE %st_user t, (SELECT pk_i_id FROM %st_user) t1 SET t.s_username = t1.pk_i_id WHERE t.pk_i_id = t1.pk_i_id', DB_TABLE_PREFIX, DB_TABLE_PREFIX));
    osc_set_preference('username_blacklist', 'admin,user', 'osclass', 'STRING');
    osc_set_preference('rewrite_user_change_username', 'username/change');
    osc_set_preference('csrf_name', 'CSRF' . mt_rand(0, mt_getrandmax()));
    @mkdir(CONTENT_PATH . 'uploads/page-images');
}
osc_changeVersionTo(312);
echo '<div class="well ui-rounded-corners separate-top-medium">';
echo '<p>' . __('Osclass &raquo; Updated correctly') . '</p>';
echo '<p>' . __('Osclass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>') . '</p>';
foreach ($aMessages as $msg) {
    echo "<p>" . $msg . "</p>";
}
echo "</div>";
/**
 * Convert alerts < 2.4, updating s_search with json encoded to based64.
 *
 * @param string $alert base64+serialized
 */
function convertAlert($alert)
{
    // decode search model
Beispiel #11
0
    foreach ($rs[0] as $r) {
        if (preg_match_all('|CONSTRAINT `([^`]+)` FOREIGN KEY \\(`fk_c_country_code`\\) REFERENCES `' . DB_TABLE_PREFIX . 't_country` \\(`pk_c_code`\\)|', $r, $matches)) {
            foreach ($matches[1] as $m) {
                $comm->query("ALTER TABLE  `" . DB_TABLE_PREFIX . "t_user` DROP FOREIGN KEY  `" . $m . "`");
            }
        }
    }
    $comm->query("DROP TABLE " . DB_TABLE_PREFIX . "t_country");
    $comm->query("RENAME TABLE  `" . DB_TABLE_PREFIX . "t_country_aux` TO  `" . DB_TABLE_PREFIX . "t_country`");
    $comm->query("ALTER TABLE " . DB_TABLE_PREFIX . "t_city ADD FOREIGN KEY (fk_c_country_code) REFERENCES " . DB_TABLE_PREFIX . "t_country (pk_c_code)");
    $comm->query("ALTER TABLE " . DB_TABLE_PREFIX . "t_region ADD FOREIGN KEY (fk_c_country_code) REFERENCES " . DB_TABLE_PREFIX . "t_country (pk_c_code)");
    $comm->query("ALTER TABLE " . DB_TABLE_PREFIX . "t_country_stats ADD FOREIGN KEY (fk_c_country_code) REFERENCES " . DB_TABLE_PREFIX . "t_country (pk_c_code)");
    $comm->query("ALTER TABLE " . DB_TABLE_PREFIX . "t_item_location ADD FOREIGN KEY (fk_c_country_code) REFERENCES " . DB_TABLE_PREFIX . "t_country (pk_c_code)");
    $comm->query("ALTER TABLE " . DB_TABLE_PREFIX . "t_user ADD FOREIGN KEY (fk_c_country_code) REFERENCES " . DB_TABLE_PREFIX . "t_country (pk_c_code)");
}
osc_changeVersionTo(240);
echo '<div style="border: 1px solid rgb(204, 204, 204); background: none repeat scroll 0% 0% rgb(238, 238, 238);"> <div style="padding: 20px;">';
echo '<p>' . __('OSClass &raquo; Updated correctly') . '</p>';
echo '<p>' . __('OSClass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>') . '</p>';
foreach ($aMessages as $msg) {
    echo "<p>" . $msg . "</p>";
}
echo "</div></div>";
/**
 * Convert alerts < 2.4, updating s_search with json encoded to based64.
 *
 * @param string $alert base64+serialized
 */
function convertAlert($alert)
{
    // decode search model
Beispiel #12
0
        $comm->query(sprintf("UPDATE %st_pages SET i_order = %d WHERE pk_i_id = %d ;", DB_TABLE_PREFIX, $key, $page['pk_i_id']));
    }
    $comm->query(sprintf("INSERT INTO %st_pages (s_internal_name, b_indelible, dt_pub_date) VALUES ('email_item_validation_non_register_user', 1, '%s' )", DB_TABLE_PREFIX, date('Y-m-d H:i:s')));
    $comm->query(sprintf("INSERT INTO %st_pages_description (fk_i_pages_id, fk_c_locale_code, s_title, s_text) VALUES (%d, 'en_US', '{WEB_TITLE} - Validate your ad', '<p>Hi {USER_NAME},</p>\n<p>You\\'re receiving this e-mail because an ad has been published at {WEB_TITLE}. Please validate this item by clicking on the link at the end of this e-mail. If you didn\\'t publish this ad, please ignore this e-mail.</p>\n<p>Ad details:</p>\n<p>Contact name: {USER_NAME}<br />Contact e-mail: {USER_EMAIL}</p>\n<p>{ITEM_DESCRIPTION_ALL_LANGUAGES}</p>\n<p>Price: {ITEM_PRICE}<br />Country: {ITEM_COUNTRY}<br />Region: {ITEM_REGION}<br />City: {ITEM_CITY}<br />Url: {ITEM_URL}<br /><br />Validate your ad: {VALIDATION_LINK}</p>\n\n<p>You\\'re not registered at {WEB_TITLE}, but you can still edit or delete the item {ITEM_TITLE} for a short period of time.</p>\n<p>You can edit your item by following this link: {EDIT_LINK}</p>\n<p>You can delete your item by following this link: {DELETE_LINK}</p>\n\n<p>If you register as a user to post items, you will have full access to editing options.</p>\n<p>Regards,</p>\n{WEB_TITLE}</div>')", DB_TABLE_PREFIX, $comm->insertedId()));
    $comm->query(sprintf("INSERT INTO %st_pages (s_internal_name, b_indelible, dt_pub_date) VALUES ('email_admin_new_user', 1, '%s' )", DB_TABLE_PREFIX, date('Y-m-d H:i:s')));
    $comm->query(sprintf("INSERT INTO %st_pages_description (fk_i_pages_id, fk_c_locale_code, s_title, s_text) VALUES (%d, 'en_US', '{WEB_TITLE} - New user', '<div><p>Dear {WEB_TITLE} admin,</p>\n<p>You\\'re receiving this email because a new user has been created at {WEB_TITLE}.</p>\n<p>User details:</p>\n<p>Name: {USER_NAME}<br />E-mail: {USER_EMAIL}</p>\n<p>Regards,</p>\n<p>{WEB_TITLE}</p></div>')", DB_TABLE_PREFIX, $comm->insertedId()));
    $comm->query(sprintf("INSERT INTO %st_pages (s_internal_name, b_indelible, dt_pub_date) VALUES ('email_contact_user', 1, '%s' )", DB_TABLE_PREFIX, date('Y-m-d H:i:s')));
    $comm->query(sprintf("INSERT INTO %st_pages_description (fk_i_pages_id, fk_c_locale_code, s_title, s_text) VALUES (%d, 'en_US', '{WEB_TITLE} - Someone has a question for you', '<p>Hi {CONTACT_NAME}!</p>\n<p>{USER_NAME} ({USER_EMAIL}, {USER_PHONE}) left you a message:</p>\n<p>{COMMENT}</p>\n<p>Regards,</p>\n<p>{WEB_TITLE}</p>')", DB_TABLE_PREFIX, $comm->insertedId()));
    $comm->query(sprintf("INSERT INTO %st_pages (s_internal_name, b_indelible, dt_pub_date) VALUES ('email_new_comment_user', 1, '%s' )", DB_TABLE_PREFIX, date('Y-m-d H:i:s')));
    $comm->query(sprintf("INSERT INTO %st_pages_description (fk_i_pages_id, fk_c_locale_code, s_title, s_text) VALUES (%d, 'en_US', '{WEB_TITLE} - New comment on the ad with id {ITEM_ID}', '<p>There\\'s a new comment on the ad with id {ITEM_ID} <br />URL: {ITEM_URL}</p>\n<p>Title: {COMMENT_TITLE}<br />Comment: {COMMENT_TEXT}<br />Author: {COMMENT_AUTHOR}<br />Author\\'s email: {COMMENT_EMAIL}</p>')", DB_TABLE_PREFIX, $comm->insertedId()));
    $comm->query(sprintf("INSERT INTO %st_preference VALUES ('osclass', 'notify_new_user', '1', 'BOOLEAN')", DB_TABLE_PREFIX));
    $comm->query(sprintf("INSERT INTO %st_preference VALUES ('osclass', 'notify_new_comment_user', '0', 'BOOLEAN')", DB_TABLE_PREFIX));
    $comm->query(sprintf("UPDATE %st_locale SET s_currency_format = '{NUMBER} {CURRENCY}'", DB_TABLE_PREFIX));
    $result = $comm->query(sprintf("SELECT pk_i_id, f_price FROM %st_item", DB_TABLE_PREFIX));
    $items = $result->result();
    foreach ($items as $item) {
        if ($item['f_price'] == null) {
            $sql = sprintf("UPDATE %st_item SET i_price = NULL WHERE pk_i_id = %d", DB_TABLE_PREFIX, $item['pk_i_id']);
        } else {
            $sql = sprintf("UPDATE %st_item SET i_price = %f WHERE pk_i_id = %d", DB_TABLE_PREFIX, 1000000 * $item['f_price'], $item['pk_i_id']);
        }
        $comm->query($sql);
    }
    osc_changeVersionTo(230);
}
osc_changeVersionTo(231);
if (Params::getParam('action') == '') {
    $title = 'OSClass &raquo; Updated correctly';
    $message = 'OSClass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>';
    osc_die($title, $message);
}
Beispiel #13
0
                $comm->query("ALTER TABLE  `" . DB_TABLE_PREFIX . "t_user` DROP FOREIGN KEY  `" . $m . "`");
            }
        }
    }
    $comm->query("DROP TABLE " . DB_TABLE_PREFIX . "t_country");
    $comm->query("RENAME TABLE  `" . DB_TABLE_PREFIX . "t_country_aux` TO  `" . DB_TABLE_PREFIX . "t_country`");
    $comm->query("ALTER TABLE " . DB_TABLE_PREFIX . "t_city ADD FOREIGN KEY (fk_c_country_code) REFERENCES " . DB_TABLE_PREFIX . "t_country (pk_c_code)");
    $comm->query("ALTER TABLE " . DB_TABLE_PREFIX . "t_region ADD FOREIGN KEY (fk_c_country_code) REFERENCES " . DB_TABLE_PREFIX . "t_country (pk_c_code)");
    $comm->query("ALTER TABLE " . DB_TABLE_PREFIX . "t_country_stats ADD FOREIGN KEY (fk_c_country_code) REFERENCES " . DB_TABLE_PREFIX . "t_country (pk_c_code)");
    $comm->query("ALTER TABLE " . DB_TABLE_PREFIX . "t_item_location ADD FOREIGN KEY (fk_c_country_code) REFERENCES " . DB_TABLE_PREFIX . "t_country (pk_c_code)");
    $comm->query("ALTER TABLE " . DB_TABLE_PREFIX . "t_user ADD FOREIGN KEY (fk_c_country_code) REFERENCES " . DB_TABLE_PREFIX . "t_country (pk_c_code)");
}
if (osc_version() < 241) {
    $comm->query(sprintf("INSERT INTO %st_preference VALUES ('osclass', 'use_imagick', '0', 'BOOLEAN')", DB_TABLE_PREFIX));
}
osc_changeVersionTo(241);
echo '<div style="border: 1px solid rgb(204, 204, 204); background: none repeat scroll 0% 0% rgb(238, 238, 238);"> <div style="padding: 20px;">';
echo '<p>' . __('OSClass &raquo; Updated correctly') . '</p>';
echo '<p>' . __('OSClass has been updated successfully. <a href="http://forums.osclass.org/">Need more help?</a>') . '</p>';
foreach ($aMessages as $msg) {
    echo "<p>" . $msg . "</p>";
}
echo "</div></div>";
/**
 * Convert alerts < 2.4, updating s_search with json encoded to based64.
 *
 * @param string $alert base64+serialized
 */
function convertAlert($alert)
{
    // decode search model