Пример #1
0
function phpwcms_revision_r502()
{
    $status = true;
    // do former revision check – fallback to r497
    if (phpwcms_revision_check_temp('497') !== true) {
        $status = phpwcms_revision_check('497');
    }
    // add field for default language type and target ID to article, category
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_articlecat LIKE 'acat_lang_type'", 'COUNT_SHOW');
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_articlecat ADD acat_lang_type VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
        _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_articlecat ADD INDEX (acat_lang_type)", 'ALTER');
    }
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_articlecat LIKE 'acat_lang_id'", 'COUNT_SHOW');
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_articlecat ADD acat_lang_id INT(11) unsigned NOT NULL DEFAULT '0'", 'ALTER');
        _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_articlecat ADD INDEX (acat_lang_id)", 'ALTER');
    }
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_article LIKE 'article_lang_type'", 'COUNT_SHOW');
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_article ADD article_lang_type VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
        _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_article ADD INDEX (article_lang_type)", 'ALTER');
    }
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_article LIKE 'article_lang_id'", 'COUNT_SHOW');
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_article ADD article_lang_id INT(11) unsigned NOT NULL DEFAULT '0'", 'ALTER');
        _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_article ADD INDEX (article_lang_id)", 'ALTER');
    }
    return $status;
}
Пример #2
0
function phpwcms_revision_r535()
{
    $status = true;
    // do former revision check – fallback to r534
    if (phpwcms_revision_check_temp('534') !== true) {
        $status = phpwcms_revision_check('534');
    }
    // change type of some content related fields from TEXT to MEDIUMTEXT
    // Retrieve Type of profession name
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_profession` WHERE Field='prof_name'");
    if (isset($result[0]['Type']) && strpos($result[0]['Type'], '100')) {
        $update = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_profession` CHANGE `prof_name` `prof_name` VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
        if (!$update) {
            $status = false;
        }
    }
    // Change profession ' n/a'
    _dbUpdate('phpwcms_profession', array('prof_name' => 'n/a'), "prof_name=' n/a'");
    // Import new professions
    $result = _dbCount("SELECT COUNT(*) FROM `" . DB_PREPEND . "phpwcms_profession`");
    if ($result < 25) {
        $jobs = array('academic', 'accountant', 'actor', 'administrative services department manager', 'administrator', 'administrator, IT', 'agricultural advisor', 'air steward', 'air-conditioning installer or mechanic', 'aircraft service technician', 'ambulance driver (non paramedic)', 'animal carer (not in farms)', 'animator', 'arable farm manager, field crop or vegetable', 'arable farmer, field crop or vegetable', 'architect', 'architect, landscape', 'artist', 'asbestos removal worker', 'assembler', 'assembly team leader', 'assistant', 'author', 'baker', 'bank clerk (back-office)', 'beauty therapist', 'beverage production process controller', 'biologist', 'blogger', 'boring machine operator', 'bricklayer', 'builder', 'butcher', 'car mechanic', 'career counsellor', 'caretaker', 'carpenter', 'charge nurse', 'check-out operator', 'chef', 'child-carer', 'civil engineering technician', 'civil servant', 'cleaning supervisor', 'clerk', 'climatologist', 'cloak room attendant', 'cnc operator', 'comic book writer', 'community health worker', 'company director', 'computer programmer', 'confectionery maker', 'construction operative', 'cook', 'cooling or freezing installer or mechanic', 'critic', 'database designer', 'decorator', 'dental hygienist', 'dental prosthesis technician', 'dentist', 'department store manager', 'designer', 'designer, graphic', 'designer, industrial', 'designer, interface', 'designer, interior', 'designer, screen', 'designer, web', 'dietician', 'diplomat', 'director', 'display designer', 'doctor', 'domestic housekeeper', 'economist', 'editor', 'education advisor', 'electrical engineer', 'electrical mechanic or fitter', 'electrician', 'engineer', 'engineering maintenance supervisor', 'estate agent', 'executive', 'executive secretary', 'farmer', 'felt roofer', 'filing clerk', 'film director', 'financial clerk', 'financial services manager', 'fire fighter', 'first line supervisor beverages workers', 'first line supervisor of cleaning workers', 'fisherman', 'fishmonger', 'flight attendant', 'floral arranger', 'food scientist', 'garage supervisor', 'garbage man', 'gardener, all other', 'general practitioner', 'geographer', 'geologist', 'hairdresser', 'head groundsman', 'head teacher', 'horse riding instructor', 'hospital nurse', 'hotel manager', 'house painter', 'hr manager', 'it applications programmer', 'it systems administrator', 'jeweller', 'journalist', 'judge', 'juggler', 'kitchen assistant', 'lathe setter-operator', 'lawyer', 'lecturer', 'legal secretary', 'lexicographer', 'library assistant', 'local police officer', 'logistics manager', 'machine tool operator', 'magician', 'makeup artist', 'manager', 'manager, all other health services', 'marketing manager', 'meat processing operator', 'mechanical engineering technician', 'medical laboratory technician', 'medical radiography equipment operator', 'metal moulder', 'metal production process operator', 'meteorologist', 'midwifery professional', 'miner', 'mortgage clerk', 'musical instrument maker', 'musician', 'non-commissioned officer armed forces', 'nurse', 'nursery school teacher', 'nursing aid', 'ophthalmic optician', 'optician', 'painter', 'payroll clerk', 'personal assistant', 'personal carer in an institution for the elderly', 'personal carer in an institution for the handicapped', 'personal carer in private homes', 'personnel clerk', 'pest controller', 'photographer', 'physician assistant', 'pilot', 'pipe fitter', 'plant maintenance mechanic', 'plumber', 'police inspector', 'police officer', 'policy advisor', 'politician', 'porter', 'post secondary education teacher', 'post sorting or distributing clerk', 'power plant operator', 'primary school head', 'primary school teacher', 'printer', 'printing machine operator', 'prison officer / warder', 'product manager', 'professional gambler', 'project manager', 'programmer', 'psychologist', 'puppeteer', 'quality inspector, all other products', 'receptionist', 'restaurant cook', 'road paviour', 'roofer', 'sailor', 'sales assistant, all other', 'sales or marketing manager', 'sales representative', 'sales support clerk', 'salesperson', 'scientist', 'seaman (armed forces)', 'secondary school manager', 'secondary school teacher', 'secretary', 'security guard', 'sheet metal worker', 'ship mechanic', 'shoe repairer, leather repairer', 'shop assistant', 'sign language Interpreter', 'singer', 'social media manager', 'social photographer', 'software analyst', 'software developer', 'software engineer', 'soldier', 'solicitor', 'speech therapist', 'steel fixer', 'stockman', 'structural engineer', 'student', 'surgeon', 'surgical footwear maker', 'swimming instructor', 'system operator', 'tailor', 'tailor, seamstress', 'tax inspector', 'taxi driver', 'teacher', 'telephone operator', 'telephonist', 'theorist', 'tile layer', 'translator', 'transport clerk', 'travel agency clerk', 'travel agent', 'truck driver long distances', 'trucker', 'TV cameraman', 'TV presenter', 'university professor', 'university researcher', 'vet', 'veterinary practitioner', 'vocational education teacher', 'waiter', 'waiting staff', 'web designer', 'web developer', 'webmaster', 'welder, all other', 'wood processing plant operator', 'writer', 'other', 'n/a');
        foreach ($jobs as $job) {
            $sql = 'INSERT IGNORE INTO `' . DB_PREPEND . 'phpwcms_profession` (prof_name) VALUES(' . _dbEscape($job) . ')';
            _dbQuery($sql, 'INSERT');
        }
    }
    return $status;
}
Пример #3
0
function phpwcms_revision_r403()
{
    $status = true;
    // do former revision check
    // r402 required no action, so fallback to r401
    $r401 = '401';
    if (phpwcms_revision_check_temp($r401) !== true) {
        $status = phpwcms_revision_check($r401);
    }
    // check if article content tab field exists
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_articlecontent LIKE 'acontent_tab'", 'COUNT_SHOW');
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_articlecontent ADD acontent_tab VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
    }
    // check if new structure level class field exists
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_articlecat LIKE 'acat_class'", 'COUNT_SHOW');
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_articlecat ADD acat_class VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
    }
    // check if new structure level keywords field exists
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_articlecat LIKE 'acat_keywords'", 'COUNT_SHOW');
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_articlecat ADD acat_keywords VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
    }
    // upgrade sysvalue fields
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_sysvalue LIKE 'sysvalue_vartype'");
    if (isset($result[0]['Type']) && $result[0]['Type'] == 'varchar(100)') {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_sysvalue CHANGE sysvalue_vartype sysvalue_vartype VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
    }
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_sysvalue LIKE 'sysvalue_value'");
    if (isset($result[0]['Type']) && $result[0]['Type'] == 'text') {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_sysvalue CHANGE sysvalue_value sysvalue_value MEDIUMTEXT NOT NULL", 'ALTER');
    }
    return $status;
}
Пример #4
0
function phpwcms_revision_r414()
{
    $status = true;
    // Test against new shopping module fields
    $result = _dbQuery("SHOW TABLES LIKE '" . DB_PREPEND . "phpwcms_shop_products'");
    if (!empty($result)) {
        $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_shop_products LIKE 'shopprod_special_price'");
        if (empty($result)) {
            $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_shop_products ADD shopprod_special_price TEXT NOT NULL", 'ALTER');
        }
        $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_shop_products LIKE 'shopprod_track_view'");
        if (empty($result)) {
            $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_shop_products ADD shopprod_track_view INT(11) NOT NULL DEFAULT '0'", 'ALTER');
            $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_shop_products ADD INDEX (shopprod_track_view)", 'ALTER');
        }
        $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_shop_products LIKE 'shopprod_lang'");
        if (empty($result)) {
            $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_shop_products ADD shopprod_lang VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
            $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_shop_products ADD INDEX (shopprod_lang)", 'ALTER');
        }
    }
    // do former revision check
    // r407 - 413 required no action, so fallback to r406
    $r406 = '406';
    if (phpwcms_revision_check_temp($r406) !== true) {
        $status = phpwcms_revision_check($r406);
    }
    return $status;
}
Пример #5
0
function saveFeedback()
{
    $feedback = array('name' => '', 'email' => '', 'subject' => '', 'message' => '', 'userid' => $_SESSION['SESS_USER_ID'], 'blocked' => 'false', 'dtoc' => date('Y-m-d H:i:s'), 'dtoe' => date('Y-m-d H:i:s'));
    foreach ($feedback as $k => $v) {
        if (isset($_POST[$k])) {
            $feedback[$k] = trim($_POST[$k]);
        }
    }
    $sql = _db()->_insertQ1('feedbacks', $feedback);
    $res = _dbQuery($sql);
    $id = _db()->insert_id();
    if ($res) {
        _dbFree($res);
        //send email to admin
        $mailto = "*****@*****.**";
        $mailfrom = "*****@*****.**";
        $feedback_content = array("name" => $_REQUEST['name'], "email" => $_REQUEST['email'], "subject" => $_REQUEST['subject'], "message" => $_REQUEST['message']);
        $template = _template("feedback_admin", $profile);
        loadHelpers('email');
        sendMail($mailto, " Feedback", $template, $mailfrom);
        return "success";
    } else {
        return "error";
    }
}
Пример #6
0
function phpwcms_revision_r540()
{
    $status = true;
    // do former revision check – fallback to r539
    if (phpwcms_revision_check_temp('539') !== true) {
        $status = phpwcms_revision_check('539');
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_article` WHERE Field='article_canonical'");
    if (!isset($result[0])) {
        $insert = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_article` ADD `article_canonical` VARCHAR(2000) NOT NULL DEFAULT ''", 'ALTER');
        if (!$insert) {
            $status = false;
        }
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_articlecat` WHERE Field='acat_canonical'");
    if (!isset($result[0])) {
        $insert = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_articlecat` ADD `acat_canonical` VARCHAR(2000) NOT NULL DEFAULT ''", 'ALTER');
        if (!$insert) {
            $status = false;
        }
        // Reset cache values
        _setConfig('structure_array_vmode_all', false, 'frontend_render', 1);
        _setConfig('structure_array_vmode_editor', false, 'frontend_render', 1);
        _setConfig('structure_array_vmode_admin', false, 'frontend_render', 1);
    }
    return $status;
}
Пример #7
0
function feedimport_filestorage_dirlist($pid = 0, $prefix = '+', $userID = null, $counter = 0)
{
    if (!$counter) {
        $GLOBALS['filestorage_dirlist'] = array(0 => $GLOBALS['BL']['be_ftptakeover_rootdir']);
    }
    $pid = intval($pid);
    $sql = "SELECT f_id, f_name, f_uid, usr_login FROM " . DB_PREPEND . "phpwcms_file f ";
    $sql .= "LEFT JOIN " . DB_PREPEND . "phpwcms_user u ON u.usr_id=f.f_uid ";
    $sql .= "WHERE f.f_pid=" . $pid . " AND ";
    if (empty($_SESSION["wcs_user_admin"]) && $userID) {
        $sql .= "f.f_uid=" . intval($userID) . " AND ";
    }
    $sql .= "f.f_kid=0 AND f.f_trash=0 ORDER BY f_name";
    $result = _dbQuery($sql);
    if (isset($result[0])) {
        foreach ($result as $row) {
            if ($_SESSION["wcs_user_id"] != $row['f_uid']) {
                $row["f_name"] .= ' (' . $row["usr_login"] . ')';
            }
            $GLOBALS['filestorage_dirlist'][(int) $row['f_id']] = str_repeat($prefix, $counter + 1) . ' ' . $row["f_name"];
            feedimport_filestorage_dirlist($row['f_id'], $prefix, $userID, $counter + 1);
        }
    }
    if (!$counter) {
        $result = $GLOBALS['filestorage_dirlist'];
        unset($GLOBALS['filestorage_dirlist']);
        return $result;
    }
}
Пример #8
0
function phpwcms_revision_r534()
{
    $status = true;
    // do former revision check – fallback to r533
    if (phpwcms_revision_check_temp('533') !== true) {
        $status = phpwcms_revision_check('533');
    }
    // change type of some content related fields from TEXT to MEDIUMTEXT
    // Retrieve Types of article content table
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_articlecontent` WHERE Field IN ('acontent_text', 'acontent_html', 'acontent_media')");
    if (isset($result[0]['Type'])) {
        foreach ($result as $column) {
            $update = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_articlecontent` CHANGE `" . $column['Field'] . '` `' . $column['Field'] . "` MEDIUMTEXT NOT NULL", 'ALTER');
            if (!$update) {
                $status = false;
            }
        }
    }
    // Retrieve Types of article table
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_article` WHERE Field='article_summary'");
    if (isset($result[0]['Type'])) {
        $update = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_article` CHANGE `article_summary` `article_summary` MEDIUMTEXT NOT NULL", 'ALTER');
        if (!$update) {
            $status = false;
        }
    }
    return $status;
}
Пример #9
0
function phpwcms_revision_r541()
{
    $status = true;
    // do former revision check – fallback to r540
    if (phpwcms_revision_check_temp('540') !== true) {
        $status = phpwcms_revision_check('540');
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_articlecat` WHERE Field='acat_breadcrumb'");
    if (!isset($result[0])) {
        $insert = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_articlecat` ADD `acat_breadcrumb` INT(1) NOT NULL DEFAULT '0'", 'ALTER');
        if (!$insert) {
            $status = false;
        }
        // Reset cache values
        _setConfig('structure_array_vmode_all', false, 'frontend_render', 1);
        _setConfig('structure_array_vmode_editor', false, 'frontend_render', 1);
        _setConfig('structure_array_vmode_admin', false, 'frontend_render', 1);
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_shop_products` WHERE Field='shopprod_unit'");
    if (!isset($result[0])) {
        if (!($insert = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_shop_products` ADD `shopprod_unit` VARCHAR(100) NOT NULL DEFAULT ''", 'ALTER'))) {
            $status = false;
        }
    }
    return $status;
}
Пример #10
0
function phpwcms_revision_r538()
{
    $status = true;
    // do former revision check – fallback to r537
    if (phpwcms_revision_check_temp('537') !== true) {
        $status = phpwcms_revision_check('537');
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_articlecat` WHERE Field='acat_public'");
    if (isset($result[0]['Default']) && $result[0]['Default'] == 0) {
        $update = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_articlecat` CHANGE `acat_public` `acat_public` INT(1) NOT NULL DEFAULT '1'", 'ALTER');
        if (!$update) {
            $status = false;
        }
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_articlecat` WHERE Field='acat_alias'");
    if (isset($result[0]['Type']) && strpos($result[0]['Type'], '255') === false) {
        $update = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_articlecat` CHANGE `acat_alias` `acat_alias` VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
        if (!$update) {
            $status = false;
        }
    }
    // Reset cache values
    _setConfig('structure_array_vmode_all', false, 'frontend_render', 1);
    _setConfig('structure_array_vmode_editor', false, 'frontend_render', 1);
    _setConfig('structure_array_vmode_admin', false, 'frontend_render', 1);
    return $status;
}
Пример #11
0
 /**
  * @param int $pid current folder ID
  * @param int $img_list_width
  * @param int $img_list_height
  * @param int $img_list_sl sharpen level
  * @param int[] $folders array with active folders in cp
  * @param bool|string $active to pass the status to subfolders
  * @return string html for folderlist
  */
 public function getFolderList($pid, $img_list_width, $img_list_height, $img_list_sl, $folders, $active = 'true')
 {
     $pid = intval($pid);
     $userID = intval($_SESSION["wcs_user_id"]);
     $sql = "SELECT f_id, f_name, f_aktiv, f_public, f_uid FROM " . DB_PREPEND . "phpwcms_file WHERE " . "f_pid=" . intval($pid) . " AND f_kid=0 AND f_trash=0 AND (f_public=1 OR f_uid=" . $userID . ") ORDER BY f_sort, f_name";
     $data = _dbQuery($sql);
     foreach ($data as $key => $val) {
         $dirname = html_specialchars($val["f_name"]);
         //check if depending files/dirs exist
         $sql2 = "SELECT COUNT(f_id) FROM " . DB_PREPEND . "phpwcms_file WHERE " . "f_pid=" . $val["f_id"] . " AND f_kid=0 AND f_trash=0 AND (f_public=1 OR f_uid=" . $userID . ") LIMIT 1";
         $data2 = _dbQuery($sql2, 'COUNT');
         $folders_act = "";
         //curr ID is in selectedFoldersList
         if (in_array($val["f_id"], $folders)) {
             $folders_act = 'checked="checked"';
         }
         //start outputfor the row
         $this->_folderlist_html .= '<li class="br_module_jqs_folderlist_li">';
         //if folder active and parent not inactive
         if ($val["f_aktiv"] == 1 && $active == 'true') {
             $this->_folderlist_html .= '<span id="openlink' . $val["f_id"] . '" class="br_module_jqs_folderlist_openlink closed" onclick="PHPWCMS_MODULE.JQS.sendRequest(' . $val["f_id"] . ');">&nbsp;</span>';
         } else {
             $this->_folderlist_html .= '<span class="br_module_jqs_folderlist_openlink">&nbsp;</span>';
         }
         $this->_folderlist_html .= '<input type="checkbox" name="jqs_folders[]" value="' . $val["f_id"] . '" ' . $folders_act;
         //if folder active and parent not inactive
         if ($val["f_aktiv"] == 1 && $active == 'true') {
             $this->_folderlist_html .= ' />' . $dirname;
             $this->_folderlist_html .= '<span id="arr' . $val["f_id"] . '"></span><div id="images' . $val["f_id"] . '" style="display:none;"></div>';
         } else {
             $this->_folderlist_html .= ' disabled="disabled" />' . $dirname;
             $this->_folderlist_html .= ' (';
             //if folder itself is inactive then show image
             if ($val["f_aktiv"] == 0) {
                 $this->_folderlist_html .= '<img style="vertical-align: text-bottom;" src="include/inc_module/mod_sliderjs/img/active_11x11a_0.gif" />';
             }
             $this->_folderlist_html .= ')';
             //curr ID is in selectedFoldersList
             if (in_array($val["f_id"], $folders)) {
                 //hidden field to pass the ID just in case it's selcted
                 $this->_folderlist_html .= '<input type="hidden" name="jqs_folders[]" value="' . $val["f_id"] . '">';
             }
         }
         //deeper if subdir
         if ($data2) {
             //pass the inactive status to all subfolders
             if ($val["f_aktiv"] == 0) {
                 $active = 'false';
             }
             $this->_folderlist_html .= "<ul>" . LF;
             $this->getFolderList($val["f_id"], $img_list_width, $img_list_height, $img_list_sl, $folders, $active);
             $this->_folderlist_html .= "</ul>" . LF;
             //reset the status for following folders (of same level)
             $active = 'true';
         }
         $this->_folderlist_html .= '</li>' . LF;
     }
     return $this->_folderlist_html;
 }
