Example #1
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;
 }
Example #2
0
 function compile($row)
 {
     $res = array();
     $res['link'] = $url = e107::url('faqs', 'category', $row);
     // e_PLUGIN . "faq/faq.php?cat." . $cat_id . "." . $link_id . "";
     $res['pre_title'] = $row['faq_info_title'] ? $row['faq_info_title'] . ' | ' : "";
     $res['title'] = $row['faq_question'];
     $res['summary'] = substr($row['faq_answer'], 0, 100) . "....  ";
     $res['detail'] = e107::getParser()->toDate($row['faq_datestamp'], 'long');
     return $res;
 }
Example #3
0
 function sc_forumjump()
 {
     $jumpList = $this->forum->forumGetAllowed('view');
     $text = "<form class='form-inline' method='post' action='" . e_REQUEST_URI . "'><div class='btn-group'><p>" . LAN_FORUM_1017 . ": <select name='forumjump' class='tbox form-control'>";
     foreach ($jumpList as $key => $val) {
         $text .= "\n<option value='" . e107::url('forum', 'forum', $val) . "'>" . $val['forum_name'] . "</option>";
     }
     $text .= "</select><input class='btn btn-default button' type='submit' name='fjsubmit' value='" . LAN_GO . "' /></p></div></form>";
     return $text;
     // return forumjump(); // FIXME - broken in v1 themes
 }
Example #4
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::url('faqs', 'category', $row), '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;
 }
Example #5
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');
 }
Example #6
0
    /**
     * {XURL_ICONS: size=2x}
     */
    function sc_xurl_icons($parm = '')
    {
        $social = array('rss' => array('href' => e107::isInstalled('rss_menu') ? e107::url('rss_menu', 'index', array('rss_url' => 'news')) : '', 'title' => 'RSS/Atom Feed'), 'facebook' => array('href' => deftrue('XURL_FACEBOOK'), 'title' => 'Facebook'), 'twitter' => array('href' => deftrue('XURL_TWITTER'), 'title' => 'Twitter'), 'google-plus' => array('href' => deftrue('XURL_GOOGLE'), 'title' => 'Google Plus'), 'linkedin' => array('href' => deftrue('XURL_LINKEDIN'), 'title' => 'LinkedIn'), 'github' => array('href' => deftrue('XURL_GITHUB'), 'title' => 'Github'), 'pinterest' => array('href' => deftrue('XURL_PINTEREST'), 'title' => 'Pinterest'), 'flickr' => array('href' => deftrue('XURL_FLICKR'), 'title' => 'Flickr'), 'instagram' => array('href' => deftrue('XURL_INSTAGRAM'), 'title' => 'Instagram'), 'youtube' => array('href' => deftrue('XURL_YOUTUBE'), 'title' => 'YouTube'), 'vimeo' => array('href' => deftrue('XURL_VIMEO'), 'title' => 'Vimeo'));
        $class = vartrue($parm['size']) ? 'fa-' . $parm['size'] : '';
        $text = '';
        foreach ($social as $id => $data) {
            if ($data['href'] != '') {
                $text .= '<a rel="external" href="' . $data['href'] . '" class="e-tip social-icon social-' . $id . '" title="' . $data['title'] . '">
				 	<span class="fa fa-' . $id . ' ' . $class . '"></span>
				 </a>';
                $text .= "\n";
            }
        }
        if ($text != '') {
            return '<p class="xurl-social-icons hidden-print">' . $text . '</p>';
        }
    }
Example #7
0
 function config()
 {
     $frontPage = array();
     $frontPage['title'] = CONT_FP_3;
     if ($maincat = e107::getDb()->retrieve("pcontent", "content_id, content_heading", " WHERE LEFT(content_parent,1)='0'", true)) {
         $i = 0;
         foreach ($maincat as $row) {
             $row['url_content_id'] = $row['content_id'];
             $frontPage['page'][] = array('page' => e107::url("content", "recent", $row, "full"), 'title' => $row['content_heading'] . ' ' . CONT_FP_2);
             if ($subpages = e107::getDb()->retrieve("pcontent", "content_id, content_heading", "content_parent = '" . $row['content_id'] . "' ORDER BY content_heading", TRUE)) {
                 foreach ($subpages as $row2) {
                     $frontPage['page'][] = array('page' => '{e_PLUGIN}content/content.php?content.' . $row2['content_id'], 'title' => $row['content_heading'] . ' - ' . $row2['content_heading']);
                 }
             }
         }
     }
     return $frontPage;
 }
Example #8
0
 function sc_rss_types()
 {
     global $row, $tp;
     //	$url1 = e_PLUGIN_ABS."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".1".($row['rss_topicid'] ? ".".$row['rss_topicid'] : '');
     //	$url2 = e_PLUGIN_ABS."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".2".($row['rss_topicid'] ? ".".$row['rss_topicid'] : '');
     //	$url3 = e_PLUGIN_ABS."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".3".($row['rss_topicid'] ? ".".$row['rss_topicid'] : '');
     //	$url4 = e_PLUGIN_ABS."rss_menu/rss.php?".e_LANQRY.$tp->toHTML($row['rss_url'], TRUE, 'constants').".4".($row['rss_topicid'] ? ".".$row['rss_topicid'] : '');
     $url2 = e107::url('rss_menu', 'rss', $row);
     $url4 = e107::url('rss_menu', 'atom', $row);
     if (deftrue('BOOTSTRAP') === 3) {
         $text = "\n\t\t\t<div>\n\t\t\t\t<a class='btn btn-sm btn-default'  href='" . e107::url('rss_menu', 'rss', $row) . "' title='RSS 2.0'>" . $tp->toGlyph('fa-rss') . " RSS</a>\n\t\t\t\t<a class='btn btn-sm btn-default'  href='" . e107::url('rss_menu', 'atom', $row) . "' title='ATOM'>" . $tp->toGlyph('fa-rss') . " Atom</a>\n\t\t\t</div>";
         return $text;
     }
     $text = "";
     //	$text .= "<a href='".$url1."' class='rss'><img src='".e_PLUGIN_ABS."rss_menu/images/rss1.png' class='icon' alt='RSS 0.92' /></a>";
     $text .= "<a href='" . $url2 . "' class='rss'><img src='" . e_PLUGIN_ABS . "rss_menu/images/rss2.png' class='icon' alt='RSS 2.0' /></a>";
     //	$text .= "<a href='".$url3."' class='rss'><img src='".e_PLUGIN_ABS."rss_menu/images/rss3.png' class='icon' alt='RDF' /></a>";
     $text .= "<a href='" . $url4 . "' class='rss'><img src='" . e_PLUGIN_ABS . "rss_menu/images/rss4.png' class='icon' alt='ATOM' /></a>";
     return $text;
 }
Example #9
0
 function rss_url($curVal, $mode)
 {
     switch ($mode) {
         case 'read':
             // List Page
             $type = $this->getController()->getListModel()->get('rss_type');
             $topic = $this->getController()->getListModel()->get('rss_topicid');
             $link = e107::url('rss_menu', 'rss', array('rss_type' => $type, 'rss_url' => $curVal, 'rss_topicid' => $topic));
             return "<a href='" . $link . "'>" . $curVal . "</a>";
             break;
         case 'write':
             // Edit Page
             $link = SITEURL . "feed/";
             // e107::url('rss_menu','index').'/';
             return "<div class='form-inline'>" . $link . e107::getForm()->text('rss_url', $curVal, 255, 'size=small') . "/rss/{Topic id}</div>";
             break;
         case 'filter':
         case 'batch':
             return null;
             break;
     }
 }
Example #10
0
 function init()
 {
     global $forum;
     $e107 = e107::getInstance();
     $this->threadId = (int) varset($_GET['id']);
     $this->perPage = varset($_GET['perpage']) ? (int) $_GET['perpage'] : $forum->prefs->get('postspage');
     $this->page = varset($_GET['p']) ? (int) $_GET['p'] : 1;
     if (!$this->threadId && e_QUERY) {
         list($id, $page) = explode(".", e_QUERY);
         $this->threadId = intval($id);
         $this->page = intval($page);
     }
     //If threadId doesn't exist, or not given, redirect to main forum page
     if (!$this->threadId || !($this->threadInfo = $forum->threadGet($this->threadId))) {
         if (E107_DEBUG_LEVEL > 0) {
             e107::getMessage()->addError("Thread not found or query error: " . __METHOD__ . ' Line: ' . __LINE__);
             return;
             //	exit;
         }
         $url = e107::url('forum', 'index', 'full');
         e107::getRedirect()->go($url);
         //	header('Location:' . $e107->url->create('forum/forum/main', array(), 'encode=0&full=1'));
         exit;
     }
     //If not permitted to view forum, redirect to main forum page
     if (!$forum->checkPerm($this->threadInfo['thread_forum_id'], 'view')) {
         if (E107_DEBUG_LEVEL > 0) {
             echo __METHOD__ . ' Line: ' . __LINE__;
             exit;
         }
         $url = e107::url('forum', 'index', 'full');
         e107::getRedirect()->go($url);
         //	header('Location:' . $e107->url->create('forum/forum/main', array(), 'encode=0&full=1'));
         exit;
     }
     $totalPosts = $this->threadInfo['thread_total_replies'];
     //  + 1; // add 1 for the original post . ie. not a reply.
     $this->pages = ceil($totalPosts / $this->perPage);
     $this->noInc = false;
 }
