Seite 2 von 3
Verfasst: 10.04.2003 16:27
von Schumi
Bei mir hat sich nix geändert
Wenn man eingeloggt ist funktioniert das ganze
Andersrum, wenn man ausgeloggt ist, geht es.
Verfasst: 10.04.2003 16:42
von AWSW
Hallo,
es bringt bei mir auch immer noch diese Meldungen

Verfasst: 10.04.2003 17:33
von Chaze
Versucht es mal mit dieser summary.php:
Code: Alles auswählen
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
$page_title = "Forum Summary";
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'summary_body.tpl')
);
if ( $userdata['session_logged_in'] )
{
$sql = "SELECT t.forum_id, t.topic_id, p.post_time
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE p.post_id = t.topic_last_post_id
AND p.post_time > " . $userdata['user_lastvisit'] . "
AND t.topic_moved_id = 0";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query new topic information', '', __LINE__, __FILE__, $sql);
}
while( $topic_data = $db->sql_fetchrow($result) )
{
if ( $topic_data[post_time] > $userdata['user_lastvisit'] )
{
$neueT_FID[] = $topic_data[forum_id];
}
}
$neueT_FID[] = " ";
}
else
{
$neueT_FID[] = " ";
}
$sql = "SELECT forum_id, forum_desc, forum_name, auth_view FROM " . FORUMS_TABLE . " WHERE auth_view = '0'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user information', '', __LINE__, __FILE__, $sql);
}
while($row = $db->sql_fetchrow($results))
{
$forum_id = $row[forum_id];
$forum_name = $row[forum_name];
$fdesc = $row[forum_desc];
$auth = $row[auth_view];
if(in_array($forum_id,$neueT_FID))
{
$f_image = $images['folder_new'];
}
if(!in_array($forum_id,$neueT_FID))
{
$f_image = $images['folder'];
}
$template->assign_block_vars("summary_body", array(
'F_ID' => $forum_id,
'F_NAME' => $forum_name,
'F_DESC' => $fdesc,
'NEWT' => $f_image )
);
}
$lforum = $lang['Forum'];
$title = $lang['Forum_Index'];
$template->assign_vars(array(
'TITLE' => str_replace ("%s ", "", $lang['Forum_Index']),
'L_FORUM' => $lang['Forum'],
'L_DESC' => $lang['Group_description'])
);
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
Verfasst: 10.04.2003 20:31
von Schumi
Jetzt geht's, danke

