Beispiel #1
0
         $database->transactionally(function () use($database, $baseurl) {
             $template = new WelcomeTemplate();
             $template->setDatabase($database);
             $template->setUserCode($_POST['usercode']);
             $template->setBotCode($_POST['botcode']);
             $template->save();
             Logger::welcomeTemplateCreated($database, $template);
             Notification::welcomeTemplateCreated($template);
             SessionAlert::success("Template successfully created.");
             header("Location: {$baseurl}/acc.php?action=templatemgmt");
         });
     } else {
         if (isset($_POST['preview'])) {
             $usercode = $_POST['usercode'];
             $botcode = $_POST['botcode'];
             echo displayPreview($usercode);
         } else {
             $usercode = '';
             $botcode = '';
         }
         $smarty->assign("usercode", $usercode);
         $smarty->assign("botcode", $botcode);
         $smarty->display("welcometemplate/add.tpl");
         BootstrapSkin::displayInternalFooter();
         die;
     }
     die;
 }
 if (isset($_GET['select'])) {
     $user = User::getCurrent();
     if ($_GET['select'] == 0) {
Beispiel #2
0
function show_content_author()
{
    global $qs, $plugindir, $ns, $plugintable, $sql, $aa, $e107cache, $tp, $pref, $content_pref, $cobj;
    global $nextprevquery, $from, $number, $content_icon_path;
    global $CONTENT_RECENT_TABLE, $datequery, $crumb, $mainparent;
    $newcontent_shortcodes = e107::getScBatch('content', TRUE);
    $mainparent = $aa->getMainParent(intval($qs[1]));
    $content_pref = $aa->getContentPref($mainparent);
    show_content_search_menu("author", $mainparent);
    //show navigator/search/order menu
    $cachestr = "{$plugintable}.author.{$qs['1']}";
    $cachecheck = CachePre($cachestr);
    if ($cachecheck) {
        echo $cachecheck;
        return;
    }
    $content_icon_path = $tp->replaceConstants($content_pref["content_icon_path"]);
    $array = $aa->getCategoryTree("", $mainparent, TRUE);
    if (array_key_exists($qs[1], $array)) {
        $validparent = "0,0." . implode(",0.", array_keys($array));
    } else {
        $validparent = implode(",", array_keys($array));
    }
    $order = $aa->getOrder();
    $number = isset($content_pref["content_nextprev_number"]) && $content_pref["content_nextprev_number"] ? $content_pref["content_nextprev_number"] : "5";
    $nextprevquery = isset($content_pref["content_nextprev"]) && $content_pref["content_nextprev"] ? "LIMIT " . intval($from) . "," . intval($number) : "";
    $qry = " content_parent REGEXP '" . $aa->CONTENTREGEXP($validparent) . "' ";
    $sqla = "";
    if (!is_object($sqla)) {
        $sqla = new db();
    }
    if (!($author = $sqla->db_Select($plugintable, "content_author", "content_refer !='sa' AND " . $qry . " " . $datequery . " AND content_id = '" . intval($qs[1]) . "' AND content_class REGEXP '" . e_CLASS_REGEXP . "' "))) {
        $row['url_content_id'] = $mainparent;
        $url = e107::url("content", "authors", $row, "full");
        //header("location:".e_SELF."?authorx.xlist.".$mainparent); exit;
        e107::redirect($url);
    } else {
        list($content_author) = $sqla->db_Fetch();
        $sqlb = new db();
        $authordetails = $aa->getAuthor($content_author);
        $query = " content_author = '" . $authordetails[3] . "' || content_author REGEXP '^" . $authordetails[1] . "^' " . (is_numeric($content_author) ? " || content_author = '" . $authordetails[0] . "' " : "") . " ";
        $validparent = implode(",", array_keys($array));
        $qry = " content_refer !='sa' AND content_parent REGEXP '" . $aa->CONTENTREGEXP($validparent) . "' " . $datequery . " AND content_class REGEXP '" . e_CLASS_REGEXP . "' AND (" . $query . ") ";
        $contenttotal = $sqlb->db_Count($plugintable, "(*)", "WHERE " . $qry . " ");
        $authorqry = $qry . " " . $order . " " . $nextprevquery;
        $text = displayPreview($authorqry);
        $text = $aa->getCrumbPage("author", $array, $mainparent) . $text;
        $caption = $content_pref['content_author_caption'];
        if (isset($content_pref['content_author_caption_append_name']) && $content_pref['content_author_caption_append_name']) {
            $caption .= " " . $authordetails[1];
        }
        $pagination = $aa->ShowNextPrev("", $from, $number, $contenttotal);
        $ns->tablerender($caption, $text . $pagination);
    }
    $cachecheck = CachePost($cachestr);
}