function add_field($table, $field, $type, $after) { global $xoopsDB, $myprefix; $res = $xoopsDB->query("SELECT {$field} FROM {$table}", 1); if (empty($res) && $xoopsDB->errno()) { // check exists if ($after) { $after = "AFTER {$after}"; } $res = $xoopsDB->query("ALTER TABLE {$table} ADD {$field} {$type} {$after}"); } else { return false; } report_message(" Add new field: <b>{$table}.{$field}</b>"); if (!$res) { echo "<span style='color: red; font: bold;'>" . $xoopsDB->error() . "</span>\n"; } return $res; }
function add_field($table, $field, $type, $after) { global $xoopsDB; $res = $xoopsDB->query("SELECT {$field} FROM {$table}", 1); if (empty($res) && $xoopsDB->errno()) { // check exists if ($after) { $after = "AFTER {$after}"; } $res = $xoopsDB->query("ALTER TABLE {$table} ADD {$field} {$type} {$after}"); } else { return false; } report_message(" Add new field: <b>{$table}.{$field}</b>"); if (!$res) { echo "<div class='errorMsg'>" . $xoopsDB->errno() . "</div>\n"; } return $res; }
require_once "../../administrator/components/com_performs/lib/lib_phpForm.php"; require_once "../../administrator/components/com_performs/class.performs.php"; if (file_exists('../../components/com_performs/language/' . $mosConfig_lang . '.php')) { include '../../components/com_performs/language/' . $mosConfig_lang . '.php'; } else { include '../../components/com_performs/language/english.php'; } if (isJ10()) { //session_name( 'pf_'.md5( $mosConfig_live_site ) ); @session_start(); if ($pfDebug) { // report_message ("Version is < 1.5", "<ul><li>So we can relax about image paths...</li></ul>"); } } else { if ($pfDebug) { report_message("1.5 Session Issue...", "<ul><li>We have to pass data in a GET request to 15, because I can't get the session working!</li></ul>"); } } if (!isset($my)) { if (isset($_SESSION[md5('my')])) { $my = $_SESSION[md5('my')]; } } if (isJ10()) { if (!isset($_SESSION[md5('form_id')])) { report_error(18, PF_ERROR_18, PF_ERROR_18_COMMENT); return; } if (!isset($_SESSION[md5('pdfAvailable')])) { die2("Intruder Alert 19!"); }
<?php # trackback -> refpage upgrade # $Id: oninstall.php,v 1.1 2009/10/31 10:05:53 nobu Exp $ global $xoopsDB; # rename trackback* -> refpage* define('OLDTBL', $xoopsDB->prefix("trackback")); define('NEWTBL', $xoopsDB->prefix("refpage")); if ($xoopsDB->query("SELECT * FROM " . OLDTBL . "_ref LIMIT 1")) { report_message(" Add new table: <b>{$table}</b>"); foreach (array('', '_ref', '_log') as $pfix) { report_message("Replace: trackback{$pfix} -> refpage{$pfix}"); $xoopsDB->query('DROP TABLE `' . NEWTBL . $pfix . '`'); $xoopsDB->query('RENAME TABLE `' . OLDTBL . $pfix . '` TO `' . NEWTBL . $pfix . '`'); } } function report_message($msg) { global $msgs; // module manager's variable static $first = true; if ($first) { $msgs[] = "Update Database..."; $first = false; } $msgs[] = " {$msg}"; } $handler =& xoops_gethandler('groupperm');