Portal, eine tabelle nur für registrierte

Probleme bei der regulären Arbeiten mit phpBB, Fragen zu Vorgehensweisen oder Funktionsweise sowie sonstige Fragen zu phpBB im Allgemeinen.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.1, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Benutzeravatar
Bully
Mitglied
Beiträge: 74
Registriert: 24.04.2002 00:48
Kontaktdaten:

Portal, eine tabelle nur für registrierte

Beitrag von Bully »

<table width="100%" border="1" cellpadding="2" cellspacing="0" style="border-collapse: collapse" class="forumline">
.....
..... diverse andere tabellen-teile
.....
<tr>
<th class="catrow"><span class="thCornerL">{CALPEEK_TIMER}</span>
</th>
</tr>
<tr>
<td class="row3 align="left" valign="head" height="100%">
<!-- BEGIN calpeek -->
<span class="gen">{calpeek.DATE}:</span><a href="{calpeek.LINK}" class="gensmall">{calpeek.EVENT}</a><br>
<!-- END calpeek -->
</td></tr>

</table>
möchte diesen teil der tabelle nur für registrierte sichtbar machen.

wie muss ich das machen?
Gast

Beitrag von Gast »

muss irgendwie mit
<!-- BEGIN switch_user_logged_in -->
und
<!-- END switch_user_logged_in -->

