Exemplo n.º 1
0
 public function showForm($mes)
 {
     $ns = e107::getRender();
     $frm = new form();
     $text = $frm->form_open('post', e_SELF);
     $text .= "<table class='table adminform'>";
     $text .= "<tr><td>" . LAN_RADIUS_01 . "</td><td>";
     $text .= $frm->form_text('radius_server', 35, vartrue($this->radius['radius_server']), 120);
     $text .= "</td></tr>\n";
     $text .= "<tr><td>" . LAN_RADIUS_02 . "</td><td>";
     $text .= $frm->form_text('radius_secret', 35, vartrue($this->radius['radius_secret']), 200);
     $text .= "</td></tr>\n";
     $tmp = $this->alt_auth_get_field_list('radius', $frm, $this->radius, FALSE);
     if ($tmp) {
         $text .= "<tr><td class='forumheader2' colspan='2'>" . LAN_ALT_27 . "</td></tr>\n" . $tmp;
         unset($tmp);
     }
     $text .= "<tr><td class='forumheader' colspan='2' style='text-align:center;'>";
     // $text .= $frm -> form_button("submit", "update", LAN_ALT_2);
     $text .= e107::getForm()->admin_button('update', LAN_UPDATE, 'update');
     $text .= "</td></tr>\n";
     $text .= "</table>\n";
     $text .= $frm->form_close();
     $ns->tablerender(LAN_RADIUS_06, $mes->render() . $text);
     $ns->tablerender(LAN_ALT_40 . LAN_ALT_41, $this->alt_auth_test_form('radius', $frm));
 }
Exemplo n.º 2
0
Arquivo: e_rss.php Projeto: 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;
 }
Exemplo n.º 3
0
function iconpicker_shortcode($parm)
{
    $parms = array();
    parse_str($parm, $parms);
    $name = varset($parms['id']);
    $sql = e107::getDb();
    $frm = e107::getForm();
    $tp = e107::getParser();
    // $sc_parameters is currently being used to select the media-category.
    $qry = "SELECT * FROM `#core_media` WHERE media_userclass IN (" . USERCLASS_LIST . ") ";
    $qry .= vartrue($sc_parameters) ? " AND media_category = '" . $sc_parameters . "' " : " AND `media_category` REGEXP '_icon_16|_icon_32|_icon_48|_icon_64' ";
    $qry .= "ORDER BY media_category,media_name";
    $str = "";
    $size_section = array();
    $lastsize = "16";
    if ($sql->db_Select_gen($qry)) {
        while ($row = $sql->db_Fetch()) {
            list($tmp, $tmp2, $size) = explode("_", $row['media_category']);
            if ($str != '' && $size != $lastsize) {
                $size_section[] = $str;
                $str = "";
            }
            $str .= "<a href='#" . $row['media_url'] . "' title='{$filepath}' onclick=\"e107Helper.insertText('{$row['media_url']}','{$name}','{$name}-iconpicker'); return false; \"><img class='icon picker list%%size%%' src='" . $tp->replaceConstants($row['media_url'], 'abs') . "' alt='{$row['media_name']}' /></a>";
            $lastsize = $size;
        }
        return '<div id="' . $name . '-iconpicker-ajax"><div class="field-spacer iconpicker">' . str_replace('%%size%%', '', implode('</div><div class="field-spacer iconpicker">', $size_section)) . '</div></div>';
    }
}
Exemplo n.º 4
0
function user_avatar_shortcode($parm = '')
{
    global $loop_uid;
    $height = e107::getPref("im_height");
    $width = e107::getPref("im_width");
    $tp = e107::getParser();
    if (intval($loop_uid) > 0 && trim($parm) == "") {
        $parm = $loop_uid;
    }
    if (is_numeric($parm)) {
        if ($parm == USERID) {
            $image = USERIMAGE;
        } else {
            $row = get_user_data(intval($parm));
            $image = $row['user_image'];
        }
    } elseif ($parm) {
        $image = $parm;
    } elseif (USERIMAGE) {
        $image = USERIMAGE;
    } else {
        $image = "";
    }
    if (vartrue($image)) {
        $img = strpos($image, "://") !== false ? $image : $tp->thumbUrl(e_MEDIA . "avatars/" . $image, "aw=" . $width . "&ah=" . $height);
        $text = "<img class='user-avatar e-tip' src='" . $img . "' alt='' style='width:" . $width . "px; height:" . $height . "px' />\n\t\t";
    } else {
        $img = $tp->thumbUrl(e_IMAGE . "generic/blank_avatar.jpg", "aw=" . $width . "&ah=" . $height);
        $text = "<img class='user-avatar' src='" . $img . "' alt='' />";
    }
    return $text;
}
Exemplo n.º 5
0
/**
 * Event callback after triggering "user_forum_post_created".
 *
 * @param array $info
 *  Details about forum post.
 */
