Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.com * License: http://www.mybboard.com/eula.html *
|
* Website: http://www.mybboard.com * License: http://www.mybboard.com/eula.html *
|
* $Id: portal.php 2378 2006-10-30 15:06:39Z Tikitiki $
| * $Id: portal.php 2741 2007-02-08 23:11:12Z CraKteR $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 17 | Zeile 17 |
---|
// 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"; $parser = new postParser;
|
require_once MYBB_ROOT."inc/functions_post.php"; require_once MYBB_ROOT."inc/functions_user.php"; require_once MYBB_ROOT."inc/class_parser.php"; $parser = new postParser;
|
|
|
global $theme, $templates;
// Fetch the current URL $portal_url = get_current_location();
|
global $theme, $templates;
// Fetch the current URL $portal_url = get_current_location();
|
|
|
// Load global language phrases $lang->load("portal");
add_breadcrumb($lang->nav_portal, "portal.php");
|
// Load global language phrases $lang->load("portal");
add_breadcrumb($lang->nav_portal, "portal.php");
|
|
|
// This allows users to login if the portal is stored offsite or in a different directory if($mybb->input['action'] == "do_login" && $mybb->request_method == "post") { $plugins->run_hooks("portal_do_login_start");
|
// This allows users to login if the portal is stored offsite or in a different directory if($mybb->input['action'] == "do_login" && $mybb->request_method == "post") { $plugins->run_hooks("portal_do_login_start");
|
|
|
//Checks to make sure the user can login; they haven't had too many tries at logging in. //Is a fatal call if user has had too many tries $logins = login_attempt_check();
| //Checks to make sure the user can login; they haven't had too many tries at logging in. //Is a fatal call if user has had too many tries $logins = login_attempt_check();
|
Zeile 59 | Zeile 68 |
---|
$login_text = sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins); } error($lang->error_invalidusername.$login_text);
|
$login_text = sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins); } error($lang->error_invalidusername.$login_text);
|
}
| }
|
$user = validate_password_from_username($mybb->input['username'], $mybb->input['password']); if(!$user['uid']) {
| $user = validate_password_from_username($mybb->input['username'], $mybb->input['password']); if(!$user['uid']) {
|
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 177 | Zeile 186 |
---|
$lang->new_posts = sprintf($lang->new_posts, $newposts); } eval("\$welcometext = \"".$templates->get("portal_welcome_membertext")."\";");
|
$lang->new_posts = sprintf($lang->new_posts, $newposts); } eval("\$welcometext = \"".$templates->get("portal_welcome_membertext")."\";");
|
} else {
| } else {
|
$lang->guest_welcome_registration = sprintf($lang->guest_welcome_registration, $mybb->settings['bburl'] . '/member.php?action=register'); $mybb->user['username'] = $lang->guest; eval("\$welcometext = \"".$templates->get("portal_welcome_guesttext")."\";");
| $lang->guest_welcome_registration = sprintf($lang->guest_welcome_registration, $mybb->settings['bburl'] . '/member.php?action=register'); $mybb->user['username'] = $lang->guest; eval("\$welcometext = \"".$templates->get("portal_welcome_guesttext")."\";");
|
Zeile 231 | Zeile 240 |
---|
"); 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 272 | Zeile 316 |
---|
$recordcount = $mostonline['numusers']; $recorddate = my_date($mybb->settings['dateformat'], $mostonline['time']); $recordtime = my_date($mybb->settings['timeformat'], $mostonline['time']);
|
$recordcount = $mostonline['numusers']; $recorddate = my_date($mybb->settings['dateformat'], $mostonline['time']); $recordtime = my_date($mybb->settings['timeformat'], $mostonline['time']);
|
|
|
$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_users = sprintf($lang->online_users, $onlinecount); $lang->online_counts = sprintf($lang->online_counts, $membercount, $guestcount); eval("\$whosonline = \"".$templates->get("portal_whosonline")."\";");
|
Zeile 281 | Zeile 325 |
---|
// 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 321 | Zeile 365 |
---|
// Get latest news announcements // First validate announcement fids: $mybb->settings['portal_announcementsfid'] = explode(',', $mybb->settings['portal_announcementsfid']);
|
// Get latest news announcements // First validate announcement fids: $mybb->settings['portal_announcementsfid'] = explode(',', $mybb->settings['portal_announcementsfid']);
|
foreach($mybb->settings['portal_announcementsfid'] as $fid)
| if(is_array($mybb->settings['portal_announcementsfid']))
|
{
|
{
|
$fid_array[] = intval($fid);
| foreach($mybb->settings['portal_announcementsfid'] as $fid) { $fid_array[] = intval($fid); } $mybb->settings['portal_announcementsfid'] = implode(',', $fid_array);
|
}
|
}
|
$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)) { $forum[$forumrow['fid']] = $forumrow;
|
// And get them! $query = $db->simple_select(TABLE_PREFIX."forums", "*", "fid IN (".$mybb->settings['portal_announcementsfid'].")"); while($forumrow = $db->fetch_array($query)) { $forum[$forumrow['fid']] = $forumrow;
|
}
| }
|
$pids = ''; $comma=""; $query = $db->query("
| $pids = ''; $comma=""; $query = $db->query("
|
Zeile 344 | Zeile 391 |
---|
LIMIT 0, ".$mybb->settings['portal_numannouncements'] ); while($getid = $db->fetch_array($query))
|
LIMIT 0, ".$mybb->settings['portal_numannouncements'] ); while($getid = $db->fetch_array($query))
|
{
| {
|
$pids .= ",'$getid[pid]'"; $posts[$getid['tid']] = $getid; }
| $pids .= ",'$getid[pid]'"; $posts[$getid['tid']] = $getid; }
|
Zeile 352 | Zeile 399 |
---|
// Now lets fetch all of the attachments for these posts $query = $db->query("SELECT * FROM ".TABLE_PREFIX."attachments WHERE $pids"); while($attachment = $db->fetch_array($query))
|
// Now lets fetch all of the attachments for these posts $query = $db->query("SELECT * FROM ".TABLE_PREFIX."attachments WHERE $pids"); while($attachment = $db->fetch_array($query))
|
{
| {
|
$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");
|