zu tun haben, ich kriegs bloss net a die richtige stelle:((
Acid
Ehrenadmin
Beiträge: 12195
Registriert: 26.04.2001 02:00
Wohnort: Berlin

Beitrag von Acid »

..welchen Teil willst Du genau verstecken, wo hast Du es probiert und was funktioniert dann ned ?
Benutzeravatar
Bully
Mitglied
Beiträge: 74
Registriert: 24.04.2002 00:48
Kontaktdaten:

Beitrag von Bully »

den teil der anzeige:
<!-- BEGIN calpeek -->

<!-- BEGIN switch_user_logged_in -->

<span class="gen">{calpeek.DATE}:</span><a href="{calpeek.LINK}" class="gensmall">{calpeek.EVENT}</a><br>

<!-- END switch_user_logged_in -->

<!-- END calpeek -->

</td></tr
was funktioniert ist das ausblenden bei nichtregistrierten, aber die registrierten können leider auch nix sehen.
Benutzeravatar
saerdnaer
Ehemaliges Teammitglied
Beiträge: 4268
Registriert: 21.04.2001 02:00

Beitrag von saerdnaer »

das kennn nicht gehn... dieser switch_user_logged_in würde in ner php datei calpeek.switch_user_logged_in heißen... poste doch mal deine php datei...

ah
Benutzeravatar
Bully
Mitglied
Beiträge: 74
Registriert: 24.04.2002 00:48
Kontaktdaten:

Beitrag von Bully »

<?php
// Start standard
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
// End standard

// Start session management
$userdata = session_pagestart($user_ip, PAGE_PORTAL);
init_userprefs($userdata);
// End session management


//my_cal_peek
$cal_num = 14; // number of days to look ahead
$peeklen = 30; // subject character length
$datefirst = ''; // display the date in which order 'month' = Month/Day
// (Default: Day/Month)
include_once('./cal_settings.php');
$today = date("Y-m-d") . " 00:00:00";
$window = date("Y-m-d", mktime(0,0,0,date("m"),date("d")+$cal_num,date("Y")));
$sql = "SELECT * FROM ". $table_prefix . $tablename;
$sql .= " WHERE eventspan >= '$today' AND stamp <= '$window'";
$sql .= " ORDER BY eventspan";
$result = $db->sql_query($sql);
$result = mysql_db_query($dbname, $sql);
if ($result)
{
while ($row = mysql_fetch_array($result))
{
$row[stamp] = substr($row[stamp], 0, 10);
$evntdate = split("-", $row[stamp]);
if ($datefirst == 'month') { $shortdate = $evntdate[1] . "/" . $evntdate[2]; }
else { $shortdate = $evntdate[2] . "/" . $evntdate[1]; }
$link = "calendar.php?mode=display&day=".$evntdate[2];
$link .= "&month=".$evntdate[1]."&year=".$evntdate[0];
$link = ereg_replace("=0", "=", $link);
$curevnt = $row[subject];
if (strlen($curevnt) > ($peeklen+3))
{
$curevnt = substr($curevnt, 0, $peeklen) . "...";
}
else
{
$curevnt = $curevnt;
}
$template->assign_block_vars('calpeek', array(
'LINK' => $link,
'DATE' => $shortdate,
'EVENT' => $curevnt
)
);
} # end of while
}

//end of my_cal_peek


// Start Output page header
$page_title = $lang['Who_is_online'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

$template->set_filenames(array(
'body' => 'portal_body.tpl')
);
// End Output page header


###### start last_reg_users_#####
$sql = "SELECT user_id, username, user_regdate
FROM " . USERS_TABLE . "
WHERE user_id <> " . ANONYMOUS . "
ORDER BY user_regdate DESC
LIMIT 5";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/online forums information', '', __LINE__, __FILE__, $sql);
}

while ($row = $db->sql_fetchrow($result))
{
$user_id=$row['user_id'];
$template->assign_block_vars("last_registrations", array(
'USERNAME' => $row['username'],
'REG_DATE' => create_date($board_config['default_dateformat'], $row['user_regdate'], $board_config['board_timezone']),
'U_VIEWPROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id"))
);
}
##### end last_reg_users_#######


###### start last visits_#####
$sql = "SELECT user_id, username, user_lastvisit
FROM " . USERS_TABLE . "
WHERE user_id <> " . ANONYMOUS . "
ORDER BY user_lastvisit DESC
LIMIT 5";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/online forums information', '', __LINE__, __FILE__, $sql);
}

while ($row = $db->sql_fetchrow($result))
{
$user_id=$row['user_id'];
$template->assign_block_vars("last_visits", array(
'USERNAME' => $row['username'],
'LAST_VISIT_DATE' => create_date($board_config['default_dateformat'], $row['user_lastvisit'], $board_config['board_timezone']),
'U_VIEWPROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id"))
);
}
##### end last visits_#######


##### start ranks #####
$sql = "SELECT rank_title, rank_min
FROM " . RANKS_TABLE . "
WHERE rank_special !='1'
ORDER BY rank_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/online forums information', '', __LINE__, __FILE__, $sql);
}

while ($row = $db->sql_fetchrow($result))
{
$user_id=$row['user_id'];
$template->assign_block_vars("ranks", array(
'RANK_TITLE' => $row['rank_title'],
'RANK_MIN' => $row['rank_min'])
);
}
##### end ranks #####


###### start most posts_#####
$sql = "SELECT user_id, username, user_posts
FROM " . USERS_TABLE . "
WHERE user_id <> " . ANONYMOUS . "
ORDER BY user_posts DESC
LIMIT 5";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/online forums information', '', __LINE__, __FILE__, $sql);
}

while ($row = $db->sql_fetchrow($result))
{
$user_id=$row['user_id'];
$template->assign_block_vars("most_posts", array(
'USERNAME' => $row['username'],
'POSTS' => $row['user_posts'],
'U_VIEWPROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id"))
);
}
##### end most posts_#######


##### start beste topics #####
$sql = "SELECT topic_id,topic_title,topic_replies
FROM " . TOPICS_TABLE . " t
LEFT JOIN " . FORUMS_TABLE . " f
ON t.forum_id=f.forum_id
WHERE f.auth_view < 2
ORDER BY topic_replies DESC
LIMIT 5";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/online forums information', '', __LINE__, __FILE__, $sql);
}

while ($row = $db->sql_fetchrow($result))
{
$topic_id=$row['topic_id'];
$template->assign_block_vars("best_topics", array(
'TOPIC_TITLE' => $row['topic_title'],
'REPLIES' => $row['topic_replies'],
'VIEWTOPIC' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id"))
);
}
##### end best topics #####


##### start last_topics ##### (z123-428)
$template->assign_vars(array(
'FORUM_ID' => $forum_id,
'FORUM_NAME' => $forum_row['forum_name'],
'MODERATORS' => $forum_moderators,
'POST_IMG' => ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $images['post_locked'] : $images['post_new'],

'FOLDER_IMG' => $images['folder'],
'FOLDER_NEW_IMG' => $images['folder_new'],
'FOLDER_HOT_IMG' => $images['folder_hot'],
'FOLDER_HOT_NEW_IMG' => $images['folder_hot_new'],
'FOLDER_LOCKED_IMG' => $images['folder_locked'],
'FOLDER_LOCKED_NEW_IMG' => $images['folder_locked_new'],
'FOLDER_STICKY_IMG' => $images['folder_sticky'],
'FOLDER_STICKY_NEW_IMG' => $images['folder_sticky_new'],
'FOLDER_ANNOUNCE_IMG' => $images['folder_announce'],
'FOLDER_ANNOUNCE_NEW_IMG' => $images['folder_announce_new'],

'L_TOPICS' => $lang['Topics'],
'L_REPLIES' => $lang['Replies'],
'L_VIEWS' => $lang['Views'],
'L_POSTS' => $lang['Posts'],
'L_LASTPOST' => $lang['Last_Post'],
'L_MODERATOR' => $l_moderators,
'L_MARK_TOPICS_READ' => $lang['Mark_all_topics'],
'L_POST_NEW_TOPIC' => ( $forum_row['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['Post_new_topic'],
'L_NO_NEW_POSTS' => $lang['No_new_posts'],
'L_NEW_POSTS' => $lang['New_posts'],
'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'],
'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'],
//My_Cal_Peek
'CALPEEK' => $lang['calpeek'],
'CALPEEK_TIMER' => sprintf($lang['calpeektimer'],$cal_num),
'CALPEEK_BIRTHDAY_TIMER' => sprintf($lang['calpeekbirthtimer'],$cal_num),
//My_Cal_Peek
'L_NO_NEW_POSTS_HOT' => $lang['No_new_posts_hot'],
'L_NEW_POSTS_HOT' => $lang['New_posts_hot'],
'L_ANNOUNCEMENT' => $lang['Post_Announcement'],
'L_STICKY' => $lang['Post_Sticky'],
'L_POSTED' => $lang['Posted'],
'L_JOINED' => $lang['Joined'],
'L_AUTHOR' => $lang['Author'],

'S_AUTH_LIST' => $s_auth_can,

'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL ."=$forum_id"),

'U_MARK_READ' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&mark=topics"))
);

$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
LEFT JOIN " . FORUMS_TABLE . " f
ON t.forum_id=f.forum_id
WHERE t.topic_poster = u.user_id
AND p.post_id = t.topic_first_post_id
AND p2.post_id = t.topic_last_post_id
AND u2.user_id = p2.poster_id
AND f.auth_view < 2
ORDER BY t.topic_last_post_id DESC
LIMIT 10";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}

$total_topics = 0;
while( $row = $db->sql_fetchrow($result) )
{
$topic_rowset[] = $row;
$total_topics++;
}

$db->sql_freeresult($result);

//
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);

//
// Post URL generation for templating vars
//
$template->assign_vars(array(
'L_DISPLAY_TOPICS' => $lang['Display_topics'],

'U_POST_NEW_TOPIC' => append_sid("posting.$phpEx?mode=newtopic&" . POST_FORUM_URL . "=$forum_id"),

'S_SELECT_TOPIC_DAYS' => $select_topic_days,
'S_POST_DAYS_ACTION' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=" . $forum_id . "&start=$start"))
);

for($i = 0; $i < $total_topics; $i++)
{
$topic_id = $topic_rowset[$i]['topic_id'];

$topic_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_title']) : $topic_rowset[$i]['topic_title'];

$replies = $topic_rowset[$i]['topic_replies'];

$topic_type = $topic_rowset[$i]['topic_type'];

if( $topic_type == POST_ANNOUNCE )
{
$topic_type = $lang['Topic_Announcement'] . ' ';
}
else if( $topic_type == POST_STICKY )
{
$topic_type = $lang['Topic_Sticky'] . ' ';
}
else
{
$topic_type = '';
}

if( $topic_rowset[$i]['topic_vote'] )
{
$topic_type .= $lang['Topic_Poll'] . ' ';
}

if( $topic_rowset[$i]['topic_status'] == TOPIC_MOVED )
{
$topic_type = $lang['Topic_Moved'] . ' ';
$topic_id = $topic_rowset[$i]['topic_moved_id'];

$folder_image = $images['folder'];
$folder_alt = $lang['Topic_Moved'];
$newest_post_img = '';
}
else
{
if( $topic_rowset[$i]['topic_type'] == POST_ANNOUNCE )
{
$folder = $images['folder_announce'];
$folder_new = $images['folder_announce_new'];
}
else if( $topic_rowset[$i]['topic_type'] == POST_STICKY )
{
$folder = $images['folder_sticky'];
$folder_new = $images['folder_sticky_new'];
}
else if( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED )
{
$folder = $images['folder_locked'];
$folder_new = $images['folder_locked_new'];
}
else
{
if($replies >= $board_config['hot_threshold'])
{
$folder = $images['folder_hot'];
$folder_new = $images['folder_hot_new'];
}
else
{
$folder = $images['folder'];
$folder_new = $images['folder_new'];
}
}

$newest_post_img = '';
if( $userdata['session_logged_in'] )
{
if( $topic_rowset[$i]['post_time'] > $userdata['user_lastvisit'] )
{
if( !empty($tracking_topics) || !empty($tracking_forums) || isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
{
$unread_topics = true;

if( !empty($tracking_topics[$topic_id]) )
{
if( $tracking_topics[$topic_id] >= $topic_rowset[$i]['post_time'] )
{
$unread_topics = false;
}
}

if( !empty($tracking_forums[$forum_id]) )
{
if( $tracking_forums[$forum_id] >= $topic_rowset[$i]['post_time'] )
{
$unread_topics = false;
}
}

if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
{
if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] >= $topic_rowset[$i]['post_time'] )
{
$unread_topics = false;
}
}

if( $unread_topics )
{
$folder_image = $folder_new;
$folder_alt = $lang['New_posts'];

$newest_post_img = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=newest") . '"><img src="' . $images['icon_newest_reply'] . '" alt="' . $lang['View_newest_post'] . '" title="' . $lang['View_newest_post'] . '" border="0" /></a> ';
}
else
{
$folder_image = $folder;
$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];

$newest_post_img = '';
}
}
else
{
$folder_image = $folder_new;
$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];

$newest_post_img = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&view=newest") . '"><img src="' . $images['icon_newest_reply'] . '" alt="' . $lang['View_newest_post'] . '" title="' . $lang['View_newest_post'] . '" border="0" /></a> ';
}
}
else
{
$folder_image = $folder;
$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];

$newest_post_img = '';
}
}
else
{
$folder_image = $folder;
$folder_alt = ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'];

$newest_post_img = '';
}
}