function nodejs_forum_event_user_forum_post_created_callback($info)
{
    $postID = intval(vartrue($info['data']['post_id'], 0));
    $postUserID = intval(vartrue($info['data']['post_user'], 0));
    $postThreadID = intval(vartrue($info['data']['post_thread'], 0));
    if ($postID === 0 || $postThreadID === 0) {
        return;
    }
    // Get forum plugin preferences.
    $plugForumPrefs = e107::getPlugConfig('forum')->getPref();
    $db = e107::getDb();
    // Load thread.
    $thread = $db->retrieve('forum_thread', '*', 'thread_id = ' . $postThreadID);
    $threadUser = intval(vartrue($thread['thread_user'], 0));
    // Load forum to check (read) permission.
    $forum = $db->retrieve('forum', '*', 'forum_id = ' . intval(vartrue($thread['thread_forum_id'], 0)));
    // Author of the forum post.
    $authorPost = e107::user($postUserID);
    // Author of the forum topic.
    $authorThread = e107::user($threadUser);
    e107_require_once(e_PLUGIN . 'nodejs/nodejs.main.php');
    $template = e107::getTemplate('nodejs_forum');
    $sc = e107::getScBatch('nodejs_forum', true);
    $tp = e107::getParser();
    // Get topic page number.
    $postNum = $db->count('forum_post', '(*)', "WHERE post_id <= " . $postID . " AND post_thread = " . $postThreadID . " ORDER BY post_id ASC");
    $postPage = ceil($postNum / vartrue($plugForumPrefs['postspage'], 10));
    // Push rendered row item into Latest Forum Posts menu.
    $sc_vars = array('author' => $authorPost, 'post' => $info['data'], 'thread' => $thread, 'topicPage' => $postPage);
    $sc->setVars($sc_vars);
    $markup = $tp->parseTemplate($template['MENU']['RECENT']['ITEM'], true, $sc);
    $message = (object) array('broadcast' => true, 'channel' => 'nodejs_notify', 'callback' => 'nodejsForumMenu', 'type' => 'latestForumPosts', 'markup' => $markup);
    nodejs_enqueue_message($message);
    // Broadcast logged in users to inform about new forum post created.
    if ($authorPost) {
        $sc->setVars($sc_vars);
        $markup = $tp->parseTemplate($template['NOTIFICATION']['POST_ALL'], true, $sc);
        // It's a public forum, so broadcast every online user.
        if (intval(vartrue($forum['forum_class'], 0)) === 0) {
            $message = (object) array('broadcast' => true, 'channel' => 'nodejs_notify', 'callback' => 'nodejsForum', 'type' => 'newForumPostAny', 'markup' => $markup, 'exclude' => $postUserID);
            nodejs_enqueue_message($message);
        } else {
            $forumClass = vartrue($forum['forum_class'], 0);
            $db->select('nodejs_presence');
            while ($row = $db->fetch()) {
                if (isset($row['uid']) && check_class($forumClass, null, $row['uid'])) {
                    $message = (object) array('channel' => 'nodejs_user_' . $row['uid'], 'callback' => 'nodejsForum', 'type' => 'newForumPostAny', 'markup' => $markup, 'exclude' => $postUserID);
                    nodejs_enqueue_message($message);
                }
            }
        }
    }
    // Broadcast logged in (thread-author) user to inform about new forum post created in his/her topic.
    if (isset($authorThread['user_id'])) {
        $sc->setVars($sc_vars);
        $markup = $tp->parseTemplate($template['NOTIFICATION']['POST_OWN'], true, $sc);
        $message = (object) array('channel' => 'nodejs_user_' . $authorThread['user_id'], 'callback' => 'nodejsForum', 'type' => 'newForumPostOwn', 'markup' => $markup, 'exclude' => $postUserID);
        nodejs_enqueue_message($message);
    }
}
Exemplo n.º 6
0
 function init()
 {
     $pref = e107::getPref();
     $sql = e107::getDb();
     if (vartrue($_POST['cron_execute'])) {
         $executeID = key($_POST['cron_execute']);
         $this->cronExecute($executeID);
     }
     if (!vartrue(e107::getPref('e_cron_pwd')) || varset($_POST['generate_pwd'])) {
         $pwd = $this->setCronPwd();
     }
     $sql->gen("SELECT cron_function,cron_active FROM #cron ");
     while ($row = $sql->fetch(MYSQL_ASSOC)) {
         $this->curCrons[] = $row['cron_function'];
         if ($row['cron_active'] == 1) {
             $this->activeCrons++;
         }
     }
     $this->lastRefresh();
     // Import Core and Plugin e_cron data
     $cronDefaults['_system'] = array(0 => array('name' => LAN_CRON_01_1, 'function' => 'sendEmail', 'category' => 'mail', 'description' => str_replace("[eml]", $pref['siteadminemail'], LAN_CRON_01_2) . "<br />" . LAN_CRON_01_3), 1 => array('name' => LAN_CRON_02_1, 'category' => 'mail', 'function' => 'procEmailQueue', 'description' => LAN_CRON_02_2), 2 => array('name' => LAN_CRON_03_1, 'category' => 'mail', 'function' => 'procEmailBounce', 'description' => LAN_CRON_03_2), 3 => array('name' => LAN_CRON_04_1, 'category' => 'user', 'function' => 'procBanRetrigger', 'description' => LAN_CRON_04_2 . "<br />" . LAN_CRON_04_3, 'available' => e107::getPref('ban_retrigger')), 4 => array('name' => LAN_CRON_05_1, 'category' => 'backup', 'function' => 'dbBackup', 'description' => LAN_CRON_05_2 . ' ' . e_SYSTEM . 'backups/'), 5 => array('name' => LAN_CRON_06_1, 'category' => 'user', 'function' => 'procBanRetrigger', 'description' => LAN_CRON_06_2 . "<br />" . LAN_CRON_06_3), 6 => array('name' => LAN_CRON_20_1, 'category' => 'update', 'function' => 'checkCoreUpdate', 'description' => LAN_CRON_20_2 . "<br />" . LAN_CRON_20_3));
     if (is_dir(e_BASE . ".git")) {
         $cronDefaults['_system'][7] = array('name' => LAN_CRON_20_4, 'category' => 'update', 'function' => 'gitrepo', 'description' => LAN_CRON_20_5 . "<br />" . LAN_CRON_20_6 . "<br /><span class='label label-warning'>" . LAN_CRON_20_7 . "</span> " . LAN_CRON_20_8);
     }
     if (!vartrue($_GET['action']) || $_GET['action'] == 'refresh') {
         $this->cronImport($cronDefaults);
         // import Core Crons (if missing)
         $this->cronImport(e107::getAddonConfig('e_cron'));
         // Import plugin Crons
         $this->cronImportLegacy();
         // Import Legacy Cron Tab Settings
     }
 }
