Exemple #1
0
 function showList()
 {
     $mes = e107::getMessage();
     $sql = e107::getDb();
     $ns = e107::getRender();
     $tp = e107::getParser();
     $frm = e107::getForm();
     $gen = new convert();
     $count = $sql->select("gsitemap", "*", "gsitemap_id !=0 ORDER BY gsitemap_order ASC");
     if (!$count) {
         $text = "\n\t\t\t<form action='" . e_SELF . "?import' id='import' method='post'>\n\t\t\t" . GSLAN_39 . "<br /><br />" . $frm->admin_button('import', LAN_YES, 'submit') . "\n\t\t\t</form>";
         $mes->addInfo($text);
         $ns->tablerender(GSLAN_24, $mes->render());
         return;
     } else {
         $text = "\n\t\t\t<form action='" . e_SELF . "' id='display' method='post'>\n\t\t\t<table class='table adminlist'>\n            \t<colgroup span='2'>\n\t\t\t\t\t<col style='width:5%' />\n\t\t\t\t\t<col style='width:10%' />\n\t\t\t\t\t<col style='width:35%' />\n\t\t\t\t\t<col style='width:20%' />\n\t\t\t\t\t<col style='width:10%' />\n\t\t\t\t\t<col style='width:10%' />\n\t\t\t\t\t<col style='width:10%' />\n\t\t\t\t</colgroup>\n                <thead>\n\t\t\t\t<tr class='first last' >\n\t\t\t\t<th style='text-align: center;'>Id</th>\n\t\t\t\t<th>" . LAN_NAME . "</th>\n\t\t\t\t<th>" . LAN_URL . "</th>\n\t\t\t\t<th style='text-align: center'>" . GSLAN_27 . "</th>\n\t\t\t\t<th style='text-align: center' >" . GSLAN_28 . "</th>\n\t\t\t\t<th style='text-align: center' >" . GSLAN_9 . "</th>\n\t\t\t\t<th style='text-align: center'>" . LAN_OPTIONS . "</th>\n\t\t\t\t</tr>\n\t\t\t\t</thead>\n\t\t\t\t<tbody>\n\t\t\t";
         $glArray = $sql->db_getList();
         foreach ($glArray as $row2) {
             $datestamp = $gen->convert_date($row2['gsitemap_lastmod'], "short");
             $rowStyle = vartrue($rowStyle) == "odd" ? "even" : "odd";
             $text .= "<tr class='{$rowStyle}'>\n\t\t\t\t<td style='; text-align: center;'>" . $row2['gsitemap_id'] . "</td>\n\t\t\t\t<td>" . $tp->toHTML($row2['gsitemap_name'], "", "defs") . "</td>\n\t\t\t\t<td>" . $row2['gsitemap_url'] . "</td>\n\t\t\t\t<td style='; text-align: center;'>" . $datestamp . "</td>\n\t\t\t\t<td style='; text-align: center;'>" . $this->freq_list[$row2['gsitemap_freq']] . "</td>\n\t\t\t\t<td style='; text-align: center;'>" . $row2['gsitemap_priority'] . "</td>\n\n\t\t\t\t<td class='center' style='white-space:nowrap'>\n\t\t\t\t<div>\n\t\t\t\t<button class='btn btn-default' type='submit' name='edit[{$row2['gsitemap_id']}]' value='edit' alt='" . LAN_EDIT . "' title='" . LAN_EDIT . "' style='border:0px' >" . ADMIN_EDIT_ICON . "</button>\n\t\t\t\t<button class='btn btn-default action delete' type='submit' name='delete[{$row2['gsitemap_id']}]' value='del' data-confirm='" . $tp->toJS(LAN_CONFIRMDEL . " [" . $row2['gsitemap_name'] . "]") . "' title='" . LAN_DELETE . "' >" . ADMIN_DELETE_ICON . "</button>\n\t\t\t\t</div>\n\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t";
         }
     }
     $text .= "</tbody></table>\n</form>";
     $ns->tablerender(GSLAN_24, $mes->render() . $text);
 }
Exemple #2
0
function email_item($thread_id)
{
    global $tp;
    $gen = new convert();
    include_once e_PLUGIN . 'forum/forum_class.php';
    $forum = new e107forum();
    $thread_info = $forum->thread_get($thread_id, 0, 999);
    $thread_name = $tp->toHTML($thread_info[0]['thread_name'], TRUE);
    $text = "<b>" . $thread_name . "</b><br />\n\t" . $thread_info[0]['user_name'] . ", " . $gen->convert_date($thread_info[0]['thread_datestamp'], "forum") . "<br /><br />\n\t" . $tp->toHTML($thread_info[0]['thread_thread'], TRUE);
    $count = 1;
    unset($thread_info[0], $thread_info['head']);
    foreach ($thread_info as $reply) {
        $text .= "<br /><br />Re: <b>" . $thread_name . "</b><br />\n\t\t" . $reply['user_name'] . ", " . $gen->convert_date($reply['thread_datestamp'], "forum") . "<br /><br />\n\t\t" . $tp->toHTML($reply['thread_thread'], TRUE);
    }
    return $text;
}
Exemple #3
0
 public function sc_pm_blocked_date($parm = '')
 {
     require_once e_HANDLER . 'date_handler.php';
     return convert::convert_date($this->pmBlocked['pm_block_datestamp'], $parm);
 }
