示例#1
0
 function getListData()
 {
     $sql = e107::getDb();
     $list_caption = $this->parent->settings['caption'];
     $list_display = $this->parent->settings['open'] ? "" : "none";
     $qry = '';
     if ($this->parent->mode == "new_page" || $this->parent->mode == "new_menu") {
         $qry = "user_join>" . $this->parent->getlvisit() . " AND ";
     }
     $qry .= " user_ban=0 ORDER BY user_join DESC LIMIT 0," . intval($this->parent->settings['amount']);
     $bullet = $this->parent->getBullet($this->parent->settings['icon']);
     if (!$this->parent->e107->sql->gen("SELECT user_id,user_name,user_join FROM #user WHERE " . $qry)) {
         $list_data = LIST_MEMBER_2;
     } else {
         while ($row = $this->parent->e107->sql->fetch()) {
             $record = array();
             $rowheading = $this->parent->parse_heading($row['user_name']);
             //<a href='".e_BASE."user.php?id.".$row['user_id']."'>".$rowheading."</a>
             $uparams = array('id' => $row['user_id'], 'name' => $rowheading);
             $link = e107::getUrl()->create('user/profile/view', $uparams);
             $userlink = "<a href='" . $link . "'>" . $rowheading . "</a>";
             $record['icon'] = $bullet;
             $record['heading'] = USER ? $userlink : $rowheading;
             $record['category'] = '';
             $record['author'] = '';
             $record['date'] = vartrue($this->parent->settings['date']) ? $this->parent->getListDate($row['user_join']) : "";
             $record['info'] = '';
             $list_data[] = $record;
         }
     }
     //return array with 'records', (global)'caption', 'display'
     return array('records' => $list_data, 'caption' => $list_caption, 'display' => $list_display);
 }
示例#2
0
文件: e_rss.php 项目: gitye/e107
 /**
  * Generate the Feed Data
  * @param string $parms
  * @return array
  */
 function data($parms = '')
 {
     $pref = e107::getConfig()->getPref();
     $tp = e107::getParser();
     $this->showImages = vartrue($pref['rss_shownewsimage'], false);
     $this->summaryDescription = vartrue($pref['rss_summarydiz'], false);
     $render = $pref['rss_othernews'] != 1 ? "AND (FIND_IN_SET('0', n.news_render_type) OR FIND_IN_SET(1, n.news_render_type))" : "";
     $nobody_regexp = "'(^|,)(" . str_replace(",", "|", e_UC_NOBODY) . ")(,|\$)'";
     $topic = !empty($parms['id']) && is_numeric($parms['id']) ? " AND news_category = " . intval($parms['id']) : '';
     $limit = vartrue($parms['limit'], 10);
     $rssQuery = "SELECT n.*, u.user_id, u.user_name, u.user_email, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n\n\t\t\t\tLEFT JOIN #user AS u ON n.news_author = u.user_id\n\t\t\t\tLEFT JOIN #news_category AS nc ON n.news_category = nc.category_id\n\t\t\t\tWHERE n.news_class IN (" . USERCLASS_LIST . ") AND NOT (n.news_class REGEXP " . $nobody_regexp . ") AND n.news_start < " . time() . " AND (n.news_end=0 || n.news_end>" . time() . ") {$render} {$topic} ORDER BY n.news_datestamp DESC LIMIT 0," . $limit;
     $sql = e107::getDb();
     $sql->gen($rssQuery);
     $tmp = $sql->db_getList();
     $rss = array();
     $i = 0;
     foreach ($tmp as $value) {
         $rss[$i]['title'] = $value['news_title'];
         $rss[$i]['link'] = e107::getUrl()->create('news/view/item', $value, 'full=1');
         $rss[$i]['author'] = $value['user_name'];
         $rss[$i]['author_email'] = $value['user_email'];
         $rss[$i]['category_name'] = $tp->toHTML($value['category_name'], TRUE, 'defs');
         $rss[$i]['category_link'] = SITEURL . "news.php?cat." . $value['news_category'];
         //TODO SEFURL.
         $rss[$i]['datestamp'] = $value['news_datestamp'];
         $rss[$i]['description'] = $this->getDescription($value);
         if ($value['news_allow_comments'] && $pref['comments_disabled'] != 1) {
             $rss[$i]['comment'] = "http://" . $_SERVER['HTTP_HOST'] . e_HTTP . "comment.php?comment.news." . $value['news_id'];
         }
         $rss[$i]['media'] = $this->getMedia($value);
         $i++;
     }
     return $rss;
 }