Пример #12
0
function phpwcms_revision_r401()
{
    // check if article description field exists
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_article LIKE 'article_description'", 'COUNT_SHOW');
    if (empty($result)) {
        return _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_article ADD article_description VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
    }
    return true;
}
Пример #13
0
 function registerSettings($name, $value = "", $scope = "default")
 {
     $data = array("userid" => $_SESSION['SESS_USER_ID'], "site" => SITENAME, "scope" => $scope, "name" => $name, "settings" => $value);
     $q = _db(true)->_insertQ1(_dbtable("settings", true), $data);
     $res = _dbQuery($q, true);
     if ($res) {
         return true;
     } else {
         return false;
     }
 }
Пример #14
0
function phpwcms_revision_r438()
{
    $status = true;
    // do former revision check – fallback to r427
    if (phpwcms_revision_check_temp('427') !== true) {
        $status = phpwcms_revision_check('427');
    }
    // Fix possible problem
    _dbQuery('UPDATE ' . DB_PREPEND . "phpwcms_article SET article_subtitle = '' WHERE article_subtitle = '0'", 'UPDATE');
    _dbQuery('UPDATE ' . DB_PREPEND . "phpwcms_article SET article_menutitle = '' WHERE article_menutitle = '0'", 'UPDATE');
    _dbQuery('UPDATE ' . DB_PREPEND . "phpwcms_article SET article_description = '' WHERE article_description = '0'", 'UPDATE');
    return $status;
}
Пример #15
0
function phpwcms_revision_r427()
{
    $status = true;
    // do former revision check – fallback to r427
    $r421 = '421';
    if (phpwcms_revision_check_temp($r421) !== true) {
        $status = phpwcms_revision_check($r421);
    }
    // Change some missing default values for older releases
    $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_article CHANGE article_menutitle article_menutitle VARCHAR(255) NOT NULL DEFAULT  ''", 'ALTER');
    $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_article CHANGE article_description article_description VARCHAR(255) NOT NULL DEFAULT  ''", 'ALTER');
    return $status;
}
Пример #16
0
function phpwcms_revision_r528()
{
    $status = true;
    // do former revision check – fallback to r514
    if (phpwcms_revision_check_temp('514') !== true) {
        $status = phpwcms_revision_check('514');
    }
    // add field to disable forced 302 redirect for article to structure level
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_articlecat LIKE 'acat_disable301'", 'COUNT_SHOW');
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_articlecat ADD acat_disable301 INT(1) unsigned NOT NULL DEFAULT '0'", 'ALTER');
    }
    return $status;
}
Пример #17
0
 function registerSettings($name, $value = "", $scope = "system")
 {
     if (is_file($value)) {
         $value = json_decode(file_get_contents($value), true);
     }
     $data = array("guid" => $_SESSION['SESS_GUID'], "userid" => $_SESSION['SESS_USER_ID'], "site" => SITENAME, "scope" => strtolower($scope), "name" => $name, "settings" => $value);
     $q = _db(true)->_insertQ1(_dbTable("settings", true), $data);
     $res = _dbQuery($q, true);
     if ($res) {
         return true;
     } else {
         return false;
     }
 }
