Exemplo n.º 1
0
 public function doHome(LJL_Request $input, LJL_Response $output)
 {
     $error = 0;
     if (!$input->post('submit')) {
         $output->error = $error;
         $output->setTemplate('Apply');
         return;
     }
     $webName = $input->post('webName');
     $adminName = $input->post('adminName');
     $adminPassword = $input->post('adminPassword');
     $webDesc = $input->post('webDesc');
     $webSite = $input->post('webSite');
     $weiboUid = $input->post('weiboUid');
     $email = $input->post('email');
     $cate = $input->post('cate');
     if (!trim($webName) || !trim($adminName) || !trim($adminPassword) || !trim($webDesc) || !trim($webSite) || !trim($cate) || !trim($email)) {
         //信息不完整
         $error = 2;
     }
     if (Helper_Blogconfig::getAdminInfo(array('website' => $webSite, 'status' => 0)) || Helper_Blogconfig::getAdminInfo(array('webname' => $webName, 'status' => 0))) {
         //网站已存在
         $error = 1;
     }
     if (!$error) {
         Helper_Blogconfig::insertAdminInfo(array('insertData' => array('webName' => $webName, 'adminName' => $adminName, 'adminPassword' => md5($adminPassword . '_'), 'webDesc' => $webDesc, 'webSite' => $webSite, 'weiboUid' => $weiboUid, 'email' => $email, 'cate' => $cate, 'status' => 0)));
         $error = 'noerror';
     }
     $output->error = $error;
     $output->setTemplate('Apply');
 }
Exemplo n.º 2
0
 public function doDefault(LJL_Request $input, LJL_Response $output)
 {
     #如果是提交
     if ($input->funName) {
         #获得所有需要参数的值
         $iparam = $output->helperCfgArr[$input->funName]['param'];
         $paramVal = array();
         if ($iparam) {
             foreach ($iparam as $p) {
                 $paramValArr[$p[0]] = $input->post($p[0]);
             }
         }
         if (isset($paramValArr)) {
             foreach ($paramValArr as $k => $v) {
                 if ($v == '') {
                     unset($paramValArr[$k]);
                 }
             }
             $paramValArr = $output->paramValArr = $paramValArr;
             // array_filter($paramValArr);
         } else {
             $paramValArr = array();
             $output->paramValArr = $paramValArr;
         }
         $data = LJL_Api::run($input->funName, $paramValArr);
         $output->htmlVarStr = Libs_Tools_VarDump::showVar($data);
     }
     $output->setTemplate('IcloudManage');
 }
Exemplo n.º 3
0
 public function doDefault(LJL_Request $input, LJL_Response $output)
 {
     #如果是提交
     //var_dump($input->dopost);die;
     if ($input->dopost && $input->funName) {
         #获得所有需要参数的值
         $iparam = $output->helpCfgArr2[$input->funName]['param'];
         //var_dump($iparam);die;
         $paramVal = array();
         if ($iparam) {
             foreach ($iparam as $p) {
                 $paramValArr[$p[0]] = $input->post($p[0]);
             }
         }
         if (isset($paramValArr)) {
             foreach ($paramValArr as $k => $v) {
                 if ($v == '') {
                     unset($paramValArr[$k]);
                 }
             }
             $paramValArr = $output->paramValArr = $paramValArr;
             // array_filter($paramValArr);
         } else {
             $paramValArr = array();
             $output->paramValArr = $paramValArr;
         }
         #获得结果
         $tmpArr = explode("::", $input->funName);
         $className = "Helper_" . $tmpArr[0];
         //var_dump($className);die;
         $classMethod = $tmpArr[1];
         #特殊处理
         if ('Helper_Blog' == $className && in_array($classMethod, array('getArticleList', 'getArticleInfo'))) {
             Db_Blog::instance(null, 'blog_laura');
         }
         if (isset($output->helpCfgArr2[$input->funName]['norun'])) {
             $output->htmlVarStr = $output->helpCfgArr2[$input->funName]['norun'];
         } else {
             $data = call_user_func(array($className, $classMethod), $paramValArr);
             $output->htmlVarStr = Libs_Tools_VarDump::showVar($data);
         }
     }
     $output->setTemplate('HelperManage');
 }