Exemplo n.º 7
0
 function __construct()
 {
     $pref = e107::pref('core', 'social_login');
     if (!empty($pref) && is_array($pref['Twitter'])) {
         $this->twitterActive = vartrue($pref['Twitter']['keys']['key']);
     }
 }
Exemplo n.º 8
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);
 }
 /**
  * Render menu.
  */
 function renderMenu()
 {
     $tpl = e107::getTemplate('nodejs_comment');
     $sc = e107::getScBatch('nodejs_comment', true);
     $tp = e107::getParser();
     $cm = e107::getComment();
     $amount = (int) vartrue($this->plugPrefs['comment_display'], 10);
     /**
      * getCommentData() returns with array, which contains:
      * - comment_datestamp
      * - comment_author_id
      * - comment_author
      * - comment_comment
      * - comment_subject
      * - comment_type
      * - comment_title
      * - comment_url
      */
     $items = $cm->getCommentData($amount);
     $text = $tp->parseTemplate($tpl['MENU']['LATEST']['HEADER'], true, $sc);
     foreach ($items as $item) {
         $sc->setVars($item);
         $text .= $tp->parseTemplate($tpl['MENU']['LATEST']['ITEM'], true, $sc);
     }
     if (empty($items)) {
         $text .= '<a href="#" class="list-group-item no-posts text-center">' . LAN_PLUGIN_NODEJS_COMMENT_FRONT_05 . '</a>';
     }
     $text .= $tp->parseTemplate($tpl['MENU']['LATEST']['FOOTER'], true, $sc);
     e107::getRender()->tablerender(LAN_PLUGIN_NODEJS_COMMENT_FRONT_04, $text);
     unset($text);
 }