Пример #18
0
function phpwcms_revision_r509()
{
    $status = true;
    // do former revision check – fallback to r502
    if (phpwcms_revision_check_temp('502') !== true) {
        $status = phpwcms_revision_check('502');
    }
    // Hide article from teaser list
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_article LIKE 'article_noteaser'", 'COUNT_SHOW');
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_article ADD article_noteaser INT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER article_morelink", 'ALTER');
        _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_article ADD INDEX (article_noteaser)", 'ALTER');
    }
    return $status;
}
Пример #19
0
function phpwcms_revision_r537()
{
    $status = true;
    // do former revision check – fallback to r536
    if (phpwcms_revision_check_temp('536') !== true) {
        $status = phpwcms_revision_check('536');
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_articlecat` WHERE Field='acat_public'");
    if (isset($result[0]['Default']) && $result[0]['Default'] == 0) {
        $update = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_articlecat` CHANGE `acat_public` `acat_public` INT(1) NOT NULL DEFAULT '1'", 'ALTER');
        if (!$update) {
            $status = false;
        }
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_articlecat` WHERE Field='acat_opengraph'");
    if (!isset($result[0])) {
        $insert = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_articlecat` ADD `acat_opengraph` INT(1) UNSIGNED NOT NULL DEFAULT '1', ADD INDEX (`acat_opengraph`)", 'ALTER');
        if (!$insert) {
            $status = false;
        }
        // Reset cache values
        _setConfig('structure_array_vmode_all', false, 'frontend_render', 1);
        _setConfig('structure_array_vmode_editor', false, 'frontend_render', 1);
        _setConfig('structure_array_vmode_admin', false, 'frontend_render', 1);
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_content` WHERE Field='cnt_opengraph'");
    if (!isset($result[0])) {
        $insert = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_content` ADD `cnt_opengraph` INT(1) UNSIGNED NOT NULL DEFAULT '1', ADD INDEX (`cnt_opengraph`)", 'ALTER');
        if (!$insert) {
            $status = false;
        }
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_categories` WHERE Field='cat_opengraph'");
    if (!isset($result[0])) {
        $insert = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_categories` ADD `cat_opengraph` INT(1) UNSIGNED NOT NULL DEFAULT '1', ADD INDEX (`cat_opengraph`)", 'ALTER');
        if (!$insert) {
            $status = false;
        }
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_shop_products` WHERE Field='shopprod_opengraph'");
    if (!isset($result[0])) {
        $insert = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_shop_products` ADD `shopprod_opengraph` INT(1) UNSIGNED NOT NULL DEFAULT '1', ADD INDEX (`shopprod_opengraph`)", 'ALTER');
        if (!$insert) {
            $status = false;
        }
    }
    return $status;
}
Пример #20
0
function phpwcms_revision_r421()
{
    $status = true;
    // Add column for default content part
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_categories LIKE 'cat_sort'");
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_categories ADD cat_sort INT(11) NOT NULL DEFAULT '0'", 'ALTER');
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_categories ADD INDEX (cat_sort)", 'ALTER');
    }
    // do former revision check – fallback to r416
    $r416 = '416';
    if (phpwcms_revision_check_temp($r416) !== true) {
        $status = phpwcms_revision_check($r416);
    }
    return $status;
}
Пример #21
0
function phpwcms_revision_r533()
{
    $status = true;
    // do former revision check – fallback to r532
    if (phpwcms_revision_check_temp('532') !== true) {
        $status = phpwcms_revision_check('532');
    }
    $result = _dbQuery("SHOW TABLES LIKE '" . DB_PREPEND . "phpwcms_shop_products'");
    if (!empty($result)) {
        $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_shop_products LIKE 'shopprod_overwrite_meta'");
        if (empty($result)) {
            $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_shop_products ADD shopprod_overwrite_meta INT(1) NOT NULL DEFAULT '1'", 'ALTER');
        }
    }
    return $status;
}
Пример #22
0
function phpwcms_revision_r416()
{
    $status = true;
    // Add column for default content part
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_articlecat LIKE 'acat_cpdefault'");
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_articlecat ADD acat_cpdefault INT(10) UNSIGNED NOT NULL DEFAULT '0'", 'ALTER');
    }
    // do former revision check
    // r415 requires no action, so fallback to r414
    $r414 = '414';
    if (phpwcms_revision_check_temp($r414) !== true) {
        $status = phpwcms_revision_check($r414);
    }
    return $status;
}
Пример #23
0
function phpwcms_revision_r539()
{
    $status = true;
    // do former revision check – fallback to r538
    if (phpwcms_revision_check_temp('538') !== true) {
        $status = phpwcms_revision_check('538');
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_article` WHERE Field='article_description'");
    if (isset($result[0]['Type']) && substr(strtolower($result[0]['Type']), 0, 7) == 'varchar') {
        $update = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_article` CHANGE `article_description` `article_description` text NOT NULL", 'ALTER');
        if (!$update) {
            $status = false;
        }
    }
    return $status;
}
Пример #24
0
function _getFileInfo($value, $limit = '1', $mode = 'hash')
{
    $sql = '';
    switch ($mode) {
        case 'hash':
            $sql = "SELECT * FROM " . DB_PREPEND . "phpwcms_file WHERE f_aktiv=1 AND ";
            $sql .= "f_trash=0 AND f_public=1 AND ";
            $sql .= "f_hash=" . _dbEscape($value);
            if (!FEUSER_LOGIN_STATUS) {
                $sql .= ' AND f_granted=0';
            }
            if ($limit) {
                $sql .= " LIMIT " . $limit;
            }
            break;
    }
    return _dbQuery($sql);
}
Пример #25
0
function phpwcms_revision_r406()
{
    $status = true;
    // upgrade sysvalue fields +KH:24.11.2011 if no field exists
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_sysvalue LIKE 'sysvalue_vartype'");
    // sysvalue_vartype
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_sysvalue ADD sysvalue_vartype VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
    } elseif (isset($result[0]['Type']) && $result[0]['Type'] == 'varchar(100)') {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_sysvalue CHANGE sysvalue_vartype sysvalue_vartype VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
    }
    // sysvalue_value
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_sysvalue LIKE 'sysvalue_value'");
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_sysvalue ADD sysvalue_value MEDIUMTEXT NOT NULL DEFAULT ''", 'ALTER');
    } elseif (isset($result[0]['Type']) && ($result[0]['Type'] == 'text' or $result[0]['Type'] == 'mediumblob')) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_sysvalue CHANGE sysvalue_value sysvalue_value MEDIUMTEXT NOT NULL", 'ALTER');
    }
    // sysvalue_lastchange
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_sysvalue LIKE 'sysvalue_lastchange'");
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_sysvalue ADD sysvalue_lastchange INT(11) NOT NULL DEFAULT 0", 'ALTER');
    }
    // sysvalue_group
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_sysvalue LIKE 'sysvalue_group'");
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_sysvalue ADD sysvalue_group VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_sysvalue ADD INDEX (sysvalue_group)", 'ALTER');
    }
    // sysvalue_status
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_sysvalue LIKE 'sysvalue_status'");
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_sysvalue ADD sysvalue_status INT(1) NOT NULL DEFAULT 0", 'ALTER');
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_sysvalue ADD INDEX (sysvalue_status)", 'ALTER');
    }
    // do former revision check
    // r404/405 required no action, so fallback to r403
    $r403 = '403';
    if (phpwcms_revision_check_temp($r403) !== true) {
        $status = phpwcms_revision_check($r403);
    }
    return $status;
}
Пример #26
0
 function printContent($refID, $category = "", $silent = false, $autoCreate = false)
 {
     $sql = "SELECT title,category,text,blocked FROM " . _dbtable("contents") . " WHERE (ID='{$refID}' OR reflink='{$refID}')";
     if (strlen($category) > 0) {
         $sql .= " AND category='{$category}'";
     }
     $sql .= " AND (site='*' OR site='" . SITENAME . "')";
     $rs = _dbQuery($sql);
     $data = _dbData($rs);
     _dbFree($rs);
     $text = "";
     if (count($data) > 0) {
         if ($data[0]['blocked'] == "false") {
             $text = $data[0]['text'];
         } else {
             if (!$silent) {
                 echo "<div class=divError>";
                 dispErrMessage("Page Content Currently Not Available For <i class='text2'>{$refID}</i><br/><br/>Visit Us Again ...", "Not Available!", "400", "notfound/file.png");
                 echo "</div>";
             }
         }
         if (strlen($text) > 0) {
             echo $text;
             return $data[0]['title'];
         } else {
             if (!$silent) {
                 echo "<div class=divError>";
                 dispErrMessage("Page Content Not Found For <i class='text2'>{$refID}</i>", "Content Not Found OR Missing !", "404", "notfound/file.png");
                 echo "</div>";
             }
             return false;
         }
     } elseif ($autoCreate) {
         $date = date("Y-m-d");
         $cols = "id,reflink,title,category,text,blocked,site,userid,doc,doe";
         $vals = "0,'{$refID}','" . toTitle($refID) . "','{$category}','','false','" . SITENAME . "','auto','{$date}','{$date}'";
         $sql = "INSERT INTO " . _dbtable("contents") . " ({$cols}) VALUES ({$vals})";
         _dbQuery($sql);
         return true;
     }
     return false;
 }
