Пример #1
0
        $newtagid = getcount('tag', array('tagname' => $_POST['newtagname']), 'tagid');
        if (empty($newtagid)) {
            // add tag
            $setarr = array('tagname' => $_POST['newtagname'], 'uid' => $_SGLOBAL['supe_uid'], 'dateline' => $_SGLOBAL['timestamp']);
            $newtagid = inserttable('tag', $setarr, 1);
        }
        //ʼϲ
        include_once S_ROOT . './source/function_op.php';
        if (!empty($_POST['ids']) && mergetag($_POST['ids'], $newtagid)) {
            cpmessage('do_success', $_POST['mpurl']);
        } else {
            cpmessage('the_tag_choose_to_merge', $_POST['mpurl']);
        }
    } elseif ($_POST['optype'] == 'close' || $_POST['optype'] == 'open') {
        include_once S_ROOT . './source/function_op.php';
        if (!empty($_POST['ids']) && closetag($_POST['ids'], $_POST['optype'])) {
            cpmessage('do_success', $_POST['mpurl']);
        } else {
            cpmessage('choose_to_operate_tag', $_POST['mpurl']);
        }
    }
}
$mpurl = 'admincp.php?ac=tag';
// Search Processing
$intkeys = array('close');
$strkeys = array();
$randkeys = array(array('sstrtotime', 'dateline'), array('intval', 'blognum'));
$likekeys = array('tagname');
$results = getwheres($intkeys, $strkeys, $randkeys, $likekeys);
$wherearr = $results['wherearr'];
$wheresql = empty($wherearr) ? '1' : implode(' AND ', $wherearr);
Пример #2
0
echo file_get_contents("./templates/mainpage.html");
//checks if title and text is not empty
if ($_POST["title"] != "" and $_POST["text"] != "") {
    //TODO check where the link is created and the filename and if the string replacement affectes this
    $filename = $_POST["title"] . '.html';
    //all entrys will be saved in the content folder als a .html file
    $filepath = "./content/{$filename}";
    //creates a new file in the content folder with the name of the entry title
    $datei = fopen("{$filepath}", "x");
    //if file already exists nothing happens
    //bulilds html file and triggers the functions for replaceing the "<" ">"
    $headline = $_POST['title'];
    $content = $_POST['text'];
    $headline = mb_convert_encoding($headline, 'UTF-8', mb_detect_encoding($headline));
    $headline = opentag($headline);
    $headline = closetag($headline);
    $headline2 = str_replace("/", "&#47;", $headline);
    $headline2 = "<h2>" . $headline . "</h2>";
    $content = mb_convert_encoding($content, 'UTF-8', mb_detect_encoding($content));
    $content = opentag($content);
    $search = "/";
    $replace = "&#47;";
    $subject = $content;
    $content2 = str_replace("/", "&#47;", $content);
    $content2 = '<p>' . $content2 . '</p>';
    // File header indicating that the file is UTF-8
    fwrite($datei, pack("CCC", 0xef, 0xbb, 0xbf));
    fwrite($datei, $headline2, 25);
    fwrite($datei, $content2, 5555);
    fclose($datei);
    //redirect to mainpage