示例#3
0
文件: e_search.php 项目: armpit/e107
 function compile($row)
 {
     $tp = e107::getParser();
     $book = $this->getParent($row['page_chapter']);
     $row['chapter_sef'] = $this->getSef($row['page_chapter']);
     $row['book_sef'] = $this->getSef($book);
     if (empty($row['page_sef'])) {
         $row['page_sef'] = '--sef-not-assigned--';
     }
     if ($row['page_chapter'] == 0) {
         $route = 'page/view/other';
         $pre = '';
     } else {
         $route = 'page/view/index';
         $pre = $tp->toHtml($this->getName($book), false, 'TITLE') . ' &raquo; ' . $tp->toHtml($this->getName($row['page_chapter']), false, 'TITLE') . " | ";
     }
     $res = array();
     $res['link'] = e107::getUrl()->create($route, $row, array('allow' => 'page_sef,page_title,page_id,chapter_sef,book_sef'));
     $res['pre_title'] = $pre;
     $res['title'] = $tp->toHtml($row['page_title'], false, 'TITLE');
     $res['summary'] = !empty($row['page_metadscr']) ? $row['page_metadscr'] : $row['page_text'];
     $res['detail'] = LAN_SEARCH_3 . $tp->toDate($row['page_datestamp'], "long");
     $res['image'] = $row['menu_image'];
     return $res;
 }
示例#4
0
 function compile($row)
 {
     $tp = e107::getParser();
     $res = array();
     $datestamp = $tp->toDate($row['thread_datestamp'], "long");
     if ($row['thread_parent']) {
         $title = $row['parent_name'];
     } else {
         $title = $row['thread_name'];
     }
     $link_id = $row['thread_id'];
     $uparams = array('id' => $row['user_id'], 'name' => $row['user_name']);
     $link = e107::getUrl()->create('user/profile/view', $uparams);
     $userlink = "<a href='" . $link . "'>" . $row['user_name'] . "</a>";
     $row['thread_sef'] = eHelper::title2sef($row['thread_name'], 'dashl');
     $forumTitle = "<a href='" . e107::url('forum', 'forum', $row) . "'>" . $row['forum_name'] . "</a>";
     $res['link'] = e107::url('forum', 'topic', $row, array('query' => array('f' => 'post', 'id' => $row['post_id'])));
     // e_PLUGIN."forum/forum_viewtopic.php?".$link_id.".post";
     $res['pre_title'] = '';
     // $title ? FOR_SCH_LAN_5.": " : "";
     $res['title'] = $title ? $forumTitle . " | " . $title : LAN_SEARCH_9;
     $res['pre_summary'] = "";
     $res['summary'] = $row['post_entry'];
     $res['detail'] = LAN_SEARCH_7 . $userlink . LAN_SEARCH_8 . $datestamp;
     return $res;
 }
示例#5
0
 function sc_lastseen_userlink()
 {
     $uparams = array('id' => $this->currentUser['user_id'], 'name' => $this->currentUser['user_name']);
     $link = e107::getUrl()->create('user/profile/view', $uparams);
     return "<a href='" . $link . "'>" . $this->currentUser['user_name'] . "</a>";
     // $uparams = array('id' => $this->currentUser['user_id'], 'name' => $this->currentUser['user_name']);
     //	return "<a href='".e_BASE."user.php?id.".$this->currentUser['user_id']."'>".$this->currentUser['user_name']."</a>";
 }
示例#6
0
 function getLink($id)
 {
     if (empty($this->row)) {
         $this->row = $this->getRecord($id);
     }
     //$url = e_BASE."news.php?item.".$this->row['news_id'];
     $url = e107::getUrl()->create('news/view/item', $this->row);
     return "<a href='" . $url . "'>" . e107::getParser()->toHTML($this->row['news_title'], TRUE, '') . "</a>";
 }