Example #11
0
 function init()
 {
     $sql = e107::getDb();
     $tp = e107::getParser();
     $ns = e107::getRender();
     $frm = e107::getForm();
     require_once e_PLUGIN . 'forum/forum_class.php';
     $gen = e107::getDate();
     $forum = new e107forum();
     $total_posts = $sql->count('forum_post');
     $total_topics = $sql->count('forum_thread');
     $total_replies = $total_posts - $total_topics;
     $total_views = 0;
     $query = 'SELECT sum(thread_views) AS total FROM `#forum_thread` ';
     if ($sql->gen($query)) {
         $row = $sql->fetch();
         $total_views = $row['total'];
     }
     $firstpost = $sql->select('forum_post', 'post_datestamp', 'post_datestamp > 0 ORDER BY post_datestamp ASC LIMIT 0,1', 'default');
     $fp = $sql->fetch();
     $open_ds = $fp['post_datestamp'];
     $open_date = $gen->convert_date($open_ds, 'long');
     $open_since = $gen->computeLapse($open_ds);
     $open_days = floor((time() - $open_ds) / 86400);
     $postsperday = $open_days < 1 ? $total_posts : round($total_posts / $open_days);
     global $mySQLdefaultdb;
     $query = "SHOW TABLE STATUS FROM `{$mySQLdefaultdb}`";
     $sql->gen($query);
     $array = $sql->db_getList();
     foreach ($array as $table) {
         if ($table['Name'] == MPREFIX . 'forum_post') {
             $db_size = eHelper::parseMemorySize($table['Data_length']);
             $avg_row_len = eHelper::parseMemorySize($table['Avg_row_length']);
             break;
         }
     }
     $query = "\n\t\tSELECT ft.thread_id, ft.thread_user, ft.thread_name, ft.thread_total_replies, ft.thread_datestamp, f.forum_sef, f.forum_class, u.user_name, u.user_id FROM #forum_thread as ft\n\t\tLEFT JOIN #user AS u ON ft.thread_user = u.user_id\n\t\tLEFT JOIN #forum AS f ON f.forum_id = ft.thread_forum_id\n\t\tWHERE ft.thread_active > 0\n\t\tAND f.forum_class IN (" . USERCLASS_LIST . ")\n\t\tORDER BY ft.thread_total_replies DESC LIMIT 0,10";
     $sql->gen($query);
     $most_activeArray = $sql->db_getList();
     $query = "\n\t\tSELECT ft.*, f.forum_class, f.forum_sef, u.user_name, u.user_id FROM #forum_thread as ft\n\t\tLEFT JOIN #user AS u ON ft.thread_user = u.user_id\n\t\tLEFT JOIN #forum AS f ON f.forum_id = ft.thread_forum_id\n\t\tWHERE f.forum_class IN (" . USERCLASS_LIST . ")\n\t\tORDER BY ft.thread_views DESC LIMIT 0,10";
     $sql->gen($query);
     $most_viewedArray = $sql->db_getList();
     /*$sql->db_Select("user", "user_id, user_name, user_forums", "ORDER BY user_forums DESC LIMIT 0, 10", "no_where");
     		$posters = $sql -> db_getList();
     		$top_posters = array();
     		foreach($posters as $poster)
     		{
     			$percen = round(($poster['user_forums'] / $total_posts) * 100, 2);
     			$top_posters[] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['user_forums'], "percentage" => $percen);
     		}*/
     // get all replies
     $query = "\n\t\tSELECT COUNT(fp.post_id) AS post_count, u.user_name, u.user_id, fp.post_thread FROM #forum_post as fp\n\t\tLEFT JOIN #user AS u ON fp.post_user = u.user_id\n\t\tGROUP BY fp.post_user\n\t\tORDER BY post_count DESC LIMIT 0,10";
     $sql->gen($query);
     // 	$top_repliers_data = $sql->db_getList('ALL', false, false, 'user_id');
     $top_repliers_data = $sql->retrieve($query, true);
     // build top posters meanwhile
     $top_posters = array();
     $topReplier = array();
     foreach ($top_repliers_data as $poster) {
         $percent = round($poster['post_count'] / $total_posts * 100, 2);
         $topReplier[] = intval($poster['user_id']);
         $top_posters[] = array("user_id" => $poster['user_id'], "user_name" => vartrue($poster['user_name'], LAN_ANONYMOUS), "user_forums" => $poster['post_count'], "percentage" => $percent);
     }
     // end build top posters
     $ids = implode(',', $topReplier);
     // find topics by top 10 users
     $query = "\n\t\tSELECT COUNT(ft.thread_id) AS thread_count, u.user_id FROM #forum_thread as ft\n\t\tLEFT JOIN #user AS u ON ft.thread_user = u.user_id\n\t\tWHERE u.user_id IN ({$ids})\tGROUP BY ft.thread_user";
     $sql->gen($query);
     $top_repliers_data_c = $sql->db_getList('ALL', false, false, 'user_id');
     $top_repliers = array();
     foreach ($top_repliers_data as $uid => $poster) {
         $poster['post_count'] = $poster['post_count'] - $top_repliers_data_c[$uid]['thread_count'];
         $percent = round($poster['post_count'] / $total_replies * 100, 2);
         $top_repliers_sort[$uid] = $poster['post_count'];
         //$top_repliers[$uid] = $poster;
         $top_repliers_data[$uid]['user_forums'] = $poster['post_count'];
         $top_repliers_data[$uid]['percentage'] = $percent;
         //$top_repliers_data[$uid] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['post_count'], "percentage" => $percent);
     }
     // sort
     arsort($top_repliers_sort, SORT_NUMERIC);
     // build top repliers
     foreach ($top_repliers_sort as $uid => $c) {
         $top_repliers[] = $top_repliers_data[$uid];
     }
     // get all replies
     $query = "\n\t\tSELECT COUNT(ft.thread_id) AS thread_count, u.user_name, u.user_id FROM #forum_thread as ft\n\t\tLEFT JOIN #user AS u ON ft.thread_user = u.user_id\n\t\tGROUP BY ft.thread_user\n\t\tORDER BY thread_count DESC LIMIT 0,10";
     $sql->gen($query);
     $top_topic_starters_data = $sql->db_getList();
     $top_topic_starters = array();
     foreach ($top_topic_starters_data as $poster) {
         $percent = round($poster['thread_count'] / $total_topics * 100, 2);
         $top_topic_starters[] = array("user_id" => $poster['user_id'], "user_name" => vartrue($poster['user_name'], LAN_ANONYMOUS), "user_forums" => $poster['thread_count'], "percentage" => $percent);
     }
     /*
     			$query = "
     			SELECT SUBSTRING_INDEX(thread_user,'.',1) AS t_user, COUNT(SUBSTRING_INDEX(ft.thread_user,'.',1)) AS ucount, u.user_name, u.user_id FROM #forum_t as ft
     			LEFT JOIN #user AS u ON SUBSTRING_INDEX(ft.thread_user,'.',1) = u.user_id
     			WHERE ft.thread_parent=0
     			GROUP BY t_user
     			ORDER BY ucount DESC
     			LIMIT 0,10";
     			$sql -> db_Select_gen($query);
     			$posters = $sql -> db_getList();
     			$top_topic_starters = array();
     			foreach($posters as $poster)
     			{
     				$percen = round(($poster['ucount'] / $total_topics) * 100, 2);
     				$top_topic_starters[] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['ucount'], "percentage" => $percen);
     			}*/
     /*
     $query = "
     SELECT SUBSTRING_INDEX(thread_user,'.',1) AS t_user, COUNT(SUBSTRING_INDEX(ft.thread_user,'.',1)) AS ucount, u.user_name, u.user_id FROM #forum_t as ft
     LEFT JOIN #user AS u ON SUBSTRING_INDEX(ft.thread_user,'.',1) = u.user_id
     WHERE ft.thread_parent!=0
     GROUP BY t_user
     ORDER BY ucount DESC
     LIMIT 0,10";
     $sql -> db_Select_gen($query);
     $posters = $sql -> db_getList();
     
     $top_repliers = array();
     foreach($posters as $poster)
     {
     	$percen = round(($poster['ucount'] / $total_replies) * 100, 2);
     	$top_repliers[] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['ucount'], "percentage" => $percen);
     }
     */
     $text_0 = "\n\t\t<table style='width: 100%;' class='fborder table'>\n\t\t\t<tr><td style='width: 50%; text-align: right;'><b>" . LAN_FORUM_6001 . ":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>{$open_date}</td></tr>\n\t\t\t<tr><td style='width: 50%; text-align: right;'><b>" . LAN_FORUM_6002 . ":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>{$open_since}</td></tr>\n\t\t\t<tr><td style='width: 50%; text-align: right;'><b>" . LAN_FORUM_6003 . ":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>{$total_posts}</td></tr>\n\t\t\t<tr><td style='width: 50%; text-align: right;'><b>" . LAN_FORUM_1007 . ":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>{$total_topics}</td></tr>\n\t\t\t<tr><td style='width: 50%; text-align: right;'><b>" . LAN_FORUM_6004 . ":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>{$total_replies}</td></tr>\n\t\t\t<tr><td style='width: 50%; text-align: right;'><b>" . LAN_FORUM_6005 . ":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>{$total_views}</td></tr>\n\t\t\t<tr><td style='width: 50%; text-align: right;'><b>" . LAN_FORUM_6014 . ":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>{$postsperday}</td></tr>\n\t\t\t<tr><td style='width: 50%; text-align: right;'><b>" . LAN_FORUM_6006 . ":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>{$db_size}</td></tr>\n\t\t\t<tr><td style='width: 50%; text-align: right;'><b>" . LAN_FORUM_6007 . ":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>{$avg_row_len}</td></tr>\n\t\t</table>";
     $text_1 = "\n\t\t<table style='width: 100%;' class='fborder table'>\n\t\t<thead>\n\t\t<tr>\n\t\t<th style='width: 10%; text-align: center;' class='fcaption'>" . LAN_FORUM_6008 . "</th>\n\t\t<th style='width: 40%;' class='fcaption'>" . LAN_FORUM_1003 . "</th>\n\t\t<th style='width: 10%; text-align: center;' class='fcaption'>" . LAN_FORUM_0003 . "</th>\n\t\t<th style='width: 20%; text-align: center;' class='fcaption'>" . LAN_FORUM_6009 . "</th>\n\t\t<th style='width: 20%; text-align: center;' class='fcaption'>" . LAN_DATE . "</th>\n\t\t</tr>\n\t\t</thead>\n\t\t";
     $count = 1;
     foreach ($most_activeArray as $ma) {
         if ($ma['user_name']) {
             //$uinfo = "<a href='".e_HTTP."user.php ?id.{$ma['user_id']}'>{$ma['user_name']}</a>"; //TODO SEf Url .
             $uparams = array('id' => $ma['user_id'], 'name' => $ma['user_name']);
             $link = e107::getUrl()->create('user/profile/view', $uparams);
             $uinfo = "<a href='" . $link . "'>" . $ma['user_name'] . "</a>";
         } else {
             $tmp = explode(chr(1), $ma['thread_anon']);
             $uinfo = $tp->toHTML($tmp[0]);
         }
         $ma['thread_sef'] = eHelper::title2sef($ma['thread_name'], 'dashl');
         $url = e107::url('forum', 'topic', $ma);
         $text_1 .= "\n\t\t\t<tr>\n\t\t\t<td style='width: 10%; text-align: center;' class='forumheader3'>{$count}</td>\n\t\t\t<td style='width: 40%;' class='forumheader3'><a href='" . $url . "'>{$ma['thread_name']}</a></td>\n\t\t\t<td style='width: 10%; text-align: center;' class='forumheader3'>{$ma['thread_total_replies']}</td>\n\t\t\t<td style='width: 20%; text-align: center;' class='forumheader3'>{$uinfo}</td>\n\t\t\t<td style='width: 20%; text-align: center;' class='forumheader3'>" . $gen->convert_date($ma['thread_datestamp'], "forum") . "</td>\n\t\t\t</tr>\n\t\t\t";
         $count++;
     }
     $text_1 .= "</table>";
     $text_2 = "\n\t\t<table style='width: 100%;' class='fborder table'>\n\t\t<thead>\n\t\t<tr>\n\t\t<th style='width: 10%; text-align: center;' class='fcaption'>" . LAN_FORUM_6008 . "</th>\n\t\t<th style='width: 40%;' class='fcaption'>" . LAN_FORUM_1003 . "</th>\n\t\t<th style='width: 10%; text-align: center;' class='fcaption'>" . LAN_FORUM_1005 . "</th>\n\t\t<th style='width: 20%; text-align: center;' class='fcaption'>" . LAN_FORUM_6009 . "</th>\n\t\t<th style='width: 20%; text-align: center;' class='fcaption'>" . LAN_DATE . "</th>\n\t\t</tr>\n\t\t</thead>\n\t\t";
     $count = 1;
     foreach ($most_viewedArray as $ma) {
         if ($ma['user_name']) {
             //$uinfo = "<a href='".e_HTTP."user.php ?id.{$ma['user_id']}'>".$ma['user_name']."</a>";  //TODO SEf Url .
             $uparams = array('id' => $ma['user_id'], 'name' => $ma['user_name']);
             $link = e107::getUrl()->create('user/profile/view', $uparams);
             $uinfo = "<a href='" . $link . "'>" . $ma['user_name'] . "</a>";
         } else {
             $tmp = explode(chr(1), $ma['thread_anon']);
             $uinfo = $tp->toHTML($tmp[0]);
         }
         $ma['thread_sef'] = eHelper::title2sef($ma['thread_name'], 'dashl');
         $url = e107::url('forum', 'topic', $ma);
         $text_2 .= "\n\t\t\t<tr>\n\t\t\t<td style='width: 10%; text-align: center;' class='forumheader3'>{$count}</td>\n\t\t\t<td style='width: 40%;' class='forumheader3'><a href='" . $url . "'>" . $ma['thread_name'] . "</a></td>\n\t\t\t<td style='width: 10%; text-align: center;' class='forumheader3'>" . $ma['thread_views'] . "</td>\n\t\t\t<td style='width: 20%; text-align: center;' class='forumheader3'>" . $uinfo . "</td>\n\t\t\t<td style='width: 20%; text-align: center;' class='forumheader3'>" . $gen->convert_date($ma['thread_datestamp'], "forum") . "</td>\n\t\t\t</tr>\n\t\t\t";
         $count++;
     }
     $text_2 .= "</table>";
     $text_3 = "\n\t\t<table style='width: 100%;' class='fborder table'>\n\t\t<thead>\n\t\t<tr>\n\t\t<th style='width: 10%; text-align: center;' class='fcaption'>" . LAN_FORUM_6008 . "</th>\n\t\t<th style='width: 20%;' class='fcaption'>" . LAN_NAME . "</th>\n\t\t<th style='width: 10%; text-align: center;' class='fcaption'>" . LAN_FORUM_2032 . "</th>\n\t\t<th style='width: 10%; text-align: center;' class='fcaption'>%</th>\n\t\t<th style='width: 50%; text-align: center;' class='fcaption'>&nbsp;</th>\n\t\t</tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t";
     $count = 1;
     foreach ($top_posters as $ma) {
         $text_3 .= "<tr>\n\t\t\t<td style='width: 10%; text-align: center;' class='forumheader3'>{$count}</td>\n\t\t\t<td style='width: 20%;' class='forumheader3'><a href='" . e107::getUrl()->create('user/profile/view', $ma) . "'>" . $ma['user_name'] . "</a></td>\n\t\t\t<td style='width: 10%; text-align: center;' class='forumheader3'>" . $ma['user_forums'] . "</td>\n\t\t\t<td style='width: 10%; text-align: center;' class='forumheader3'>" . $ma['percentage'] . "%</td>\n\t\t\t<td style='width: 50%;' class='forumheader3'>" . $this->showBar($ma['percentage']) . "\n\t\t\t</td>\n\t\t\t</tr>\n\t\t\t";
         $count++;
     }
     $text_3 .= "</tbody>\n\t\t</table>\n\t\t";
     $text_4 = "\n\t\t<table style='width: 100%;' class='fborder table'>\n\t\t<thead>\n\t\t<tr>\n\t\t<th style='width: 10%; text-align: center;' class='fcaption'>" . LAN_FORUM_6008 . "</th>\n\t\t<th style='width: 20%;' class='fcaption'>" . LAN_NAME . "</th>\n\t\t<th style='width: 10%; text-align: center;' class='fcaption'>" . LAN_FORUM_2032 . "</th>\n\t\t<th style='width: 10%; text-align: center;' class='fcaption'>%</th>\n\t\t<th style='width: 50%; text-align: center;' class='fcaption'>&nbsp;</th>\n\t\t</tr>\n\t\t</thead>\n\t\t";
     $count = 1;
     foreach ($top_topic_starters as $ma) {
         $text_4 .= "<tr>\n\t\t\t<td style='width: 10%; text-align: center;' class='forumheader3'>{$count}</td>\n\t\t\t<td style='width: 20%;' class='forumheader3'><a href='" . e107::getUrl()->create('user/profile/view', $ma) . "'>" . $ma['user_name'] . "</a></td>\n\t\t\t<td style='width: 10%; text-align: center;' class='forumheader3'>" . $ma['user_forums'] . "</td>\n\t\t\t<td style='width: 10%; text-align: center;' class='forumheader3'>" . $ma['percentage'] . "%</td>\n\t\t\t<td style='width: 50%; text-align: center;' class='forumheader3'>" . $this->showBar($ma['percentage']) . "</td>\n\t\t\t</tr>\n\t\t\t";
         $count++;
     }
     $text_4 .= "</table>";
     $text_5 = "\n\t\t<table style='width: 100%;' class='fborder table'>\n\t\t<thead>\n\t\t<tr>\n\t\t<th style='width: 10%; text-align: center;' class='fcaption'>" . LAN_FORUM_6008 . "</th>\n\t\t<th style='width: 20%;' class='fcaption'>" . LAN_NAME . "</th>\n\t\t<th style='width: 10%; text-align: center;' class='fcaption'>" . LAN_FORUM_2032 . "</th>\n\t\t<th style='width: 10%; text-align: center;' class='fcaption'>%</th>\n\t\t<th style='width: 50%; text-align: center;' class='fcaption'>&nbsp;</th>\n\t\t</tr>\n\t\t</thead>\n\t\t";
     $count = 1;
     foreach ($top_repliers as $ma) {
         $text_5 .= "\n\t\t\t<tr>\n\t\t\t<td style='width: 10%; text-align: center;' class='forumheader3'>{$count}</td>\n\t\t\t<td style='width: 20%;' class='forumheader3'><a href='" . e107::getUrl()->create('user/profile/view', $ma) . "'>" . $ma['user_name'] . "</a></td>\n\t\t\t<td style='width: 10%; text-align: center;' class='forumheader3'>" . $ma['user_forums'] . "</td>\n\t\t\t<td style='width: 10%; text-align: center;' class='forumheader3'>" . $ma['percentage'] . "%</td>\n\t\t\t<td style='width: 50%; text-align: center;' class='forumheader3'>" . $this->showBar($ma['percentage']) . "</td>\n\t\t\t</tr>\n\t\t\t";
         $count++;
     }
     $text_5 .= '</table>';
     if (deftrue('BOOTSTRAP')) {
         $tabs = array();
         $tabs[0] = array('caption' => LAN_FORUM_6000, 'text' => $text_0);
         $tabs[1] = array('caption' => LAN_FORUM_0011, 'text' => $text_1);
         $tabs[2] = array('caption' => LAN_FORUM_6010, 'text' => $text_2);
         $tabs[3] = array('caption' => LAN_FORUM_0010, 'text' => $text_3);
         $tabs[4] = array('caption' => LAN_FORUM_6011, 'text' => $text_4);
         $tabs[5] = array('caption' => LAN_FORUM_6012, 'text' => $text_5);
         $frm = e107::getForm();
         $breadarray = array(array('text' => e107::pref('forum', 'title', LAN_PLUGIN_FORUM_NAME), 'url' => e107::url('forum', 'index')), array('text' => LAN_FORUM_6013, 'url' => null));
         $text = $frm->breadcrumb($breadarray);
         $text = "<div id='forum-stats'>" . $text . e107::getForm()->tabs($tabs) . "</div>";
     } else {
         $text = "\n\t\t\t<h3>" . LAN_FORUM_6000 . "</h3>" . $text_0 . "<h3>" . LAN_FORUM_0011 . "</h3>" . $text_1 . "<h3>" . LAN_FORUM_6010 . "</h3>" . $text_2 . "<h3>" . LAN_FORUM_0010 . "</h3>" . $text_3 . "<h3>" . LAN_FORUM_6011 . "</h3>" . $text_4 . "<h3>" . LAN_FORUM_6012 . "</h3>" . $text_5;
     }
     $text .= "<div class='center'>" . e107::getForm()->pagination(e107::url('forum', 'index'), LAN_BACK) . "</div>";
     $ns->tablerender(LAN_FORUM_6013, $text);
 }