Exemple #4
0
function show_newsarchive($newsAr, $i = 1)
{
    global $ns, $gen, $pref, $tp, $news_archive_shortcodes, $NEWSARCHIVE, $news2;
    // do not show the news archive on the news.php?item.X page (but only on the news mainpage)
    require_once e_CORE . 'shortcodes/batch/news_archives.php';
    $textnewsarchive = '';
    ob_start();
    $i++;
    // First entry to show
    while (isset($newsAr[$i])) {
        $news2 = $newsAr[$i];
        // Code from Lisa
        // copied from the rss creation, but added here to make sure the url for the newsitem is to the news.php?item.X
        // instead of the actual hyperlink that may have been added to a newstitle on creation
        $search = array();
        $replace = array();
        $search[0] = "/\\<a href=\"(.*?)\">(.*?)<\\/a>/si";
        $replace[0] = '\\2';
        $search[1] = "/\\<a href='(.*?)'>(.*?)<\\/a>/si";
        $replace[1] = '\\2';
        $search[2] = "/\\<a href='(.*?)'>(.*?)<\\/a>/si";
        $replace[2] = '\\2';
        $search[3] = "/\\<a href=&quot;(.*?)&quot;>(.*?)<\\/a>/si";
        $replace[3] = '\\2';
        $search[4] = "/\\<a href=&#39;(.*?)&#39;>(.*?)<\\/a>/si";
        $replace[4] = '\\2';
        $news2['news_title'] = preg_replace($search, $replace, $news2['news_title']);
        // End of code from Lisa
        $gen = new convert();
        $news2['news_datestamp'] = $gen->convert_date($news2['news_datestamp'], "short");
        if (!$NEWSARCHIVE) {
            $NEWSARCHIVE = "<div>\n\t\t\t\t\t<table style='width:98%;'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t<div>{ARCHIVE_BULLET} <b>{ARCHIVE_LINK}</b> <span class='smalltext'><i>{ARCHIVE_AUTHOR} @ ({ARCHIVE_DATESTAMP}) ({ARCHIVE_CATEGORY})</i></span></div>\n\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t\t</div>";
        }
        $textnewsarchive .= $tp->parseTemplate($NEWSARCHIVE, FALSE, $news_archive_shortcodes);
        $i++;
    }
    $ns->tablerender($pref['newsposts_archive_title'], $textnewsarchive, 'news_archive');
    $newsarchive = ob_get_contents();
    ob_end_flush();
    // dump collected data
    setNewsCache('newsarchive', $newsarchive);
}
Exemple #5
0
    if (strstr($online_location, "admin")) {
        $class_check = FALSE;
        $online_location_page = ADMINAREA;
    }
    $ONLINE_TABLE_ICON = varsettrue($pref['plug_installed']['pm']) && $oid != USERID ? $tp->parseTemplate("{SENDPM={$oid}}", 'sendpm.sc') : "<img src='" . e_PLUGIN . "online_extended_menu/images/user.png' alt='' style='vertical-align:middle' />";
    $ONLINE_TABLE_USERNAME = "******" . e_BASE . "user.php?id.{$oid}'>{$oname}</a>";
    $ONLINE_TABLE_LOCATION = $class_check ? "<a href='{$online_location}'>{$online_location_page}</a>" : $online_location_page;
    $textstring .= preg_replace("/\\{(.*?)\\}/e", '$\\1', $ONLINE_TABLE);
}
$ONLINE_TABLE_MEMBERS_ONLINE = ONLINE_EL1 . GUESTS_ONLINE;
$ONLINE_TABLE_GUESTS_ONLINE = ONLINE_EL2 . MEMBERS_ONLINE;
if (!isset($gen) || !is_object($gen)) {
    $gen = new convert();
}
$siteHistory = e107::getConfig('history')->getPref('');
$datestamp = $gen->convert_date($siteHistory['most_online_datestamp'], "short");
$ONLINE_TABLE_MOST_EVER_ONLINE = ONLINE_EL8 . ($siteHistory['most_members_online'] + $siteHistory['most_guests_online']);
$ONLINE_TABLE_MOST_MEMBERS_ONLINE = ONLINE_EL2 . $siteHistory['most_members_online'];
$ONLINE_TABLE_MOST_GUESTS_ONLINE = ONLINE_EL1 . $siteHistory['most_guests_online'];
$ONLINE_TABLE_DATESTAMP = $datestamp;
$total_members = $sql->db_Count("user", "(*)", "where user_ban = 0");
if ($total_members > 1) {
    $newest_member = $sql->db_Select("user", "user_id, user_name", "user_ban=0 ORDER BY user_join DESC LIMIT 0,1");
    $row = $sql->db_Fetch();
    $ONLINE_TABLE_MEMBERS_TOTAL = "<br />" . ONLINE_EL5 . ": " . $total_members;
    $ONLINE_TABLE_MEMBERS_NEWEST = "<br />" . ONLINE_EL6 . ": " . (USER ? "<a href='" . e_BASE . "user.php?id." . $row['user_id'] . "'>" . $row['user_name'] . "</a>" : $row['user_name']);
}
$text = '';
if (count($listuserson)) {
    $textstart = preg_replace("/\\{(.*?)\\}/e", '$\\1', $ONLINE_TABLE_START);
    $textend = preg_replace("/\\{(.*?)\\}/e", '$\\1', $ONLINE_TABLE_END);
Exemple #6
0
 if ($source == 'news') {
     $con = new convert();
     $sql->db_Select('news', '*', 'news_id=' . intval($parms));
     $row = $sql->db_Fetch();
     $news_body = $tp->toHTML($row['news_body'], TRUE);
     $news_extended = $tp->toHTML($row['news_extended'], TRUE);
     if ($row['news_author'] == 0) {
         $a_name = 'e107';
         $category_name = 'e107 welcome message';
     } else {
         $sql->db_Select('news_category', 'category_id, category_name', 'category_id=' . intval($row['news_category']));
         list($category_id, $category_name) = $sql->db_Fetch();
         $sql->db_Select('user', 'user_id, user_name', 'user_id=' . intval($row['news_author']));
         list($a_id, $a_name) = $sql->db_Fetch(MYSQL_NUM);
     }
     $row['news_datestamp'] = $con->convert_date($row['news_datestamp'], "long");
     $row['news_title'] = $tp->toHTML($row['news_title'], TRUE, 'parse_sc');
     //remove existing links from news title
     $search = array();
     $replace = array();
     $search[0] = "/\\<a href=\"(.*?)\">(.*?)<\\/a>/si";
     $replace[0] = '\\2';
     $search[1] = "/\\<a href='(.*?)'>(.*?)<\\/a>/si";
     $replace[1] = '\\2';
     $search[2] = "/\\<a href='(.*?)'>(.*?)<\\/a>/si";
     $replace[2] = '\\2';
     $search[3] = "/\\<a href=&quot;(.*?)&quot;>(.*?)<\\/a>/si";
     $replace[3] = '\\2';
     $search[4] = "/\\<a href=&#39;(.*?)&#39;>(.*?)<\\/a>/si";
     $replace[4] = '\\2';
     $row['news_title'] = preg_replace($search, $replace, $row['news_title']);
Exemple #7
0
 define("CB_MOD", check_class($pref['cb_mod']));
 $qry = "\n\tSELECT c.*, u.user_name FROM #chatbox AS c\n\tLEFT JOIN #user AS u ON SUBSTRING_INDEX(c.cb_nick,'.',1) = u.user_id\n\tORDER BY c.cb_datestamp DESC LIMIT 0, " . intval($chatbox_posts);
 if ($sql->db_Select_gen($qry)) {
     $obj2 = new convert();
     $cbpost = $sql->db_getList();
     $text .= "<div id='chatbox-posts-block'>\n";
     foreach ($cbpost as $cb) {
         // get available vars
         list($cb_uid, $cb_nick) = explode(".", $cb['cb_nick'], 2);
         if ($cb['user_name']) {
             $cb_nick = "<a href='" . e_HTTP . "user.php?id.{$cb_uid}'>{$cb['user_name']}</a>";
         } else {
             $cb_nick = $tp->toHTML($cb_nick, FALSE, 'USER_TITLE, emotes_off, no_make_clickable');
             $cb_nick = str_replace("Anonymous", LAN_ANONYMOUS, $cb_nick);
         }
         $datestamp = $obj2->convert_date($cb['cb_datestamp'], "short");
         $emotes_active = $pref['cb_emote'] ? 'USER_BODY, emotes_on' : 'USER_BODY, emotes_off';
         $cb_message = $tp->toHTML($cb['cb_message'], FALSE, $emotes_active, $cb_uid, $pref['menu_wordwrap']);
         $replace[0] = "[";
         $replace[1] = "]";
         $search[0] = "&lsqb;";
         $search[1] = "&rsqb;";
         $cb_message = str_replace($search, $replace, $cb_message);
         global $CHATBOXSTYLE;
         if (!$CHATBOXSTYLE) {
             $bullet = '';
             if (defined('BULLET')) {
                 $bullet = '<img src="' . THEME_ABS . 'images/' . BULLET . '" alt="" class="icon" />';
             } elseif (file_exists(THEME . 'images/bullet2.gif')) {
                 $bullet = '<img src="' . THEME_ABS . 'images/bullet2.gif" alt="" class="icon" />';
             }
Exemple #8
0
function print_item_pdf($id)
{
    global $tp, $pref, $content_shortcodes;
    global $CONTENT_PRINT_IMAGES, $row, $content_image_path, $content_pref, $mainparent;
    //in this section you decide what to needs to be output to the pdf file
    $con = new convert();
    require_once e_PLUGIN . "content/content_shortcodes.php";
    require_once e_PLUGIN . "content/handlers/content_class.php";
    $aa = new content();
    if (!is_object($sql)) {
        $sql = new db();
    }
    $sql->db_Select($plugintable, "content_id, content_heading, content_subheading, content_text, content_image, content_author, content_parent, content_datestamp, content_class, content_pref", "content_id='" . intval($id) . "' ");
    $row = $sql->db_Fetch();
    if (!check_class($row['content_class'])) {
        header("location:" . e_PLUGIN . "content/content.php");
        exit;
    }
    $authordetails = $aa->getAuthor($row['content_author']);
    $row['content_datestamp'] = $con->convert_date($row['content_datestamp'], "long");
    $img = $tp->parseTemplate('{CONTENT_PRINT_IMAGES}', FALSE, $content_shortcodes);
    $mainparent = $aa->getMainParent(intval($id));
    $content_pref = $aa->getContentPref($mainparent);
    $content_icon_path = $tp->replaceConstants($content_pref["content_icon_path"]);
    $content_image_path = $tp->replaceConstants($content_pref["content_image_path"]);
    $img = $tp->parseTemplate('{CONTENT_PDF_IMAGES}', FALSE, $content_shortcodes);
    //add custom and preset tags if present
    $custom = e107::unserialize($row['content_pref']);
    //$custom						= $eArrayStorage->ReadxxxArray($row['content_pref']);
    $months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11);
    $CONTENT_CONTENT_TABLE_CUSTOM_TAGS = "";
    if (!empty($custom)) {
        foreach ($custom as $k => $v) {
            if ($k == "content_custom_presettags") {
                if (isset($content_pref["content_content_presettags"]) && $content_pref["content_content_presettags"]) {
                    foreach ($v as $ck => $cv) {
                        if (is_array($cv)) {
                            //date
                            if (!($cv['day'] == "" && $cv['month'] == "" && $cv['year'] == "")) {
                                $vv = $cv['day'] . " " . $months[$cv['month'] - 1] . " " . $cv['year'];
                            }
                        } else {
                            $vv = $cv;
                        }
                        if (isset($ck) && $ck != "" && isset($vv) && $vv != "") {
                            $CUSTOM_TAGS = TRUE;
                            $CONTENT_CONTENT_TABLE_CUSTOM_KEY = $tp->toHTML($ck, true);
                            $CONTENT_CONTENT_TABLE_CUSTOM_VALUE = $tp->toHTML($vv, true);
                            $CONTENT_CONTENT_TABLE_CUSTOM_TAGS .= $CONTENT_CONTENT_TABLE_CUSTOM_KEY . " : " . $CONTENT_CONTENT_TABLE_CUSTOM_VALUE . "<br />";
                        }
                    }
                }
            } else {
                if (isset($content_pref["content_content_customtags"]) && $content_pref["content_content_customtags"]) {
                    $key = substr($k, 15);
                    if (isset($key) && $key != "" && isset($v) && $v != "") {
                        $CUSTOM_TAGS = TRUE;
                        $CONTENT_CONTENT_TABLE_CUSTOM_KEY = $tp->toHTML($key, true);
                        $CONTENT_CONTENT_TABLE_CUSTOM_VALUE = $tp->toHTML($v, true);
                        $CONTENT_CONTENT_TABLE_CUSTOM_TAGS .= $CONTENT_CONTENT_TABLE_CUSTOM_KEY . " : " . $CONTENT_CONTENT_TABLE_CUSTOM_VALUE . "<br />";
                    }
                }
            }
        }
    }
    $text = "\n\t<b>" . $row['content_heading'] . "</b><br />\n\t" . $row['content_subheading'] . "<br />\n\t" . $authordetails[1] . ", " . $row['content_datestamp'] . "<br />\n\t<br />\n\t" . $row['content_text'] . "<br />\n\t" . ($CONTENT_CONTENT_TABLE_CUSTOM_TAGS ? $CONTENT_CONTENT_TABLE_CUSTOM_TAGS : "") . "\n\t<div style='float:left; padding-left:10px;'>" . $img . "</div>\n\t";
    //the following defines are processed in the document properties of the pdf file
    //Do NOT add parser function to the variables, leave them as raw data !
    //as the pdf methods will handle this !
    $text = $text;
    //define text
    $creator = SITENAME;
    //define creator
    $author = $authordetails[1];
    //define author
    $title = $row['content_heading'];
    //define title
    $subject = $row['content_subheading'];
    //define subject
    $keywords = "";
    //define keywords
    //define url to use in the header of the pdf file
    $url = SITEURLBASE . e_PLUGIN_ABS . "content/content.php?content." . $row['content_id'];
    //always return an array with the following data:
    return array($text, $creator, $author, $title, $subject, $keywords, $url);
}
Exemple #9
0
 function user_info($ipd)
 {
     global $ns, $sql, $e107;
     if (isset($ipd)) {
         $bullet = '';
         if (defined('BULLET')) {
             $bullet = '<img src="' . THEME . 'images/' . BULLET . '" alt="" class="icon" />';
         } elseif (file_exists(THEME . 'images/bullet2.gif')) {
             $bullet = '<img src="' . THEME . 'images/bullet2.gif" alt="" class="icon" />';
         }
         // TODO - move to e_userinfo.php
         $obj = new convert();
         $sql->db_Select("chatbox", "*", "cb_ip='{$ipd}' LIMIT 0,20");
         $host = $e107->get_host_name($ipd);
         $text = USFLAN_3 . " <b>" . $ipd . "</b> [ " . USFLAN_4 . ": {$host} ]<br />\r\n\t\t\t\t<i><a href=\"banlist.php?" . $ipd . "\">" . USFLAN_5 . "</a></i>\r\n\r\n\t\t\t\t<br /><br />";
         while (list($cb_id, $cb_nick, $cb_message, $cb_datestamp, $cb_blocked, $cb_ip) = $sql->fetch()) {
             $datestamp = $obj->convert_date($cb_datestamp, "short");
             $post_author_id = substr($cb_nick, 0, strpos($cb_nick, "."));
             $post_author_name = substr($cb_nick, strpos($cb_nick, ".") + 1);
             $text .= $bullet . "\r\n\t\t\t\t\t<span class=\"defaulttext\"><i>" . $post_author_name . " (" . USFLAN_6 . ": " . $post_author_id . ")</i></span>\r\n\t\t\t\t\t<div class=\"mediumtext\">\r\n\t\t\t\t\t" . $datestamp . "\r\n\t\t\t\t\t<br />\r\n\t\t\t\t\t" . $cb_message . "\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<br />";
         }
         $text .= "<hr />";
         $sql->db_Select("comments", "*", "comment_ip='{$ipd}' LIMIT 0,20");
         while (list($comment_id, $comment_item_id, $comment_author, $comment_author_email, $comment_datestamp, $comment_comment, $comment_blocked, $comment_ip) = $sql->fetch()) {
             $datestamp = $obj->convert_date($comment_datestamp, "short");
             $post_author_id = substr($comment_author, 0, strpos($comment_author, "."));
             $post_author_name = substr($comment_author, strpos($comment_author, ".") + 1);
             $text .= $bullet . "\r\n\t\t\t\t\t<span class=\"defaulttext\"><i>" . $post_author_name . " (" . USFLAN_6 . ": " . $post_author_id . ")</i></span>\r\n\t\t\t\t\t<div class=\"mediumtext\">\r\n\t\t\t\t\t" . $datestamp . "\r\n\t\t\t\t\t<br />" . $comment_comment . "\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<br />";
         }
     }
     $ns->tablerender(USFLAN_7, $text);
 }
Exemple #10
0
            $from = $page_count;
            break;
        }
        $row_count++;
        if ($row_count == 30) {
            $row_count = 0;
            $page_count += 30;
        }
    }
}
// end search
$sql->db_Select("chatbox", "*", "{$qry_where} ORDER BY cb_datestamp DESC LIMIT " . intval($from) . ", 30");
$obj2 = new convert();
$chatList = $sql->db_getList();
foreach ($chatList as $row) {
    $CHAT_TABLE_DATESTAMP = $obj2->convert_date($row['cb_datestamp'], "long");
    $CHAT_TABLE_NICK = preg_replace("/[0-9]+\\./", "", $row['cb_nick']);
    $cb_message = $tp->toHTML($row['cb_message'], TRUE, 'USER_BODY');
    if ($row['cb_blocked']) {
        $cb_message .= "<br />" . CHATBOX_L25;
    }
    if (CB_MOD) {
        $cb_message .= "<br /><input type='checkbox' name='delete[{$row['cb_id']}]' value='1' />" . CHATBOX_L10;
        if ($row['cb_blocked']) {
            $cb_message .= "&nbsp;&nbsp;&nbsp;<input type='checkbox' name='unblock[{$row['cb_id']}]' value='1' />" . CHATBOX_L7;
        } else {
            $cb_message .= "&nbsp;&nbsp;&nbsp;<input type='checkbox' name='block[{$row['cb_id']}]' value='1' />" . CHATBOX_L9;
        }
    }
    $CHAT_TABLE_MESSAGE = $cb_message;
    $CHAT_TABLE_FLAG = $flag ? "forumheader3" : "forumheader4";
Exemple #11
0
$barr = file_exists(THEME . 'images/barr.png') ? THEME . 'images/barr.png' : e_PLUGIN . 'poll/images/barr.png';
$bar = file_exists(THEME . 'images/bar.png') ? THEME . 'images/bar.png' : e_PLUGIN . 'poll/images/bar.png';
require_once HEADERF;
$total_posts = $sql->db_Count('forum_post');
$total_topics = $sql->db_Count('forum_thread');
$total_replies = $total_posts - $total_topics;
$total_views = 0;
$query = 'SELECT sum(thread_views) AS total FROM `#forum_thread` ';
if ($sql->db_Select_gen($query)) {
    $row = $sql->db_Fetch();
    $total_views = $row['total'];
}
$firstpost = $sql->db_Select('forum_post', 'post_datestamp', 'post_datestamp > 0 ORDER BY post_datestamp ASC LIMIT 0,1', 'default');
$fp = $sql->db_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);
$query = "SHOW TABLE STATUS FROM `{$mySQLdefaultdb}`";
$sql->db_Select_gen($query);
$array = $sql->db_getList();
foreach ($array as $table) {
    if ($table['Name'] == MPREFIX . 'forum_post') {
        $db_size = $e107->parseMemorySize($table['Data_length']);
        $avg_row_len = $e107->parseMemorySize($table['Avg_row_length']);
        break;
    }
}
$query = "\nSELECT ft.thread_id, ft.thread_user, ft.thread_name, ft.thread_total_replies, ft.thread_datestamp, f.forum_class, u.user_name, u.user_id FROM #forum_thread as ft\nLEFT JOIN #user AS u ON ft.thread_user = u.user_id\nLEFT JOIN #forum AS f ON f.forum_id = ft.thread_forum_id\nWHERE ft.thread_active > 0\nAND f.forum_class IN (" . USERCLASS_LIST . ")\nORDER BY ft.thread_total_replies DESC LIMIT 0,10";
$sql->db_Select_gen($query);
Exemple #12
0
function get_history($page)
{
    global $sql;
    $r = "<script>\n\tfunction urldecode( str ) {\n\t    var ret = str;\n\t    ret = ret.replace(/\\+/g, '%20');\n\t    ret = decodeURIComponent(ret);\n\t    ret = ret.toString();\n\t    return ret;\n\t}\n\t</script><ul>";
    $sql->db_Select("wiki", "*", "ORDER BY page_datestamp DESC", false);
    $gen = new convert();
    while ($row = $sql->db_Fetch()) {
        $r .= "<li><a href='#' onclick=\"document.getElementById('wiki_content').value=urldecode('" . urlencode(stripslashes($row['page_content'])) . "');\" >" . $gen->convert_date($row['page_datestamp']) . " by " . get_username($row['page_author']) . "</a></li>";
    }
    return $r . "</ul>";
}
include_once e_PLUGIN . 'forum/forum_class.php';
$max_age = vartrue($menu_pref['newforumposts_maxage'], 0);
$max_age = $max_age == 0 ? '' : '(t.post_datestamp > ' . (time() - (int) $max_age * 86400) . ') AND ';
$forum = new e107forum();
$forumList = implode(',', $forum->getForumPermList('view'));
//TODO: Use query from forum class to get thread list
$qry = "\nSELECT\n\tp.post_user, p.post_id, p.post_datestamp, p.post_user_anon, p.post_entry,\n\tt.thread_id, t.thread_datestamp, t.thread_name, u.user_name\nFROM `#forum_post` as p\nLEFT JOIN `#forum_thread` AS t ON t.thread_id = p.post_thread\nLEFT JOIN `#user` AS u ON u.user_id = p.post_user\nWHERE {$maxage} p.post_forum IN ({$forumList})\nORDER BY p.post_datestamp DESC LIMIT 0, " . $menu_pref['newforumposts_display'];
// Get forum plugin preferences.
$plugForumPrefs = e107::getPlugConfig('forum')->getPref();
// New MySQL class instantiation to avoid overrides.
$db = new e_db_mysql();
// TODO: cache menu.
if ($results = $sql->gen($qry)) {
    $text = "<ul>";
    while ($row = $sql->fetch(MYSQL_ASSOC)) {
        $datestamp = $gen->convert_date($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']));
        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, $menu_pref['newforumposts_characters'], $menu_pref['newforumposts_postfix']);
        // Count previous posts for calculating proper (topic) page number for the current post.
Exemple #14
0
    $sql->db_Select("news", "*", "news_id='{$parms}'");
    $row = $sql->db_Fetch();
    extract($row);
    define("e_PAGETITLE", $news_title);
    $news_body = $tp->toHTML($news_body, TRUE, 'BODY');
    $news_extended = $tp->toHTML($news_extended, TRUE, 'BODY');
    if ($news_author == 0) {
        $a_name = "e107";
        $category_name = "e107 welcome message";
    } else {
        $sql->db_Select("news_category", "category_id, category_name", "category_id='{$news_category}'");
        list($category_id, $category_name) = $sql->db_Fetch(MYSQL_NUM);
        $sql->db_Select("user", "user_id, user_name", "user_id='{$news_author}'");
        list($a_id, $a_name) = $sql->db_Fetch(MYSQL_NUM);
    }
    $news_datestamp = $con->convert_date($news_datestamp, "long");
    $print_text = "<span style=\"font-size: 13px; color: black; font-family: tahoma, verdana, arial, helvetica; text-decoration: none\">\n\t<b>" . LAN_PRINT_135 . $news_title . "</b>\n\t<br />\n\t(" . LAN_PRINT_86 . " " . $tp->toHTML($category_name, FALSE, "defs") . ")\n\t<br />\n\t" . LAN_PRINT_94 . " " . $a_name . "<br />\n\t" . $news_datestamp . "\n\t<br /><br />" . $news_body;
    if ($news_extended != "") {
        $print_text .= "<br /><br />" . $news_extended;
    }
    if ($news_source != "") {
        $print_text .= "<br /><br />" . $news_source;
    }
    if ($news_url != "") {
        $print_text .= "<br />" . $news_url;
    }
    $print_text .= "<br /><br /></span><hr />" . LAN_PRINT_303 . SITENAME . "\n\t<br />\n\t( http://" . $_SERVER['HTTP_HOST'] . e_HTTP . "news.php?extend." . $news_id . " )\n\t";
}
if (defined("TEXTDIRECTION") && TEXTDIRECTION == "rtl") {
    $align = 'right';
} else {
 function sc_cm_datestamp()
 {
     $gen = new convert();
     return $gen->convert_date($this->var['comment_datestamp'], "relative");
 }
Exemple #16
0
     // Check if now not beta
     if ($evrsn_tmpupdate[2] == 0 && $evrsn_tmpcurrent[2] > 0) {
         $evrsn_nownotbeta = true;
     }
     if ($evrsn_update > $evrsn_current || $evrsn_nownotbeta) {
         // if server version greater than installed version
         $evrsn_text .= "<tr><td class='eb_td'><img src='" . e_IMAGE . "admin_images/uninstalled.png' alt='' title='' /> " . EVERSION_U7 . " - <strong>" . $evrsn_serversion . "</strong>";
         if ($evrsn_tmpupdate[2] > 0) {
             // is it a beta version?
             $evrsn_text .= "<br />" . EVERSION_U8;
         } else {
             $evrsn_text .= "<strong> " . EVERSION_U21 . "</strong>";
         }
         if ($evrsn_date > 0) {
             $evrsn_con = new convert();
             $evrsn_text .= "<br />" . EVERSION_U17 . " : <strong>" . $evrsn_con->convert_date($evrsn_date, "long") . "</strong><br />";
         }
         if (!empty($evrsn_author)) {
             $evrsn_text .= "<br />" . EVERSION_U18 . " : <strong>" . $evrsn_author . "</strong><br />";
         }
         if (!empty($evrsn_url)) {
             $evrsn_text .= "<br /><br />" . EVERSION_U13 . " <a href='" . $evrsn_url . "'>" . EVERSION_U14 . "</a><br />&nbsp;";
         }
         $evrsn_text .= "</td></tr>";
     } else {
         // It is the latest version
         $evrsn_text .= "<tr><td class='eb_td'><img src='" . e_IMAGE . "admin_images/installed.png' alt='' title='' /> " . EVERSION_U9;
         $evrsn_text .= "<br /><br />" . EVERSION_U13 . " <a href='" . $evrsn_url . "'>" . EVERSION_U14 . "</a><br /></td></tr>";
     }
 } else {
     // unable to get details from update site
Exemple #17
0
	$ICON = "<img src='".THEME."forum/new_small.png' alt='' />";
}
else
{
	$ICON = "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/new_small.png' alt='' />";
}
*/
$TOTAL_TOPICS = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent='0' ");
$TOTAL_REPLIES = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent!='0' ");
$sql->db_Select_gen("SELECT sum(thread_views) FROM " . MPREFIX . "forum_t");
$tmp = $sql->db_Fetch();
$TOTAL_VIEWS = $tmp[0];
$text = preg_replace("/\\{(.*?)\\}/e", '$\\1', $NEWFORUMPOSTSTYLE_HEADER);
foreach ($forumArray as $forumInfo) {
    extract($forumInfo);
    $r_datestamp = $gen->convert_date($thread_lastpost, "forum");
    if ($thread_total_replies) {
        $tmp = explode(".", $thread_lastuser, 2);
        if ($lp_name) {
            $LASTPOST = "<a href='" . e_BASE . "user.php?id.{$tmp[0]}'>{$lp_name}</a>";
        } else {
            if ($tmp[1]) {
                $LASTPOST = $tmp[1];
            } else {
                $LASTPOST = NFPM_L16;
            }
        }
        $LASTPOSTDATE = "<span class='smalltext'>{$r_datestamp}</span>";
    } else {
        $LASTPOST = ' - ';
        $LASTPOSTDATE = '';
Exemple #18
0
    $message .= "<div class='right'>(<a href='" . e_SELF . "?dabl'>" . FLALAN_16 . "</a>)</div>";
    $mes->addInfo($message);
}
$gen = new convert();
$fla_total = $sql->db_Count('generic', '(*)', "WHERE gen_type='failed_login'");
if (!$sql->db_Select('generic', '*', "gen_type='failed_login' ORDER BY gen_datestamp DESC LIMIT {$from},{$amount}")) {
    $mes->addInfo(FLALAN_2);
} else {
    $faArray = $sql->db_getList('ALL', FALSE, FALSE);
    $text = "\n\t\t<form method='post' action='" . e_SELF . "' id='flaform' >\n\t\t\t<fieldset id='core-fla'>\n\t\t\t\t<legend class='e-hideme'>" . ADLAN_146 . "</legend>\n\t\t\t\t<table class='table adminlist'>\n\t\t\t\t\t<colgroup>\n\t\t\t\t\t\t<col style='width: 20%' />\n\t\t\t\t\t\t<col style='width: 40%' />\n\t\t\t\t\t\t<col style='width: 20%' />\n\t\t\t\t\t\t<col style='width: 10%' />\n\t\t\t\t\t\t<col style='width: 10%' />\n\t\t\t\t\t</colgroup>\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th>" . LAN_DATE . "</th>\n\t\t\t\t\t\t\t<th>" . FLALAN_7 . "</th>\n\t\t\t\t\t\t\t<th>" . FLALAN_8 . "</th>\n\t\t\t\t\t\t\t<th class='center last'>\n\t\t\t\t\t\t\t\t" . LAN_DELETE . "<br/>\n\t\t\t\t\t\t\t\t" . $frm->checkbox('check_all_del', 'jstarget:fladelete', false, array('id' => false, 'class' => 'checkbox toggle-all')) . "\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t<th class='center last'>\n\t\t\t\t\t\t\t\t" . LAN_BAN . "<br/>\n\t\t\t\t\t\t\t\t" . $frm->checkbox_toggle('check-all-ban', 'flaban') . "\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tbody>\n\t";
    foreach ($faArray as $fa) {
        extract($fa);
        //FIXME kill extract()
        $gen_chardata = str_replace(":::", "<br />", $tp->toHTML($gen_chardata));
        $host = e107::getIPHandler()->get_host_name(getenv($gen_ip));
        $text .= "\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>" . $gen->convert_date($gen_datestamp, "forum") . "</td>\n\t\t\t\t\t\t\t<td>" . $gen_chardata . "</td>\n\t\t\t\t\t\t\t<td>" . e107::getIPHandler()->ipDecode($fa['gen_ip']) . "<br />{$host}</td>\n\t\t\t\t\t\t\t<td class='center middle autocheck e-pointer'>\n\t\t\t\t\t\t\t\t" . $frm->checkbox('fladelete[]', $gen_id) . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class='center middle autocheck e-pointer'>\n\t\t\t\t\t\t\t\t" . $frm->checkbox('flaban[]', $gen_id) . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t";
    }
    $text .= "\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t\t<div class='buttons-bar center'>\n\t\t\t\t\t" . $frm->admin_button('delbanSubmit', FLALAN_10, 'delete', FLALAN_10, 'title=') . "\n\t\t\t\t</div>\n\t\t\t</fieldset>\n\t\t</form>\n\t";
    $parms = $fla_total . "," . $amount . "," . $from . "," . e_SELF . '?' . "[FROM]." . $amount;
    $nextprev = $tp->parseTemplate("{NEXTPREV={$parms}}");
    if ($nextprev) {
        $text .= "<div class='nextprev-bar'>" . $nextprev . "</div>";
    }
}
$ns->tablerender(ADLAN_146, $mes->render() . $text);
require_once "footer.php";
/**
 * Handle page DOM within the page header
 *
 * @return string JS source
 */
Exemple #19
0
include_lan(e_PLUGIN . "poll/languages/" . e_LANGUAGE . ".php");
if (e_QUERY) {
    $query = "SELECT p.*, u.user_id, u.user_name FROM #polls AS p\n\tLEFT JOIN #user AS u ON p.poll_admin_id = u.user_id\n\tWHERE p.poll_type=1 AND p.poll_id=" . intval(e_QUERY);
    if ($sql->db_Select_gen($query)) {
        $row = $sql->db_Fetch();
        extract($row);
        $optionArray = explode(chr(1), $poll_options);
        $optionArray = array_slice($optionArray, 0, -1);
        $voteArray = explode(chr(1), $poll_votes);
        $voteArray = array_slice($voteArray, 0, -1);
        $voteTotal = array_sum($voteArray);
        $percentage = array();
        foreach ($voteArray as $votes) {
            $percentage[] = round($votes / $voteTotal * 100, 2);
        }
        $start_datestamp = $gen->convert_date($poll_datestamp, "long");
        $end_datestamp = $gen->convert_date($poll_end_datestamp, "long");
        $text = "<table style='" . USER_WIDTH . "'>\n\t\t<tr>\n\t\t<td colspan='2' class='mediumtext' style='text-align:center'>\n\t\t<b>" . $tp->toHTML($poll_title, TRUE, 'TITLE') . "</b>\n\t\t<div class='smalltext'>" . POLLAN_35 . " <a href='" . e_BASE . "user.php?id.{$user_id}'>" . $user_name . "</a>.<br /> " . POLLAN_37 . " " . $start_datestamp . " " . POLLAN_38 . " " . $end_datestamp . ".<br />" . POLLAN_26 . ": {$voteTotal}</div>\n\t\t<br />\n\n\t\t</td>\n\t\t</tr>";
        $count = 0;
        $barl = file_exists(THEME . "images/barl.png") ? THEME . "images/barl.png" : e_PLUGIN . "poll/images/barl.png";
        $barr = file_exists(THEME . "images/barr.png") ? THEME . "images/barr.png" : e_PLUGIN . "poll/images/barr.png";
        $bar = file_exists(THEME . "images/bar.png") ? THEME . "images/bar.png" : e_PLUGIN . "poll/images/bar.png";
        foreach ($optionArray as $option) {
            $text .= "\n\t\t\t<tr>\n\t\t\t<td style='width:40%; text-align: right' class='mediumtext'><b>" . $tp->toHTML($option, TRUE, 'TITLE') . "</b>&nbsp;&nbsp;</td>\n\t\t\t<td class='smalltext'>\n\t\t\t<div style='background-image: url({$barl}); width: 5px; height: 14px; float: left;'>\n\t\t\t</div>\n\t\t\t<div style='background-image: url({$bar}); width: " . (floor($percentage[$count]) != 100 ? floor($percentage[$count]) : 95) . "%; height: 14px; float: left;'>\n\t\t\t</div>\n\t\t\t<div style='background-image: url({$barr}); width: 5px; height: 14px; float: left;'>\n\t\t\t</div>\n\t\t\t" . $percentage[$count] . "% [" . POLLAN_31 . ": " . $voteArray[$count] . "]\n\t\t\t</td>\n\t\t\t</tr>\n";
            $count++;
        }
        $query = "SELECT c.*, u.* FROM #comments AS c\n\t\tLEFT JOIN #user AS u ON FLOOR(SUBSTR(c.comment_author,1,INSTR(c.comment_author,'.')-1))=u.user_id\n\t\tWHERE comment_item_id=" . intval($poll_id) . " AND comment_type=4 ORDER BY comment_datestamp";
        if ($comment_total = $sql->db_Select_gen($query) !== FALSE) {
            $text .= "<tr><td colspan='2'><br /><br />";
            while ($row = $sql->db_Fetch()) {
                $text .= $cobj->render_comment($row);
Exemple #20
0
 function sc_download_list_datestamp()
 {
     global $dlrow;
     $gen = new convert();
     return $gen->convert_date($dlrow['download_datestamp'], "short");
 }
Exemple #21
0
    $message = MESSLAN_6;
}
if (isset($message)) {
    $ns->tablerender("", "<div style='text-align:center'><b>" . $message . "</b></div>");
}
if ($amount = $sql->db_Select("generic", "*", $queryString)) {
    $text = "<table style='width: 98%;' class='fborder'>\n<form method='post' action='" . e_SELF . "'>\n";
    $messages = $sql->db_getList();
    foreach ($messages as $message) {
        extract($message);
        $sql->db_Select("user", "user_name", "user_id={$gen_user_id}");
        $user = $sql->db_Fetch();
        $user = "******" . e_BASE . "user.php?id.{$gen_user_id}'>" . $user['user_name'] . "</a>";
        switch ($gen_type) {
            case "Broken Download":
                $link = "<a href='" . e_BASE . "download.php?view.{$gen_intdata}' rel='external' title='" . MESSLAN_11 . "'>{$gen_ip}</a>";
                $link .= " [<a href='" . e_ADMIN . "download.php?create.edit." . $gen_intdata . "'>" . LAN_EDIT . "</a>]";
                break;
            case "Dev Team Message":
                $link = "";
                break;
        }
        $text .= "<tr>\n<td style='width: 100%;' class='forumheader3'><b>" . MESSLAN_8 . "</b>: {$gen_type}<br />\n<b>" . MESSLAN_9 . "</b>: " . $gen->convert_date($gen_datestamp, 'long') . "<br />\n<b>" . MESSLAN_10 . "</b>: {$user}<br />\n<b>" . MESSLAN_13 . "</b>: {$link} ";
        ($gen_chardata ? "<br /><b>" . MESSLAN_12 . "</b>: {$gen_chardata}" : "") . "<br /><input class='button' type='submit' name='delete_message' value='" . MESSLAN_2 . " {$gen_id}' />\n</td>\n</tr>\n";
    }
    $text .= "\n<tr>\n<td><br /><input class='button' type='submit' name='delete_all' value='" . MESSLAN_4 . "' />\n<input type='checkbox' name='deleteconfirm' value='1' /> " . MESSLAN_5 . "\n</td>\n</tr>\n\n\n</form></table>";
} else {
    $text = MESSLAN_7;
}
$ns->tablerender(MESSLAN_1, $text);
require_once "footer.php";
Exemple #22
0
 /**
  * Show recipients of an email
  * 
  * @param $mailid - number of email
  * @param $nextPage - 'mode' specification for page to return to following delete
  * @return text for display
  */
 public function showmailRecipients($mailID, $nextPage = 'saved')
 {
     $gen = new convert();
     $frm = e107::getForm();
     $mailData = $this->retrieveEmail($mailID);
     $text = "<div style='text-align:center'>";
     if ($mailData === FALSE) {
         $text = "<div class='forumheader2' style='text-align:center'>" . LAN_MAILOUT_79 . "</div>";
         $this->e107->ns->tablerender("<div style='text-align:center'>" . LAN_MAILOUT_171 . "</div>", $text);
         exit;
     }
     $text .= "\n\t\t\t<form action='" . e_SELF . '?' . e_QUERY . "' id='email_recip_header' method='post'>\n\t\t\t<fieldset id='email-recip_header'>\n\t\t\t<table class='table adminlist'>\n\t\t\t<colgroup>\n\t\t\t\t<col class='col-label' />\n\t\t\t\t<col class='col-control' />\n\t\t\t</colgroup>\n\t\t\t\n\t\t\t<tbody>";
     $text .= $this->showMailDetail($mailData, 'basic');
     $text .= '<tr><td>' . LAN_MAILOUT_172 . '</td><td>' . $this->statusToText($mailData['mail_content_status']) . "<input type='hidden' name='mailIDConf' value='{$mailID}' /></td></tr>";
     if ($mailData['mail_content_status'] != MAIL_STATUS_SAVED) {
         $text .= '<tr><td>' . LAN_MAILOUT_173 . '</td><td>' . ($mailData['mail_togo_count'] + $mailData['mail_sent_count'] + $mailData['mail_fail_count']) . '</td></tr>';
     }
     $text .= "</tbody></table>\n</fieldset></form>";
     // List of recipients
     // in $_GET, asc = sort order, fld = sort field
     $count = $this->selectTargetStatus($mailID, $this->showFrom, $this->showCount, '*', FALSE, $this->sortField, $this->sortOrder);
     $totalCount = $this->getTargetCount();
     if ($count == 0) {
         $text .= "<span class='required'>" . LAN_MAILOUT_253 . '</span>';
     } else {
         $text .= "\n\t\t\t\t<form action='" . e_SELF . "?mode=recipients&amp;m={$mailID}&amp;count={$count}&amp;frm={$this->showFrom}&amp;fld={$this->sortField}&amp;asc={$this->sortOrder}&amp;savepage={$nextPage}' id='email_recip_body' method='post'>\n\t\t\t\t<fieldset id='email-recip_body'>\n\t\t\t\t<table class='table adminlist'>";
         $fieldPrefs = $this->calcFieldSpec('recipients', TRUE);
         // Get columns to display
         // Must use '&' rather than '&amp;' in query pattern
         $text .= $frm->colGroup($this->fields['mail_recipients'], $this->fieldPref) . $frm->thead($this->fields['mail_recipients'], $this->fieldPref, 'mode=' . 'recipients&amp;m=' . $mailID . "&fld=[FIELD]&asc=[ASC]&frm=[FROM]") . "<tbody>";
         while ($row = $this->getNextTargetStatus(FALSE)) {
             //	print_a($row);
             $text .= '<tr>';
             foreach ($fieldPrefs as $fieldName) {
                 // Output column data value
                 $text .= '<td>';
                 if (isset($row[$fieldName])) {
                     $proctype = varset($this->fields['mail_recipients'][$fieldName]['proc'], 'default');
                     switch ($proctype) {
                         case 'username':
                             $text .= $this->getUserName($row[$fieldName]);
                             break;
                         case 'sdatetime':
                             $text .= $gen->convert_date($row[$fieldName], 'short');
                             break;
                         case 'trunc200':
                             $text .= $this->e107->tp->text_truncate($row[$fieldName], 200, '...');
                             break;
                         case 'contentstatus':
                             $text .= $this->statusToText($row[$fieldName]);
                             break;
                         case 'selectors':
                             $text .= 'cannot display';
                             break;
                         case 'array':
                             if (is_array($row[$fieldName])) {
                                 $nl = '';
                                 foreach ($row[$fieldName] as $k => $v) {
                                     if ($v) {
                                         $text .= $nl . $k . ' => ' . $v;
                                         $nl = '<br />';
                                     }
                                 }
                             } else {
                                 $text .= 'bad data: ';
                             }
                             break;
                         case 'default':
                         default:
                             $text .= $row[$fieldName];
                     }
                 } else {
                     // Special stuff
                     $text .= 'special';
                 }
                 $text .= '</td>';
             }
             // Add in options here
             $text .= '<td>' . $this->makeTargetOptions('recipients', $row) . '</td>';
             $text .= '</tr>';
         }
         $text .= "</tbody></table>\n</fieldset></form><br /><br />";
         if ($totalCount > $count) {
             $parms = "{$totalCount},{$this->showCount},{$this->showFrom}," . e_SELF . "?mode=recipients&amp;m={$mailID}&amp;count={$this->showCount}&amp;frm=[FROM]&amp;fld={$this->sortField}&amp;asc={$this->sortOrder}&amp;savepage={$nextPage}";
             $text .= $this->e107->tp->parseTemplate("{NEXTPREV={$parms}}");
         }
     }
     $text .= "</div>";
     $this->e107->ns->tablerender("<div style='text-align:center'>" . ADLAN_136 . " :: " . LAN_MAILOUT_181 . "</div>", $text);
 }
Exemple #23
0
 function sc_newsinfo()
 {
     $news_item = $this->news_item;
     $param = $this->param;
     $con = new convert();
     $news_item['news_start'] = isset($news_item['news_start']) && $news_item['news_start'] ? str_replace(' - 00:00:00', '', $con->convert_date($news_item['news_start'], 'long')) : LAN_NEWS_19;
     $news_item['news_end'] = isset($news_item['news_end']) && $news_item['news_end'] ? ' to ' . str_replace(' - 00:00:00', '', $con->convert_date($news_item['news_end'], 'long')) : '';
     $info = $news_item['news_render_type'] == 1 ? LAN_NEWS_9 : '';
     $info .= $news_item['news_class'] == 255 ? LAN_NEWS_10 : LAN_NEWS_11;
     $info .= $news_item['news_sticky'] ? '<br />' . LAN_NEWS_31 : '';
     $info .= '<br />' . ($news_item['news_allow_comments'] ? LAN_NEWS_13 : LAN_NEWS_12);
     $info .= LAN_NEWS_14 . $news_item['news_start'] . $news_item['news_end'] . '<br />';
     $info .= LAN_NEWS_15 . strlen($news_item['news_body']) . LAN_NEWS_16 . strlen($news_item['news_extended']) . LAN_NEWS_17 . "<br /><br />";
     //return $ns->tablerender(LAN_NEWS_18, $info);
     return $info;
 }
Exemple #24
0
     break;
 case 'options':
     if (!getperms('0')) {
         exit;
     }
     $text = "<div style='text-align:center'>\n\t<form method='post' action='" . e_SELF . "?options'>\n\t<table style='" . ADMIN_WIDTH . "' class='fborder'>\n\t<tr>\n\t<td style='width:50%' class='forumheader3'>" . UPLLAN_25 . "<br />\n\t<span class='smalltext'>" . UPLLAN_26 . "</span></td>\n\t<td style='width:50%' class='forumheader3'>" . ($pref['upload_enabled'] == 1 ? $rs->form_radio("upload_enabled", 1, 1) . " " . LAN_YES . $rs->form_radio("upload_enabled", 0) . " " . LAN_NO : $rs->form_radio("upload_enabled", 1) . " " . LAN_YES . $rs->form_radio("upload_enabled", 0, 1) . " " . LAN_NO) . "\n\t</td>\n\t</tr>\n\n\t<tr>\n\t<td style='width:70%' class='forumheader3'>" . UPLLAN_33 . "<br />\n\t<span class='smalltext'>" . UPLLAN_34 . " (upload_max_filesize = " . ini_get('upload_max_filesize') . ", post_max_size = " . ini_get('post_max_size') . " )</span></td>\n\t<td style='width:30%' class='forumheader3'>" . $rs->form_text("upload_maxfilesize", 10, $pref['upload_maxfilesize'], 10) . "\n\t</td>\n\t</tr>\n\n\t<tr>\n\t<td style='width:70%' class='forumheader3'>" . UPLLAN_37 . "<br />\n\t<span class='smalltext'>" . UPLLAN_38 . "</span></td>\n\t<td style='width:30%' class='forumheader3'>" . r_userclass("upload_class", $pref['upload_class'], "off", "nobody,public,guest,member,admin,classes") . "\n\n\t</td>\n\t</tr>\n\n\t<tr>\n\t<td colspan='2' class='forumheader' style='text-align:center'>" . $rs->form_button("submit", "optionsubmit", LAN_SUBMIT) . "\n\t</td>\n\t</tr>\n\t</table>" . $rs->form_close() . "\n\t</div>";
     $ns->tablerender(LAN_OPTIONS, $text);
     break;
 case 'view':
     $sql->db_Select('upload', '*', "upload_id='{$id}'");
     $row = $sql->db_Fetch();
     extract($row);
     $post_author_id = substr($upload_poster, 0, strpos($upload_poster, "."));
     $post_author_name = substr($upload_poster, strpos($upload_poster, ".") + 1);
     $poster = !$post_author_id ? "<b>" . $post_author_name . "</b>" : "<a href='" . e_BASE . "user.php?id." . $post_author_id . "'><b>" . $post_author_name . "</b></a>";
     $upload_datestamp = $gen->convert_date($upload_datestamp, "long");
     $text = "<div style='text-align:center'>\n\t\t<table style='" . ADMIN_WIDTH . "' class='fborder'>\n\t\t<colgroup>\n\t\t<col style='width:30%' />\n\t\t<col style='width:70%' />\n\t\t</colgroup>\n\n\t\t<tr>\n\t\t<td class='forumheader3'>" . LAN_ID . "</td>\n\t\t<td class='forumheader3'>{$upload_id}</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td class='forumheader3'>" . LAN_DATE . "</td>\n\t\t<td class='forumheader3'>{$upload_datestamp}</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td class='forumheader3'>" . UPLLAN_5 . "</td>\n\t\t<td class='forumheader3'>{$poster}</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td class='forumheader3'>" . UPLLAN_6 . "</td>\n\t\t<td class='forumheader3'><a href='mailto:{$upload_email}'>{$upload_email}</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td class='forumheader3'>" . UPLLAN_7 . "</td>\n\t\t<td class='forumheader3'>" . ($upload_website ? "<a href='{$upload_website}'>{$upload_website}</a>" : " - ") . "</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td class='forumheader3'>" . LAN_FILE_NAME . "</td>\n\t\t<td class='forumheader3'>" . ($upload_name ? $upload_name : " - ") . "</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td class='forumheader3'>" . LAN_VERSION . "</td>\n\t\t<td class='forumheader3'>" . ($upload_version ? $upload_version : " - ") . "</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td class='forumheader3'>" . LAN_FILE . "</td>\n\t\t<td class='forumheader3'>" . (is_numeric($upload_file) ? "Binary file ID " . $upload_file : "<a href='" . e_SELF . "?dl.{$upload_file}'>{$upload_file}</a>") . "</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td class='forumheader3'>" . LAN_SIZE . "</td>\n\t\t<td class='forumheader3'>" . $e107->parseMemorySize($upload_filesize) . "</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td class='forumheader3'>" . LAN_SCREENSHOT . "</td>\n\t\t<td class='forumheader3'>" . ($upload_ss ? "<a href='" . e_BASE . "request.php?upload." . $upload_id . "'>" . $upload_ss . "</a>" : " - ") . "</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td class='forumheader3'>" . LAN_DESCRIPTION . "</td>\n\t\t<td class='forumheader3'>{$upload_description}</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td class='forumheader3'>" . UPLLAN_14 . "</td>\n\t\t<td class='forumheader3'>" . ($upload_demo ? $upload_demo : " - ") . "</td>\n\t\t</tr>\n\n\t\t<tr>\n\t\t<td class='forumheader3'>" . LAN_OPTIONS . "</td>\n\t\t<td class='forumheader3'><a href='" . e_SELF . "?dlm.{$upload_id}'>" . UPLAN_COPYTODLM . "</a> | <a href='" . e_SELF . "?news.{$upload_id}'>" . UPLLAN_16 . "</a> | <a href='" . e_SELF . "?dis.{$upload_id}'>" . UPLLAN_17 . "</a></td>\n\t\t</tr>\n\n\t\t</table>\n\t\t</div>";
     $ns->tablerender(UPLLAN_18, $text);
     // Intentionally fall through into list mode
 // Intentionally fall through into list mode
 case 'list':
 default:
     $imgd = e_BASE . $IMAGES_DIRECTORY;
     $text = "<div style='text-align:center'>\n\t\t<table style='" . ADMIN_WIDTH . "' class='fborder'>\n\t\t<colgroup>\n\t\t<col style='width:5%' />\n\t\t<col style='width:20%' />\n\t\t<col style='width:15%' />\n\t\t<col style='width:20%' />\n\t\t<col style='width:25%' />\n\t\t<col style='width:10%' />\n\t\t<col style='width:50px;white-space:nowrap' />\n\t\t</colgroup>\n\t\t<tr>\n\t\t<td class='fcaption'>" . LAN_ID . "</td>\n\t\t<td class='fcaption'>" . LAN_DATE . "</td>\n\t\t<td class='fcaption'>" . UPLLAN_5 . "</td>\n\t\t<td class='fcaption'>" . LAN_NAME . "</td>\n\t\t<td class='fcaption'>" . LAN_FILE_NAME . "</td>\n\t\t<td class='fcaption'>" . LAN_SIZE . "</td>\n\t\t<td class='fcaption'>" . LAN_ACTIONS . "</td>\n\t\t</tr>";
     $text .= "<tr><td class='forumheader3' style='text-align:center' colspan='6'>";
     if (!($active_uploads = $sql->db_Select("upload", "*", "upload_active=0 ORDER BY upload_id ASC"))) {
         $text .= UPLLAN_19 . ".\n</td>\n</tr>";
     } else {
         $activeUploads = $sql->db_getList();
         $text .= UPLLAN_20 . " " . ($active_uploads == 1 ? UPLAN_IS : UPLAN_ARE) . $active_uploads . " " . ($active_uploads == 1 ? UPLLAN_21 : UPLLAN_27) . " ...";
         $text .= "</td></tr>";
    }
    $text .= "</td>\r\n\t\t</tr>\r\n\t\t";
    $c++;
}
$c = 0;
while ($files[$c]) {
    $img = substr(strrchr($files[$c], "."), 1, 3);
    if (!$img || !preg_match("/css|exe|gif|htm|jpg|js|php|png|txt|xml|zip/i", $img)) {
        $img = "def";
    }
    //$size = parsesize(filesize(e_BASE.$path."/".$files[$c]));
    $size = parsesize(filesize($path . "/" . $files[$c]));
    $text .= "<tr>\r\n\t\t<td class=\"forumheader3\" style=\"vertical-align:middle; text-align:center; width:5%\">\r\n\t\t<img src=\"" . $imagedir . $img . ".png\" alt=\"" . $files[$c] . "\" style=\"border:0\" />\r\n\t\t</td>\r\n\t\t<td style=\"width:30%\" class=\"forumheader3\">\r\n\t\t<!-- <a href=\"" . e_SELF . "?" . $path . $files[$c] . "\">" . $files[$c] . "</a> -->\r\n\t\t" . $files[$c] . "\r\n\t\t</td>";
    $gen = new convert();
    //$filedate = $gen -> convert_date(filemtime(e_BASE.$path."/".$files[$c]), "forum");
    $filedate = $gen->convert_date(filemtime($path . "/" . $files[$c]), "forum");
    $text .= "<td style=\"width:10%\" class=\"forumheader3\">" . $size . "</td>\r\n\t\t<td style=\"width:30%\" class=\"forumheader3\">" . $filedate . "</td>\r\n\t\t<td class=\"forumheader3\">";
    // EasyShop modification: suppress the delete option for index.html and .htaccess and for files without extension
    $extension = strrpos($files[$c], ".") ? substr($files[$c], strrpos($files[$c], ".")) : "";
    if ($files[$c] != "index.html" && $files[$c] != ".htaccess" && strlen($extension) != 0) {
        $text .= "<input  type=\"checkbox\" name=\"selectedfile[{$c}]\" value=\"1\" />";
    } else {
        if (strlen($extension) == 0 and strlen($files[$c]) == 32) {
            // Files with length 32 and without extension are assumed to be the MD5 protected files
            $text .= EASYSHOP_UPLOAD_51;
            // Message to inform that downloadable file is linked to product
        }
    }
    $text .= "<input type=\"hidden\" name=\"deleteconfirm[{$c}]\" value=\"" . $path . $files[$c] . "\" />";
    $text .= "</td>\r\n\t\t</tr>";
    $c++;
Exemple #26
0
 /**
  *	Display list of recent visitors to site - essentially up to (currently 20) of the entries from today's stats
  *
  *	@return string - text for display
  */
 function recentVisitors()
 {
     if (!is_array($this->fileRecent) || !count($this->fileRecent)) {
         return "<div style='text-align: center;'>" . ADSTAT_L25 . ".</div>";
     }
     $gen = new convert();
     $recentArray = array_reverse($this->fileRecent, TRUE);
     $text = "\n\t\t\t<table class='table table-striped fborder' style='width: 100%;'>\n\t\t\t<tr>\n\t\t\t\t<th class='fcaption' style='width: 30%;'>" . ADSTAT_L18 . "</th>\n\t\t\t\t<th class='fcaption' style='width: 70%;'>Information</th>\n\t\t\t</tr>\n";
     foreach ($recentArray as $key => $info) {
         if (is_array($info)) {
             $host = $info['host'];
             $datestamp = $info['date'];
             $os = $info['os'];
             $browser = $info['browser'];
             $screen = $info['screen'];
             $referer = $info['referer'];
         } else {
             list($host, $datestamp, $os, $browser, $screen, $referer) = explode(chr(1), $info);
         }
         $datestamp = $gen->convert_date($datestamp, "long");
         $text .= "<tr>\n\t\t\t<td class='forumheader3' style='width: 30%;'>{$datestamp}</td>\n\t\t\t<td class='forumheader3' style='width: 70%;'>Host: {$host}<br />" . ADSTAT_L26 . ": {$browser}<br />" . ADSTAT_L27 . ": {$os}<br />" . ADSTAT_L29 . ": {$screen}" . ($referer ? "<br />" . ADSTAT_L32 . ": <a href='{$referer}' rel='external'>{$referer}</a>" : "") . "</td>\n\t\t\t</tr>\n";
     }
     $text .= "</table>";
     return $text;
 }
Exemple #27
0
 function getListData()
 {
     $list_caption = $this->parent->settings['caption'];
     $list_display = $this->parent->settings['open'] ? "" : "none";
     $bullet = $this->parent->getBullet($this->parent->settings['icon']);
     if ($this->parent->mode == 'new_page' || $this->parent->mode == 'new_menu') {
         // New posts since last visit, up to limit
         $lvisit = $this->parent->getlvisit();
         $qry = "\n\t\t\tSELECT tp.thread_name AS parent_name, tp.thread_id as parent_id, \n\t\t\tf.forum_id, f.forum_name, f.forum_class, \n\t\t\tu.user_name, lp.user_name AS lp_name, \n\t\t\tt.thread_id, t.thread_views as tviews, t.thread_name, t.thread_datestamp, t.thread_user,\n\t\t\ttp.post_thread, tp.post_user, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies\n\t\t\tFROM #forum_thread AS t\n\t\t\tLEFT JOIN #forum_post AS tp ON t.thread_id = tp.post_thread\n\t\t\tLEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id\n\t\t\tLEFT JOIN #user AS u ON tp.post_user = u.user_id\n\t\t\tLEFT JOIN #user AS lp ON t.thread_lastuser = lp.user_id\n\t\t\tWHERE find_in_set(forum_class, '" . USERCLASS_LIST . "')\n\t\t\tAND t.thread_lastpost > {$lvisit}\n\t\t\tORDER BY tp.post_datestamp DESC LIMIT 0," . intval($this->parent->settings['amount']);
     } else {
         // Most recently updated threads up to limit
         $qry = "\n\t\t\tSELECT t.thread_id, t.thread_name AS parent_name, t.thread_datestamp, t.thread_user, t.thread_views, t.thread_lastpost, \n\t\t\tt.thread_lastuser, t.thread_total_replies, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name\n\t\t\tFROM #forum_thread AS t\n\t\t\tLEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id\n\t\t\tLEFT JOIN #user AS u ON t.thread_user = u.user_id\n\t\t\tLEFT JOIN #user AS lp ON t.thread_lastuser = lp.user_id\n\t\t\tWHERE find_in_set(f.forum_class, '" . USERCLASS_LIST . "')\n\t\t\tORDER BY t.thread_lastpost DESC LIMIT 0," . intval($this->parent->settings['amount']);
     }
     if (!($results = $this->parent->e107->sql->gen($qry))) {
         $list_data = LIST_FORUM_2;
     } else {
         $forumArray = $this->parent->e107->sql->db_getList();
         $path = e_PLUGIN . "forum/";
         foreach ($forumArray as $forumInfo) {
             extract($forumInfo);
             $record = array();
             //last user
             $r_id = substr($thread_lastuser, 0, strpos($thread_lastuser, "."));
             $r_name = substr($thread_lastuser, strpos($thread_lastuser, ".") + 1);
             if (strstr($thread_lastuser, chr(1))) {
                 $tmp = explode(chr(1), $thread_lastuser);
                 $r_name = $tmp[0];
             }
             $thread_lastuser = $r_id;
             //user
             $u_id = substr($thread_user, 0, strpos($thread_user, "."));
             $u_name = substr($thread_user, strpos($thread_user, ".") + 1);
             $thread_user = $u_id;
             if (isset($thread_anon)) {
                 $tmp = explode(chr(1), $thread_anon);
                 $thread_user = $tmp[0];
                 $thread_user_ip = $tmp[1];
             }
             $gen = new convert();
             $r_datestamp = $gen->convert_date($thread_lastpost, "short");
             if ($thread_total_replies) {
                 $LASTPOST = "";
                 if ($lp_name) {
                     $LASTPOST = "<a href='" . e_HTTP . "user.php ?id.{$thread_lastuser}'>{$lp_name}</a>";
                 } else {
                     if ($thread_lastuser[0] == "0") {
                         $LASTPOST = substr($thread_lastuser, 2);
                     } else {
                         //$LASTPOST = NFPM_L16;
                     }
                 }
                 $LASTPOST .= " " . LIST_FORUM_6 . " <span class='smalltext'>{$r_datestamp}</span>";
             } else {
                 $LASTPOST = " - ";
                 $LASTPOSTDATE = '';
             }
             if ($parent_name == '') {
                 $parent_name = $thread_name;
             }
             $rowheading = $this->parent->parse_heading($parent_name);
             $lnk = $parent_id ? $thread_id . ".post" : $thread_id;
             $record['heading'] = "<a href='" . $path . "forum_viewtopic.php?{$lnk}'>" . $rowheading . "</a>";
             $record['author'] = $this->parent->settings['author'] ? $thread_anon ? $thread_user : "******" . e_HTTP . "user.php ?id.{$thread_user}'>{$user_name}</a>" : "";
             $record['category'] = $this->parent->settings['category'] ? "<a href='" . $path . "forum_viewforum.php?{$forum_id}'>{$forum_name}</a>" : "";
             $record['date'] = $this->parent->settings['date'] ? $this->parent->getListDate($thread_datestamp) : "";
             $record['icon'] = $bullet;
             $VIEWS = $thread_views;
             $REPLIES = $thread_total_replies;
             if ($thread_total_replies) {
                 $record['info'] = "[ " . LIST_FORUM_3 . " " . $VIEWS . ", " . LIST_FORUM_4 . " " . $REPLIES . ", " . LIST_FORUM_5 . " " . $LASTPOST . " ]";
             } else {
                 $record['info'] = "[ " . LIST_FORUM_3 . " " . intval($tviews) . " ]";
             }
             $list_data[] = $record;
         }
     }
     //return array with 'records', (global)'caption', 'display'
     return array('records' => $list_data, 'caption' => $list_caption, 'display' => $list_display);
 }
Exemple #28
0
                $ga = new convert();
                $newsletter_datestamp = $ga->convert_date($row['newsletter_datestamp'], 'long');
                $text .= "<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t" . $row['newsletter_issue'] . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<a href='" . e_PLUGIN . "newsletter/nl_archive.php?show." . $action_parent_id . "." . $row['newsletter_id'] . "'>" . $tp->toHTML($row['newsletter_title'], true) . "</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t" . $newsletter_datestamp . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t  </tr>";
            }
            $text .= "</table>";
            if ($limit_start + $page_size < $nl_count) {
                $text .= "<form id='nl' method='post' action='" . e_PLUGIN . "newsletter/nl_archive.php?showp." . $action_parent_id . "'>\n\t\t\t\t<br /><input class='button' name='submit' type='submit' value='View older newsletters in archive'/>\n\t\t\t\t<input type='hidden' name='limit_start' value='" . $limit_start . "'/></form>";
            }
        } else {
            $e107->sql->db_Select('newsletter', '*', "newsletter_parent='" . $action_parent_id . "' AND newsletter_id='" . $action_nl_id . "' AND newsletter_flag='1'");
            if ($row = $e107->sql->db_Fetch()) {
                // Display parent header
                $text .= "{$parent_newsletter_title}<br />\n\t\t\t\t\t\t  <div style='text-align: left;'>{$parent_newsletter_text}</div><br /><br />\n\t\t\t\t\t\t  {$parent_newsletter_header}<br /><br />";
                // Display newsletter text
                $ga = new convert();
                $newsletter_datestamp = $ga->convert_date($row['newsletter_datestamp'], "long");
                $text .= $newsletter_datestamp . "<br />" . $tp->toHTML($row['newsletter_title'], true) . "<br />\n\t\t\t\t\t\t <div style='text-align: left;'>" . $tp->toHTML($row['newsletter_text'], true) . "</div><br /><br />";
                // Display parent footer
                $text .= "{$parent_newsletter_footer}<br />";
                // Display back to newsletter overview button
                $text .= "<br /><a href='javascript:history.go(-1);'><input class='button' type='submit' value='" . NLLAN_71 . "'</a>";
            } else {
                $text .= NLLAN_70;
                //Selected newsletter does not exist
            }
        }
    } else {
        $text .= NLLAN_69;
        // No send newsletters available for selected parent
    }
}
Exemple #29
0
    $srchIcon = LAN_SEARCH;
}
$fVars->SEARCH = "\n<form method='get' class='form-inline input-append' action='" . e_BASE . "search.php'>\n<div class='input-group'>\n<input class='tbox form-control' type='text' name='q' size='20' value='' maxlength='50' />\n<span class='input-group-btn'>\n<button class='btn btn-default button' type='submit' name='s' value='search' />" . $srchIcon . "</button>\n</span>\n<input type='hidden' name='r' value='0' />\n<input type='hidden' name='ref' value='forum' />\n</div>\n\n</form>\n";
$fVars->PERMS = USER == TRUE || ANON == TRUE ? LAN_FORUM_0043 . " - " . LAN_FORUM_0045 . " - " . LAN_FORUM_0047 : LAN_FORUM_0044 . " - " . LAN_FORUM_0046 . " - " . LAN_FORUM_0048;
$fVars->INFO = "";
if (USER == TRUE) {
    $total_new_threads = $sql->count('forum_thread', '(*)', "WHERE thread_datestamp>'" . USERLV . "' ");
    if (USERVIEWED != "") {
        $tmp = explode(".", USERVIEWED);
        // List of numbers, separated by single period
        $total_read_threads = count($tmp);
    } else {
        $total_read_threads = 0;
    }
    $fVars->INFO = LAN_FORUM_0018 . " " . USERNAME . "<br />";
    $lastvisit_datestamp = $gen->convert_date(USERLV, 'long');
    $datestamp = $gen->convert_date(time(), "long");
    if (!$total_new_threads) {
        $fVars->INFO .= LAN_FORUM_0019 . " ";
    } elseif ($total_new_threads == 1) {
        $fVars->INFO .= LAN_FORUM_0020;
    } else {
        $fVars->INFO .= LAN_FORUM_0021 . " " . $total_new_threads . " " . LAN_FORUM_0022 . " ";
    }
    $fVars->INFO .= LAN_FORUM_0023;
    if ($total_new_threads == $total_read_threads && $total_new_threads != 0 && $total_read_threads >= $total_new_threads) {
        $fVars->INFO .= LAN_FORUM_0029;
        $allread = TRUE;
    } elseif ($total_read_threads != 0) {
        $fVars->INFO .= " (" . LAN_FORUM_0027 . " " . $total_read_threads . " " . LAN_FORUM_0028 . ")";
    }
Exemple #30
0
    $text .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><label for='display-memory-usage'>" . PRFLAN_137 . "</label></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t" . $frm->radio_switch('display_memory_usage', $pref['display_memory_usage']) . "\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t";
}
$text .= "\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t" . pref_submit('display') . "\n\t\t</fieldset>\n";
// Admin Display Areas
$text .= "\n\t\t<fieldset class='e-hideme' id='core-prefs-admindisp'>\n\t\t\t<legend>" . PRFLAN_77 . "</legend>\n\t\t\t<table class='table adminform'>\n\t\t\t\t<colgroup>\n\t\t\t\t\t<col class='col-label' />\n\t\t\t\t\t<col class='col-control' />\n\t\t\t\t</colgroup>\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><label for='admin-alerts-ok'>" . PRFLAN_95 . "</label></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t" . $frm->radio_switch('admin_alerts_ok', $pref['admin_alerts_ok']) . "\n\t\t\t\t\t\t\t<div class='field-help'>" . PRFLAN_96 . "</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><label for='admin-alerts-uniquemenu'>" . PRFLAN_97 . "</label></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t" . $frm->radio_switch('admin_alerts_uniquemenu', $pref['admin_alerts_uniquemenu']) . "\n\t\t\t\t\t\t\t<div class='field-help'>" . PRFLAN_98 . "</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>";
/*<tr>
			<td>".PRFLAN_199."</td>
			<td>
				".$frm->radio_switch('admin_slidedown_subs', $pref['admin_slidedown_subs'])."
				<div class='field-help'>".PRFLAN_200."</div>
			</td>
		</tr>*/
$text .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><label for='admin-separate-plugins'>" . PRFLAN_204 . "</label></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t" . $frm->radio_switch('admin_separate_plugins', $pref['admin_separate_plugins']) . "\n\t\t\t\t\t\t\t<div class='field-help'>" . PRFLAN_205 . "</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t" . pref_submit('admindisp') . "\n\t\t</fieldset>\n\n\t";
// Date options.
$ga = new convert();
$date1 = $ga->convert_date(time(), "short");
$date2 = $ga->convert_date(time(), "long");
$date3 = $ga->convert_date(time(), "forum");
$date4 = e107::getDate()->convert(time(), "input");
$text .= "\n\t\t<fieldset class='e-hideme' id='core-prefs-date'>\n\t\t\t<legend>" . PRFLAN_21 . "</legend>\n\t\t\t<table class='table adminform'>\n\t\t\t\t<colgroup>\n\t\t\t\t\t<col class='col-label' />\n\t\t\t\t\t<col class='col-control' />\n\t\t\t\t</colgroup>\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><label for='shortdate'>" . PRFLAN_22 . "</label></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t" . $frm->text('shortdate', $pref['shortdate'], 50) . "\n\t\t\t\t\t\t\t<div class='field-help'>" . PRFLAN_83 . ": {$date1}</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><label for='longdate'>" . PRFLAN_23 . "</label></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t" . $frm->text('longdate', $pref['longdate'], 50) . "\n\t\t\t\t\t\t\t<div class='field-help'>" . PRFLAN_83 . ": {$date2}</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><label for='forumdate'>" . PRFLAN_24 . "</label></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t" . $frm->text('forumdate', $pref['forumdate'], 50) . "\n\t\t\t\t\t\t\t<div class='field-help'>" . PRFLAN_83 . ": {$date3}</div>\n\t\t\t\t\t\t\t<div class='field-help'>" . PRFLAN_25 . " <a href='http://www.php.net/manual/en/function.strftime.php' rel='external'>" . PRFLAN_93 . "</a></div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>";
$def = strtotime('December 21, 2012 3:45pm');
$inputdate = array("%A, %d %B, %Y" => strftime("%A, %d %B, %Y", $def), "%A, %d %b, %Y" => strftime("%A, %d %b, %Y", $def), "%a, %d %B, %Y" => strftime("%a, %d %B, %Y", $def), "%a, %d %b, %Y" => strftime("%a, %d %b, %Y", $def), "%A, %B %d, %Y" => strftime("%A, %B %d, %Y", $def), "%A, %b %d, %Y" => strftime("%A, %b %d, %Y", $def), "%A, %b %d, %y" => strftime("%A, %b %d, %y", $def), "%B %d, %Y" => strftime("%B %d, %Y", $def), "%b %d, %Y" => strftime("%b %d, %Y", $def), "%b %d, %y" => strftime("%b %d, %y", $def), "%d %B, %Y" => strftime("%d %B, %Y", $def), "%d %b, %Y" => strftime("%d %b, %Y", $def), "%d %b, %y" => strftime("%d %b, %y", $def), "%Y-%m-%d" => strftime("%Y-%m-%d", $def), "%d-%m-%Y" => strftime("%d-%m-%Y", $def), "%m/%d/%Y" => strftime("%m/%d/%Y", $def));
$inputtime = array();
$inputtime["%I:%M %p"] = strftime("%I:%M %p", $def);
if (e107::getDate()->supported('P')) {
    $inputtime["%I:%M %P"] = strftime("%I:%M %P", $def);
}
if (e107::getDate()->supported('l')) {
    $inputtime["%l:%M %p"] = strftime("%l:%M %p", $def);
    $inputtime["%l:%M %P"] = strftime("%l:%M %P", $def);
}