示例#7
0
 function getLink($id)
 {
     if ($this->row == '') {
         $this->row = $this->getRecord($id);
     }
     $url = e_BASE . "page.php?" . $this->row['page_id'];
     $url = e107::getUrl()->create('page/view', $this->row, 'allow=page_id,page_title,page_sef');
     return "<a href='" . $url . "'>" . e107::getParser()->toHTML($this->row['page_title'], TRUE, '') . "</a>";
 }
示例#8
0
文件: error.php 项目: armpit/e107
 public function actionNotfound()
 {
     $this->getResponse()->setRenderMod('error404')->addHeader('HTTP/1.0 404 Not Found');
     $this->addTitle(LAN_ERROR_7);
     $template = e107::getCoreTemplate('error', 404);
     $vars = new e_vars(array('siteUrl' => SITEURL, 'searchUrl' => e107::getUrl()->create('search')));
     $body = e107::getParser()->parseTemplate($template['start'] . $template['body'] . $template['end'], true, null, $vars);
     $this->addBody($body);
 }
示例#9
0
function search_user($row)
{
    global $con;
    $res['link'] = e107::getUrl()->create('user/profile/view', array('id' => $row['user_id'], 'name' => $row['user_name']));
    //"user.php?id.".$row['user_id'];
    $res['pre_title'] = $row['user_id'] . " | ";
    $res['title'] = $row['user_name'];
    $res['summary'] = $row['user_signature'] ? LAN_SEARCH_72 . ": " . $row['user_signature'] : LAN_SEARCH_73;
    $res['detail'] = LAN_SEARCH_74 . ": " . $con->convert_date($row['user_join'], "long");
    return $res;
}
示例#10
0
function search_news($row)
{
    global $con;
    $res['link'] = e107::getUrl()->create('news/view/item', $row);
    //$row['news_allow_comments'] ? "news.php?item.".$row['news_id'] : "comment.php?comment.news.".$row['news_id'];
    $res['pre_title'] = $row['category_name'] . " | ";
    $res['title'] = $row['news_title'];
    $res['summary'] = $row['news_body'] . ' ' . $row['news_extended'];
    $res['detail'] = LAN_SEARCH_3 . $con->convert_date($row['news_datestamp'], "long");
    return $res;
}
示例#11
0
 function faqCategories()
 {
     $sql = e107::getDb();
     $tp = e107::getParser();
     $sublinks = array();
     $sql->select("faqs_info", "*", "faq_info_id != '' ORDER BY faq_info_order");
     while ($row = $sql->fetch()) {
         $sublinks[] = array('link_name' => $tp->toHtml($row['faq_info_title'], '', 'TITLE'), 'link_url' => e107::getUrl()->sc('faqs/list/all', array('category' => $row['faq_info_id'])), 'link_description' => $row['faq_info_about'], 'link_button' => $row['faq_info_icon'], 'link_category' => '', 'link_order' => '', 'link_parent' => '', 'link_open' => '', 'link_class' => intval($row['faq_info_class']));
     }
     return $sublinks;
 }
示例#12
0
function search_pages($row)
{
    global $con;
    $res['link'] = e107::getUrl()->create('page/view', $row, array('allow' => 'page_sef,page_title,page_id'));
    //"page.php?".$row['page_id'];
    $res['pre_title'] = "";
    $res['title'] = $row['page_title'];
    $res['summary'] = $row['page_text'];
    $res['detail'] = LAN_SEARCH_3 . $con->convert_date($row['page_datestamp'], "long");
    return $res;
}
 /**
  * Render username as a link.
  *
  * @return string
  */
 function sc_online_user()
 {
     $tp = e107::getParser();
     $tp->thumbWidth = 20;
     $tp->thumbHeight = 20;
     $avatar = $tp->toAvatar($this->var['user']);
     $uparams = array('id' => $this->var['user']['user_id'], 'name' => $this->var['user']['user_name']);
     $markup = '<a href="' . e107::getUrl()->create('user/profile/view', $uparams) . '">';
     $markup .= $avatar . ' ' . $uparams['name'];
     $markup .= '</a>';
     return $markup;
 }
