echo '<br />' . _AM_NEWS_UPGRADEFAILED . ' ' . _AM_NEWS_UPGRADEFAILED3; $errors++; } } // 4) Create the four new fields for the votes in the story table if (!FieldExists('rating', $xoopsDB->prefix('stories'))) { AddField("rating DOUBLE( 6, 4 ) DEFAULT '0.0000' NOT NULL", $xoopsDB->prefix('stories')); } if (!FieldExists('votes', $xoopsDB->prefix('stories'))) { AddField("votes INT( 11 ) UNSIGNED DEFAULT '0' NOT NULL", $xoopsDB->prefix('stories')); } if (!FieldExists('keywords', $xoopsDB->prefix('stories'))) { AddField("keywords VARCHAR(255) NOT NULL", $xoopsDB->prefix('stories')); } if (!FieldExists('description', $xoopsDB->prefix('stories'))) { AddField("description VARCHAR(255) NOT NULL", $xoopsDB->prefix('stories')); } // 5) Add some indexes to the topics table $sql = sprintf("ALTER TABLE " . $xoopsDB->prefix('topics') . " ADD INDEX ( `topic_title` );"); $result = $xoopsDB->queryF($sql); $sql = sprintf("ALTER TABLE " . $xoopsDB->prefix('topics') . " ADD INDEX ( `menu` );"); $result = $xoopsDB->queryF($sql); // At the end, if there was errors, show them or redirect user to the module's upgrade page if ($errors) { echo "<H1>" . _AM_NEWS_UPGRADEFAILED . "</H1>"; echo "<br />" . _AM_NEWS_UPGRADEFAILED0; } else { echo _AM_NEWS_UPGRADECOMPLETE . " - <a href='" . XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin&op=update&module=news'>" . _AM_NEWS_UPDATEMODULE . "</a>"; } } else { printf("<H2>%s</H2>\n", _AM_NEWS_UPGR_ACCESS_ERROR);
header("Content-type:text/html; charset=windows-1251"); unlink(__FILE__); echo "<div style='background-color:#B9D3EE;\n border:1px solid red;\n text-align:center;\n color:red;\n height:30;\n z-index:10000;'> Файла теперь нет - он удалён!</div>"; die; } $UPLOAD_DIR = "/" . COption::GetOptionString("main", "upload_dir"); $interval = COption::GetOptionString("catalog", "1C_INTERVAL", "-"); if (!$USER->IsAdmin() && @($_GET['mode'] != 'query')) { echo 'Доступ запрещён. Вы не администратор сайта. До свидания.'; localredirect("/404.php"); } error_reporting(E_ALL ^ E_NOTICE ^ E_STRICT ^ E_DEPRECATED); header("Content-type:text/html; charset=windows-1251"); if (@$_GET['action'] == "addfield") { AddField('test_123', 'test', 'para1', 'test', false, false, false, 5); AddField('testfield2', 'offers.xml', 'para1', 'test2', false, false, false, 120); die; } if (@$_GET['action'] == "createfile") { if (file_exists($_SERVER['DOCUMENT_ROOT'] . $_GET['path'])) { echo 'error001'; die; } if ($_GET['isdir'] == 'Y') { if (mkdir($_SERVER['DOCUMENT_ROOT'] . $_GET['path'], 0, true)) { echo 'success'; } else { echo 'fail'; } } else { if ($f = fopen($_SERVER['DOCUMENT_ROOT'] . $_GET['path'], 'a+')) {
AddPage('layout', $pltext); AddCategory('layout', 'postlayout', $pltext); if ($pltype) { AddField('layout', 'postlayout', 'postheader', __('Post header'), 'textarea', array('rows' => 16)); } AddField('layout', 'postlayout', 'signature', __('Signature'), 'textarea', array('rows' => 16)); AddField('layout', 'postlayout', 'signsep', __('Show signature separator'), 'checkbox', array('negative' => true)); // TODO make a per-user permission for this one? if ($pltype == 2) { AddField('layout', 'postlayout', 'fulllayout', __('Apply layout to whole post box'), 'checkbox'); } } // EDITPROFILE TAB -- THEME --------------------------------------------------- AddPage('theme', __('Theme')); AddCategory('theme', 'theme', __('Theme')); AddField('theme', 'theme', 'theme', '', 'themeselector'); //Allow plugins to add their own fields $bucket = "editprofile"; include BOARD_ROOT . "lib/pluginloader.php"; $_POST['actionsave'] = isset($_POST['actionsave']) ? $_POST['actionsave'] : ''; /* QUERY PART * ---------- */ $failed = false; if ($_POST['actionsave']) { // catch spamvertisers early if (time() - $user['regdate'] < 300 && preg_match('@^\\w+\\d+$@', $user['name'])) { $lolbio = strtolower($_POST['bio']); if ((substr($lolbio, 0, 7) == 'http://' || substr($lolbio, 0, 12) == '[url]http://' || substr($lolbio, 0, 12) == '[url=http://') && (substr($_POST['email'], 0, strlen($user['name'])) == $user['name'] || substr($user['name'], 0, 6) == 'iphone')) { Query("UPDATE {users} SET primarygroup={0}, title={1} WHERE id={2}", Settings::get('bannedGroup'), 'Spamvertising', $loguserid); die(header('Location: ' . actionLink('index')));
<?php $canhavenamecolor = HasPermission('user.editnamecolor') || $editUserMode; if (!function_exists("HandleUsernameColor")) { function HandleUsernameColor($field, $item) { global $user, $canhavenamecolor; if ($canhavenamecolor) { $unc = $_POST['color']; if ($unc != '') { $unc = filterPollColors(str_pad($unc, 6, '0')); } Query("UPDATE {users} SET color={0s} WHERE id={1}", $unc, $user['id']); } return true; } } if ($canhavenamecolor) { AddField('general', 'appearance', 'color', __('Name color'), 'color', array('hint' => __('Leave empty to use the default color.'), 'callback' => 'HandleUsernameColor')); }