Пример #27
0
function phpwcms_revision_r497()
{
    $status = true;
    // do former revision check – fallback to r438
    if (phpwcms_revision_check_temp('438') !== true) {
        $status = phpwcms_revision_check('438');
    }
    // Check if seo log hash (for filter unique items) field exists
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_log_seo LIKE 'hash'", 'COUNT_SHOW');
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_log_seo ADD hash CHAR(32) NOT NULL DEFAULT ''", 'ALTER');
        if ($result) {
            _dbQuery('UPDATE ' . DB_PREPEND . 'phpwcms_log_seo SET hash=MD5(LOWER(CONCAT(domain,query)))', 'UPDATE');
            _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_log_seo ADD INDEX (hash)", 'ALTER');
        }
    }
    // switch crossreference field type from INT to VARCHAR
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_crossreference LIKE 'cref_type'");
    if (isset($result[0]['Type']) && substr(strtolower($result[0]['Type']), 0, 3) == 'int') {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_crossreference CHANGE cref_type cref_type VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
        // Update feedimport References
        _dbUpdate('phpwcms_crossreference', array('cref_type' => 'feed_to_article_import'), "cref_str LIKE 'feedimport_%'");
    }
    // add language to article category, article and content part
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_articlecat LIKE 'acat_lang'", 'COUNT_SHOW');
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_articlecat ADD acat_lang VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
        _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_articlecat ADD INDEX (acat_lang)", 'ALTER');
    }
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_article LIKE 'article_lang'", 'COUNT_SHOW');
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_article ADD article_lang VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
        _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_article ADD INDEX (article_lang)", 'ALTER');
    }
    $result = _dbQuery("SHOW COLUMNS FROM " . DB_PREPEND . "phpwcms_articlecontent LIKE 'acontent_lang'", 'COUNT_SHOW');
    if (empty($result)) {
        $result = _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_articlecontent ADD acontent_lang VARCHAR(255) NOT NULL DEFAULT ''", 'ALTER');
        _dbQuery("ALTER TABLE " . DB_PREPEND . "phpwcms_articlecontent ADD INDEX (acontent_lang)", 'ALTER');
    }
    return $status;
}
 public function jqs_get_articles()
 {
     $sql = "SELECT article_id, article_cid, article_uid, article_title, article_username, ";
     $sql .= "article_aktiv, article_public, UNIX_TIMESTAMP(article_tstamp) AS article_date, ac.acat_id, ac.acat_name, ac.acat_aktiv, ac.acat_public, ac.acat_hidden, ac.acat_regonly  ";
     $sql .= "FROM " . DB_PREPEND . "phpwcms_article ar ";
     $sql .= "LEFT JOIN " . DB_PREPEND . "phpwcms_articlecat ac ON ";
     $sql .= "(ar.article_cid = ac.acat_id OR ar.article_cid = 0)";
     $sql .= " WHERE ";
     $sql .= "ar.article_deleted=0 AND ";
     $sql .= "IF((ar.article_begin < NOW() AND ar.article_end > NOW()) OR (ar.article_archive_status=1 AND ac.acat_archive=1), 1, 0) ";
     $sql .= "GROUP BY ar.article_id";
     $getart_data = _dbQuery($sql);
     foreach ($getart_data as $row) {
         // read article content for update
         $sql = "SELECT * FROM ";
         $sql .= DB_PREPEND . "phpwcms_articlecontent WHERE acontent_aid=" . $row["article_id"] . " ";
         $sql .= "AND acontent_module='br_sliderjs' ";
         $sql .= "AND acontent_trash=0 AND ";
         $sql .= "acontent_type = 30";
         $getacontent_data = _dbQuery($sql);
         foreach ($getacontent_data as $artrow) {
             $artrow["artdata"] = $row;
             $artrow['acontent_form'] = @unserialize($artrow['acontent_form']);
             $this->plugin_cplist[$artrow['acontent_id']] = $artrow;
             //get info to curr jslib in template of actual struct where this CP is in
             $sql = "SELECT template_id, template_name, template_var, " . DB_PREPEND . "phpwcms_articlecat.acat_name ";
             $sql .= " FROM " . DB_PREPEND . "phpwcms_template";
             $sql .= " INNER JOIN " . DB_PREPEND . "phpwcms_articlecat ON  " . DB_PREPEND . "phpwcms_articlecat.acat_template=" . DB_PREPEND . "phpwcms_template.template_id";
             $sql .= " and " . DB_PREPEND . "phpwcms_template.template_trash!=9";
             $sql .= " and " . DB_PREPEND . "phpwcms_articlecat.acat_id=" . $artrow["artdata"]["acat_id"];
             $getjslib_data = _dbQuery($sql);
             if (isset($getjslib_data[0])) {
                 $jslib = unserialize($getjslib_data[0]['template_var']);
                 $this->plugin_jslib[$artrow['acontent_id']] = $jslib['jslib'];
             }
         }
     }
 }