示例#14
0
 function sc_username($parm = '')
 {
     global $USERNAME;
     if (isset($this->var['user_id']) && $this->var['user_id']) {
         $USERNAME = $parm == 'raw' ? $this->var['user_name'] : "<a href='" . e107::getUrl()->create('user/profile/view', array('id' => $this->var['user_id'], 'name' => $this->var['user_name'])) . "'>" . $this->var['user_name'] . "</a>\n";
     } else {
         $this->var['user_id'] = 0;
         $USERNAME = preg_replace("/[0-9]+\\./", '', vartrue($this->var['comment_author_name']));
         $USERNAME = str_replace("Anonymous", LAN_ANONYMOUS, $USERNAME);
     }
     return $USERNAME;
 }
示例#15
0
文件: e_search.php 项目: armpit/e107
 function compile($row)
 {
     $tp = e107::getParser();
     $res = array();
     $res['link'] = e107::getUrl()->create('news/view/item', $row);
     //$row['news_allow_comments'] ? "news.php?item.".$row['news_id'] : "comment.php?comment.news.".$row['news_id'];
     $res['pre_title'] = $tp->toHtml($row['category_name'], false, 'TITLE') . " | ";
     $res['title'] = $row['news_title'];
     $res['summary'] = $row['news_body'] . ' ' . $row['news_extended'];
     $res['detail'] = LAN_SEARCH_3 . $tp->toDate($row['news_datestamp'], "long");
     $res['image'] = $row['news_thumbnail'];
     return $res;
 }
示例#16
0
 function checkForumJump()
 {
     if (isset($_POST['fjsubmit'])) {
         $this->redirect(e107::getUrl()->create('forum/forum/view', array('id' => (int) $_POST['forumjump']), '', 'full=1&encode=0'));
         exit;
     }
     if (!e_QUERY || empty($_GET['id'])) {
         $url = e107::url('forum', 'index', null, 'full');
         $this->redirect($url);
         //	header('Location:'.e107::getUrl()->create('forum/forum/main', array(), 'full=1&encode=0'));
         exit;
     }
 }
示例#17
0
文件: url.php 项目: armpit/e107
/**
 * Example usage (valid news data + option for full URL)
 * {URL=news/view/item|news_id=1&news_sef=sef-string&category_id=1&category_sef=category-sef&options[full]=1}
 */
function url_shortcode($parm)
{
    list($route, $parms) = eHelper::scDualParams($parm);
    if (empty($route)) {
        return '';
    }
    $options = array();
    if (isset($parms['options'])) {
        $options = $parms['options'];
        unset($parms['options']);
    }
    return e107::getUrl()->create($route, $parms, $options);
}
示例#18
0
 function last_ten()
 {
     $sql = e107::getDb();
     $sublinks = array();
     $nobody_regexp = "'(^|,)(" . str_replace(",", "|", e_UC_NOBODY) . ")(,|\$)'";
     $query = "SELECT * FROM #news WHERE news_class REGEXP '" . e_CLASS_REGEXP . "' AND NOT (news_class REGEXP " . $nobody_regexp . ") ORDER BY news_datestamp DESC LIMIT 10";
     if ($sql->gen($query)) {
         while ($row = $sql->fetch()) {
             $sublinks[] = array('link_name' => $row['news_title'], 'link_url' => e107::getUrl()->create('news/view/item', $row, array('allow' => 'news_sef,news_title,news_id')), 'link_description' => $row['news_summary'], 'link_button' => '', 'link_category' => '', 'link_order' => '', 'link_parent' => '', 'link_open' => '', 'link_class' => intval($row['news_class']));
         }
         $sublinks[] = array('link_name' => LAN_MORE, 'link_url' => e107::getUrl()->create('news/list/all'), 'link_description' => '', 'link_button' => '', 'link_category' => '', 'link_order' => '', 'link_parent' => '', 'link_open' => '', 'link_class' => intval($row['news_class']));
         return $sublinks;
     }
 }