Example #12
0
function newthreadjump($url)
{
    global $forum;
    $jumpList = $forum->forumGetAllowed('view');
    $text = '<div class="btn-group">
    <a href="' . $url . '" class="btn btn-primary">' . LAN_FORUM_1018 . '</a>
    <button class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
    <span class="caret"></span>
    </button>
    <ul class="dropdown-menu pull-right">
    ';
    foreach ($jumpList as $key => $val) {
        $text .= '<li><a href="' . e107::url('forum', 'forum', $val) . '">' . LAN_FORUM_1017 . ': ' . $val['forum_name'] . '</a></li>';
    }
    $text .= '
    </ul>
    </div>';
    return $text;
}
Example #13
0
 function showOptionsSelect($mode, $searchtypeid = "")
 {
     global $plugindir, $plugintable, $rs, $qs, $content_pref;
     if (!is_object($rs)) {
         require_once e_HANDLER . "form_handler.php";
         $rs = new form();
     }
     if (!isset($searchtypeid)) {
         $searchtypeid = is_numeric($qs[1]) ? $qs[1] : $qs[2];
     }
     $catarray = "";
     $mainparent = $this->getMainParent($searchtypeid);
     $content_pref = $this->getContentPref($mainparent);
     $parent = $this->getCategoryTree("", $mainparent, TRUE);
     $parent = array_merge_recursive($parent);
     for ($a = 0; $a < count($parent); $a++) {
         for ($b = 0; $b < count($parent[$a]); $b++) {
             $newparent[$parent[$a][$b]] = $parent[$a][$b + 1];
             $b++;
         }
     }
     if ($newparent) {
         $emptystring = CONTENT_LAN_14;
         $catarray = $rs->form_option($emptystring, "0", "none");
     }
     foreach ($newparent as $key => $value) {
         $n = "";
         if ($mode == "page" || $mode == "menu" && isset($content_pref["content_menu_cat_number"])) {
             $n = $this->countCatItems($key);
             $n = " (" . $n . " " . ($n == "1" ? CONTENT_LAN_53 : CONTENT_LAN_54) . ")";
         }
         if ($content_pref["content_menu_cat_main"] && $key == $mainparent || $key != $mainparent) {
             $value = strlen($value) > 25 ? substr($value, 0, 25) . "..." : $value;
             $catarray .= $rs->form_option($value . $n, 0, $plugindir . "content.php?cat." . $key);
         }
     }
     if ($mode == "page" || ($mode == "menu" && ($content_pref["content_menu_links"] && $content_pref["content_menu_links_dropdown"]) || $content_pref["content_menu_cat"] && $content_pref["content_menu_cat_dropdown"])) {
         if ($mode == "menu") {
             $style = "style='width:100%;' ";
         } else {
             $style = "";
         }
         $CONTENT_SEARCH_TABLE_SELECT = "\n\t\t\t\t" . $rs->form_open("post", $plugindir . "content.php" . (e_QUERY ? "?" . e_QUERY : ""), "contentredirect" . $mode, "", "enctype='multipart/form-data'") . "\t\t\t\t\n\t\t\t\t<div><select id='{$mode}value' name='{$mode}value' class='tbox' {$style} onchange=\"if(this.options[this.selectedIndex].value != 'none'){ return document.location=this.options[this.selectedIndex].value; }\">";
         if ($mode == "page" || $mode == "menu" && $content_pref["content_menu_links"] && $content_pref["content_menu_links_dropdown"]) {
             $CONTENT_SEARCH_TABLE_SELECT .= $rs->form_option(CONTENT_LAN_56, 1, "none") . $rs->form_option("&nbsp;", "0", "none");
             $row['url_content_id'] = $mainparent;
             if ($mode == "page" || $mode == "menu" && $content_pref["content_menu_viewallcat"]) {
                 $CONTENT_SEARCH_TABLE_SELECT .= $rs->form_option(CONTENT_LAN_6, 0, e107::url("content", "categories", $row, "full"));
             }
             if ($mode == "page" || $mode == "menu" && $content_pref["content_menu_viewallauthor"]) {
                 $CONTENT_SEARCH_TABLE_SELECT .= $rs->form_option(CONTENT_LAN_7, 0, e107::url("content", "authors", $row, "full"));
             }
             if ($mode == "page" || $mode == "menu" && $content_pref["content_menu_viewallitems"]) {
                 $CONTENT_SEARCH_TABLE_SELECT .= $rs->form_option(CONTENT_LAN_83, 0, e107::url("content", "archive", $row, "full"));
             }
             if ($mode == "page" || $mode == "menu" && $content_pref["content_menu_viewtoprated"]) {
                 $CONTENT_SEARCH_TABLE_SELECT .= $rs->form_option(CONTENT_LAN_8, 0, e107::url("content", "toprated", $row, "full"));
             }
             if ($mode == "page" || $mode == "menu" && $content_pref["content_menu_viewtopscore"]) {
                 $CONTENT_SEARCH_TABLE_SELECT .= $rs->form_option(CONTENT_LAN_12, 0, e107::url("content", "topscore", $row, "full"));
             }
             if ($mode == "page" || $mode == "menu" && $content_pref["content_menu_viewrecent"]) {
                 $CONTENT_SEARCH_TABLE_SELECT .= $rs->form_option(CONTENT_LAN_61, 0, e107::url("content", "recent", $row, "full"));
             }
             if ($mode == "page" || $mode == "menu" && $content_pref["content_menu_viewsubmit"] && $content_pref["content_submit"] && check_class($content_pref["content_submit_class"])) {
                 $CONTENT_SEARCH_TABLE_SELECT .= $rs->form_option(CONTENT_LAN_75, 0, $plugindir . "content_submit.php");
             }
             $CONTENT_SEARCH_TABLE_SELECT .= $rs->form_option("&nbsp;", "0", "none");
         }
         if ($mode == "page" || $mode == "menu" && $content_pref["content_menu_cat"] && $content_pref["content_menu_cat_dropdown"]) {
             $CONTENT_SEARCH_TABLE_SELECT .= $catarray;
         }
         $CONTENT_SEARCH_TABLE_SELECT .= $rs->form_select_close() . "</div>" . $rs->form_close();
     }
     return $CONTENT_SEARCH_TABLE_SELECT;
 }
