예제 #1
0
 public function index()
 {
     Cache::loadPage('', 30);
     $inputData = array();
     $postid = 0;
     Model::loadWithPath('post', System::getThemePath() . 'model/');
     if (!($match = Uri::match('post\\/(.*?)\\.html$'))) {
         Redirect::to('404page');
     }
     $friendly_url = addslashes($match[1]);
     $loadData = Post::get(array('cacheTime' => 30, 'where' => "where friendly_url='{$friendly_url}'"));
     if (!isset($loadData[0]['postid'])) {
         Redirect::to('404page');
     }
     $inputData = $loadData[0];
     if (Request::has('btnComment')) {
         try {
             sendComment($loadData[0]['postid']);
             $inputData['commentAlert'] = '<div class="alert alert-success">Send comment success.</div>';
         } catch (Exception $e) {
             $inputData['commentAlert'] = '<div class="alert alert-warning">' . $e->getMessage() . '</div>';
         }
     }
     $postid = $loadData[0]['postid'];
     $listTag = PostTags::renderToLink($postid);
     $inputData['listTag'] = $listTag;
     $inputData['listComments'] = Comments::get(array('where' => "where postid='{$postid}' AND status='1'", 'orderby' => "order by postid desc"));
     Post::upView($postid);
     System::setTitle(ucfirst($loadData[0]['title']));
     $keywords = isset($loadData[0]['keywords'][4]) ? $loadData[0]['keywords'] : System::getKeywords();
     System::setKeywords($keywords);
     self::makeContent('post', $inputData);
     Cache::savePage();
 }
예제 #2
0
     for ($i = 0; $i < count($results); $i++) {
         $results[$i]['Members'] = getMember($results[$i]['id']);
         $results[$i]['Hauls'] = getHaul($results[$i]['id']);
         $results[$i]['Comments'] = getComment($results[$i]['id']);
     }
     echo json_encode($results);
     break;
 case 'delOp':
     delOp($_REQUEST['owner_id'], $_REQUEST['op_id']);
     break;
     /////
     /////
 /////
 /////
 case 'sendComment':
     $member_id = sendComment($_REQUEST['op_id'], $_REQUEST['user_id'], $_REQUEST['comment']);
     $results['Comments'] = getComment($_REQUEST['op_id']);
     echo json_encode($results);
     break;
     /////
 /////
 case 'joinMember':
     $member_id = joinMember($_REQUEST['op_id'], $_REQUEST['user_id'], $_REQUEST['displayname'], $_REQUEST['profile_url']);
     $results['Members'] = getMember($_REQUEST['op_id']);
     echo json_encode($results);
     break;
 case 'partMember':
     $member_id = partMember($_REQUEST['op_id'], $_REQUEST['user_id']);
     $results['Members'] = getMember($_REQUEST['op_id']);
     echo json_encode($results);
     break;