Exemplo n.º 10
0
Arquivo: bb_p.php Projeto: notzen/e107
 /**
  * Called prior to save
  * Sanitize and re-assemble the bbcode
  */
 function toDB($code_text, $parm)
 {
     $code_text = trim($code_text);
     if (empty($code_text)) {
         return '';
     }
     if ($parm && !strpos($parm, '=')) {
         $parm = 'class=' . $parm;
     }
     $parms = eHelper::scParams($parm);
     $safe = array();
     if (vartrue($parms['class'])) {
         $safe['class'] = eHelper::secureClassAttr($parms['class']);
     }
     if (vartrue($parms['id'])) {
         $safe['id'] = eHelper::secureIdAttr($parms['id']);
     }
     if (vartrue($parms['style'])) {
         $safe['style'] = eHelper::secureStyleAttr($parms['style']);
     }
     if ($safe) {
         return '[p=' . eHelper::buildAttr($safe) . ']' . $code_text . '[/p]';
     }
     return '[p]' . $code_text . '[/p]';
 }
Exemplo n.º 11
0
 function getListData()
 {
     $list_caption = $this->parent->settings['caption'];
     $list_display = $this->parent->settings['open'] ? "" : "none";
     if ($this->parent->mode == "new_page" || $this->parent->mode == "new_menu") {
         $qry = " l.link_datestamp>" . $this->parent->getlvisit() . " AND ";
     } else {
         $qry = '';
     }
     $bullet = $this->parent->getBullet($this->parent->settings['icon']);
     $qry = "\n  \tSELECT l.*, c.link_category_id, c.link_category_name\n  \tFROM #links_page AS l\n  \tLEFT JOIN #links_page_cat AS c ON c.link_category_id = l.link_category\n  \tWHERE " . $qry . " l.link_class REGEXP '" . e_CLASS_REGEXP . "' AND c.link_category_class REGEXP '" . e_CLASS_REGEXP . "' AND l.link_active != '0'  \n  \tORDER BY l.link_datestamp DESC LIMIT 0," . intval($this->parent->settings['amount']) . " ";
     $links_pages = $this->parent->e107->sql->gen($qry);
     if ($links_pages == 0) {
         $list_data = LIST_LINKS_2;
     } else {
         $list_data = array();
         while ($row = $this->parent->e107->sql->fetch()) {
             $record = array();
             $rowheading = $this->parent->parse_heading($row['link_name']);
             $record['icon'] = $bullet;
             $record['heading'] = "<a href='" . $row['link_url'] . "' rel='external' title='" . $row['link_name'] . "'>" . $rowheading . "</a>";
             $record['author'] = "";
             $record['category'] = vartrue($this->parent->settings['category']) ? "<a href='" . e_PLUGIN . "links_page/links.php?cat." . $row['link_category_id'] . "'>" . $row['link_category_name'] . "</a>" : "";
             $record['date'] = vartrue($this->parent->settings['date']) ? $this->parent->getListDate($row['link_datestamp']) : "";
             $record['info'] = "";
             $list_data[] = $record;
         }
     }
     //return array with 'records', (global)'caption', 'display'
     return array('records' => $list_data, 'caption' => $list_caption, 'display' => $list_display);
 }
Exemplo n.º 12
0
Arquivo: url.php Projeto: notzen/e107
 /**
  * 
  */
 public function create($route, $params = array())
 {
     if (!$params) {
         return 'page.php';
     }
     if (is_string($route)) {
         $route = explode('/', $route, 2);
     }
     if (!varset($route[1])) {
         $route[1] = 'index';
     }
     ## aliases as retrieved from the DB, map vars to proper values
     if (isset($params['page_title']) && !empty($params['page_title'])) {
         $params['name'] = $params['page_title'];
     }
     if (isset($params['page_id']) && !empty($params['page_id'])) {
         $params['id'] = $params['page_id'];
     }
     $url = 'page.php?';
     if ('--FROM--' != vartrue($params['page'])) {
         $page = varset($params['page']) ? intval($params['page']) : '0';
     } else {
         $page = '--FROM--';
     }
     $url .= intval($params['id']) . ($page ? '.' . $page : '');
     return $url;
 }