Example #14
0
  function sc_faq_search($parm = '')
  {
      $frm = e107::getForm();
      $tp = e107::getParser();
      $target = e107::url('faqs', 'search');
      $text = $frm->open('faq-search-form', 'get', $target);
      $text .= '<span class="input-group e-search">';
      $text .= $frm->text('srch', $_GET['srch'], 20, 'class=search-query&placeholder=' . LAN_SEARCH) . '
 			 <span class="input-group-btn"><button class="btn btn-primary"  type="submit">' . $tp->toGlyph('fa-search') . '</button>';
      $text .= '</span></span>';
      $text .= $frm->close();
      return $text;
  }
 /**
  * Render title (as link) for topic used in the recent forum posts menu.
  *
  * @return string
  */
 function sc_recent_topic_name()
 {
     $post = $this->var['post'];
     $thread = $this->var['thread'];
     $toPost = e107::url('forum', 'topic', $thread, array('query' => array('p' => $this->var['topicPage']), 'fragment' => 'post-' . $post['post_id']));
     return '<a href="' . $toPost . '">' . $this->var['thread']['thread_name'] . '</a>';
 }
Example #16
0
    function sc_postoptions()
    {
        $tp = e107::getParser();
        // {EMAILITEM} {PRINTITEM} {REPORTIMG}{EDITIMG}{QUOTEIMG}
        $text = '<div class="btn-group pull-right">
    	<button class="btn btn-default btn-sm btn-small dropdown-toggle" data-toggle="dropdown">
    	Options
    	<span class="caret"></span>
    	</button>
    	<ul class="dropdown-menu pull-right text-right">';
        $text .= "<li class='text-right'><a href='" . e_HTTP . "email.php?plugin:forum." . $this->postInfo['post_thread'] . "'>" . LAN_FORUM_2044 . " " . $tp->toGlyph('envelope') . "</a></li>";
        $text .= "<li class='text-right'><a href='" . e_HTTP . "print.php?plugin:forum." . $this->postInfo['post_thread'] . "'>" . LAN_FORUM_2045 . " " . $tp->toGlyph('print') . "</a></li>";
        // FIXME
        if (USER) {
            $urlReport = e107::url('forum', 'post') . "?f=report&amp;id=" . $this->postInfo['post_thread'] . "&amp;post=" . $this->postInfo['post_id'];
            //	$urlReport = $this->e107->url->create('forum/thread/report', "id={$this->postInfo['post_thread']}&post={$this->postInfo['post_id']}");
            $text .= "<li class='text-right'><a href='" . $urlReport . "'>" . LAN_FORUM_2046 . " " . $tp->toGlyph('flag') . "</a></li>";
        }
        // Edit
        if (USER && $this->postInfo['post_user'] == USERID && $this->thread->threadInfo['thread_active']) {
            $url = e107::url('forum', 'post') . "?f=edit&amp;id=" . $this->postInfo['post_thread'] . "&amp;post=" . $this->postInfo['post_id'];
            //$url = e107::getUrl()->create('forum/thread/edit', array('id' => $this->postInfo['post_thread'], 'post'=>$this->postInfo['post_id']));
            $text .= "<li class='text-right'><a href='" . $url . "'>" . LAN_EDIT . " " . $tp->toGlyph('edit') . "</a></li>";
        }
        if ($this->forum->checkperm($this->postInfo['post_forum'], 'post')) {
            $url = e107::url('forum', 'post') . "?f=quote&amp;id=" . $this->postInfo['post_thread'] . "&amp;post=" . $this->postInfo['post_id'];
            //$url = e107::getUrl()->create('forum/thread/quote', array('id' => $this->postInfo['post_thread'], 'post'=>$this->postInfo['post_id']));
            $text .= "<li class='text-right'><a href='" . $url . "'>" . LAN_FORUM_2041 . " " . $tp->toGlyph('share-alt') . "</a></li>";
            //	$text .= "<li class='text-right'><a href='".e107::getUrl()->create('forum/thread/quote', array('id' => $this->postInfo['post_id']))."'>".LAN_FORUM_2041." ".$tp->toGlyph('share-alt')."</a></li>";
        }
        if (MODERATOR) {
            $text .= "<li role='presentation' class='divider'> </li>";
            $type = $this->postInfo['thread_start'] ? 'thread' : 'Post';
            //	print_a($this->postInfo);
            if (USER && $this->postInfo['post_user'] != USERID && $this->thread->threadInfo['thread_active']) {
                $url = e107::url('forum', 'post') . "?f=edit&amp;id=" . $this->postInfo['post_thread'] . "&amp;post=" . $this->postInfo['post_id'];
                // $url = e107::getUrl()->create('forum/thread/edit', array('id' => $this->postInfo['post_thread'], 'post'=>$this->postInfo['post_id']));
                $text .= "<li class='text-right'><a href='" . $url . "'>" . LAN_EDIT . " " . $tp->toGlyph('edit') . "</a></li>";
            }
            // only show delete button when post is not the initial post of the topic
            //	if(!$this->forum->threadDetermineInitialPost($this->postInfo['post_id']))
            if (empty($this->postInfo['thread_start'])) {
                $text .= "<li class='text-right'><a href='" . e_REQUEST_URI . "' data-forum-action='deletepost' data-forum-post='" . $this->postInfo['post_id'] . "'>" . LAN_DELETE . " " . $tp->toGlyph('trash') . "</a></li>";
            }
            if ($type == 'thread') {
                $url = e107::url('forum', 'move', array('thread_id' => $this->postInfo['post_thread']));
                $text .= "<li class='text-right'><a href='" . $url . "'>" . LAN_FORUM_2042 . " " . $tp->toGlyph('move') . "</a></a></li>";
            } else {
                // $text .= "<li class='text-right'><a href='" . e107::getUrl()->create('forum/thread/split', array('id' => $this->postInfo['post_id'], 'post'=>$this->postInfo['post_id']))."'>".LAN_FORUM_2043." ".$tp->toGlyph('cut')."</a></li>";
            }
        }
        $text .= '
		</ul>
		</div>';
        return $text;
    }
Example #17
0
File: links.php Project: gitye/e107
 function link_url($curVal, $mode)
 {
     if ($mode == 'read') {
         $owner = $this->getController()->getListModel()->get('link_owner');
         $sef = $this->getController()->getListModel()->get('link_sefurl');
         if (!empty($owner) && !empty($sef)) {
             $curVal = str_replace(e_HTTP, '', e107::url($owner, $sef));
         }
         return $curVal;
         //  $this->linkFunctions[$curVal];
     }
     if ($mode == 'write') {
         $owner = $this->getController()->getModel()->get('link_owner');
         $sef = $this->getController()->getModel()->get('link_sefurl');
         if (!empty($owner) && !empty($sef)) {
             $text = str_replace(e_HTTP, '', e107::url($owner, $sef));
             // dynamically created.
             $text .= $this->hidden('link_url', $curVal);
             $text .= " <span class='label label-warning'>" . LAN_AUTO_GENERATED . "</span>";
             return $text;
         }
         return $this->text('link_url', $curVal, 255, array('size' => 'xxlarge'));
     }
     if ($mode == 'inline') {
         $sef = $this->getController()->getListModel()->get('link_sefurl');
         if (empty($sef)) {
             return array('inlineType' => 'text');
         }
         return false;
     }
 }
