function comment(array $articleLangs = array())
{
    $comment = new Comment();
    $comment->setAuthor(author('niko'));
    $comment->content = 'Booh.';
    $comment->setArticle(article($articleLangs));
    return $comment;
}
 /**
  * Deleted checked categories.
  */
 public function index_onDelete()
 {
     if (($checkedIds = article('checked')) && is_array($checkedIds) && count($checkedIds)) {
         foreach ($checkedIds as $categoryId) {
             if (!($category = Category::find($categoryId))) {
                 continue;
             }
             $category->delete();
         }
         Flash::success(Lang::get('abnmt.theaterpress::lang.categories.delete_selected_success'));
     } else {
         Flash::error(Lang::get('abnmt.theaterpress::lang.categories.delete_selected_empty'));
     }
     return $this->listRefresh();
 }
示例#3
0
文件: front.php 项目: bjrnblm/blender
<?php

Route::get('/', 'HomeController@index');
Route::get(article('contact')->url, 'ContactController@index');
Route::post(article('contact')->url, 'ContactController@handleResponse');
Route::post('newsletter/api/subscribe', 'NewsletterApiController@subscribe');
示例#4
0
 /**
  * Get page instance.
  *
  * @return mixed
  */
 function page()
 {
     return article()->onlyPage();
 }