if( ( $replies + 1 ) > $board_config['posts_per_page'] )
{
$total_pages = ceil( ( $replies + 1 ) / $board_config['posts_per_page'] );
$goto_page = ' [ <img src="' . $images['icon_gotopost'] . '" alt="' . $lang['Goto_page'] . '" title="' . $lang['Goto_page'] . '" />' . $lang['Goto_page'] . ': ';

$times = 1;
for($j = 0; $j < $replies + 1; $j += $board_config['posts_per_page'])
{
$goto_page .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&start=$j") . '">' . $times . '</a>';
if( $times == 1 && $total_pages > 4 )
{
$goto_page .= ' ... ';
$times = $total_pages - 3;
$j += ( $total_pages - 4 ) * $board_config['posts_per_page'];
}
else if ( $times < $total_pages )
{
$goto_page .= ', ';
}
$times++;
}
$goto_page .= ' ] ';
}
else
{
$goto_page = '';
}

$view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");

$topic_author = ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $topic_rowset[$i]['user_id']) . '">' : '';
$topic_author .= ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? $topic_rowset[$i]['username'] : ( ( $topic_rowset[$i]['post_username'] != '' ) ? $topic_rowset[$i]['post_username'] : $lang['Guest'] );

$topic_author .= ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? '</a>' : '';