Example #18
0
 /**
  * @return bool|null|string|void
  */
 function processFunction()
 {
     global $forum, $thread;
     //	$e107 = e107::getInstance();
     $ns = e107::getRender();
     $sql = e107::getDb();
     $tp = e107::getParser();
     $frm = e107::getForm();
     if (empty($_GET['f'])) {
         return;
     }
     $function = trim($_GET['f']);
     switch ($function) {
         case 'post':
             $postId = varset($_GET['id']);
             $postInfo = $forum->postGet($postId, 'post');
             $postNum = $forum->postGetPostNum($postInfo['post_thread'], $postId);
             $postPage = ceil($postNum / $forum->prefs->get('postspage'));
             $url = e107::url('forum', 'topic', $postInfo, array('query' => array('p' => $postPage), 'fragment' => 'post-' . $postId, 'mode' => 'full'));
             e107::redirect($url);
             exit;
             break;
         case 'last':
             $pages = ceil(($thread->threadInfo['thread_total_replies'] + 1) / $thread->perPage);
             $thread->page = $_GET['p'] = $pages;
             break;
             /*              // Now linked directly - no more redirect.
             			case 'next':
             				$next = $forum->threadGetNextPrev('next', $this->threadId, $this->threadInfo['forum_id'], $this->threadInfo['thread_lastpost']);
             				if ($next)
             				{
             					$url = e107::getUrl()->create('forum/thread/view', array('id' => $next), array('encode' => false, 'full' => 1)); // no thread name info at this time
             					header("location: {$url}");
             					exit;
             				}
             				$this->message = LAN_FORUM_2013;
             				break;
             
             			case 'prev':
             				$prev = $forum->threadGetNextPrev('prev', $this->threadId, $this->threadInfo['forum_id'], $this->threadInfo['thread_lastpost']);
             				if ($prev)
             				{
             					$url = e107::getUrl()->create('forum/thread/view', array('id' => $prev), array('encode' => false, 'full' => 1));// no thread name info at this time
             					header("location: {$url}");
             					exit;
             				}
             				$this->message = LAN_FORUM_2012;
             				break;
             */
             // Moved to form_post.php
             /*
             			case 'report':
             				$threadId 	= (int)$_GET['id'];
             				$postId 	= (int)$_GET['post'];
             				$postInfo 	= $forum->postGet($postId, 'post');
             
             				if(!empty($_POST['report_thread']))
             				{
             					$report_add = $tp->toDB($_POST['report_add']);
             
             					if($forum->prefs->get('reported_post_email'))
             					{
             						require_once(e_HANDLER.'mail.php');
             						$report = LAN_FORUM_2018." ".SITENAME." : ".(substr(SITEURL, -1) == "/" ? SITEURL : SITEURL."/") . $e107->getFolder('plugins') . "forum/forum_viewtopic.php?" . $this->threadId . ".post\n
             						".LAN_FORUM_2019.": ".USERNAME. "\n" . $report_add;
             						$subject = LAN_FORUM_2020." ". SITENAME;
             						sendemail(SITEADMINEMAIL, $subject, $report);
             					}
             					// no reference of 'head' $threadInfo['head']['thread_name']
             
             					$insert = array(
             						'gen_id'        =>	0,
             						'gen_type'      =>	'reported_post',
             						'gen_datestamp' =>	time(),
             						'gen_user_id'   =>	USERID,
             						'gen_ip'        =>	$tp->toDB($postInfo['thread_name']),
             						'gen_intdata'   =>	intval($this->threadId),
             						'gen_chardata'  =>	$report_add,
             
             
             
             					);
             
             					$url = e107::getUrl()->create('forum/thread/post', array('id' => $postId, 'name' => $postInfo['thread_name'], 'thread' => $threadId)); // both post info and thread info contain thread name
             
             					$result = $sql->insert('generic', $insert);
             
             					if($result)
             					{
             						$text = "<div class='alert alert-block alert-success'><h4>".LAN_FORUM_2021 . "</h4><a href='{$url}'>".LAN_FORUM_2022.'</a></div>';
             					}
             					else
             					{
             						$text = "<div class='alert alert-block alert-error'><h4>".LAN_FORUM_2021 . "</h4><a href='{$url}'>".LAN_FORUM_2022.'</a></div>';
             					}
             
             					define('e_PAGETITLE', LAN_FORUM_1001 . " / " . LAN_FORUM_2021);
             
             					return $ns->tablerender(LAN_FORUM_2023, $text, array('forum_viewtopic', 'report'), true);
             				}
             				else
             				{
             					$thread_name = e107::getParser()->toHTML($postInfo['thread_name'], true, 'no_hook, emotes_off');
             					define('e_PAGETITLE', LAN_FORUM_1001.' / '.LAN_FORUM_2024.': '.$thread_name);
             					$url = e107::getUrl()->create('forum/thread/post', array('id' => $postId, 'name' => $postInfo['thread_name'], 'thread' => $threadId));
             					$actionUrl = e107::getUrl()->create('forum/thread/report', "id={$threadId}&post={$postId}");
             
             
             					if(deftrue('BOOTSTRAP')) //v2.x
             					{
             						$text = $frm->open('forum-report-thread','post');
             						$text .= "
             							<div>
             								<div class='alert alert-block alert-warning'>
             								<h4>".LAN_FORUM_2025.': '.$thread_name."</h4>
             									".LAN_FORUM_2027."<br />".str_replace(array('[', ']'), array('<b>', '</b>'), LAN_FORUM_2028)."
             								<a class='pull-right btn btn-xs btn-primary e-expandit' href='#post-info'>View Post</a>
             								</div>
             								<div id='post-info' class='e-hideme alert alert-block alert-danger'>
             									".$tp->toHtml($postInfo['post_entry'],true)."
             								</div>
             								<div class='form-group' >
             									<div class='col-md-12'>
             								".$frm->textarea('report_add','',10,35,array('size'=>'xxlarge'))."
             									</div>
             								</div>
             								<div class='form-group'>
             									<div class='col-md-12'>
             									".$frm->button('report_thread',1,'submit',LAN_FORUM_2029)."
             									</div>
             								</div>
             
             							</div>";
             
             						$text .= $frm->close();
             					//	$text .= print_a($postInfo['post_entry'],true);
             
             					}
             					else //v1.x legacy layout.
             					{
             						$text = "<form action='".$actionUrl."' method='post'>
             						<table class='table' style='width:100%'>
             						<tr>
             							<td  style='width:50%'>
             							".LAN_FORUM_2025.': '.$thread_name." <a href='".$url."'><span class='smalltext'>".LAN_FORUM_2026."</span></a>
             							</td>
             							<td style='text-align:center;width:50%'></td>
             						</tr>
             						<tr>
             							<td>".LAN_FORUM_2027."<br />".str_replace(array('[', ']'), array('<b>', '</b>'), LAN_FORUM_2028)."</td>
             						</tr>
             						<tr>
             							<td style='text-align:center;'><textarea cols='40' rows='10' class='tbox' name='report_add'></textarea></td>
             						</tr>
             						<tr>
             							<td colspan='2' style='text-align:center;'><br /><input class='btn btn-default button' type='submit' name='report_thread' value='".LAN_FORUM_2029."' /></td>
             						</tr>
             						</table>
             						</form>";
             
             
             
             					}
             
             
             					return e107::getRender()->tablerender(LAN_FORUM_2023, $text, array('forum_viewtopic', 'report2'), true);
             				}
             
             				exit;
             				break;*/
     }
 }
Example #19
0
 /**
  * @param $id of the post
  */
 function updateReply()
 {
     $mes = e107::getMessage();
     $ns = e107::getRender();
     if (empty($_POST['post'])) {
         $mes->addError(LAN_FORUM_3007);
         return;
     }
     if ($this->isAuthor() == false) {
         $mes->addError(LAN_FORUM_3009);
         return;
     }
     $postVals['post_edit_datestamp'] = time();
     $postVals['post_edit_user'] = USERID;
     $postVals['post_entry'] = $_POST['post'];
     $this->forumObj->postUpdate($this->data['post_id'], $postVals);
     e107::getCache()->clear('newforumposts');
     //	$url = e107::getUrl()->create('forum/thread/post', "id={$this->data['post_id']}", 'encode=0&full=1'); // XXX what data is available, find thread name
     $url = e107::url('forum', 'topic', $this->data);
     // ."&f=post";
     $this->redirect($url);
     exit;
 }
