Example #1
0
function update_tad_web()
{
    global $xoopsDB, $xoopsUser, $WebID;
    $myts =& MyTextSanitizer::getInstance();
    $_POST['WebName'] = $myts->addSlashes($_POST['WebName']);
    $sql = "update " . $xoopsDB->prefix("tad_web") . " set\n   `WebName` = '{$_POST['WebName']}'\n    where WebID ='{$WebID}'";
    $xoopsDB->queryF($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error());
    $TadUpFilesLogo = TadUpFilesLogo();
    $TadUpFilesLogo->set_col('logo', $WebID, 1);
    $TadUpFilesLogo->del_files();
    mklogoPic($WebID);
    $TadUpFilesLogo->import_one_file(XOOPS_ROOT_PATH . "/uploads/tad_web/{$WebID}/auto_logo/auto_logo.png", null, 1280, 150, null, 'auto_logo.png', false);
    //import_img(XOOPS_ROOT_PATH . "/uploads/tad_web/{$WebID}/auto_logo", "logo", $WebID);
    output_head_file();
}
Example #2
0
function save_webs_title($webTitles = array())
{
    global $xoopsDB, $TadUpFiles;
    $myts =& MyTextSanitizer::getInstance();
    foreach ($webTitles as $WebID => $WebTitle) {
        $WebTitle = $myts->addSlashes($WebTitle);
        $sql = "update " . $xoopsDB->prefix("tad_web") . " set `WebTitle` = '{$WebTitle}' where WebID='{$WebID}'";
        $xoopsDB->queryF($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error());
        $TadUpFiles->set_col("WebLogo", $WebID);
        $TadUpFiles->upload_file('upfile', 246, null, null, null, true);
        mklogoPic($WebID);
    }
    return $WebID;
}