Exemplo n.º 13
0
    public function init()
    {
        //  $this->listQry = "SELECT p.*,u.user_name FROM #private_msg AS p LEFT JOIN #user AS u ON p.pm_from = u.user_id  ";
        if ($this->getMode() == 'inbox') {
            $this->listQry = 'SELECT  p.*, u.user_name, f.user_name AS fromuser FROM #private_msg AS p LEFT JOIN  #user AS u ON u.user_id = p.pm_to
					LEFT JOIN #user as f on f.user_id = p.pm_from WHERE p.pm_to = ' . USERID;
            $this->fields['pm_to']['nolist'] = true;
            $this->fields['options']['readParms'] = 'editClass=' . e_UC_NOBODY;
        }
        if ($this->getMode() == 'outbox') {
            $this->listQry = 'SELECT  p.*, u.user_name, f.user_name AS fromuser FROM #private_msg AS p LEFT JOIN  #user AS u ON u.user_id = p.pm_to
					LEFT JOIN #user as f on f.user_id = p.pm_from WHERE p.pm_from = ' . USERID;
            $this->fields['pm_from']['nolist'] = true;
            $this->fields['options']['readParms'] = 'editClass=' . e_UC_NOBODY;
        }
        if ($this->getAction() == 'create') {
            $this->fields['pm_to']['writeParms']['default'] = 99999999;
            $this->fields['pm_to']['writeParms']['required'] = 1;
            $this->fields['pm_subject']['writeParms']['required'] = 1;
            if (!empty($_GET['to'])) {
                $this->fields['pm_to']['writeParms']['default'] = intval($_GET['to']);
                $this->addTitle('Reply');
            }
            if (!empty($_GET['subject'])) {
                $this->fields['pm_subject']['writeParms']['default'] = "Re: " . base64_decode($_GET['subject']);
            }
        }
        if (vartrue($_GET['iframe'])) {
            define('e_IFRAME', true);
        }
    }
Exemplo n.º 14
0
 function getListData()
 {
     $list_caption = $this->parent->settings['caption'];
     $list_display = $this->parent->settings['open'] ? "" : "none";
     if ($this->parent->mode == "new_page" || $this->parent->mode == "new_menu") {
         $qry = " AND download_datestamp>" . $this->parent->getlvisit();
     } else {
         $qry = '';
     }
     $bullet = $this->parent->getBullet($this->parent->settings['icon']);
     $qry = "SELECT d.download_id, d.download_name, d.download_author, d.download_datestamp,\n\t\t   dc.download_category_id, dc.download_category_name, dc.download_category_class\n\t\t   FROM #download AS d\n\t\t   LEFT JOIN #download_category AS dc ON d.download_category=dc.download_category_id\n\t\t   WHERE dc.download_category_class REGEXP '" . e_CLASS_REGEXP . "' AND d.download_class REGEXP '" . e_CLASS_REGEXP . "' AND d.download_active != '0' " . $qry . "\n\t\t   ORDER BY download_datestamp DESC LIMIT 0," . intval($this->parent->settings['amount']) . " ";
     $downloads = $this->parent->e107->sql->db_Select_gen($qry);
     if ($downloads == 0) {
         $list_data = LIST_DOWNLOAD_2;
     } else {
         $list_data = array();
         while ($row = $this->parent->e107->sql->db_Fetch()) {
             $record = array();
             $rowheading = $this->parent->parse_heading($row['download_name']);
             $record['icon'] = $bullet;
             $record['heading'] = "<a href='" . e_BASE . "download.php?view." . $row['download_id'] . "'>" . $rowheading . "</a>";
             $record['author'] = vartrue($this->parent->settings['author']) ? $row['download_author'] : "";
             $record['category'] = vartrue($this->parent->settings['category']) ? "<a href='" . e_BASE . "download.php?list." . $row['download_category_id'] . "'>" . $row['download_category_name'] . "</a>" : "";
             $record['date'] = vartrue($this->parent->settings['date']) ? $this->parent->getListDate($row['download_datestamp']) : "";
             $record['info'] = "";
             $list_data[] = $record;
         }
     }
     //return array with 'records', (global)'caption', 'display'
     return array('records' => $list_data, 'caption' => $list_caption, 'display' => $list_display);
 }