Example #20
0
|     http://e107.org
|
|
|     Released under the terms and conditions of the
|     GNU General Public License (http://gnu.org).
|
|     $Source: /cvs_backup/e107_0.8/e107_plugins/rss_menu/e_meta.php,v $
|     $Revision$
|     $Date$
|     $Author$
+----------------------------------------------------------------------------+
*/
if (!defined('e107_INIT')) {
    exit;
}
global $PLUGINS_DIRECTORY;
$tp = e107::getParser();
$sql = e107::getDb();
if (USER_AREA && $sql->select("rss", "*", "rss_class='0' AND rss_limit>0 ORDER BY rss_name")) {
    while ($row = $sql->fetch()) {
        if (strpos($row['rss_url'], "*") === false) {
            //	$url = SITEURL.$PLUGINS_DIRECTORY."rss_menu/rss.php?".$tp->toHTML($row['rss_url'], TRUE, 'constants, no_hook, emotes_off').".2";
            //	$url .= ($row['rss_topicid']) ? ".".$row['rss_topicid'] : "";
            $url2 = rtrim(SITEURL, '/') . e107::url('rss_menu', 'rss', $row);
            $url4 = rtrim(SITEURL, '/') . e107::url('rss_menu', 'atom', $row);
            $name = $tp->toHTML($row['rss_name'], TRUE, 'no_hook, emotes_off');
            echo "<link rel='alternate' type='application/rss+xml' title='" . htmlspecialchars(SITENAME, ENT_QUOTES, 'utf-8') . " " . htmlspecialchars($name, ENT_QUOTES, 'utf-8') . "' href='" . $url2 . "' />\n";
            echo "<link rel='alternate' type='application/atom+xml' title='" . htmlspecialchars(SITENAME, ENT_QUOTES, 'utf-8') . " " . htmlspecialchars($name, ENT_QUOTES, 'utf-8') . "' href='" . $url4 . "' />\n";
        }
    }
}
Example #21
0
$sql = e107::getDb();
e107::includeLan(e_PLUGIN . "rss_menu/languages/" . e_LANGUAGE . "_admin_rss_menu.php");
$topic = "";
$caption = "";
if (e_PAGE == "news.php" && e107::getPref('rss_newscats')) {
    $qry = explode(".", e_QUERY);
    if ($qry[0] == "cat" || $qry[0] == "list") {
        $topic = intval($qry[1]);
    }
}
if (deftrue('e_CURRENT_PLUGIN') && ($res = $sql->retrieve("rss", "rss_path,rss_url", " rss_path = '" . e_CURRENT_PLUGIN . "' LIMIT 1"))) {
    $caption = e107::getParser()->lanVars(LAN_PLUGIN_RSS_SUBSCRIBE_TO, deftrue('LAN_PLUGIN_' . strtoupper(e_CURRENT_PLUGIN) . '_NAME'));
    $type = $res['rss_url'];
    $plug = $res['rss_path'];
} elseif ($sql->select("rss", "rss_path", " rss_path = 'news' LIMIT 1")) {
    $caption = LAN_PLUGIN_RSS_SUBSCRIBE;
    $type = 'news';
    $plug = 'news';
}
if (!empty($type)) {
    $arr = array('rss_topicid' => $topic, 'rss_url' => $type);
    if (deftrue('BOOTSTRAP') === 3) {
        $text = "\n\t\t\t<div>\n\t\t\t\t<a class='btn btn-sm btn-default'  href='" . e107::url('rss_menu', 'rss', $arr) . "'>" . $tp->toGlyph('fa-rss') . " RSS</a>\n\t\t\t\t<a class='btn btn-sm btn-default'  href='" . e107::url('rss_menu', 'atom', $arr) . "'>" . $tp->toGlyph('fa-rss') . " Atom</a>\n\t\t\t</div>";
    } else {
        $path = e_PLUGIN_ABS . "rss_menu/";
        $description = array('chatbox' => RSS_MENU_L7, 'download' => RSS_MENU_L9, 'bugtracker' => RSS_MENU_L8, 'forumtopic' => RSS_MENU_L6, 'forumname' => RSS_MENU_L5, 'forumposts' => '', 'comments' => RSS_MENU_L4, 5 => RSS_MENU_L4, 6 => RSS_MENU_L5, 7 => RSS_MENU_L6, 9 => RSS_MENU_L7, 10 => RSS_MENU_L8, 12 => RSS_MENU_L9);
        $text = "\n\t\t\t<div>\n\t\t\t\t" . varset($description[$type]) . RSS_MENU_L1 . "<br />\n\n\t\t\t\t<div class='spacer'><a href='" . e107::url('rss_menu', 'rss', $arr) . "'><img src='" . $path . "images/rss2.png' alt='rss2.0' /></a></div>\n\t\t\t\t<div class='spacer'><a href='" . e107::url('rss_menu', 'atom', $arr) . "'><img src='" . $path . "images/rss4.png' alt='atom' /></a></div>\n\t\t\t</div>";
        $caption = RSS_MENU_L2;
    }
    e107::getRender()->tablerender($caption, $text, 'rss_menu');
}
Example #22
0
 function sc_content_cat_table_url($parm = '')
 {
     //need to rewrite
     global $row, $qs;
     //return e_SELF."?cat.".$row['content_id'];
     $row['url_content_id'] = $row['content_id'];
     return e107::url("content", "cat", $row, "full");
 }
Example #23
0
File: faqs.php Project: armpit/e107
 function view_all_query($srch = '')
 {
     $sql = e107::getDb();
     $tp = e107::getParser();
     $text = "";
     $insert = "";
     $item = false;
     $removeUrl = e107::url('faqs', 'index');
     if (!empty($srch)) {
         $srch = $tp->toDB($srch);
         $insert = " AND (f.faq_question LIKE '%" . $srch . "%' OR f.faq_answer LIKE '%" . $srch . "%' OR FIND_IN_SET ('" . $srch . "', f.faq_tags) ) ";
         $message = "<span class='label label-lg label-info'>" . $srch . " <a class='e-tip' title='Remove' href='" . $removeUrl . "'>×</a></span>";
         e107::getMessage()->setClose(false, E_MESSAGE_INFO)->setTitle(LAN_FAQS_FILTER_ACTIVE, E_MESSAGE_INFO)->addInfo($message);
         $text = e107::getMessage()->render();
     }
     if (!empty($_GET['id'])) {
         $srch = intval($_GET['id']);
         //	$insert = " AND (f.faq_id = ".$srch.") ";
         $item = $srch;
     }
     if (!empty($_GET['cat'])) {
         $srch = $tp->toDB($_GET['cat']);
         $insert = " AND (cat.faq_info_sef = '" . $srch . "') ";
     }
     if (!empty($_GET['tag'])) {
         $srch = $tp->toDB($_GET['tag']);
         $insert = " AND FIND_IN_SET ('" . $srch . "', f.faq_tags)  ";
         $message = "<span class='label label-lg label-info'>" . $srch . " <a class='e-tip' title='Remove' href='" . $removeUrl . "'>×</a></span>";
         e107::getMessage()->setClose(false, E_MESSAGE_INFO)->setTitle(LAN_FAQS_FILTER_ACTIVE, E_MESSAGE_INFO)->addInfo($message);
         $text = e107::getMessage()->render();
     }
     list($orderBy, $ascdesc) = explode('-', vartrue($this->pref['orderby'], 'faq_order-ASC'));
     $query = "SELECT f.*,cat.* FROM #faqs AS f LEFT JOIN #faqs_info AS cat ON f.faq_parent = cat.faq_info_id WHERE cat.faq_info_class IN (" . USERCLASS_LIST . ") " . $insert . " ORDER BY cat.faq_info_order, f." . $orderBy . " " . $ascdesc . " ";
     if (!$sql->gen($query)) {
         $message = !empty($srch) ? "<b>" . $srch . "</b> was not found in search results. <a class='e-tip' title='Reset' href='" . $removeUrl . "'>Reset</a>" : LAN_FAQS_NONE_AVAILABLE;
         return "<div class='alert alert-warning alert-block'>" . $message . "</div>";
         //TODO LAN
     }
     // -----------------
     $FAQ_LISTALL = e107::getTemplate('faqs', true, 'all');
     $prevcat = "";
     $sc = e107::getScBatch('faqs', true);
     $sc->counter = 1;
     $sc->tag = htmlspecialchars($tag, ENT_QUOTES, 'utf-8');
     $sc->category = $category;
     if (!empty($_GET['id'])) {
         $sc->item = intval($_GET['id']);
         $js = "\n\t\t\t\t\$( document ).ready(function() {\n                    \$('html, body').animate({ scrollTop:  \$('div#faq_" . $sc->item . "').offset().top - 300 }, 4000);\n\t\t\t\t});\n\n\t\t\t\t";
         e107::js('footer-inline', $js);
     }
     //	$text = $tp->parseTemplate($FAQ_START, true, $sc);
     //	$text = "";
     if ($this->pref['list_type'] == 'ol') {
         $reversed = $ascdesc == 'DESC' ? 'reversed ' : '';
         $tsrch = array('<ul ', '/ul>');
         $trepl = array('<ol ' . $reversed, '/ol>');
         $FAQ_LISTALL['start'] = str_replace($tsrch, $trepl, $FAQ_LISTALL['start']);
         $FAQ_LISTALL['end'] = str_replace($tsrch, $trepl, $FAQ_LISTALL['end']);
     }
     while ($rw = $sql->fetch()) {
         $rw['faq_sef'] = eHelper::title2sef($tp->toText($rw['faq_question']), 'dashl');
         $sc->setVars($rw);
         if ($sc->item == $rw['faq_id']) {
             $this->pageTitle = $rw['faq_question'];
             $this->pageDescription = $rw['faq_answer'];
         }
         if ($rw['faq_info_order'] != $prevcat) {
             if ($prevcat != '') {
                 $text .= $tp->parseTemplate($FAQ_LISTALL['end'], true, $sc);
             }
             $text .= "\n\n<!-- FAQ Start " . $rw['faq_info_order'] . "-->\n\n";
             $text .= $tp->parseTemplate($FAQ_LISTALL['start'], true, $sc);
             $start = TRUE;
         }
         $text .= $tp->parseTemplate($FAQ_LISTALL['item'], true, $sc);
         $prevcat = $rw['faq_info_order'];
         $sc->counter++;
     }
     $text .= $start ? $tp->parseTemplate($FAQ_LISTALL['end'], true, $sc) : "";
     //		$text .= $tp->parseTemplate($FAQ_END, true, $sc);
     return $text;
 }
Example #24
0
 function buildRss($rss_title)
 {
     global $pref;
     $tp = e107::getParser();
     header('Content-type: application/xml', TRUE);
     $rss_title = $tp->toRss($tp->toHtml($pref['sitename'], '', 'defs') . " : " . $tp->toHtml($rss_title, '', 'defs'));
     $rss_namespace = $this->rssNamespace ? "xmlns:" . $this->rssNamespace : '';
     $rss_custom_channel = $this->rssCustomChannel ? $this->rssCustomChannel : '';
     $time = time();
     switch ($this->rssType) {
         case 1:
             // RSS 1.0
             echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?" . ">\n\t\t\t\t\t\t<!-- generator=\"e107\" -->\n\t\t\t\t\t\t<!-- content type=\"" . $this->contentType . "\" -->\n\t\t\t\t\t\t<rss version=\"0.92\">\n\t\t\t\t\t\t<channel>\n\t\t\t\t\t\t<title>" . $tp->toRss($rss_title) . "</title>\n\t\t\t\t\t\t<link>" . $pref['siteurl'] . "</link>\n\t\t\t\t\t\t<description>" . $tp->toRss($pref['sitedescription']) . "</description>\n\t\t\t\t\t\t<lastBuildDate>" . ($itemdate = date("r", $time + $this->offset) . "</lastBuildDate>\n\t\t\t\t\t\t<docs>http://backend.userland.com/rss092</docs>\n");
             foreach ($this->rssItems as $value) {
                 // Multi-language rss links.
                 $link = e_LANQRY ? str_replace("?", "?" . e_LANQRY, $value['link']) : $value['link'];
                 echo "\n\t\t\t\t\t\t\t<item>\n\t\t\t\t\t\t\t<title>" . $tp->toRss($value['title']) . "</title>\n\t\t\t\t\t\t\t<description>" . substr($tp->toRss($value['description']), 0, 150);
                 if ($pref['rss_shownewsimage'] == 1 && strlen(trim($value['news_thumbnail'])) > 0) {
                     $news_thumbnail = SITEURLBASE . e_IMAGE_ABS . "newspost_images/" . $tp->toRss($value['news_thumbnail']);
                     echo "&lt;a href=&quot;" . $link . "&quot;&gt;&lt;img src=&quot;" . $news_thumbnail . "&quot; height=&quot;50&quot; border=&quot;0&quot; hspace=&quot;10&quot; vspace=&quot;10&quot; align=&quot;right&quot;&gt;&lt;/a&gt;";
                     unset($news_thumbail);
                 }
                 echo "</description>\n\t\t\t\t\t\t\t<author>" . $value['author'] . "&lt;" . $this->nospam($value['author_email']) . "&gt;</author>\n\t\t\t\t\t\t\t<link>" . $link . "</link>\n\t\t\t\t\t\t\t</item>";
             }
             echo "\n\t\t\t\t\t\t</channel>\n\t\t\t\t\t\t</rss>";
             break;
         case 2:
             // RSS 2.0
             $sitebutton = strstr(SITEBUTTON, "http:") ? SITEBUTTON : SITEURL . str_replace("../", "", SITEBUTTON);
             echo "<?xml version=\"1.0\" encoding=\"utf-8\"?" . ">\n\t\t\t\t<!-- generator=\"e107\" -->\n\t\t\t\t<!-- content type=\"" . $this->contentType . "\" -->\n\t\t\t\t<rss {$rss_namespace} version=\"2.0\"\n\t\t\t\t\txmlns:content=\"http://purl.org/rss/1.0/modules/content/\"\n\t\t\t\t\txmlns:atom=\"http://www.w3.org/2005/Atom\"\n\t\t\t\t\txmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n\t\t\t\t\txmlns:sy=\"http://purl.org/rss/1.0/modules/syndication/\"\n\t\t\t\t\txmlns:media=\"http://search.yahoo.com/mrss/\"\n\t\t\t\t>\n\t\t\t\t<channel>\n\t\t\t\t<title>" . $tp->toRss($rss_title) . "</title>\n\t\t\t\t<link>" . $pref['siteurl'] . "</link>\n\t\t\t\t<description>" . $tp->toRss($pref['sitedescription']) . "</description>\n";
             echo $tp->toHtml($rss_custom_channel, FALSE) . "\n";
             // must not convert to CDATA.
             echo "\n\t\t\t\t<language>" . CORE_LC . (defined("CORE_LC2") ? "-" . CORE_LC2 : "") . "</language>\n\t\t\t\t<copyright>" . $tp->toRss(SITEDISCLAIMER) . "</copyright>\n\t\t\t\t<managingEditor>" . $this->nospam($pref['siteadminemail']) . " (" . $pref['siteadmin'] . ")</managingEditor>\n\t\t\t\t<webMaster>" . $this->nospam($pref['siteadminemail']) . " (" . $pref['siteadmin'] . ")</webMaster>\n\t\t\t\t<pubDate>" . date("r", $time + $this->offset) . "</pubDate>\n\t\t\t\t<lastBuildDate>" . date("r", $time + $this->offset) . "</lastBuildDate>\n\t\t\t\t<docs>http://backend.userland.com/rss</docs>\n\t\t\t\t<generator>e107 (http://e107.org)</generator>\n\t\t\t\t<sy:updatePeriod>hourly</sy:updatePeriod>\n\t\t\t\t<sy:updateFrequency>1</sy:updateFrequency>\n\t\t\t\t<ttl>60</ttl>";
             echo "\n\t\t\t\t<atom:link href=\"" . $tp->toRss(e107::url('rss_menu', 'atom', array('rss_url' => $this->contentType, 'rss_topicid' => $this->topicid), 'full')) . "\" rel=\"self\" type=\"application/rss+xml\" />\n";
             if (trim(SITEBUTTON)) {
                 echo "\n\t\t\t\t\t<image>\n\t\t\t\t\t<title>" . $tp->toRss($rss_title) . "</title>\n\t\t\t\t\t<url>" . (strstr(SITEBUTTON, "http:") !== FALSE ? SITEBUTTON : SITEURL . str_replace("../", "", SITEBUTTON)) . "</url>\n\t\t\t\t\t<link>" . $pref['siteurl'] . "</link>\n\t\t\t\t\t<width>88</width>\n\t\t\t\t\t<height>31</height>\n\t\t\t\t\t<description>" . $tp->toRss($pref['sitedescription']) . "</description>\n\t\t\t\t\t</image>\n";
             }
             // Generally Ignored by 99% of readers.
             /*
             echo "
             <textInput>
             <title>Search</title>
             <description>Search ".$tp->toRss($pref['sitename'])."</description>
             <name>query</name>
             <link>".SITEURL.(substr(SITEURL, -1) == "/" ? "" : "/")."search.php</link>
             </textInput>";
             */
             foreach ($this->rssItems as $value) {
                 // Multi-language rss links.
                 $link = e_LANQRY ? str_replace("?", "?" . e_LANQRY, $value['link']) : $value['link'];
                 $catlink = e_LANQRY ? str_replace("?", "?" . e_LANQRY, $value['category_link']) : $value['category_link'];
                 echo "<item>\n";
                 echo "<title>" . $tp->toRss($value['title']) . "</title>\n";
                 if ($link) {
                     echo "<link>" . $link . "</link>\n";
                 }
                 echo "<description>" . $tp->toRss($value['description'], true) . "</description>\n";
                 if ($value['content_encoded']) {
                     echo "<content:encoded>" . $tp->toRss($value['content_encoded'], true) . "</content:encoded>\n";
                 }
                 if ($value['category_name'] && $catlink) {
                     echo "<category domain='" . $catlink . "'>" . $tp->toRss($value['category_name']) . "</category>\n";
                 }
                 if ($value['comment']) {
                     echo "<comments>" . $value['comment'] . "</comments>\n";
                 }
                 if ($value['author']) {
                     echo "<dc:creator>" . $value['author'] . "</dc:creator>\n";
                     // correct tag for author without email.
                 }
                 // Enclosure support for podcasting etc.
                 if ($value['enc_url'] && $value['enc_leng'] && $value['enc_type']) {
                     echo "<enclosure url=\"" . $value['enc_url'] . "\" length=\"" . $value['enc_leng'] . "\" type=\"" . $value['enc_type'] . "\"   />\n";
                 }
                 echo "<pubDate>" . date("r", $value['pubdate'] + $this->offset) . "</pubDate>\n";
                 if ($link) {
                     echo "<guid isPermaLink=\"true\">" . $link . "</guid>\n";
                 }
                 if (isset($value['custom'])) {
                     foreach ($value['custom'] as $cKey => $cVal) {
                         echo "<" . $cKey . ">" . $tp->toRss($cVal) . "</" . $cKey . ">\n";
                     }
                 }
                 if (!empty($value['media'])) {
                     foreach ($value['media'] as $cVal) {
                         foreach ($cVal as $k => $v) {
                             echo $this->buildTag($k, $v);
                         }
                     }
                 }
                 echo "</item>\n\n";
             }
             // echo "<atom:link href=\"".e_SELF."?".($this -> contentType).".4.".$this -> topicId ."\" rel=\"self\" type=\"application/rss+xml\" />";
             echo "\n\t\t\t\t</channel>\n\t\t\t\t</rss>";
             break;
         case 3:
             // RDF
             echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?" . ">\n\t\t\t\t<!-- generator=\"e107\" -->\n\t\t\t\t<!-- content type=\"" . $this->contentType . "\" -->\n\t\t\t\t<rdf:RDF xmlns=\"http://purl.org/rss/1.0/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:sy=\"http://purl.org/rss/1.0/modules/syndication/\" xmlns:admin=\"http://webns.net/mvcb/\" xmlns:content=\"http://purl.org/rss/1.0/modules/content/\">\n\t\t\t\t<channel rdf:about=\"" . $pref['siteurl'] . "\">\n\t\t\t\t<title>" . $tp->toRss($rss_title) . "</title>\n\t\t\t\t<link>" . $pref['siteurl'] . "</link>\n\t\t\t\t<description>" . $tp->toRss($pref['sitedescription']) . "</description>\n\t\t\t\t<dc:language>" . CORE_LC . (defined("CORE_LC2") ? "-" . CORE_LC2 : "") . "</dc:language>\n\t\t\t\t<dc:date>" . $this->get_iso_8601_date($time + $this->offset) . "</dc:date>\n\t\t\t\t<dc:creator>" . $this->nospam($pref['siteadminemail']) . "</dc:creator>\n\t\t\t\t<admin:generatorAgent rdf:resource=\"http://e107.org\" />\n\t\t\t\t<admin:errorReportsTo rdf:resource=\"mailto:" . $this->nospam($pref['siteadminemail']) . "\" />\n\t\t\t\t<sy:updatePeriod>hourly</sy:updatePeriod>\n\t\t\t\t<sy:updateFrequency>1</sy:updateFrequency>\n\t\t\t\t<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>\n\t\t\t\t<items>\n\t\t\t\t<rdf:Seq>";
             foreach ($this->rssItems as $value) {
                 // Multi-language rss links.
                 $link = e_LANQRY ? str_replace("?", "?" . e_LANQRY, $value['link']) : $value['link'];
                 echo "\n\t\t\t\t\t\t<rdf:li rdf:resource=\"" . $link . "\" />";
             }
             echo "\n\t\t\t\t</rdf:Seq>\n\t\t\t\t</items>\n\t\t\t\t</channel>";
             reset($this->rssItems);
             unset($link);
             foreach ($this->rssItems as $value) {
                 $link = e_LANQRY ? str_replace("?", "?" . e_LANQRY, $value['link']) : $value['link'];
                 // Multi-language rss links.
                 echo "\n\t\t\t\t\t\t<item rdf:about=\"" . $link . "\">\n\t\t\t\t\t\t<title>" . $tp->toRss($value['title']) . "</title>\n\t\t\t\t\t\t<link>" . $link . "</link>\n\t\t\t\t\t\t<dc:date>" . $this->get_iso_8601_date($time + $this->offset) . "</dc:date>\n\t\t\t\t\t\t<dc:creator>" . $value['author'] . "</dc:creator>\n\t\t\t\t\t\t<dc:subject>" . $tp->toRss($value['category_name']) . "</dc:subject>\n\t\t\t\t\t\t<description>" . $tp->toRss($value['description']) . "</description>\n\t\t\t\t\t\t</item>";
             }
             echo "\n\t\t\t\t</rdf:RDF>";
             break;
             // Atom
         // Atom
         case 4:
             echo "<?xml version='1.0' encoding='utf-8'?" . ">\n\n\t\t\t\t<feed xmlns='http://www.w3.org/2005/Atom'>\n";
             /*
             <feed version='0.3'
             xmlns='http://purl.org/atom/ns#'
             xmlns:dc='http://purl.org/dc/elements/1.1/'
             xml:lang='".CORE_LC.(defined("CORE_LC2") ? "-".CORE_LC2 : "")."'>\n";
             */
             // Required
             echo "\n\t\t\t\t\t<id>" . $pref['siteurl'] . "</id>\n\n\t\t\t\t\t<title type='text'>" . $tp->toRss($rss_title) . "</title>\n\n\t\t\t\t\t<updated>" . $this->get_iso_8601_date($time + $this->offset) . "</updated>\n";
             // Recommended
             echo "\n\t\t\t\t\t<author>\n\n\t\t\t\t\t\t<name>e107</name>\n";
             //<email></email>\n
             echo "\n\t\t\t\t\t\t<uri>http://e107.org/</uri>\n\n\t\t\t\t\t</author>\n\n\t\t\t\t\t<link rel='self' href='" . $tp->toRss(e107::url('rss_menu', 'atom', array('rss_url' => $this->contentType, 'rss_topicid' => $this->topicid), 'full')) . "' />\n";
             // Optional
             include e_ADMIN . "ver.php";
             echo "\n\t\t\t\t\t<category term='e107'/>\n\n\t\t\t\t\t<contributor>\n\n\t\t\t\t\t\t<name>e107</name>\n\n\t\t\t\t\t</contributor>\n\n\t\t\t\t\t<generator uri='http://e107.org/' version='" . $e107info['e107_version'] . "'>e107</generator>\n";
             //<icon>/icon.jpg</icon>\n
             echo "\n\t\t\t\t\t<logo>" . (strstr(SITEBUTTON, "http:") ? SITEBUTTON : SITEURL . str_replace("../", "", SITEBUTTON)) . "</logo>\n\n\t\t\t\t\t<rights type='html'>" . $pref['siteadmin'] . " - " . $this->nospam($pref['siteadminemail']) . "</rights>\n";
             if ($pref['sitedescription']) {
                 echo "\n\t\t\t\t\t<subtitle type='text'>" . $pref['sitedescription'] . "</subtitle>\n";
             }
             foreach ($this->rssItems as $value) {
                 echo "\n\t\t\t\t\t<entry>\n";
                 // Required
                 echo "\n\t\t\t\t\t\t<id>" . $value['link'] . "</id>\n\n\t\t\t\t\t\t<title type='text'>" . $tp->toRss($value['title']) . "</title>\n\n\t\t\t\t\t\t<updated>" . $this->get_iso_8601_date($value['pubdate'] + $this->offset) . "</updated>\n";
                 // Recommended
                 $author = $value['author'] ? $value['author'] : "unknown";
                 echo "\n\t\t\t\t\t\t<author>\n";
                 echo "\n\t\t\t\t\t\t<name>" . $author . "</name>\n";
                 echo $value['author_email'] ? "\t\t\t\t\t\t<email>" . $this->nospam($value['author_email']) . "</email>\n" : "";
                 echo "</author>\n";
                 //<content>complete story here</content>\n
                 echo "\n\t\t\t\t\t\t<link rel='alternate' type='text/html' href='" . $value['link'] . "' />\n\n\t\t\t\t\t\t<summary type='text'>" . $tp->toRss($tp->toText($value['description'])) . "</summary>\n";
                 // Optional
                 if (!empty($value['category_name'])) {
                     echo "<category term='" . $tp->toRss($value['category_name']) . "'/>\n";
                 }
                 //<contributor>
                 //	<name>Jane Doe</name>
                 //</contributor>
                 echo "<published>" . $this->get_iso_8601_date($value['pubdate'] + $this->offset) . "</published>\n";
                 //<source>
                 //	<id>http://example.org/</id>
                 //	<title>Fourty-Two</title>
                 //	<updated>2003-12-13T18:30:02Z</updated>
                 //	<rights>© 2005 Example, Inc.</rights>
                 //</source>
                 //<rights type='html'>&amp;copy; 2005 John Doe</rights>
                 echo "\n\t\t\t\t\t</entry>\n";
             }
             echo "\n\t\t\t\t</feed>\n";
             break;
     }
 }
Example #25
0
    $mains = "";
    $cap = isset($linkspage_pref['link_menu_category_caption']) && $linkspage_pref['link_menu_category_caption'] ? $linkspage_pref['link_menu_category_caption'] : LCLAN_OPT_83;
    $sqlc = new db();
    $sql2 = new db();
    if ($sqlc->db_Select("links_page_cat", "link_category_id, link_category_name, link_category_sef", "link_category_class REGEXP '" . e_CLASS_REGEXP . "' ORDER BY link_category_order")) {
        while ($rowc = $sqlc->fetch()) {
            if (isset($linkspage_pref['link_menu_category_amount']) && $linkspage_pref['link_menu_category_amount']) {
                $amount = $sql2->count("links_page", "(*)", "WHERE link_category = '" . $rowc['link_category_id'] . "' AND link_active = 1 AND link_class REGEXP '" . e_CLASS_REGEXP . "' ");
                $amount = "(" . $amount . ")";
            } else {
                $amount = "";
            }
            if (isset($linkspage_pref['link_menu_category_rendertype']) && $linkspage_pref['link_menu_category_rendertype'] == "1") {
                $mains .= $rs->form_option($rowc['link_category_name'] . " " . $amount, "0", e107::url('links_page', 'category', $rowc, 'full'), "");
            } else {
                $mains .= $bullet . " <a href='" . e107::url('links_page', 'category', $rowc, 'full') . "'>" . $rowc['link_category_name'] . "</a> " . $amount . "<br />";
            }
        }
        if (isset($linkspage_pref['link_menu_category_rendertype']) && $linkspage_pref['link_menu_category_rendertype'] == "1") {
            $selectjs = "style='width:100%;' onchange=\"if(this.options[this.selectedIndex].value != ''){ return document.location=this.options[this.selectedIndex].value; }\" ";
            $text .= $rs->form_select_open("category", $selectjs);
            $text .= $rs->form_option($cap, "0", "", "");
            $text .= $mains;
            $text .= $rs->form_select_close();
            $text .= "<br />";
        } else {
            $text .= $cap . "<br />";
            $text .= $mains;
        }
    }
}
Example #26
0
 function set_crumb($forum_href = false, $thread_title = '', &$templateVar)
 {
     $tp = e107::getParser();
     $frm = e107::getForm();
     global $FORUM_CRUMB, $forumInfo, $threadInfo, $thread;
     global $BREADCRUMB, $BACKLINK;
     // Eventually we should deprecate BACKLINK
     if (!$forumInfo && $thread) {
         $forumInfo = $thread->threadInfo;
     }
     if (is_array($FORUM_CRUMB)) {
         $search = array('{SITENAME}', '{SITENAME_HREF}');
         $replace = array(SITENAME, e107::getUrl()->create('/'));
         $FORUM_CRUMB['sitename']['value'] = str_replace($search, $replace, $FORUM_CRUMB['sitename']['value']);
         $search = array('{FORUMS_TITLE}', '{FORUMS_HREF}');
         $replace = array(LAN_PLUGIN_FORUM_NAME, e107::url('forum', 'index'));
         $FORUM_CRUMB['forums']['value'] = str_replace($search, $replace, $FORUM_CRUMB['forums']['value']);
         $search = array('{PARENT_TITLE}', '{PARENT_HREF}');
         $replace = array($tp->toHTML($forumInfo['parent_name']), e107::url('forum', 'index') . "#" . $frm->name2id($forumInfo['parent_name']));
         $FORUM_CRUMB['parent']['value'] = str_replace($search, $replace, $FORUM_CRUMB['parent']['value']);
         if ($forumInfo['forum_sub']) {
             $search = array('{SUBPARENT_TITLE}', '{SUBPARENT_HREF}');
             $replace = array(ltrim($forumInfo['sub_parent'], '*'), e107::getUrl()->create('forum/forum/view', "id={$forumInfo['forum_sub']}"));
             // XXX forum sub name
             $FORUM_CRUMB['subparent']['value'] = str_replace($search, $replace, $FORUM_CRUMB['subparent']['value']);
         } else {
             $FORUM_CRUMB['subparent']['value'] = '';
         }
         $search = array('{FORUM_TITLE}', '{FORUM_HREF}');
         // TODO - remove 'href=' from the return value
         $replace = array(ltrim($forumInfo['forum_name'], '*'), e107::getUrl()->create('forum/forum/view', $forumInfo));
         $FORUM_CRUMB['forum']['value'] = str_replace($search, $replace, $FORUM_CRUMB['forum']['value']);
         $threadInfo['thread_id'] = intval($threadInfo['thread_id']);
         $search = array('{THREAD_TITLE}', '{THREAD_HREF}');
         $replace = array(vartrue($threadInfo['thread_name']), e107::getUrl()->create('forum/thread/view', $threadInfo));
         // $thread->threadInfo - no reference found
         $FORUM_CRUMB['thread']['value'] = str_replace($search, $replace, $FORUM_CRUMB['thread']['value']);
         $FORUM_CRUMB['fieldlist'] = 'sitename,forums,parent,subparent,forum,thread';
         $BREADCRUMB = $tp->parseTemplate('{BREADCRUMB=FORUM_CRUMB}', true);
     } else {
         $dfltsep = ' :: ';
         $BREADCRUMB = "<a class='forumlink' href='" . e_BASE . "index.php'>" . SITENAME . "</a>" . $dfltsep . "<a class='forumlink' href='" . e_PLUGIN . "forum/forum.php'>" . LAN_PLUGIN_FORUM_NAME . "</a>" . $dfltsep;
         if ($forumInfo['sub_parent']) {
             $forum_sub_parent = substr($forumInfo['sub_parent'], 0, 1) == '*' ? substr($forumInfo['sub_parent'], 1) : $forumInfo['sub_parent'];
             $BREADCRUMB .= "<a class='forumlink' href='" . e_PLUGIN . "forum/forum_viewforum.php?{$forumInfo['forum_sub']}'>{$forum_sub_parent}</a>" . $dfltsep;
         }
         $tmpFname = $forumInfo['forum_name'];
         if (substr($tmpFname, 0, 1) == "*") {
             $tmpFname = substr($tmpFname, 1);
         }
         if ($forum_href) {
             $BREADCRUMB .= "<a class='forumlink' href='" . e_PLUGIN . "forum/forum_viewforum.php?{$forumInfo['forum_id']}'>" . $tp->toHTML($tmpFname, TRUE, 'no_hook,emotes_off') . "</a>";
         } else {
             $BREADCRUMB .= $tmpFname;
         }
         if (strlen($thread_title)) {
             $BREADCRUMB .= $dfltsep . $thread_title;
         }
     }
     // New v2.x Bootstrap Standardized Breadcrumb.
     //	print_a($forumInfo);
     // return;
     $breadcrumb = array();
     $breadcrumb[] = array('text' => LAN_PLUGIN_FORUM_NAME, 'url' => e107::url('forum', 'index'));
     if ($forumInfo['sub_parent']) {
         $forum_sub_parent = substr($forumInfo['sub_parent'], 0, 1) == '*' ? substr($forumInfo['sub_parent'], 1) : $forumInfo['sub_parent'];
     }
     $breadcrumb[] = array('text' => $tp->toHTML($forumInfo['parent_name']), 'url' => e107::url('forum', 'index') . "#" . $frm->name2id($forumInfo['parent_name']));
     if ($forumInfo['forum_sub']) {
         $breadcrumb[] = array('text' => ltrim($forumInfo['sub_parent'], '*'), 'url' => e107::url('forum', 'forum', array('forum_sef' => $forumInfo['parent_sef'])));
         $breadcrumb[] = array('text' => ltrim($forumInfo['forum_name'], '*'), 'url' => e_PAGE != 'forum_viewforum.php' ? e107::url('forum', 'forum', $forumInfo) : null);
     } else {
         $breadcrumb[] = array('text' => ltrim($forumInfo['forum_name'], '*'), 'url' => e_PAGE != 'forum_viewforum.php' ? e107::url('forum', 'forum', $forumInfo) : null);
     }
     if (vartrue($forumInfo['thread_name'])) {
         $breadcrumb[] = array('text' => $forumInfo['thread_name'], 'url' => null);
     }
     if (deftrue('BOOTSTRAP')) {
         $BREADCRUMB = $frm->breadcrumb($breadcrumb);
     }
     $BACKLINK = $BREADCRUMB;
     $templateVar->BREADCRUMB = $BREADCRUMB;
     $templateVar->BACKLINK = $BACKLINK;
     $templateVar->FORUM_CRUMB = $FORUM_CRUMB;
 }