示例#19
0
 function getListData()
 {
     if ($this->parent->mode == "new_page" || $this->parent->mode == "new_menu") {
         $qry = " n.news_datestamp>" . $this->parent->getlvisit();
     } else {
         $qry = " (n.news_start=0 || n.news_start < " . time() . ") AND (n.news_end=0 || n.news_end>" . time() . ") ";
     }
     $bullet = $this->parent->getBullet($this->parent->settings['icon']);
     $list_caption = $this->parent->settings['caption'];
     $list_display = vartrue($this->parent->settings['open']) ? '' : LAN_NONE;
     $qry = "\n\t\tSELECT n.*, c.category_id AS news_category_id, c.category_name AS news_category_name, u.user_id AS news_author_id, u.user_name AS news_author_name\n\t\tFROM #news AS n\n\t\tLEFT JOIN #news_category AS c ON c.category_id = n.news_category\n\t\tLEFT JOIN #user AS u ON n.news_author = u.user_id\n\t\tWHERE " . $qry . " AND n.news_class REGEXP '" . e_CLASS_REGEXP . "'\n\t\tORDER BY n.news_datestamp DESC LIMIT 0," . intval($this->parent->settings['amount']);
     if (!$this->parent->e107->sql->db_Select_gen($qry)) {
         $list_data = LIST_NEWS_2;
     } else {
         $list_data = array();
         while ($row = $this->parent->e107->sql->db_Fetch()) {
             $row['news_title'] = $this->parse_news_title($row['news_title']);
             $rowheading = $this->parent->parse_heading($row['news_title']);
             $record = array();
             $record['icon'] = $bullet;
             $record['heading'] = "<a href='" . e_BASE . "news.php?item." . $row['news_id'] . "'>" . $rowheading . "</a>";
             $record['author'] = '';
             if (vartrue($this->parent->settings['author'])) {
                 if ($row['news_author'] == 0) {
                     $record['author'] = $row['news_author'];
                 } else {
                     if (vartrue($row['news_author_name'])) {
                         //$record['author'] = "<a href='".e_BASE."user.php?id.".$row['news_author_id']."'>".$row['news_author_name']."</a>";
                         $uparams = array('id' => $row['news_author_id'], 'name' => $row['news_author_name']);
                         $link = e107::getUrl()->create('user/profile/view', $uparams);
                         $record['author'] = "<a href='" . $link . "'>" . $row['news_author_name'] . "</a>";
                     }
                 }
             }
             $record['category'] = '';
             if (vartrue($this->parent->settings['category'])) {
                 $record['category'] = "<a href='" . e_BASE . "news.php?cat." . $row['news_category_id'] . "'>" . $row['news_category_name'] . "</a>";
             }
             $record['date'] = '';
             if (vartrue($this->parent->settings['date'])) {
                 $record['date'] = $this->parent->getListDate($row['news_datestamp']);
             }
             $record['info'] = '';
             //collect each result
             $list_data[] = $record;
         }
     }
     //return array with 'records', (global)'caption', 'display'
     return array('records' => $list_data, 'caption' => $list_caption, 'display' => $list_display);
 }
示例#20
0
文件: e_search.php 项目: armpit/e107
 function compile($row)
 {
     $tp = e107::getParser();
     //TODO SEF URLs for list below.
     //TODO Remove html from pre_summary and use additional vars instead.
     $res = array();
     $datestamp = $tp->toDate($row['download_datestamp'], "long");
     $res['link'] = e107::getUrl()->create('download/view/item', array('id' => $row['download_id'], 'name' => vartrue($row['download_sef'], '--no-sef-set--')));
     $res['pre_title'] = $tp->toHtml($row['download_category_name'], false, 'TITLE_PLAIN') . " | ";
     $res['title'] = $row['download_name'];
     $res['pre_summary'] = "<div class='smalltext'><a href='download.php'>" . LAN_197 . "</a> -> <a href='download.php?list." . $row['download_category_id'] . "'>" . $row['download_category_name'] . "</a></div>";
     $res['summary'] = $row['download_description'];
     $res['detail'] = LAN_SEARCH_15 . " " . $row['download_author'] . " | " . LAN_SEARCH_66 . ": " . $datestamp;
     return $res;
 }
示例#21
0
文件: e_related.php 项目: armpit/e107
 function compile($tags, $parm = array())
 {
     $sql = e107::getDb();
     $items = array();
     $tag_regexp = "'(^|,)(" . str_replace(",", "|", $tags) . ")(,|\$)'";
     $query = "SELECT * FROM #news WHERE news_id != " . $parm['current'] . " AND news_class REGEXP '" . e_CLASS_REGEXP . "'  AND news_meta_keywords REGEXP " . $tag_regexp . "  ORDER BY news_datestamp DESC LIMIT " . $parm['limit'];
     if ($sql->gen($query)) {
         while ($row = $sql->fetch()) {
             $items[] = array('title' => varset($row['news_title']), 'url' => e107::getUrl()->create('news/view/item', $row), 'body' => varset($row['news_summary']), 'image' => varset($row['news_image']));
         }
         return $items;
     } elseif (ADMIN) {
         //	return array(array('title'=>$query,'url'=>''));
     }
 }