Exemplo n.º 15
0
 function getQuery()
 {
     $max_age = vartrue($this->menuPref['maxage'], 0);
     $max_age = $max_age == 0 ? '' : '(t.post_datestamp > ' . (time() - (int) $max_age * 86400) . ') AND ';
     $forumList = implode(',', $this->forumObj->getForumPermList('view'));
     $qry = "\n\t\tSELECT\n\t\t\tp.post_user, p.post_id, p.post_datestamp, p.post_user_anon, p.post_entry,\n\t\t\tt.thread_id, t.thread_datestamp, t.thread_name, u.user_name, f.forum_sef\n\t\tFROM `#forum_post` as p\n\n\t\tLEFT JOIN `#forum_thread` AS t ON t.thread_id = p.post_thread\n\t\tLEFT JOIN `#forum` as f ON f.forum_id = t.thread_forum_id\n\t\tLEFT JOIN `#user` AS u ON u.user_id = p.post_user\n\t\tWHERE {$max_age} p.post_forum IN ({$forumList})\n\t\tORDER BY p.post_datestamp DESC LIMIT 0, " . vartrue($this->menuPref['display'], 10);
     return $qry;
 }
Exemplo n.º 16
0
 function __construct()
 {
     if (ADMIN && vartrue($_GET['eml'])) {
         $this->debug = 2;
         // mode2  - via browser for admin.
         $this->source = $_GET['eml'] . ".eml";
     }
 }
Exemplo n.º 17
0
 function __construct()
 {
     $this->catList = e107::getMedia()->getCategories('gallery');
     if (vartrue($_GET['cat']) && isset($this->catList[$_GET['cat']])) {
         $this->showImages($_GET['cat']);
     } else {
         $this->listCategories();
     }
 }
Exemplo n.º 18
0
 function sc_contact_body($parm = '')
 {
     parse_str($parm, $parm);
     $rows = vartrue($parm['rows'], 10);
     $cols = vartrue($parm['cols'], 70);
     if ($cols > 60) {
         $size = 'input-xxlarge';
     }
     return "<textarea cols='{$cols}' style='max-width:99%'  id='contactBody' rows='{$rows}' name='body' required='required' class='tbox {$size} form-control'>" . stripslashes(varset($_POST['body'])) . "</textarea>";
 }
Exemplo n.º 19
0
 function init()
 {
     $mes = e107::getMessage();
     if (vartrue($_POST['bloggerUrl'])) {
         $this->feedUrl = rtrim($_POST['bloggerUrl'], "/") . "/feeds/posts/default?max-results=999&alt=rss";
     }
     if (vartrue($_POST['bloggerCleanup'])) {
         $this->cleanupHtml = true;
     }
     $mes->addDebug("Blogger Feed:" . $this->feedUrl);
 }
Exemplo n.º 20
0
function navigation_shortcode($parm = '')
{
    $types = array('main' => 1, 'side' => 2, 'footer' => 3, 'alt' => 4, 'alt5' => 5, 'alt6' => 6);
    $category = varset($types[$parm], 1);
    $tmpl = vartrue($parm, 'main');
    $nav = e107::getNav();
    $template = e107::getCoreTemplate('navigation', $tmpl);
    $data = $nav->initData($category);
    //	$data 			= $nav->collection($category);
    return $nav->render($data, $template);
}
Exemplo n.º 21
0
function glyph_shortcode($parm = '')
{
    if (!is_array($parm)) {
        $file = $parm;
        $parm = null;
    } else {
        $file = vartrue($parm['type']);
        unset($parm['type']);
    }
    return e107::getParser()->toGlyph($file, $parm);
}
Exemplo n.º 22
0
 /**
  * Optional - Advanced Where
  * @param $parm - data returned from $_GET (ie. advanced fields included. in this case 'date' and 'author' )
  */
 function where($parm = '')
 {
     $tp = e107::getParser();
     $qry = " find_in_set(x.faq_info_class,'" . USERCLASS_LIST . "') AND ";
     if (vartrue($parm['time']) && is_numeric($parm['time'])) {
         $qry .= " cb_datestamp " . ($parm['on'] == 'new' ? '>=' : '<=') . " '" . (time() - $parm['time']) . "' AND";
     }
     if (vartrue($parm['author'])) {
         $qry .= " cb_nick LIKE '%" . $tp->toDB($parm['author']) . "%' AND";
     }
     return $qry;
 }