Пример #29
0
function phpwcms_revision_r536()
{
    $status = true;
    // do former revision check – fallback to r535
    if (phpwcms_revision_check_temp('535') !== true) {
        $status = phpwcms_revision_check('535');
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_article` WHERE Field='article_public'");
    if (isset($result[0]['Default']) && $result[0]['Default'] == 0) {
        $update = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_article` CHANGE `article_public` `article_public` INT(1) NOT NULL DEFAULT '1'", 'ALTER');
        if (!$update) {
            $status = false;
        }
    }
    $result = _dbQuery("SHOW COLUMNS FROM `" . DB_PREPEND . "phpwcms_article` WHERE Field='article_opengraph'");
    if (!isset($result[0])) {
        $insert = _dbQuery("ALTER TABLE `" . DB_PREPEND . "phpwcms_article` ADD `article_opengraph` INT(1) UNSIGNED NOT NULL DEFAULT '1', ADD INDEX (`article_opengraph`)", 'ALTER');
        if (!$insert) {
            $status = false;
        }
    }
    return $status;
}
Пример #30
0
function phpwcms_revision_r532()
{
    $status = true;
    // do former revision check – fallback to r529
    if (phpwcms_revision_check_temp('529') !== true) {
        $status = phpwcms_revision_check('529');
    }
    $result = _dbQuery('SHOW TABLES LIKE ' . _dbEscape(DB_PREPEND . 'phpwcms_redirect'));
    if (!isset($result[0])) {
        $sql = "CREATE TABLE IF NOT EXISTS `" . DB_PREPEND . "phpwcms_redirect` (\n\t\t\t\t\t`rid` int(11) unsigned NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t`changed` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n\t\t\t\t\t`id` bigint(20) unsigned NOT NULL DEFAULT '0',\n\t\t\t\t\t`aid` bigint(20) unsigned NOT NULL DEFAULT '0',\n\t\t\t\t\t`alias` varchar(255) NOT NULL DEFAULT '',\n\t\t\t\t\t`link` varchar(255) NOT NULL DEFAULT '',\n\t\t\t\t\t`views` bigint(20) unsigned NOT NULL DEFAULT '0',\n\t\t\t\t\t`active` int(1) unsigned NOT NULL DEFAULT '0',\n\t\t\t\t\t`shortcut` int(1) unsigned NOT NULL DEFAULT '0',\n\t\t\t\t\t`type` varchar(255) NOT NULL DEFAULT '',\n\t\t\t\t\t`code` varchar(255) NOT NULL DEFAULT '',\n\t\t\t\t\t`target` varchar(255) NOT NULL DEFAULT '',\n\t\t\t\t\tPRIMARY KEY (`rid`),\n\t\t\t\t\tKEY `id` (`id`,`aid`,`alias`),\n\t\t\t\t\tKEY `active` (`active`),\n\t\t\t\t\tKEY `link` (`link`)\n\t\t\t\t) ENGINE=MyISAM";
        if (!empty($GLOBALS['phpwcms']['db_charset'])) {
            $sql .= ' DEFAULT CHARSET=' . $GLOBALS['phpwcms']['db_charset'];
        }
        if (!empty($GLOBALS['phpwcms']['db_collation'])) {
            $sql .= ' COLLATE=' . $GLOBALS['phpwcms']['db_collation'];
        }
        $result = _dbQuery($sql, 'CREATE');
        if (!$result) {
            $status = false;
        }
    }
    return $status;
}