示例#22
0
 function sc_cb_username($parm = '')
 {
     list($cb_uid, $cb_nick) = explode(".", $this->var['cb_nick'], 2);
     if ($this->var['user_name']) {
         //$cb_nick = "<a href='".e_HTTP."user.php?id.{$cb_uid}'>".$this->var['user_name']."</a>";
         $uparams = array('id' => $cb_uid, 'name' => $this->var['user_name']);
         $link = e107::getUrl()->create('user/profile/view', $uparams);
         $cb_nick = "<a href='" . $link . "'>" . $this->var['user_name'] . "</a>";
     } else {
         $tp = e107::getParser();
         $cb_nick = $tp->toHTML($cb_nick, FALSE, 'USER_TITLE, emotes_off, no_make_clickable');
         $cb_nick = str_replace("Anonymous", LAN_ANONYMOUS, $cb_nick);
     }
     return $cb_nick;
 }
示例#23
0
文件: xup.php 项目: notzen/e107
 public function actionTest()
 {
     echo 'Login controller<br /><br />';
     if (isset($_GET['lgt'])) {
         e107::getUser()->logout();
     }
     echo 'Logged in: ' . (e107::getUser()->isUser() ? 'true' : 'false');
     $provider = e107::getUser()->getProvider();
     if ($provider) {
         print_a($provider->getUserProfile());
     }
     echo '<br /><br /><a href="' . e107::getUrl()->create('system/xup/test?lgt') . '">Test logout</a>';
     echo '<br /><a href="' . e107::getUrl()->create('system/xup/login?provider=Facebook') . '">Test login with Facebook</a>';
     echo '<br /><a href="' . e107::getUrl()->create('system/xup/signup?provider=Facebook') . '">Test signup with Facebook</a>';
 }
示例#24
0
 function render()
 {
     $tp = e107::getParser();
     $sql = e107::getDb('nfp');
     $pref = e107::getPref();
     $qry = $this->getQuery();
     if ($results = $sql->gen($qry)) {
         $text = "<ul>";
         while ($row = $sql->fetch()) {
             $datestamp = $tp->toDate($row['post_datestamp'], 'relative');
             $id = $row['thread_id'];
             $topic = $row['thread_datestamp'] == $row['post_datestamp'] ? '' : 'Re:';
             $topic .= strip_tags($tp->toHTML($row['thread_name'], true, 'emotes_off, no_make_clickable, parse_bb', '', $pref['menu_wordwrap']));
             $row['thread_sef'] = $this->forumObj->getThreadSef($row);
             if ($row['post_user_anon']) {
                 $poster = $row['post_user_anon'];
             } else {
                 if ($row['user_name']) {
                     $poster = "<a href='" . e107::getUrl()->create('user/profile/view', array('name' => $row['user_name'], 'id' => $row['post_user'])) . "'>{$row['user_name']}</a>";
                 } else {
                     $poster = '[deleted]';
                 }
             }
             $post = strip_tags($tp->toHTML($row['post_entry'], true, 'emotes_off, no_make_clickable', '', $pref['menu_wordwrap']));
             $post = $tp->text_truncate($post, $this->menuPref['characters'], $this->menuPref['postfix']);
             // Count previous posts for calculating proper (topic) page number for the current post.
             //	$postNum = $sql2->count('forum_post', '(*)', "WHERE post_id <= " . $row['post_id'] . " AND post_thread = " . $row['thread_id'] . " ORDER BY post_id ASC");
             //	$postPage = ceil($postNum / vartrue($this->plugPref['postspage'], 10)); // Calculate (topic) page number for the current post.
             //	$thread = $sql->retrieve('forum_thread', '*', 'thread_id = ' . $row['thread_id']); 	// Load thread for passing it to e107::url().
             // Create URL for post.
             // like: e107_plugins/forum/forum_viewtopic.php?f=post&id=1
             $url = e107::url('forum', 'topic', $row, array('query' => array('f' => 'post', 'id' => intval($row['post_id']))));
             $text .= "<li>";
             if ($this->menuPref['title']) {
                 $text .= "<a href='{$url}'>{$topic}</a><br />{$post}<br /><small class='text-muted muted'>" . LAN_FORUM_MENU_001 . " {$poster} {$datestamp}</small>";
             } else {
                 $text .= "<a href='{$url}'>" . LAN_FORUM_MENU_001 . "</a> {$poster} <small class='text-muted muted'>{$datestamp}</small><br />{$post}<br />";
             }
             $text .= "</li>";
         }
         $text .= "</ul>";
     } else {
         $text = LAN_FORUM_MENU_002;
     }
     $caption = varset($this->menuPref['caption'][e_LANGUAGE], $this->menuPref['caption']);
     e107::getRender()->tablerender($caption, $text, 'nfp_menu');
 }