Exemplo n.º 23
0
function setimage_shortcode($parm, $mode = '')
{
    ### Reset to defaults TODO site prefs
    if (isset($parm['default'])) {
        $parm['w'] = 100;
        $parm['h'] = 0;
        $parm['crop'] = 0;
    }
    e107::getParser()->thumbWidth = vartrue($parm['w'], 100);
    e107::getParser()->thumbHeight = vartrue($parm['h'], 0);
    e107::getParser()->thumbCrop = vartrue($parm['crop'], 0);
}
Exemplo n.º 24
0
 function sc_username($parm = '')
 {
     global $USERNAME;
     if (isset($this->var['comment_author_id']) && $this->var['comment_author_id']) {
         $USERNAME = $parm == 'raw' ? $this->var['comment_author_name'] : "<a href='" . e107::getUrl()->create('user/profile/view', array('id' => $this->var['comment_author_id'], 'name' => $this->var['comment_author_name'])) . "'>" . $this->var['comment_author_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;
 }
Exemplo n.º 25
0
 /**
  * Optional - Advanced Where
  * @param $parm - data returned from $_GET (ie. advanced fields included. in this case 'date' and 'author' )
  */
 function where($parm = '')
 {
     $tp = e107::getParser();
     $qry = "";
     if (vartrue($parm['time']) && is_numeric($parm['time'])) {
         $qry .= " cb_datestamp " . ($parm['on'] == 'new' ? '>=' : '<=') . " '" . (time() - $parm['time']) . "' AND";
     }
     if (vartrue($parm['author'])) {
         $qry .= " cb_nick LIKE '%" . $tp->toDB($parm['author']) . "%' AND";
     }
     return $qry;
 }
Exemplo n.º 26
0
 function sc_comment_avatar($parm = '')
 {
     $tp = e107::getParser();
     //
     $text = $tp->parseTemplate("{USER_AVATAR=" . vartrue($this->var['user_image']) . "}");
     $text .= "<div class='field-help' style='display:none;'>\n\t\t<div class='left'>";
     $text .= "<h2>" . $this->sc_username() . "</h2>";
     //	$text .= e107::getDate()-> //    convert($this->var['user_lastvisit'],'short');
     $text .= $this->sc_joined() . "<br />" . $this->sc_comments() . "<br />" . $this->sc_rating() . $this->sc_location;
     $text .= "\n\t\t</div>\n\t\t</div>";
     return $text;
 }
Exemplo n.º 27
0
Arquivo: url.php Projeto: armpit/e107
 /**
  * Query mapping in format route?params:
  * - profile/view?id=xxx -> user.php?id.xxx
  * - profile/list?page=xxx -> user.php?xxx
  * - myprofile/view -> user.php
  * - profile/edit?id=xxx -> usersettings.php?xxx
  * - myprofile/edit -> usersettings.php
  * - login/index (or just 'login') -> login.php
  * - register/index (or just 'register') -> signup.php
  */
 public function create($route, $params = array())
 {
     if (!$params) {
         return 'user.php';
     }
     if (is_string($route)) {
         $route = explode('/', $route, 2);
     }
     if (!varset($route[1])) {
         $route[1] = 'index';
     }
     ## aliases as retrieved from the DB, map vars to proper values
     if (isset($params['user_name']) && !empty($params['user_name'])) {
         $params['id'] = $params['user_name'];
     }
     if (isset($params['user_id']) && !empty($params['user_id'])) {
         $params['id'] = $params['user_id'];
     }
     $url = 'user.php';
     $page = vartrue($params['page']) ? intval($params['page']) : '0';
     if ($route[0] == 'profile') {
         switch ($route[1]) {
             case '':
             case 'view':
                 $url .= '?id.' . $params['id'];
                 break;
             case 'list':
                 $url .= $page ? '?' . $page : '';
                 break;
             case 'edit':
                 $url = e_ADMIN_ABS . "user.php?mode=main&action=edit&id=" . $params['id'];
                 // 'usersettings.php?'.$params['id'];
                 break;
         }
     } elseif ($route[0] == 'myprofile') {
         switch ($route[1]) {
             case '':
             case 'view':
                 // user.php
                 break;
             case 'edit':
                 $url = 'usersettings.php';
                 break;
         }
     } elseif ($route[0] == 'login') {
         $url = 'login.php';
     } elseif ($route[0] == 'register') {
         $url = 'signup.php';
     }
     // XXX signup URL parameters
     return $url;
 }
Exemplo n.º 28
0
Arquivo: bb_p.php Projeto: armpit/e107
 /**
  *	Translate to <p> tag
  */
 function toHTML($code_text, $parm)
 {
     if ($parm && !strpos($parm, '=')) {
         $parm = 'class=' . $parm;
     }
     $code_text = trim($code_text);
     $parms = eHelper::scParams($parm);
     $class = " " . e107::getBB()->getClass('p');
     // consistent classes across all themes.
     $id = vartrue($parms['id']) ? ' id="' . eHelper::secureIdAttr($parms['id']) . '"' : '';
     $style = vartrue($parms['style']) ? ' style="' . eHelper::secureStyleAttr($parms['style']) . '"' : '';
     return "<p{$id}{$class}{$style}>" . $code_text . '</p>';
 }
Exemplo n.º 29
0
 function init()
 {
     $mes = e107::getMessage();
     if (vartrue($_POST['siteUrl'])) {
         $domain = preg_replace("/https?:\\/\\//i", '', $_POST['siteUrl']);
         list($site, $dom, $tld) = explode(".", $domain);
         $this->feedUrl = "http://" . $site . ".livejournal.com/data/rss";
     }
     if (vartrue($_POST['siteCleanup'])) {
         $this->cleanupHtml = true;
     }
     $mes->addDebug("LiveJournal Feed:" . $this->feedUrl);
 }
Exemplo n.º 30
0
 function __construct()
 {
     $mes = e107::getMessage();
     $frm = e107::getForm();
     $tp = e107::getParser();
     //	$this->simulation();
     $mailoutPlugins = e107::getConfig()->get('e_mailout_list');
     if (empty($_GET['id'])) {
         return;
     }
     $tmp = base64_decode($_GET['id']);
     parse_str($tmp, $data);
     $data['plugin'] = $tp->filter($data['plugin'], 'str');
     $data['email'] = $tp->filter($data['email'], 'email');
     e107::getMessage()->addDebug(print_a($data, true));
     $plugin = vartrue($data['plugin'], false);
     if (empty($data) || !e107::isInstalled($plugin) || !in_array($plugin, $mailoutPlugins)) {
         $this->invalidURL();
         return;
     }
     $ml = e107::getAddon($plugin, 'e_mailout');
     if (!empty($data['userclass'])) {
         $data['userclass'] = intval($data['userclass']);
         $listName = e107::getUserClass()->getName($data['userclass']);
     } else {
         $listName = $ml->mailerName;
     }
     if (vartrue($_POST['remove']) && !empty($data)) {
         if ($ml->unsubscribe('process', $data) != false) {
             $text = "<p><b>" . $data['email'] . "</b> has been removed from " . $listName . ".</p>";
             $mes->addSuccess($text);
         } else {
             $text = "<p>There was a problem when attempting to remove <b>" . $data['email'] . "</b> from " . $listName . ".</p>";
             $mes->addError($text);
         }
         echo "<div class='container'>" . $mes->render() . "</div>";
         return;
     }
     if ($ml->unsubscribe('check', $data) != false) {
         $text = "<p>We are very sorry for the inconvenience. <br />Please click the button below to remove <b>" . $data['email'] . "</b> from <i>" . $listName . "</i>.</p>";
         $text .= $frm->open('unsub', 'post', e_REQUEST_URI);
         $text .= $frm->button('remove', 'Remove ', 'submit');
         $text .= $frm->close();
         $mes->setTitle('Unsubscribe', E_MESSAGE_INFO)->addInfo($text);
         echo "<div class='container'>" . $mes->render() . "</div>";
         return;
     } else {
         $this->invalidURL();
         return;
     }
 }