$first_post_time = create_date($board_config['default_dateformat'], $topic_rowset[$i]['topic_time'], $board_config['board_timezone']);

$last_post_time = create_date($board_config['default_dateformat'], $topic_rowset[$i]['post_time'], $board_config['board_timezone']);

$last_post_author = ( $topic_rowset[$i]['id2'] == ANONYMOUS ) ? ( ($topic_rowset[$i]['post_username2'] != '' ) ? $topic_rowset[$i]['post_username2'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $topic_rowset[$i]['id2']) . '">' . $topic_rowset[$i]['user2'] . '</a>';

$last_post_url = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $topic_rowset[$i]['topic_last_post_id']) . '#' . $topic_rowset[$i]['topic_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" border="0" /></a>';

$views = $topic_rowset[$i]['topic_views'];

$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

$template->assign_block_vars('topicrow', array(
'ROW_COLOR' => $row_color,
'ROW_CLASS' => $row_class,
'FORUM_ID' => $forum_id,
'TOPIC_ID' => $topic_id,
'TOPIC_FOLDER_IMG' => $folder_image,
'TOPIC_AUTHOR' => $topic_author,
'GOTO_PAGE' => $goto_page,
'REPLIES' => $replies,
'NEWEST_POST_IMG' => $newest_post_img,
'TOPIC_TITLE' => $topic_title,
'TOPIC_TYPE' => $topic_type,
'VIEWS' => $views,
'FIRST_POST_TIME' => $first_post_time,
'LAST_POST_TIME' => $last_post_time,
'LAST_POST_AUTHOR' => $last_post_author,
'LAST_POST_IMG' => $last_post_url,

'L_TOPIC_FOLDER_ALT' => $folder_alt,

'U_VIEW_TOPIC' => $view_topic_url)
);
}