示例#25
0
 function sc_signup_xup_signup()
 {
     $pref = e107::getPref('social_login_active');
     if (!empty($pref)) {
         $text = "";
         $providers = e107::getPref('social_login');
         foreach ($providers as $p => $v) {
             $p = strtolower($p);
             if ($v['enabled'] == 1) {
                 $text .= "<a href='" . e107::getUrl()->create('system/xup/signup?provider=' . $p . '&back=' . base64_encode(e_REQUEST_URL)) . "'><img class='e-tip' title='Register using your {$p} account' src='" . e_IMAGE_ABS . "xup/{$p}.png' alt='' /></a>";
             }
             //TODO different icon options. see: http://zocial.smcllns.com/
         }
         //	$text .= "<hr />";
         return $text;
     }
 }
示例#26
0
文件: e_related.php 项目: armpit/e107
 function compile($tags, $parm = array())
 {
     $sql = e107::getDb();
     $items = array();
     $tag_regexp = "'(^|,)(" . str_replace(",", "|", $tags) . ")(,|\$)'";
     $query = "SELECT * FROM #page WHERE page_id != " . $parm['current'] . " AND page_class REGEXP '" . e_CLASS_REGEXP . "'  AND page_metakeys REGEXP " . $tag_regexp . "  ORDER BY page_datestamp DESC LIMIT " . $parm['limit'];
     if ($sql->gen($query)) {
         while ($row = $sql->fetch()) {
             $row['chapter_sef'] = $this->getSef($row['page_chapter']);
             $book = $this->getParent($row['page_chapter']);
             $row['book_sef'] = $this->getSef($book);
             $id = $row['page_chapter'];
             $title = vartrue($this->chapterName[$id]) ? $this->chapterName[$id] . " | " . $row['page_title'] : $row['page_title'];
             $items[] = array('title' => $title, 'url' => e107::getUrl()->create('page/view/index', $row), 'body' => $row['news_summary'], 'image' => $row['news_image']);
         }
         return $items;
     } else {
         // return array(array('title'=>$query,'url'=>''));
     }
 }
示例#27
0
文件: error.php 项目: notzen/e107
 public function actionNotfound()
 {
     $this->addTitle(LAN_ERROR_7);
     //var_dump($this->getRequest()->getRouteHistory());
     $errorText = "<img src='" . e_IMAGE_ABS . "generic/warning.png' alt='" . LAN_ERROR_37 . "' /> " . LAN_ERROR_21 . '<br />' . LAN_ERROR_9 . "<br /><br />";
     if (strlen($errFrom)) {
         $errorText .= LAN_ERROR_23 . " <a href='{$errFrom}' rel='external'>{$errFrom}</a> " . LAN_ERROR_24 . " -- " . LAN_ERROR_19 . "<br /><br />";
     }
     $errorText .= "<h3>" . LAN_ERROR_45 . "</h3>";
     if ($errReturnTo) {
         foreach ($errReturnTo as $url => $label) {
             $errorText .= "<a href='{$url}'>" . $label . "</a><br />";
         }
         $errorText .= '<br />';
     }
     $url = e107::getUrl();
     $errorText .= "<a href='" . SITEURL . "'>" . LAN_ERROR_20 . "</a><br />";
     $errorText .= "<a href='" . $url->create('search') . "'>" . LAN_ERROR_22 . "</a>";
     $this->addBody($errorText);
 }
