Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: portal.php 5147 2010-07-30 23:18:16Z RyanGordon $
| * $Id: portal.php 5821 2012-05-02 15:40:38Z Tomm $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 60 | Zeile 60 |
---|
if(!username_exists($mybb->input['username'])) {
|
if(!username_exists($mybb->input['username'])) {
|
error($lang->error_invalidpworusername.$login_text);
| switch($mybb->settings['username_method']) { case 0: error($lang->error_invalidpworusername.$login_text); break; case 1: error($lang->error_invalidpworusername1.$login_text); break; case 2: error($lang->error_invalidpworusername2.$login_text); break; default: error($lang->error_invalidpworusername.$login_text); break; }
|
} $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 87 | Zeile 101 |
---|
my_setcookie("sid", $session->sid, -1, true);
if(function_exists("loggedIn"))
|
my_setcookie("sid", $session->sid, -1, true);
if(function_exists("loggedIn"))
|
{
| {
|
loggedIn($user['uid']); }
|
loggedIn($user['uid']); }
|
|
|
$plugins->run_hooks("portal_do_login_end");
|
$plugins->run_hooks("portal_do_login_end");
|
|
|
redirect("portal.php", $lang->redirect_loggedin);
|
redirect("portal.php", $lang->redirect_loggedin);
|
}
| }
|
$plugins->run_hooks("portal_start");
| $plugins->run_hooks("portal_start");
|
Zeile 130 | Zeile 144 |
---|
$announcementsfids = implode(',', $fid_array); $query = $db->simple_select("threads", "COUNT(tid) AS newann", "visible=1 AND dateline>'".$mybb->user['lastvisit']."' AND fid IN (".$announcementsfids.") $unviewwhere"); $newann = $db->fetch_field($query, "newann");
|
$announcementsfids = implode(',', $fid_array); $query = $db->simple_select("threads", "COUNT(tid) AS newann", "visible=1 AND dateline>'".$mybb->user['lastvisit']."' AND fid IN (".$announcementsfids.") $unviewwhere"); $newann = $db->fetch_field($query, "newann");
|
}
| }
|
if(!$newthreads) {
| if(!$newthreads) {
|
Zeile 141 | Zeile 155 |
---|
{ $newann = 0; }
|
{ $newann = 0; }
|
} else {
| } else {
|
$newposts = 0; $newthreads = 0; $newann = 0;
| $newposts = 0; $newthreads = 0; $newann = 0;
|
Zeile 153 | Zeile 167 |
---|
if($newann == 1) { $lang->new_announcements = $lang->new_announcement;
|
if($newann == 1) { $lang->new_announcements = $lang->new_announcement;
|
} else {
| } else {
|
$lang->new_announcements = $lang->sprintf($lang->new_announcements, $newann); } if($newthreads == 1) { $lang->new_threads = $lang->new_thread;
|
$lang->new_announcements = $lang->sprintf($lang->new_announcements, $newann); } if($newthreads == 1) { $lang->new_threads = $lang->new_thread;
|
} else
| } else
|
{ $lang->new_threads = $lang->sprintf($lang->new_threads, $newthreads); }
| { $lang->new_threads = $lang->sprintf($lang->new_threads, $newthreads); }
|
Zeile 181 | Zeile 195 |
---|
{ $lang->guest_welcome_registration = $lang->sprintf($lang->guest_welcome_registration, $mybb->settings['bburl'] . '/member.php?action=register'); $mybb->user['username'] = $lang->guest;
|
{ $lang->guest_welcome_registration = $lang->sprintf($lang->guest_welcome_registration, $mybb->settings['bburl'] . '/member.php?action=register'); $mybb->user['username'] = $lang->guest;
|
| switch($mybb->settings['username_method']) { case 0: $username = $lang->username; break; case 1: $username = $lang->username1; break; case 2: $username = $lang->username2; break; default: $username = $lang->username; break; }
|
eval("\$welcometext = \"".$templates->get("portal_welcome_guesttext")."\";"); } $lang->welcome = $lang->sprintf($lang->welcome, $mybb->user['username']);
| eval("\$welcometext = \"".$templates->get("portal_welcome_guesttext")."\";"); } $lang->welcome = $lang->sprintf($lang->welcome, $mybb->user['username']);
|
Zeile 337 | Zeile 366 |
---|
$recordtime = my_date($mybb->settings['timeformat'], $mostonline['time']);
if($onlinecount == 1)
|
$recordtime = my_date($mybb->settings['timeformat'], $mostonline['time']);
if($onlinecount == 1)
|
{
| {
|
$lang->online_users = $lang->online_user; } else
| $lang->online_users = $lang->online_user; } else
|
Zeile 363 | Zeile 392 |
---|
); while($thread = $db->fetch_array($query)) {
|
); while($thread = $db->fetch_array($query)) {
|
| $forumpermissions[$thread['fid']] = forum_permissions($thread['fid']);
// Make sure we can view this thread if($forumpermissions[$thread['fid']]['canview'] == 0 || $forumpermissions[$thread['fid']]['canviewthreads'] == 0 || $forumpermissions[$thread['fid']]['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid']) { continue; }
|
$lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']); $lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']); // Don't link to guest's profiles (they have no profile). if($thread['lastposteruid'] == 0) { $lastposterlink = $thread['lastposter'];
|
$lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']); $lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']); // Don't link to guest's profiles (they have no profile). if($thread['lastposteruid'] == 0) { $lastposterlink = $thread['lastposter'];
|
}
| }
|
else { $lastposterlink = build_profile_link($thread['lastposter'], $thread['lastposteruid']);
| else { $lastposterlink = build_profile_link($thread['lastposter'], $thread['lastposteruid']);
|
Zeile 380 | Zeile 417 |
---|
} $thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject'])); $thread['threadlink'] = get_thread_link($thread['tid']);
|
} $thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subject'])); $thread['threadlink'] = get_thread_link($thread['tid']);
|
| $thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");
|
eval("\$threadlist .= \"".$templates->get("portal_latestthreads_thread")."\";"); $altbg = alt_trow(); }
| eval("\$threadlist .= \"".$templates->get("portal_latestthreads_thread")."\";"); $altbg = alt_trow(); }
|
Zeile 402 | Zeile 440 |
---|
$announcementsfids = implode(',', $fid_array); } // And get them!
|
$announcementsfids = implode(',', $fid_array); } // And get them!
|
$query = $db->simple_select("forums", "*", "fid IN (".$announcementsfids.")"); while($forumrow = $db->fetch_array($query))
| foreach($forum_cache as $fid => $f) { if(is_array($fid_array) && in_array($fid, $fid_array)) { $forum[$fid] = $f; } }
$numannouncements = intval($mybb->settings['portal_numannouncements']); if(!$numannouncements)
|
{
|
{
|
$forum[$forumrow['fid']] = $forumrow;
| $numannouncements = 10; // Default back to 10
|
}
$pids = '';
| }
$pids = '';
|
Zeile 417 | Zeile 463 |
---|
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE t.fid IN (".$announcementsfids.") AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND t.firstpost=p.pid ORDER BY t.dateline DESC
|
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) WHERE t.fid IN (".$announcementsfids.") AND t.visible='1' AND t.closed NOT LIKE 'moved|%' AND t.firstpost=p.pid ORDER BY t.dateline DESC
|
LIMIT 0, ".$mybb->settings['portal_numannouncements']
| LIMIT 0, {$numannouncements}"
|
); while($getid = $db->fetch_array($query)) {
| ); while($getid = $db->fetch_array($query)) {
|
Zeile 450 | Zeile 496 |
---|
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid) WHERE t.fid IN (".$announcementsfids.") AND t.tid IN (0{$tids}) AND t.visible='1' AND t.closed NOT LIKE 'moved|%' ORDER BY t.dateline DESC
|
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid) WHERE t.fid IN (".$announcementsfids.") AND t.tid IN (0{$tids}) AND t.visible='1' AND t.closed NOT LIKE 'moved|%' ORDER BY t.dateline DESC
|
LIMIT 0, ".$mybb->settings['portal_numannouncements']
| LIMIT 0, {$numannouncements}"
|
); while($announcement = $db->fetch_array($query)) {
|
); while($announcement = $db->fetch_array($query)) {
|
| // Make sure we can view this announcement if($forumpermissions[$announcement['fid']]['canview'] == 0 || $forumpermissions[$announcement['fid']]['canviewthreads'] == 0 || $forumpermissions[$announcement['fid']]['canonlyviewownthreads'] == 1 && $announcement['uid'] != $mybb->user['uid']) { continue; }
|
$announcement['message'] = $posts[$announcement['tid']]['message']; $announcement['pid'] = $posts[$announcement['tid']]['pid']; $announcement['smilieoff'] = $posts[$announcement['tid']]['smilieoff'];
| $announcement['message'] = $posts[$announcement['tid']]['message']; $announcement['pid'] = $posts[$announcement['tid']]['pid']; $announcement['smilieoff'] = $posts[$announcement['tid']]['smilieoff'];
|
Zeile 618 | Zeile 670 |
---|
eval("\$portal = \"".$templates->get("portal")."\";"); output_page($portal);
|
eval("\$portal = \"".$templates->get("portal")."\";"); output_page($portal);
|
| |
?>
| ?>
|