$template->assign_vars(array(
'PAGINATION' => generate_pagination("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&topicdays=$topic_days", $topics_count, $board_config['topics_per_page'], $start),
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $topics_count / $board_config['topics_per_page'] )),

'L_GOTO_PAGE' => $lang['Goto_page'])
);
##### end last topics #####


// Start Main Part and Footer
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
// End Main Part and Footer

?>
Zuletzt geändert von Bully am 04.12.2002 18:46, insgesamt 1-mal geändert.
Benutzeravatar
saerdnaer
Ehemaliges Teammitglied
Beiträge: 4268
Registriert: 21.04.2001 02:00

Beitrag von saerdnaer »

die php datei!!!

ah
Benutzeravatar
Bully
Mitglied
Beiträge: 74
Registriert: 24.04.2002 00:48
Kontaktdaten:

Beitrag von Bully »

sorry, habs geändert.
Benutzeravatar
saerdnaer
Ehemaliges Teammitglied
Beiträge: 4268
Registriert: 21.04.2001 02:00

Beitrag von saerdnaer »

suche:

Code: Alles auswählen

//my_cal_peek 
$cal_num = 14; // number of days to look ahead 
$peeklen = 30; // subject character length 
$datefirst = ''; // display the date in which order 'month' = Month/Day 
// (Default: Day/Month) 
include_once('./cal_settings.php'); 
$today = date("Y-m-d") . " 00:00:00"; 
$window = date("Y-m-d", mktime(0,0,0,date("m"),date("d")+$cal_num,date("Y"))); 
$sql = "SELECT * FROM ". $table_prefix . $tablename; 
$sql .= " WHERE eventspan >= '$today' AND stamp <= '$window'"; 
$sql .= " ORDER BY eventspan"; 
$result = $db->sql_query($sql); 
$result = mysql_db_query($dbname, $sql); 
if ($result) 
{ 
while ($row = mysql_fetch_array($result)) 
{ 
$row[stamp] = substr($row[stamp], 0, 10); 
$evntdate = split("-", $row[stamp]); 
if ($datefirst == 'month') { $shortdate = $evntdate[1] . "/" . $evntdate[2]; } 
else { $shortdate = $evntdate[2] . "/" . $evntdate[1]; } 
$link = "calendar.php?mode=display&day=".$evntdate[2]; 
$link .= "&month=".$evntdate[1]."&year=".$evntdate[0]; 
$link = ereg_replace("=0", "=", $link); 
$curevnt = $row[subject]; 
if (strlen($curevnt) > ($peeklen+3)) 
{ 
$curevnt = substr($curevnt, 0, $peeklen) . "..."; 
} 
else 
{ 
$curevnt = $curevnt; 
} 
$template->assign_block_vars('calpeek', array( 
'LINK' => $link, 
'DATE' => $shortdate, 
'EVENT' => $curevnt 
) 
); 
} # end of while 
} 