Example #27
0
function displayLinkComment()
{
    global $qs, $cobj, $linkbutton_count, $lc, $rowl, $link_shortcodes, $linkspage_pref, $LINK_APPEND;
    $db = e107::getDb();
    $template = e107::getTemplate('links_page', 'links_page');
    $tp = e107::getParser();
    if (!(isset($linkspage_pref["link_comment"]) && $linkspage_pref["link_comment"])) {
        //jsx_location(e107::url('links_page', 'index'));
        $url = e107::url('links_page', 'index');
        e107::getRedirect()->go($url);
    } else {
        $qry = "\n\t\tSELECT l.*, lc.*, COUNT(c.comment_id) AS link_comment\n\t\tFROM #links_page AS l\n\t\tLEFT JOIN #links_page_cat AS lc ON lc.link_category_id = l.link_category\n\t\tLEFT JOIN #comments as c ON c.comment_item_id=l.link_id AND comment_type='links_page'\n\t\tWHERE l.link_active = 1 AND l.link_id = '" . intval($qs[1]) . "' AND lc.link_category_class REGEXP '" . e_CLASS_REGEXP . "' AND l.link_class REGEXP '" . e_CLASS_REGEXP . "'\n\t\tGROUP BY l.link_id";
        $link_comment_table_string = "";
        if (!($linkcomment = $db->gen($qry))) {
            //jsx_location(e107::url('links_page', 'index'));
            $url = e107::url('links_page', 'index');
            e107::getRedirect()->go($url);
        } else {
            $rowl = $db->fetch();
            $linkbutton_count = $rowl['link_button'] ? $linkbutton_count + 1 : $linkbutton_count;
            $LINK_APPEND = $lc->parse_link_append($rowl);
            $subject = $rowl['link_name'];
            $text = $tp->parseTemplate($template['LINK_TABLE_START'], FALSE, $link_shortcodes);
            $text .= $tp->parseTemplate($template['LINK_TABLE'], FALSE, $link_shortcodes);
            $text .= $tp->parseTemplate($template['LINK_TABLE_END'], FALSE, $link_shortcodes);
            $navigator = displayNavigator();
            $text = $navigator . $text;
            e107::getRender()->tablerender(LAN_LINKS_36, $text);
            $cobj->compose_comment("links_page", "comment", $qs[1], $width, $subject, $showrate = FALSE);
        }
    }
    return;
}
Example #28
0
        } 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, $menu_pref['newforumposts_characters'], $menu_pref['newforumposts_postfix']);
        // Count previous posts for calculating proper (topic) page number for the current post.
        $postNum = $db->count('forum_post', '(*)', "WHERE post_id <= " . $row['post_id'] . " AND post_thread = " . $row['thread_id'] . " ORDER BY post_id ASC");
        // Calculate (topic) page number for the current post.
        $postPage = ceil($postNum / vartrue($plugForumPrefs['postspage'], 10));
        // Load thread for passing it to e107::url().
        $thread = $db->retrieve('forum_thread', '*', 'thread_id = ' . $row['thread_id']);
        // Create URL for post.
        // like: e107_plugins/forum/forum_viewtopic.php?id=1&p=2#post-55
        $url = e107::url('forum', 'topic', $thread, array('query' => array('p' => $postPage), 'fragment' => 'post-' . $row['post_id']));
        $text .= "<li>";
        if ($menu_pref['newforumposts_title']) {
            $text .= "<a href='{$url}'>{$topic}</a><br />{$post}<br /><small class='muted'>" . LAN_FORUM_MENU_001 . " {$poster} {$datestamp}</small>";
        } else {
            $text .= "<a href='{$url}'>" . LAN_FORUM_MENU_001 . "</a> {$poster} <small class='muted'>{$datestamp}</small><br />{$post}<br />";
        }
        $text .= "</li>";
    }
    $text .= "</ul>";
} else {
    $text = LAN_FORUM_MENU_002;
}
e107::getRender()->tablerender($menu_pref['newforumposts_caption'], $text, 'nfp_menu');
Example #29
0
function forum_rules($action = 'check')
{
    if (ADMIN == true) {
        $type = 'forum_rules_admin';
    } elseif (USER == true) {
        $type = 'forum_rules_member';
    } else {
        $type = 'forum_rules_guest';
    }
    $result = e107::getDb()->select('generic', 'gen_chardata', "gen_type = '{$type}' AND gen_intdata = 1");
    if ($action == 'check') {
        return $result;
    }
    if ($result) {
        $row = e107::getDb()->fetch();
        $rules_text = e107::getParser()->toHTML($row['gen_chardata'], true);
    } else {
        $rules_text = LAN_FORUM_0072;
    }
    $text = '';
    if (deftrue('BOOTSTRAP')) {
        $breadarray = array(array('text' => e107::pref('forum', 'title', LAN_PLUGIN_FORUM_NAME), 'url' => e107::url('forum', 'index')), array('text' => LAN_FORUM_0016, 'url' => null));
        $text = e107::getForm()->breadcrumb($breadarray);
    }
    $text .= "<div id='forum-rules'>" . $rules_text . "</div>";
    $text .= "<div class='center'>" . e107::getForm()->pagination(e107::url('forum', 'index'), LAN_BACK) . "</div>";
    e107::getRender()->tablerender(LAN_FORUM_0016, $text, array('forum', 'forum_rules'));
}
Example #30
0
 /**
  * Return the URL of the current link
  * @return string
  */
 function sc_link_url($parm = '')
 {
     $tp = e107::getParser();
     if (!empty($this->var['link_owner']) && !empty($this->var['link_sefurl'])) {
         return e107::url($this->var['link_owner'], $this->var['link_sefurl']);
     }
     if (strpos($this->var['link_url'], e_HTTP) === 0) {
         $url = "{e_BASE}" . substr($this->var['link_url'], strlen(e_HTTP));
     } elseif ($this->var['link_url'][0] != "{" && strpos($this->var['link_url'], "://") === false) {
         $url = "{e_BASE}" . $this->var['link_url'];
         // Add e_BASE to links like: 'news.php' or 'contact.php'
     } else {
         $url = $this->var['link_url'];
     }
     $url = $tp->replaceConstants($url, 'full', TRUE);
     if (strpos($url, "{") !== false) {
         $url = $tp->parseTemplate($url, TRUE);
         // BC Fix shortcode in URL support - dynamic urls for multilanguage.
     }
     return $url;
 }