Zeile 3 | Zeile 3 |
---|
* MyBB 1.2 * Copyright � 2006 MyBB Group, All Rights Reserved *
|
* MyBB 1.2 * Copyright � 2006 MyBB Group, All Rights Reserved *
|
* Website: http://www.mybboard.com * License: http://www.mybboard.com/eula.html
| * Website: http://www.mybboard.net * License: http://www.mybboard.net/eula.html
|
*
|
*
|
* $Id: portal.php 2378 2006-10-30 15:06:39Z Tikitiki $
| * $Id: portal.php 3595 2008-01-09 00:10:57Z Tikitiki $
|
*/
define("IN_MYBB", 1);
|
*/
define("IN_MYBB", 1);
|
| define("IN_PORTAL", 1);
|
// set the path to your forums directory here (without trailing slash) $forumdir = "./";
|
// set the path to your forums directory here (without trailing slash) $forumdir = "./";
|
|
|
// end editing
|
// end editing
|
if(!chdir($forumdir) && $forumdir)
| $change_dir = "./";
if(!@chdir($forumdir) && !empty($forumdir))
|
{
|
{
|
die("\$forumdir is invalid!");
| if(@is_dir($forumdir)) { $change_dir = $forumdir; } else { die("\$forumdir is invalid!"); }
|
}
$templatelist = "portal_welcome,portal_welcome_membertext,portal_stats,portal_search,portal_whosonline_memberbit,portal_whosonline,portal_latestthreads_thread_lastpost,portal_latestthreads_thread,portal_latestthreads,portal_announcement_numcomments_no,portal_announcement,portal_announcement_numcomments,portal";
|
}
$templatelist = "portal_welcome,portal_welcome_membertext,portal_stats,portal_search,portal_whosonline_memberbit,portal_whosonline,portal_latestthreads_thread_lastpost,portal_latestthreads_thread,portal_latestthreads,portal_announcement_numcomments_no,portal_announcement,portal_announcement_numcomments,portal";
|
require_once "./global.php";
| require_once $change_dir."/global.php";
|
require_once MYBB_ROOT."inc/functions_post.php"; require_once MYBB_ROOT."inc/functions_user.php"; require_once MYBB_ROOT."inc/class_parser.php";
| require_once MYBB_ROOT."inc/functions_post.php"; require_once MYBB_ROOT."inc/functions_user.php"; require_once MYBB_ROOT."inc/class_parser.php";
|
Zeile 73 | Zeile 82 |
---|
}
my_setcookie('loginattempts', 1);
|
}
my_setcookie('loginattempts', 1);
|
$db->delete_query(TABLE_PREFIX."sessions", "ip='".$session->ipaddress."' AND sid != '".$session->sid."'");
| $db->delete_query(TABLE_PREFIX."sessions", "ip='".$db->escape_string($session->ipaddress)."' AND sid != '".$session->sid."'");
|
$newsession = array( "uid" => $user['uid'], "loginattempts" => 1,
| $newsession = array( "uid" => $user['uid'], "loginattempts" => 1,
|
Zeile 98 | Zeile 107 |
---|
$plugins->run_hooks("portal_start");
|
$plugins->run_hooks("portal_start");
|
| // First validate announcement fids: $mybb->settings['portal_announcementsfid'] = explode(',', $mybb->settings['portal_announcementsfid']); if(is_array($mybb->settings['portal_announcementsfid'])) { foreach($mybb->settings['portal_announcementsfid'] as $fid) { $fid_array[] = intval($fid); } $mybb->settings['portal_announcementsfid'] = implode(',', $fid_array); }
|
// get forums user cannot view $unviewable = get_unviewable_forums(); if($unviewable) { $unviewwhere = " AND fid NOT IN ($unviewable)";
|
// get forums user cannot view $unviewable = get_unviewable_forums(); if($unviewable) { $unviewwhere = " AND fid NOT IN ($unviewable)";
|
}
| }
|
// If user is known, welcome them if($mybb->settings['portal_showwelcome'] != "no") {
| // If user is known, welcome them if($mybb->settings['portal_showwelcome'] != "no") {
|
Zeile 138 | Zeile 157 |
---|
if(!$newthreads) { $newthreads = 0;
|
if(!$newthreads) { $newthreads = 0;
|
}
| }
|
if(!$newann) { $newann = 0;
| if(!$newann) { $newann = 0;
|
Zeile 149 | Zeile 168 |
---|
$newposts = 0; $newthreads = 0; $newann = 0;
|
$newposts = 0; $newthreads = 0; $newann = 0;
|
}
| }
|
// Make the text if($newann == 1) { $lang->new_announcements = $lang->new_announcement;
|
// Make the text if($newann == 1) { $lang->new_announcements = $lang->new_announcement;
|
}
| }
|
else { $lang->new_announcements = sprintf($lang->new_announcements, $newann); } if($newthreads == 1)
|
else { $lang->new_announcements = sprintf($lang->new_announcements, $newann); } if($newthreads == 1)
|
{
| {
|
$lang->new_threads = $lang->new_thread; } else
| $lang->new_threads = $lang->new_thread; } else
|
Zeile 178 | Zeile 197 |
---|
} eval("\$welcometext = \"".$templates->get("portal_welcome_membertext")."\";");
|
} eval("\$welcometext = \"".$templates->get("portal_welcome_membertext")."\";");
|
}
| }
|
else { $lang->guest_welcome_registration = sprintf($lang->guest_welcome_registration, $mybb->settings['bburl'] . '/member.php?action=register');
| else { $lang->guest_welcome_registration = sprintf($lang->guest_welcome_registration, $mybb->settings['bburl'] . '/member.php?action=register');
|
Zeile 194 | Zeile 213 |
---|
} // Get Forum Statistics if($mybb->settings['portal_showstats'] != "no")
|
} // Get Forum Statistics if($mybb->settings['portal_showstats'] != "no")
|
{
| {
|
$stats = $cache->read("stats");
|
$stats = $cache->read("stats");
|
$threadsnum = $stats['numthreads']; $postsnum = $stats['numposts']; $membersnum = $stats['numusers'];
| $stats['numthreads'] = my_number_format($stats['numthreads']); $stats['numposts'] = my_number_format($stats['numposts']); $stats['numusers'] = my_number_format($stats['numusers']);
|
if(!$stats['lastusername']) { $newestmember = "<b>" . $lang->no_one . "</b>";
| if(!$stats['lastusername']) { $newestmember = "<b>" . $lang->no_one . "</b>";
|
Zeile 208 | Zeile 227 |
---|
$newestmember = build_profile_link($stats['lastusername'], $stats['lastuid']); } eval("\$stats = \"".$templates->get("portal_stats")."\";");
|
$newestmember = build_profile_link($stats['lastusername'], $stats['lastuid']); } eval("\$stats = \"".$templates->get("portal_stats")."\";");
|
}
| }
|
// Search box if($mybb->settings['portal_showsearch'] != "no") {
| // Search box if($mybb->settings['portal_showsearch'] != "no") {
|
Zeile 231 | Zeile 250 |
---|
"); while($user = $db->fetch_array($query)) {
|
"); while($user = $db->fetch_array($query)) {
|
| // Create a key to test if this user is a search bot. $botkey = strtolower(str_replace("bot=", '', $user['sid']));
|
if($user['uid'] == "0") {
|
if($user['uid'] == "0") {
|
$guestcount++;
| ++$guestcount; } elseif(strpos($user['sid'], "bot=") !== false && $session->bots[$botkey]) { // The user is a search bot. $onlinemembers .= $comma.format_name($session->bots[$botkey], $session->botgroup); $comma = ", "; ++$botcount;
|
} else { if($doneusers[$user['uid']] < $user['time'] || !$doneusers[$user['uid']])
|
} else { if($doneusers[$user['uid']] < $user['time'] || !$doneusers[$user['uid']])
|
{
| {
|
$doneusers[$user['uid']] = $user['time'];
|
$doneusers[$user['uid']] = $user['time'];
|
$membercount++; if($user['invisible'] != "yes" || $mybb->usergroup['canviewwolinvis'] == "yes")
| // If the user is logged in anonymously, update the count for that. if($user['invisible'] == "yes") { ++$anoncount; } else { ++$membercount; } if($user['invisible'] == "yes") { $invisiblemark = "*"; } else { $invisiblemark = ''; } if(($user['invisible'] == "yes" && ($mybb->usergroup['canviewwolinvis'] == "yes" || $user['uid'] == $mybb->user['uid'])) || $user['invisible'] != "yes")
|
{
|
{
|
if($user['invisible'] == "yes") { $invisiblemark = "*"; } else { $invisiblemark = ''; }
| |
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
|
$user['username'] = format_name($user['username'], $user['usergroup'], $user['displaygroup']);
|
| $user['profilelink'] = get_profile_link($user['uid']);
|
eval("\$onlinemembers .= \"".$templates->get("portal_whosonline_memberbit", 1, 0)."\";"); $comma = ", "; } } } }
|
eval("\$onlinemembers .= \"".$templates->get("portal_whosonline_memberbit", 1, 0)."\";"); $comma = ", "; } } } }
|
$onlinecount = $membercount + $guestcount + $anoncount;
| $onlinecount = $membercount + $guestcount + $botcount; // If we can see invisible users add them to the count if($mybb->usergroup['canviewwolinvis'] == "yes") { $onlinecount += $anoncount; } // If we can't see invisible users but the user is an invisible user incriment the count by one if($mybb->usergroup['canviewwolinvis'] != "yes" && $mybb->user['invisible'] == "yes") { ++$onlinecount; }
|
// Most users online $mostonline = $cache->read("mostonline");
| // Most users online $mostonline = $cache->read("mostonline");
|
Zeile 273 | Zeile 327 |
---|
$recorddate = my_date($mybb->settings['dateformat'], $mostonline['time']); $recordtime = my_date($mybb->settings['timeformat'], $mostonline['time']);
|
$recorddate = my_date($mybb->settings['dateformat'], $mostonline['time']); $recordtime = my_date($mybb->settings['timeformat'], $mostonline['time']);
|
$lang->online_users = sprintf($lang->online_users, $onlinecount);
| if($onlinecount == 1) { $lang->online_users = $lang->online_user; } else { $lang->online_users = sprintf($lang->online_users, $onlinecount); }
|
$lang->online_counts = sprintf($lang->online_counts, $membercount, $guestcount); eval("\$whosonline = \"".$templates->get("portal_whosonline")."\";"); }
| $lang->online_counts = sprintf($lang->online_counts, $membercount, $guestcount); eval("\$whosonline = \"".$templates->get("portal_whosonline")."\";"); }
|
Zeile 281 | Zeile 342 |
---|
// Latest forum discussions if($mybb->settings['portal_showdiscussions'] != "no" && $mybb->settings['portal_showdiscussionsnum']) {
|
// Latest forum discussions if($mybb->settings['portal_showdiscussions'] != "no" && $mybb->settings['portal_showdiscussionsnum']) {
|
$altbg = "trow1";
| $altbg = alt_trow();
|
$threadlist = ''; $query = $db->query(" SELECT t.*, u.username
| $threadlist = ''; $query = $db->query(" SELECT t.*, u.username
|
Zeile 301 | Zeile 362 |
---|
$lastposterlink = $thread['lastposter']; } else
|
$lastposterlink = $thread['lastposter']; } else
|
{
| {
|
$lastposterlink = build_profile_link($thread['lastposter'], $thread['lastposteruid']);
|
$lastposterlink = build_profile_link($thread['lastposter'], $thread['lastposteruid']);
|
}
| }
|
if(my_strlen($thread['subject']) > 25) { $thread['subject'] = my_substr($thread['subject'], 0, 25) . "...";
| if(my_strlen($thread['subject']) > 25) { $thread['subject'] = my_substr($thread['subject'], 0, 25) . "...";
|
Zeile 316 | Zeile 377 |
---|
{ // show the table only if there are threads eval("\$latestthreads = \"".$templates->get("portal_latestthreads")."\";"); }
|
{ // show the table only if there are threads eval("\$latestthreads = \"".$templates->get("portal_latestthreads")."\";"); }
|
}
| }
|
// Get latest news announcements
|
// Get latest news announcements
|
// First validate announcement fids: $mybb->settings['portal_announcementsfid'] = explode(',', $mybb->settings['portal_announcementsfid']); foreach($mybb->settings['portal_announcementsfid'] as $fid) { $fid_array[] = intval($fid); } $mybb->settings['portal_announcementsfid'] = implode(',', $fid_array); // And get them!
| |
$query = $db->simple_select(TABLE_PREFIX."forums", "*", "fid IN (".$mybb->settings['portal_announcementsfid'].")"); while($forumrow = $db->fetch_array($query)) {
| $query = $db->simple_select(TABLE_PREFIX."forums", "*", "fid IN (".$mybb->settings['portal_announcementsfid'].")"); while($forumrow = $db->fetch_array($query)) {
|
Zeile 356 | Zeile 409 |
---|
$attachcache[$attachment['pid']][$attachment['aid']] = $attachment; }
|
$attachcache[$attachment['pid']][$attachment['aid']] = $attachment; }
|
foreach($forum as $fid => $forumrow)
| if(is_array($forum))
|
{
|
{
|
$forumpermissions[$fid] = forum_permissions($fid);
| foreach($forum as $fid => $forumrow) { $forumpermissions[$fid] = forum_permissions($fid); }
|
}
$icon_cache = $cache->read("posticons");
| }
$icon_cache = $cache->read("posticons");
|
Zeile 397 | Zeile 453 |
---|
if($avatar_dimensions[0] && $avatar_dimensions[1]) { $avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\"";
|
if($avatar_dimensions[0] && $avatar_dimensions[1]) { $avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\"";
|
}
| } if (!stristr($announcement['avatar'], 'http://')) { $announcement['avatar'] = $mybb->settings['bburl'] . '/' . $announcement['avatar']; }
|
$avatar = "<td class=\"trow1\" width=\"1\" align=\"center\" valign=\"top\"><img src=\"$announcement[avatar]\" alt=\"0\" {$avatar_width_height} /></td>"; } else
| $avatar = "<td class=\"trow1\" width=\"1\" align=\"center\" valign=\"top\"><img src=\"$announcement[avatar]\" alt=\"0\" {$avatar_width_height} /></td>"; } else
|
Zeile 440 | Zeile 500 |
---|
{ if($attachment['visible']) { // There is an attachment thats visible!
|
{ if($attachment['visible']) { // There is an attachment thats visible!
|
$attachment['name'] = htmlspecialchars_uni($attachment['name']);
| $attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
|
$attachment['filesize'] = get_friendly_size($attachment['filesize']); $ext = get_extension($attachment['filename']); if($ext == "jpeg" || $ext == "gif" || $ext == "bmp" || $ext == "png" || $ext == "jpg")
| $attachment['filesize'] = get_friendly_size($attachment['filesize']); $ext = get_extension($attachment['filename']); if($ext == "jpeg" || $ext == "gif" || $ext == "bmp" || $ext == "png" || $ext == "jpg")
|