//end of my_cal_peek 
ersetzen durch

Code: Alles auswählen

if ( $userdata['session_logged_in'] )
{
$template->assign_block_vars('calendar', array());
//my_cal_peek 
$cal_num = 14; // number of days to look ahead 
$peeklen = 30; // subject character length 
$datefirst = ''; // display the date in which order 'month' = Month/Day 
// (Default: Day/Month) 
include_once('./cal_settings.php'); 
$today = date("Y-m-d") . " 00:00:00"; 
$window = date("Y-m-d", mktime(0,0,0,date("m"),date("d")+$cal_num,date("Y"))); 
$sql = "SELECT * FROM ". $table_prefix . $tablename; 
$sql .= " WHERE eventspan >= '$today' AND stamp <= '$window'"; 
$sql .= " ORDER BY eventspan"; 
$result = $db->sql_query($sql); 
$result = mysql_db_query($dbname, $sql); 
if ($result) 
{ 
while ($row = mysql_fetch_array($result)) 
{ 
$row[stamp] = substr($row[stamp], 0, 10); 
$evntdate = split("-", $row[stamp]); 
if ($datefirst == 'month') { $shortdate = $evntdate[1] . "/" . $evntdate[2]; } 
else { $shortdate = $evntdate[2] . "/" . $evntdate[1]; } 
$link = "calendar.php?mode=display&day=".$evntdate[2]; 
$link .= "&month=".$evntdate[1]."&year=".$evntdate[0]; 
$link = ereg_replace("=0", "=", $link); 
$curevnt = $row[subject]; 
if (strlen($curevnt) > ($peeklen+3)) 
{ 
$curevnt = substr($curevnt, 0, $peeklen) . "..."; 
} 
else 
{ 
$curevnt = $curevnt; 
} 
$template->assign_block_vars('calendar.calpeek', array( 
'LINK' => $link, 
'DATE' => $shortdate, 
'EVENT' => $curevnt 
) 
); 
} # end of while 
} 

//end of my_cal_peek 
}
und dann in der tpl datei <!-- BEGIN calendar --> und <!-- END calendar --> um den entsprechenden teil machen

ah
Benutzeravatar
Bully
Mitglied
Beiträge: 74
Registriert: 24.04.2002 00:48
Kontaktdaten:

Beitrag von Bully »

dank´schee :)
funktioniert fast richtig, nur:

die eingetragenen termine des TAGES werden immer noch für nichtregistrierte angezeigt.
die weiteren tage sind schön versteckt, bis man sich anmeldet.
Antworten

Zurück zu „phpBB 2.0: Administration, Benutzung und Betrieb“