Verfasst: 10.04.2003 20:47
von AWSW
Hallo,
sieht schon mal sehr schön aus
[ externes Bild ]
Könnte man noch die Userlevel abhängigen Foren mit anzeigen lassen, so dass der Admin wie oben erklärt alle Foren sieht... ?
Verfasst: 10.04.2003 23:19
von AWSW
Hallo,
habe noch selber was herausgefunden, um die Berechtigungsdarstellung zu ermöglichen... Scheint zu klappen:
Code: Alles auswählen
if ( $userdata['user_level'] == ADMIN )
{
$sql = "SELECT forum_id, forum_desc, forum_name, auth_view FROM " . FORUMS_TABLE . " WHERE auth_view = '0' || auth_view = '2' || auth_view = '3' order by forum_name";
}
else if ( $userdata['user_level'] == MOD )
{
$sql = "SELECT forum_id, forum_desc, forum_name, auth_view FROM " . FORUMS_TABLE . " WHERE auth_view = '0' || auth_view = '2' order by forum_name";
}
else
{
$sql = "SELECT forum_id, forum_desc, forum_name, auth_view FROM " . FORUMS_TABLE . " WHERE auth_view = '0' order by forum_name";
}
Die Berechtigungsnummern sind glaube ich aber noch nicht vollständig...
Somit ergibt sich folgende Darstellung:
User = ADMIN:
[ externes Bild ]
User = MOD:
[ externes Bild ]
User = Gast:
[ externes Bild ]
Verfasst: 11.04.2003 09:50
von Chaze
Fassen Wir noch mal zusammen. So sollten alle Berechtigungen berücksichtigt werden und der Link zurück zum Index ist jetzt auch mit drin.
summary.php:
Code: Alles auswählen
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
$page_title = "Forum Summary";
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
'body' => 'summary_body.tpl')
);
if ( $userdata['session_logged_in'] )
{
$sql = "SELECT t.forum_id, t.topic_id, p.post_time
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE p.post_id = t.topic_last_post_id
AND p.post_time > " . $userdata['user_lastvisit'] . "
AND t.topic_moved_id = 0";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query new topic information', '', __LINE__, __FILE__, $sql);
}
while( $topic_data = $db->sql_fetchrow($result) )
{
if ( $topic_data[post_time] > $userdata['user_lastvisit'] )
{
$neueT_FID[] = $topic_data[forum_id];
}
}
$neueT_FID[] = " ";
}
else
{
$neueT_FID[] = " ";
}
if ( $userdata['user_level'] == ADMIN )
{
$sql = "SELECT forum_id, forum_desc, forum_name, auth_view FROM " . FORUMS_TABLE . " order by forum_name";
}
elseif ( $userdata['user_level'] == JUNIOR_ADMIN )
{
$sql = "SELECT forum_id, forum_desc, forum_name, auth_view FROM " . FORUMS_TABLE . " order by forum_name";
}
elseif ( $userdata['user_level'] == MOD )
{
$sql = "SELECT forum_id, forum_desc, forum_name, auth_view FROM " . FORUMS_TABLE . " WHERE auth_view < '4' order by forum_name";
}
else
{
$sql = "SELECT forum_id, forum_desc, forum_name, auth_view FROM " . FORUMS_TABLE . " WHERE auth_view = '0' order by forum_name";
}
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user information', '', __LINE__, __FILE__, $sql);
}
while($row = $db->sql_fetchrow($results))
{
$forum_id = $row[forum_id];
$forum_name = $row[forum_name];
$fdesc = $row[forum_desc];
$auth = $row[auth_view];
if(in_array($forum_id,$neueT_FID))
{
$f_image = $images['folder_new'];
}
if(!in_array($forum_id,$neueT_FID))
{
$f_image = $images['folder'];
}
$template->assign_block_vars("summary_body", array(
'F_ID' => $forum_id,
'F_NAME' => $forum_name,
'F_DESC' => $fdesc,
'NEWT' => $f_image )
);
}
$lforum = $lang['Forum'];
$title = $lang['Forum_Index'];
$template->assign_vars(array(
'TITLE' => str_replace ("%s ", "", $lang['Forum_Index']),
'L_FORUM' => $lang['Forum'],
'L_DESC' => $lang['Group_description'],)
);
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
summary_body.tpl:
Code: Alles auswählen
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
<td align="left" class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a></td>
</tr>
</table>
<br /> <br />
<table width="70%" cellpadding="6" cellspacing="1" border="0" align="center" class="forumline">
<tr>
<th class="thHead" colspan="6"><font size="4"><b>{TITLE}</b></font></th>
</tr>
<tr>
<td class="row1" align="center"><b> </b></td>
<td class="row1" align="center"><b>{L_FORUM} </b></td>
<td class="row1" align="center"><b>{L_DESC}</b></td>
</tr>
<tr>
<td class="row2" align="center"> </td>
<td class="row2" align="center"> </td>
<td class="row2" align="center"> </td>
</tr>
<!-- BEGIN summary_body -->
<tr>
<td class="row2" align="left"><img src="{summary_body.NEWT}"></td>
<td class="row2" align="left"><font size="2"><a href="viewforum.php?f={summary_body.F_ID}">{summary_body.F_NAME}</a></font><br></td>
<td class="row2" align="left"><font size="1">{summary_body.F_DESC}</font></td>
</tr>
<!-- END summary_body -->
</table>
<br><br>
Verfasst: 11.04.2003 16:15
von AWSW
Hi Chaze,
Danke - wird gleich probiert

Verfasst: 11.04.2003 17:07
von AWSW
Hallo Chaze,
klappt offenbar 1a
Vielen Dank für Deine Mühe !!!
THX & Schönes WE - AWSW
Verfasst: 11.04.2003 17:18
von Chaze
Gern geschehen!
BTW: Warst Du nicht auch an einem Mod interessiert, der User die ihren Account noch nicht aktiviert haben bzw. Zero-Poster per Mail anschreibt.
Ich hab das mal umgesetzt:
http://www.pro-art-service.de/phpbb/adm ... _final.zip