示例#5
0
        echo implode("\n", $html);
        echo "\n<br/>\n";
        echo $pageLink;
    }
}
$error = true;
if (validRequest()) {
    if (isset($_SESSION['login']) && $_SESSION['permission'] == 'admin') {
        if (isset($_GET['token']) && $_GET['token'] == $_SESSION['token']) {
            $error = false;
            $do = 'info';
            if (isset($_GET['do']) && !empty($_GET['do'])) {
                $do = trim(strtolower($_GET['do']));
            }
            switch ($do) {
                case 'info':
                    echo info($pdo);
                    break;
                case 'article':
                    article($pdo);
                    break;
                case 'thesis':
                    thesis($pdo);
                    break;
            }
        }
    }
}
if ($error) {
    redirect(BASE_PATH . '/index.php', 1);
}
示例#6
0
 /**
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $article = article(SpecialArticle::HOME());
     return view('front.home.index', compact('article'));
 }
 public function index()
 {
     $article = article($this->getTechnicalName());
     return view("front.{$this->getViewFolderName()}.index")->with(compact('article'));
 }
示例#8
0
<?php

include $_SERVER['DOCUMENT_ROOT'] . "/php/brainspell.php";
header($_SERVER['SERVER_PROTOCOL'] . " 200 OK");
$uri = $_SERVER['REQUEST_URI'];
$parts = preg_split("/[\\/?]/", $uri);
if ($parts[1] == "article") {
    $id = "";
    for ($i = 2; $i < count($parts); $i++) {
        $id .= $parts[$i];
        if ($i < count($parts) - 1) {
            $id .= "/";
        }
    }
    article($id);
} else {
    if ($parts[1] == "json") {
        if ($parts[2] == "pmid") {
            article_json_pmid($parts[3]);
        } else {
            if ($parts[2] == "doi") {
                $doi = "";
                for ($i = 3; $i < count($parts); $i++) {
                    $doi .= $parts[$i];
                    if ($i < count($parts) - 1) {
                        $doi .= "/";
                    }
                }
                article_json_doi($doi);
            }
        }
 public function index()
 {
     $article = article(SpecialArticle::CONTACT());
     return view('front.contact.index', compact('article'));
 }
if (isset($_GET["action"])) {
    switch ($_GET["action"]) {
        case "login":
            user_login();
            break;
        case "register":
            user_register();
            break;
        case "remind":
            user_remind();
            break;
        case "logout":
            user_logout();
            break;
        case "article":
            article($_GET["PMID"]);
            break;
        case "article_json_pmid":
            article_json_pmid($_GET["PMID"]);
            break;
        case "article_json_doi":
            article_json_doi($_GET["PMID"]);
            break;
        case "search_lucene":
            search_lucene($_GET["query"]);
            break;
        case "article_list":
            article_list($_GET["query"]);
            break;
        case "index_lucene":
            index_lucene($_GET, 1);
示例#11
0
    $str = '';
    for ($i = 0; $i < $len; $i++) {
        $str = $str . getChineseChar();
    }
    return $str;
}
function getTagStr($tagcount)
{
    $str = '';
    for ($i = 0; $i < $tagcount; $i++) {
        $str = $str . '{' . mt_rand(1, 10000) . '}';
    }
    return $str;
}
echo "生成文章!<br/>";
article();
/*
echo "生成分类!<br/>";
cate();
echo "生成文章!<br/>";
article();
echo "生成页面!<br/>";
page();
echo "tag!<br/>";
tag();
$zbp->LoadTags();
foreach ($zbp->tags as $key => $value) {
	$value->Count=$zbp->CountTag($key);
	$value->Save();
}
foreach ($zbp->categorys as $key => $value) {
示例#12
0
<?php

use App\Models\Enums\SpecialArticle;
Route::get('/', 'HomeController@index')->name('home');
Route::get(article(SpecialArticle::CONTACT())->url, 'ContactController@index')->name('contact');
Route::post(article(SpecialArticle::CONTACT())->url, 'ContactController@handleResponse');
Route::get('{articleUrl}/{subArticleUrl}', 'ArticleController@index');
Route::get('{articleUrl}', 'ArticleController@index');
示例#13
0
function arclist_tag($str)
{
    preg_match_all('/{catelist(.*){\\/catelist}/isU', $str, $p_arr);
    foreach ($p_arr[0] as $k => $v) {
        $list = '';
        $search = '';
        $search[] = $v;
        preg_match('/{catelist(.*)}(.*){\\/catelist}/isU', $v, $p_attr);
        $attr = explode(' ', $p_attr[1]);
        foreach ($attr as $key => $value) {
            $attr_v = explode('=', $value);
            global ${$attr_v[0]};
            ${$attr_v[0]} = '';
            ${$attr_v[0]} = $attr_v[1];
        }
        preg_match_all('/{(.*)\\/}/isU', $p_attr[2], $list_attr);
        $list_attr = $list_attr[1];
        $rel_arr = article();
        //读取数
        for ($i = 0; $i < count($rel_arr); $i++) {
            $search_rel = '';
            $replace_rel = '';
            foreach ($rel_arr[$i] as $a => $b) {
                if (in_array($a, $list_attr)) {
                    $search_rel[] = '{' . $a . '/}';
                    $replace_rel[] = $b;
                }
                $search_rel['url'] = '{url/}';
                $replace_rel['url'] = 'show.php?id=' . $rel_arr[$i]['id'];
            }
            $list .= str_replace($search_rel, $replace_rel, $p_attr[2]);
        }
        $str = str_replace($search, $list, $str);
    }
    return $str;
}
 public function index()
 {
     $article = article('contact');
     return view('front.contact.index', compact('article'));
 }
示例#15
0
<?php

echo "\n<aside class='col-md-4'>\n    <div class='widget categories'>\n        <h3>Categories</h3>\n        <div class='row'>\n            <div class='col-sm-6'>\n                <ul class='blog_category'>";
$right_cat = DB::table('tb_category')->orderBy('name', 'asc')->where('prnt', '=', 0)->get();
foreach ($right_cat as $row) {
    $right_cat_sub = DB::table('tb_category')->orderBy('name', 'asc')->where('prnt', '=', $row->id)->get();
    if (count($right_cat_sub) > 0) {
        foreach ($right_cat_sub as $item) {
            echo article($item->id, $item->name);
        }
    } else {
        echo article($row->id, $row->name);
    }
}
function article($id, $name)
{
    $data = DB::table('tb_article')->where('category_id', $id)->where('status', '=', 1)->count();
    $article = '';
    if ($data > 0) {
        $article = "<li><a href='" . Url() . "/category/" . Convert_string::tosmall($name) . "'>" . $name . " <span class='badge'>{$data}</span></a></li>";
    }
    return $article;
}
echo "\n                </ul>\n            </div>\n        </div>                     \n    </div><!--/.categories-->\n    \n    <div class='widget archieve'>\n        <h3>Archieve</h3>\n        <div class='row'>\n            <div class='col-sm-12'>\n                <ul class='blog_archieve'>";
for ($i = 0; $i < 10; $i++) {
    $date = date('Y-m', strtotime("-{$i} months"));
    $right_month = DB::table('tb_article')->where('created_at', 'like', $date . '%')->where('status', '=', 1)->get();
    if (count($right_month) > 0) {
        echo "<li>\n                                <a href='" . Url() . "/read/" . date('Y/m', strtotime($date)) . "'><i class='fa fa-angle-double-right'></i> " . Convert_date::english(date('M Y', strtotime($date))) . "\n                                <span class='pull-right'>(" . count($right_month) . ")</span></a>\n                            </li>";
    }
}