예제 #3
0
파일: index.php 프로젝트: hardkap/pritlog
function mainLogic()
{
    global $debugMode, $option, $requestCategory, $optionValue, $serverName;
    //$category = $data[4];
    switch ($option) {
        case "newEntry":
            if ($debugMode == "on") {
                echo "Calling newEntryPass()";
            }
            newEntryForm();
            break;
        case "newEntryForm":
            if ($debugMode == "on") {
                echo "Calling newEntryForm()";
            }
            newEntryForm();
            break;
        case "newEntrySubmit":
            newEntrySubmit();
            break;
        case "newEntrySuccess":
            newEntrySuccess();
            break;
        case "mainPage":
            $requestCategory = '';
            listPosts();
            $referrer = $serverName . $_SERVER['REQUEST_URI'];
            $_SESSION['referrer'] = $referrer;
            break;
        case "adminPage":
            adminPage();
            break;
        case "adminPageBasic":
            if ($debugMode == "on") {
                echo "adminPageBasic  " . $_POST['process'] . "<br>";
            }
            adminPageBasic();
            break;
        case "adminPageBasicSubmit":
            if ($debugMode == "on") {
                echo "adminPageBasicSubmit  " . $_POST['process'] . "<br>";
            }
            adminPageBasicSubmit();
            break;
        case "adminPageAdvanced":
            if ($debugMode == "on") {
                echo "adminPageAdvanced  " . $_POST['process'] . "<br>";
            }
            adminPageAdvanced();
            break;
        case "adminPageAdvancedSubmit":
            if ($debugMode == "on") {
                echo "adminPageAdvancedSubmit  " . $_POST['process'] . "<br>";
            }
            adminPageAdvancedSubmit();
            break;
        case "adminPageAuthors":
            if ($debugMode == "on") {
                echo "adminPageAuthors  " . $_POST['process'] . "<br>";
            }
            adminPageAuthors();
            break;
        case "adminAuthorsAdd":
            if ($debugMode == "on") {
                echo "adminAuthorsAdd  " . $_POST['process'] . "<br>";
            }
            adminAuthorsAdd();
            break;
        case "adminAuthorsEdit":
            if ($debugMode == "on") {
                echo "adminAuthorsEdit  " . $_POST['process'] . "<br>";
            }
            adminAuthorsEdit();
            break;
        case "adminPluginsSubmit":
        case "adminPagePlugins":
            adminPagePlugins();
            break;
        case "adminPageModerate":
        case "adminModerateSubmit":
            adminPageModerate();
            break;
        case "deleteEntry":
            if ($debugMode == "on") {
                echo "deleteEntry  " . $_POST['process'] . "<br>";
            }
            //deleteEntrySubmit();
            if ($_POST['process'] !== "deleteEntrySubmit") {
                deleteEntryForm();
            } else {
                deleteEntrySubmit();
            }
            break;
        case "editEntry":
            if ($debugMode == "on") {
                echo "editEntry  " . $_POST['process'] . "<br>";
            }
            editEntryForm();
            $referrer = $serverName . $_SERVER['REQUEST_URI'];
            $_SESSION['referrer'] = $referrer;
            break;
        case "editEntryForm":
            editEntryForm();
            break;
        case "editEntrySubmit":
            editEntrySubmit();
            break;
        case "posts":
            viewEntry();
            break;
        case "archives":
            viewArchive();
            break;
        case "month":
            viewArchiveMonth();
            break;
        case "category":
            $requestCategory = $optionValue;
            listPosts();
            $referrer = $serverName . $_SERVER['REQUEST_URI'];
            $_SESSION['referrer'] = $referrer;
            break;
        case "searchPosts":
            searchPosts();
            break;
        case "sendComment":
            sendComment();
            break;
        case "sendCommentSuccess":
            sendCommentSuccess();
            break;
        case "listAllComments":
            listAllComments();
            break;
        case "deleteComment":
            if ($debugMode == "on") {
                echo "deleteEntry  " . $_POST['process'] . "<br>";
            }
            $process = isset($_POST['process']) ? $_POST['process'] : "";
            if ($process !== "deleteCommentSubmit") {
                deleteCommentForm();
            } else {
                deleteCommentSubmit();
            }
            break;
        case "loginPage":
            loginPage();
            break;
        case "logoutPage":
            logoutPage();
            break;
        case "registerPage":
            registerPage();
            break;
        case "registerPageSubmit":
            registerPageSubmit();
            break;
        case "forgotPass":
            forgotPass();
            break;
        case "forgotPassSubmit":
            forgotPassSubmit();
            break;
        case "activation":
            activation();
            break;
        case "myProfile":
            myProfile();
            break;
        case "myProfileSubmit":
            myProfileSubmit();
            break;
        case "pluginFunction1":
            pluginFunction1();
            break;
        case "pluginFunction2":
            pluginFunction2();
            break;
        case "pluginFunction3":
            pluginFunction3();
            break;
        case "pluginFunction4":
            pluginFunction4();
            break;
        case "pluginFunction5":
            pluginFunction5();
            break;
    }
}
예제 #4
0
        die;
    }
    $xoopsMailer =& getMailer();
    $xoopsMailer->useMail();
    $xoopsMailer->setTemplate('mail.tpl');
    $xoopsMailer->assign('SITENAME', $xoopsConfig['sitename']);
    $xoopsMailer->assign('ADMINMAIL', $xoopsConfig['adminmail']);
    $xoopsMailer->assign('SITEURL', XOOPS_URL . "/");
    $xoopsMailer->assign('NAME', $name);
    $xoopsMailer->assign('EMAIL', $email);
    $xoopsMailer->assign('COMMENTS', $comment);
    $xoopsMailer->setTemplateDir(XOOPS_ROOT_PATH . "/modules/team/language/" . $xoopsConfig['language'] . "/");
    $xoopsMailer->setFromEmail($email);
    $xoopsMailer->setFromName($name);
    $xoopsMailer->setSubject(sprintf(_MS_TC_COMFROM, $xoopsConfig['sitename'] . ": " . $xoopsModule->name()));
    $xoopsMailer->setToEmails($xoopsModuleConfig['email']);
    if (!$xoopsMailer->send(true)) {
        redirect_header('comment.php', 2, $xoopsMailer->getErrors());
    } else {
        redirect_header('./', 1, _MS_TC_COMTHX);
    }
}
$op = isset($_REQUEST['op']) ? $_REQUEST['op'] : '';
switch ($op) {
    case 'send':
        sendComment();
        break;
    default:
        showForm();
        break;
}
예제 #5
0
        echo '<br/>';
        echo '<label>Naam</label>';
        echo '<br/>';
        echo '<input type=text name=name maxlength="255" required>';
        echo '<br/><br/>';
        echo '<label>E-mail<span class="gray"> (wordt niet getoond)</span></label>';
        echo '<br/>';
        echo '<input type=text name=email maxlength="255" required>';
        echo '<br/><br/>';
        echo '<label>Website</label>';
        echo '<br/>';
        echo '<input type=text name=website maxlength="255" required>';
        echo '<br/><br/>';
        echo '<label>Reactie</label>';
        echo '<br/>';
        echo '<textarea required="required" name="comment" cols="30" rows="8" maxlength="2000" placeholder=""></textarea>';
        echo '<br/><br/>';
        echo '<span class="submit"><input type=submit></span>';
        echo '</form>';
        echo '<br/><br/>';
        echo '<div class=line></div>';
        echo '</div>';
    }
    if (isset($_POST['name']) && isset($_POST['email']) && isset($_POST['website']) && isset($_POST['comment'])) {
        //function sendCommend($naam, $date, $comment, $website, $id){
        date_default_timezone_set('Europe/London');
        $date = date('m/d/Y h:i:s', time());
        sendComment(stripslashes(strip_tags($_POST['name'])), $date, stripslashes(strip_tags($_POST['comment'])), stripslashes(strip_tags($_POST['website'])), $id);
        header("Location: #");
    }
}
예제 #6
0
<?php

if (!isset($_RESQUEST['id'])) {
    if (!($match = Uri::match('^post\\-(\\d+)\\-.*?\\.html'))) {
        Redirect::to('404page');
    }
    $_RESQUEST['id'] = $match[1];
    $id = $match[1];
} else {
    $id = $_RESQUEST['id'];
}
// print_r($_RESQUEST['id']);die();
$pageName = 'post';
$pageData = array();
$pageData['content_top'] = Render::content_top($pageName);
$pageData['content_left'] = Render::content_left($pageName);
$pageData['content_right'] = Render::content_right($pageName);
$pageData['content_bottom'] = Render::content_bottom($pageName);
Theme::model('post');
$headData = GlobalCMS::$setting;
$pageData['commentAlert'] = sendComment();
// $pageData['categories']=categories();
$pageData = postProcess($pageData);
$pageData['listComments'] = listComments($id);
$headData['title'] = $pageData['title'];
Theme::view('head', $headData);
Theme::view($pageName, $pageData);
Theme::view('footer');