function youtube_call_after_install()
{
    $conn = getConnection();
    $path = osc_plugin_resource('youtube/struct.sql');
    $sql = file_get_contents($path);
    $conn->osc_dbImportSQL($sql);
}
 public function import($file)
 {
     $path = osc_plugin_resource($file);
     $sql = file_get_contents($path);
     if (!$this->dao->importSQL($sql)) {
         throw new Exception("Error importSQL::ModelSeoCategory<br>" . $file);
     }
 }
 /**
  * Import sql file
  * @param type $file
  */
 public function import($file)
 {
     $path = osc_plugin_resource($file);
     $sql = file_get_contents($path);
     if (!$this->dao->importSQL($sql)) {
         throw new Exception($this->dao->getErrorLevel() . ' - ' . $this->dao->getErrorDesc());
     }
 }
 public function import($file)
 {
     $path = osc_plugin_resource($file);
     $sql = file_get_contents($path);
     if (!$this->dao->importSQL($sql)) {
         throw new Exception("Error importSQL::ModelSeo<br>" . $file . '<br>' . $path . '<br><br>Please check your database for tables t_item_seo, t_pages_seo, t_categories_seo, t_links_seo, t_region_seo, t_country_seo. <br>If any of those tables exists in your database, delete them!');
     }
 }
示例#5
0
 function seo_after_install()
 {
     $conn = DBConnectionClass::newInstance();
     $c_db = $conn->getOsclassDb();
     $comm = new DBCommandClass($c_db);
     $path = osc_plugin_resource(SEO_PLUGIN_FOLDER . '/struct.sql');
     $sql = file_get_contents($path);
     $comm->importSQL($sql);
 }
 function youtube_call_after_install()
 {
     $conn = DBConnectionClass::newInstance();
     $c_db = $conn->getOsclassDb();
     $comm = new DBCommandClass($c_db);
     $path = osc_plugin_resource('youtube/struct.sql');
     $sql = file_get_contents($path);
     $comm->importSQL($sql);
     osc_set_preference('youtube_version', '200', 'youtube', 'STRING');
     osc_reset_preferences();
 }
示例#7
0
function tooltip_call_after_install()
{
    // Insert here the code you want to execute after the plugin's install
    // for example you might want to create a table or modify some values
    // In this case we'll create a table to store the color scheme attributes
    $connection = DBConnectionClass::newInstance();
    $var = $connection->getOsclassDb();
    $conn = new DBCommandClass($var);
    $path = osc_plugin_resource('ToolTip/struct.sql');
    $sql = file_get_contents($path);
    if (!$conn->importSQL($sql)) {
        throw new Exception($conn->getErrorLevel() . ' - ' . $conn->getErrorDesc());
    }
}
示例#8
0
/**
 * Create news table after module install
 */
function gz_news_call_after_install()
{
    $conn = getConnection();
    $conn->autocommit(FALSE);
    try {
        $path = osc_plugin_resource('gz_news/schema/news.sql');
        $sql = file_get_contents($path);
        $conn->osc_dbImportSQL($sql);
        $conn->commit();
    } catch (Exception $e) {
        $conn->rollback();
        echo $e->getMessage();
    }
    $conn->autocommit(TRUE);
}
示例#9
0
文件: index.php 项目: abhi143u11/ads
function profile_picture_install()
{
    $conn = getConnection();
    $conn->autocommit(false);
    try {
        $path = osc_plugin_resource('profile_picture/struct.sql');
        $sql = file_get_contents($path);
        $conn->osc_dbImportSQL($sql);
        $conn->commit();
    } catch (Exception $e) {
        $conn->rollback();
        echo $e->getMessage();
    }
    $conn->autocommit(true);
}
示例#10
0
function adManage_install()
{
    $conn = getConnection();
    $path = osc_plugin_resource('advanced_ad_management/struct.sql');
    $sql = file_get_contents($path);
    $conn->osc_dbImportSQL($sql);
    osc_set_preference('adManageed_expire', '4', 'plugin-item_adManage', 'INTEGER');
    osc_set_preference('adManageed_payperpost', '1', 'plugin-item_adManage', 'INTEGER');
    osc_set_preference('adManageed_repubTimes', '5', 'plugin-item_adManage', 'INTEGER');
    osc_set_preference('adManageed_installed', '0', 'plugin-item_adManage', 'INTEGER');
    osc_set_preference('adManageed_freeRepubs', '0', 'plugin-item_adManage', 'INTEGER');
    osc_set_preference('adManageed_expireEmail', '1', 'plugin-item_adManage', 'INTEGER');
    osc_set_preference('adManageed_deleteDays', '0', 'plugin-item_adManage', 'INTEGER');
    //used for email template
    $conn->osc_dbExec("INSERT IGNORE INTO %st_pages (s_internal_name, b_indelible, dt_pub_date) VALUES ('email_ad_expire', 1, NOW() )", DB_TABLE_PREFIX);
    $conn->osc_dbExec("INSERT IGNORE INTO %st_pages_description (fk_i_pages_id, fk_c_locale_code, s_title, s_text) VALUES (%d, '%s', '{WEB_TITLE} - Your ad {ITEM_TITLE} is about to expire.', '<p>Hi {CONTACT_NAME}!</p>\r\n<p> </p>\r\n<p>Your ad is about to expire, click on the link if you would like to extend your ad {REPUBLISH_URL}</p><p> </p>\r\n<p>This is an automatic email, Please do not respond to this email.</p>\r\n<p> </p>\r\n<p>Thanks</p>\r\n<p>{WEB_TITLE}</p>')", DB_TABLE_PREFIX, $conn->get_last_id(), osc_language());
    $conn->osc_dbExec("INSERT IGNORE INTO %st_pages (s_internal_name, b_indelible, dt_pub_date) VALUES ('email_ad_expired', 1, NOW() )", DB_TABLE_PREFIX);
    $conn->osc_dbExec("INSERT IGNORE INTO %st_pages_description (fk_i_pages_id, fk_c_locale_code, s_title, s_text) VALUES (%d, '%s', '{WEB_TITLE} - Your ad {ITEM_TITLE} has expired.', '<p>Hi {CONTACT_NAME}!</p>\r\n<p> </p>\r\n<p>Your ad has expired. You may renew your ad by clicking on the link {REPUBLISH_URL}. Otherwise your ad will be permanently deleted in {PERM_DELETED} days</p><p> </p>\r\n<p>This is an automatic email, Please do not respond to this email.</p>\r\n<p> </p>\r\n<p>Thanks</p>\r\n<p>{WEB_TITLE}</p>')", DB_TABLE_PREFIX, $conn->get_last_id(), osc_language());
}
示例#11
0
 public function import($file)
 {
     $path = osc_plugin_resource($file);
     $sql = file_get_contents($path);
     if (!$this->dao->importSQL($sql)) {
         throw new Exception(__('Error importing the database structure of the jobboard plugin', 'jobboard'));
     }
 }