Hilfe mit Blöcken und template
Verfasst: 14.06.2006 00:12
hallo leudde,
Bräuchte mal kompetente Hilfe:
Ich will auf meiner Index verschieden Blöcke nebeneinader darstellen, die beinhalten information aus mehreren mods.
Auzug aus' HTML Code:
ich musste hier:
auszug aus der index.php
Nun hab ich die suche hier beutz und einiges gefunden. Ich glaub mein Problem wird HIER
behandelt nur irgendwie versteh ich das nicht oder habs falsh eingebaut. kann aber auch sein das ich völlig falsch lieg.
kann mir da jmd. helfen ?
vielen Dank schonma
Bräuchte mal kompetente Hilfe:
Ich will auf meiner Index verschieden Blöcke nebeneinader darstellen, die beinhalten information aus mehreren mods.
Auzug aus' HTML Code:
jetzt kommen meine miesen kentnisse:<!-- mittelblock 2 start -->
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0" background="templates/aqua/images/aquatbm.gif">
<tr>
<td width="22" height="22" align="left"><img src="templates/aqua/images/aquatbl.gif" width="22" height="22"></td>
<td width="199" height="22" align="center"><span class="cattitle">Upcoming Events</span> </td>
<td width="79" height="22" align="right" ><img src="templates/aqua/images/aquatbr.gif" width="79" height="22"></td>
<td width="22" height="22"><img src="templates/aqua/images/aquatbl.gif" width="22" height="22"></td>
<td width="499" height="22" align="center"><span class="cattitle">Latest Topics </span></td>
<td width="79" height="22" align="right"><img src="templates/aqua/images/aquatbr.gif" width="79" height="22"></td>
</tr>
</table>
<table width="900" align="center" cellpadding="2" cellspacing="1" class="forumline">
<tr>
<!-- BEGIN toprow -->
<td width="300" colspan="3" rowspan="3"><span class="gensmall">{toprow.SPAN} {toprow.AUTHOR}<br /><b>{toprow.SUBJECT}</b></span></td>
<td width="240" colspan="1" rowspan="0" align="center" valign="top"><span class="gensmall"><a href="{toprow.TOPIC_URL}" target="_top" class="topictitle">{toprow.TOPIC}</a><br />
</span></td>
<td width="120" colspan="2" rowspan="0" align="left" valign="top" ><span class="gensmall">{toprow.POSTER_URL}</span></td>
<td width="120" colspan="2" rowspan="0" align="left" valign="top" ><span class="gensmall">{toprow.TOPIC_REPLIES}</span></td>
<td width="120" colspan="2" rowspan="0" align="left" valign="top" ><span class="gensmall">{toprow.POST_TIME}<br />{toprow.REPLIER_URL} <a href="{toprow.LAST_POST_URL}" target="_top"></a></span></td>
</tr>
<!-- END toprow -->
</table>
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0" background="templates/aqua/images/aquatbdm.gif">
<tr>
<td width="15%"><img src="templates/aqua/images/aquatbdl.gif"></td>
<td width="15%" align="right"><img src="templates/aqua/images/aquatbdr.gif"></td>
<td width="15%"><img src="templates/aqua/images/aquatbdl.gif"></td>
<td width="15%" align="right"> </td>
<td width="15%"> </td>
<td width="15%" align="right"><img src="templates/aqua/images/aquatbdr.gif"></td>
</table>
<!-- mittelblock 2 ende -->
ich musste hier:
die template ausgabe 2er mods zusammenlegen...<!-- BEGIN toprow -->
<td width="300" colspan="3" rowspan="3"><span class="gensmall">{toprow.SPAN} {toprow.AUTHOR}<br /><b>{toprow.SUBJECT}</b></span></td>
<td width="240" colspan="1" rowspan="0" align="center" valign="top"><span class="gensmall"><a href="{toprow.TOPIC_URL}" target="_top" class="topictitle">{toprow.TOPIC}</a><br />
</span></td>
<td width="120" colspan="2" rowspan="0" align="left" valign="top" ><span class="gensmall">{toprow.POSTER_URL}</span></td>
<td width="120" colspan="2" rowspan="0" align="left" valign="top" ><span class="gensmall">{toprow.TOPIC_REPLIES}</span></td>
<td width="120" colspan="2" rowspan="0" align="left" valign="top" ><span class="gensmall">{toprow.POST_TIME}<br />{toprow.REPLIER_URL} <a href="{toprow.LAST_POST_URL}" target="_top"></a></span></td>
</tr>
<!-- END toprow -->
auszug aus der index.php
hat aus so weit funktioniert nur werden dir inhalte der blocks mit abstände Angezeigt, dazu hab ich was mit den rowspan was gefummelt hat aber nicht wirklich linderung gebracht.................
.............
else
{
$l_total_user_s = $lang['Registered_users_total'];
}
//
// Events
//
include_once($phpbb_root_path . 'cal_lite_settings.php');
include_once($phpbb_root_path . 'cal_lite_functions.php');
$cal_config = array();
$sql = "SELECT * FROM ". CAL_CONFIG;
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't query calendar config table", "", __LINE__, __FILE__, $sql);
}
else
{
while( $row = $db->sql_fetchrow($result) )
{
$cal_config[$row['config_name']] = $row['config_value'];
}
}
if ($cal_config['number_events'] <> 0)
{
$day = create_date("d", time(), $userdata['user_timezone']);
$month = create_date("m", time(), $userdata['user_timezone']);
$year = create_date("Y", time(), $userdata['user_timezone']);
if ($cal_config['day_number'] == 0)
{
$sql_limit = ' LIMIT 0, ' . $cal_config['number_events'];
$event_span_date = '';
$sql_span = '';
}
else
{
$sql_limit = '';
$cal_days = $cal_config['number_events'];
$event_span_date = strtotime("$year-$month-$day 23:59:59 + $cal_days days");
$event_span_date = create_date("Y", $event_span_date, $userdata['user_timezone']).'-'.create_date("m", $event_span_date, $userdata['user_timezone']).'-'.create_date("j", $event_span_date, $userdata['user_timezone']).' 23:59:59';
$sql_span = " AND stamp <= '$event_span_date'";
}
$sql = "SELECT * FROM ".$table_prefix."calendar WHERE valid = 'yes'
AND eventspan >= '$year-$month-$day 00:00:00'
$sql_span
ORDER BY stamp" . $sql_limit;
$check = 0;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not select event data', '', __LINE__, __FILE__, $sql);
}
else
{
while ($row = $db->sql_fetchrow($result))
{
$check++;
$subject = stripslashes($row['subject']);
$start_date = substr($row['stamp'],8,2).".".substr($row['stamp'],5,2).".".substr($row['stamp'],0,4);
$end_date = substr($row['eventspan'],8,2).".".substr($row['eventspan'],5,2).".".substr($row['eventspan'],0,4);
if ( $start_date == $end_date )
{
$span = $start_date;
}
else
{
$span = $start_date . " - " . $end_date;
}
$subject = ( $userdata['session_logged_in'] ) ? '<a href="'. append_sid('calendar.'.$phpEx.'?id='. $row['id'] .'&mode=display&cl_d='. substr($row['stamp'],8,2). '&cl_m='.substr($row['stamp'],5,2).'&cl_y='.substr($row['stamp'],0,4)).'">'. $subject .'</a>' : $subject;
$author = ( $userdata['session_logged_in'] ) ? '<a href="'. append_sid('profile.'.$phpEx.'?mode=viewprofile&'. POST_USERS_URL .'='. $row['user_id']) .'">('. stripslashes($row['username']) .')</a>' : '('. stripslashes($row['username']) .')';
$template->assign_block_vars('toprow', array(
'SUBJECT' => $subject,
'SPAN' => $span,
'AUTHOR' => $author));
}
if ( $check == 0 )
{
$template->assign_block_vars('toprow', array(
'SUBJECT' => $lang["No_events"]));
}
}
}
if ($cal_config['number_events'] <> 0 && $cal_config['view_new_events'] == 1)
{
$template->assign_block_vars('toprow', array(
'EVENTS' => '<a href="'. $phpbb_root_path .'calendar.'.$phpEx.'?mode=View_New">'. $lang["Events"] .'</a>'));
}
else if ($cal_config['number_events'] <> 0)
{
$template->assign_block_vars('toprow', array(
'EVENTS' => $lang['Events']));
}
..........
.........
.............
..............
...............
.............
//
// Option of Toplist Start
//
// Topics text length
$MAX_STR_LEN = 60;
// Topics to display (Default: 5)
$MAX_TOPICS = 5;
// 0 => users can see all topics including authorized issue(but they cant read the posts)
// 1 => users can see only authorized topics
$AUTH_SECRUITY = 1;
// Order by
// topic_last_post_id (Default)
// topic_replies
// topic_views
$sortby="topic_last_post_id";
//
// Option of Toplist End
//
function cutStr($str) {
global $MAX_STR_LEN;
$str = (strlen($str) > $MAX_STR_LEN) ? (substr($str, 0, $MAX_STR_LEN - 1) . "...") : $str;
return $str;
}
// Find which forums are visible for this user
$is_auth_ary_top5 = array();
$is_auth_ary_top5 = auth(AUTH_READ, AUTH_LIST_ALL, $userdata);
$auth_forum_ary_top5 = array();
// Get forum info
$sql = "SELECT forum_id FROM " . FORUMS_TABLE;
if( !$q_forums = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Toplist ERROR: Fetch forum info fail', __LINE__, __FILE__, $sql);
}
// Authorized forums info
while( $forum_row = $db->sql_fetchrow($q_forums) )
{
$forum_id1 = $forum_row['forum_id'];
if( $is_auth_ary_top5[$forum_id1]['auth_read'] == 1)
{
if(function_exists("array_push"))
{
array_push($auth_forum_ary_top5, $forum_id1);
} else {
$auth_id=count($auth_forum_ary_top5);
$auth_forum_ary_top5[$auth_id]=$forum_id1;
}
}
}
if( sizeOf($auth_forum_ary_top5) == 0 || !$AUTH_SECRUITY )
{
$auth_forums_top5 = "";
}
else
{
$auth_forums_top5 = 'AND f.forum_id IN(';
if(sizeOf($auth_forum_ary_top5) > 1)
{
$auth_forums_top5 .= implode (',', $auth_forum_ary_top5);
}
else
{
$auth_forums_top5 .= $auth_forum_ary_top5[0];
}
$auth_forums_top5 .= ')';
}
// query
$sql = "SELECT topic_id, topic_title, topic_poster, topic_views, topic_replies, topic_last_post_id, f.forum_id, forum_name
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f
WHERE t.forum_id = f.forum_id
AND topic_moved_id = '0'
$auth_forums_top5
ORDER BY $sortby DESC LIMIT 0, $MAX_TOPICS";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Toplist ERROR: Fetch topic info fail', __LINE__, __FILE__, $sql);
}
// fetch rows
while( $rows = $db->sql_fetchrow($result) )
{
$topic_url = append_sid("viewtopic.$phpEx?t=" . $rows['topic_id']);
$forum_url = append_sid("viewforum.$phpEx?f=" . $rows['forum_id']);
$topic_poster = $rows['topic_poster'];
$topic_last_post_id = $rows['topic_last_post_id'];
// Grab topic poster and last replier data
$sql = "SELECT post_username, user_id, username
FROM " . POSTS_TABLE . ", " . USERS_TABLE . "
WHERE topic_id = '" . $rows['topic_id'] . "'
AND poster_id = user_id
ORDER BY post_id LIMIT 0, 1";
if( !$p_result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Toplist ERROR: Fetch topic poster fail', __LINE__, __FILE__, $sql);
}
$p_row = $db->sql_fetchrow($p_result);
$poster_name = ( $topic_poster != ANONYMOUS ) ? $p_row['username'] : ( !$p_row['post_username'] ? $lang['Guest'] : $p_row['post_username']);
$poster_url = ( $topic_poster != ANONYMOUS && !$p_row['post_username'] ) ? ('<a href="' . append_sid("profile.$phpEx?mode=viewprofile&u=$topic_poster") . '" target="_top">' . "$poster_name</a>") : $poster_name;
$sql = "SELECT post_username, user_id, username, post_time
FROM " . POSTS_TABLE . ", " . USERS_TABLE . "
WHERE post_id = '$topic_last_post_id'
AND poster_id = user_id";
if( !$r_result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Toplist ERROR: Fetch topic last replier fail', __LINE__, __FILE__, $sql);
}
$r_row = $db->sql_fetchrow($r_result);
$replier_id = $r_row['user_id'];
$replier_name = ( $replier_id != ANONYMOUS ) ? $r_row['username'] : ( !$r_row['post_username'] ? $lang['Guest'] : $r_row['post_username']);
$replier_url = ( $replier_id != ANONYMOUS && !$r_row['post_username'] ) ? ('<a href="' . append_sid("profile.$phpEx?mode=viewprofile&u=$replier_id") . '" target="_top">' . "$replier_name</a>") : $replier_name;
$last_post_url = append_sid("viewtopic.$phpEx?p=$topic_last_post_id#$topic_last_post_id");
$template->assign_block_vars("toprow", array(
'FORUM_NAME' => $rows['forum_name'],
'FORUM_URL' => $forum_url,
'TOPIC' => cutStr($rows['topic_title']),
'TOPIC_URL' => $topic_url,
'TOPIC_VIEWS' => $rows['topic_views'],
'TOPIC_REPLIES' => $rows['topic_replies'],
'POST_TIME' => create_date($board_config['default_dateformat'], $r_row['post_time'], $board_config['board_timezone']),
'POSTER_URL' => $poster_url,
'REPLIER_URL' => $replier_url,
'LAST_POST_URL' => $last_post_url
));
}
// MOD END
//
// Integrated Toplist 1.0.3 by bu Based on OOHOO's ADV-TOP5 (20050119)
//
//
// Start output of page
//
..........
....
..
Nun hab ich die suche hier beutz und einiges gefunden. Ich glaub mein Problem wird HIER
behandelt nur irgendwie versteh ich das nicht oder habs falsh eingebaut. kann aber auch sein das ich völlig falsch lieg.
kann mir da jmd. helfen ?
vielen Dank schonma