示例#28
0
文件: e_list.php 项目: KonzolozZ/e107
 function getListData()
 {
     $sql = e107::getDb();
     $tp = e107::getParser();
     $list_caption = $this->parent->settings['caption'];
     $list_display = $this->parent->settings['open'] ? "" : "none";
     if ($this->parent->mode == "new_page" || $this->parent->mode == "new_menu") {
         $lvisit = $this->parent->getlvisit();
         $qry = "cb_datestamp>" . $lvisit;
     } else {
         $qry = "cb_id != '0' ";
     }
     $qry .= " ORDER BY cb_datestamp DESC LIMIT 0," . intval($this->parent->settings['amount']);
     $bullet = $this->parent->getBullet($this->parent->settings['icon']);
     if (!($chatbox_posts = $this->parent->e107->sql->gen("SELECT * FROM #chatbox WHERE " . $qry))) {
         $list_data = LIST_CHATBOX_2;
     } else {
         while ($row = $this->parent->e107->sql->fetch()) {
             $cb_id = substr($row['cb_nick'], 0, strpos($row['cb_nick'], "."));
             $cb_nick = substr($row['cb_nick'], strpos($row['cb_nick'], ".") + 1);
             $cb_message = $row['cb_blocked'] ? CHATBOX_L6 : str_replace("<br />", " ", $tp->toHTML($row['cb_message']));
             $rowheading = $this->parent->parse_heading($cb_message);
             //<a href='".e_BASE."user.php?id.$cb_id'>".$cb_nick."</a>
             $uparams = array('id' => $cb_id, 'name' => $cb_nick);
             $link = e107::getUrl()->create('user/profile/view', $uparams);
             $userlink = "<a href='" . $link . "'>" . $cb_nick . "</a>";
             $record['icon'] = $bullet;
             $record['heading'] = $rowheading;
             $record['author'] = $this->parent->settings['author'] ? $cb_id != 0 ? $userlink : $cb_nick : "";
             $record['category'] = "";
             $record['date'] = $this->parent->settings['date'] ? $row['cb_datestamp'] ? $this->parent->getListDate($row['cb_datestamp']) : "" : "";
             $record['info'] = "";
             $list_data[] = $record;
         }
     }
     //return array with 'records', (global)'caption', 'display'
     return array('records' => $list_data, 'caption' => $list_caption, 'display' => $list_display);
 }
示例#29
0
 public function sc_news_category_url($parm = '')
 {
     $url = e107::getUrl()->create('news/list/category', array('id' => $this->getId(), 'name' => $this->cat('sef')));
     switch ($parm) {
         case 'link':
             return '<a href="' . $url . '" class="news-category">' . $this->sc_news_category_title() . '</a>';
             break;
         case 'link_icon':
             return '<a href="' . $url . '" class="news-category">' . $this->sc_news_category_icon() . '&nbsp;' . $this->sc_news_category_title() . '</a>';
             break;
         default:
             return $url;
             break;
     }
 }
示例#30
0
文件: page.php 项目: armpit/e107
 function pageIndex()
 {
     // Use always nextprev shortcode (with a special default 'page' tempalte)
     $titles = implode("|", $this->pageTitles);
     $total_items = count($this->pageTitles);
     //$parms = $total_items.",1,".$this->pageSelected.",".e_SELF."?".$this->pageID.".[FROM],,$titles";
     $row = $this->page;
     $row['page'] = '--FROM--';
     $url = rawurlencode(e107::getUrl()->create('page/view', $row, 'allow=page_id,page_title,page_sef,page'));
     $parms = 'nonavcount&bullet=' . rawurlencode($this->bullet . ' ') . '&caption=<!-- Empty -->&' . 'pagetitle=' . rawurlencode($titles) . '&tmpl_prefix=' . deftrue('PAGE_NEXTPREV_TMPL', 'page') . '&total=' . $total_items . '&amount=1&current=' . $this->pageSelected . '&url=' . $url;
     $itext = $total_items ? e107::getParser()->parseTemplate("{NEXTPREV={$parms}}") : "";
     return $itext;
 }