Exemplo n.º 4
0
 public function DoList(LJL_Request $input, LJL_Response $output)
 {
     $page = $input->get('page');
     $articleId = $input->get('articleid');
     if ($page <= 1) {
         $page = 1;
     }
     $articleList = Helper_Blog::getArticleList(array('page' => $page, 'pageSize' => $this->pageSize, 'fields' => array(), 'isPublished' => 0, 'articleid' => $articleId));
     $articleCount = Helper_Blog::getArticleList(array('isCount' => 1, 'isPublished' => 0, 'articleid' => $articleId));
     //分页相关
     $totalPage = ceil($articleCount / $this->pageSize);
     $pageStr = Libs_Global_Page::getPageString(array('page' => $page, 'pageTotal' => $totalPage, 'urlClass' => 'Blog_Plugin_Urls', 'urlFunc' => 'getAdminListUrl', 'args' => array('page' => $page)));
     //默认showimg
     $putDir = '/tmp/' . APP_BLOG_NAME . '.php';
     $outimg = '';
     if (file_exists($putDir)) {
         $imgArr = json_decode(file_get_contents($putDir));
         foreach ((array) $imgArr as $img) {
             $outimg .= "\n" . $img;
         }
     }
     $output->imgStr = $outimg;
     $output->articleid = $articleId;
     $output->pageStr = $pageStr;
     $output->articleList = $articleList;
     $output->setTemplate('AdminList');
 }
Exemplo n.º 5
0
 public function doShowerror(LJL_Request $input, LJL_Response $output)
 {
     LJL_Http::send404Header();
     $output->setTemplate('404');
 }
Exemplo n.º 6
0
 public function buildStaticPage(array $data, $template, $filePath)
 {
     if (empty($data)) {
         trigger_error('$data dose not empty!');
         return false;
     }
     if (empty($template)) {
         trigger_error('$template dose not empty!');
         return false;
     }
     if (empty($filePath)) {
         trigger_error('$filePath dose not empty!');
         return false;
     }
     $output = new LJL_Response();
     $output->add($data);
     $output->template = $template;
     $view = new LJL_View_Simple($output);
     LJL_File::write($view->render(), $filePath);
     return false;
 }
Exemplo n.º 7
0
 public function doDefault(LJL_Request $input, LJL_Response $output)
 {
     //http://hongbo.com/index.php?c=detail&a=default&articleid=67
     LJL_Http::setExpires(3600);
     #设置缓存时间
     $articleId = $input->get('articleid');
     $articleInfo = Helper_Blog::getArticleInfo(array('articleId' => $articleId, 'fileds' => array('firstImgId', 'cate', 'title', 'descript', 'tags', 'source', 'insertTime', 'view', 'content')));
     if (count($articleInfo) < 5) {
         LJL_Http::send404Header();
         $output->setTemplate('404');
         return;
     }
     $articleInfo['id'] = $articleId;
     $articleTags = explode(',', $articleInfo['tags']);
     $cateList = LJL_Config::get('Blog_' . ucfirst(APP_BLOG_NAME) . '_Cate', 'CATE');
     $prevNext = Helper_Blog::getPreNextArticle(array('articleId' => $articleId, 'fileds' => array('id', 'title')));
     $prevNext = $this->formatPrevNext($prevNext);
     //面包屑导航
     $nav[0]['title'] = '首页';
     $nav[0]['url'] = WWW_WEB;
     $nav[1]['title'] = $cateList[$articleInfo['cate']][0];
     $nav[1]['url'] = Blog_Plugin_Urls::getListUrl(array('cate' => $articleInfo['cate']));
     $nav[2]['title'] = $articleInfo['title'];
     //seo
     $output->seoArr = array('title' => $articleInfo['title'] . ' - ' . BLOG_SEO_TITTLE . ' | 最红博', 'description' => $articleInfo['descript'], 'keywords' => implode(',', $articleTags));
     $output->cateList = $cateList;
     $output->articleInfo = $articleInfo;
     $output->articleTags = $articleTags;
     $output->prevNext = $prevNext;
     $output->nav = $nav;
     $output->cate = $articleInfo['cate'];
     $output->header = $output->fetchCol("Part/Main/Header");
     $output->footer = $output->fetchCol("Part/Main/Footer");
     $output->navbarTpl = $output->fetchCol("Part/Navbar");
     $output->leftsideCate = $output->fetchCol("Part/LeftsideCate");
     $output->navGuideTpl = $output->fetchCol("Part/Navguide");
     $output->newArticleTpl = $output->fetchCol("Part/NewArticle");
     $output->commentTpl = $output->fetchCol("Part/Comment");
     $output->searchTpl = $output->fetchCol("Part/Search");
     $output->setTemplate('Detail');
 }
Exemplo n.º 8
0
 public function doList(LJL_Request $input, LJL_Response $output)
 {
     $output->setTemplate('list');
 }