Seite 1 von 1
Recent.php - Schrift anpassen?
Verfasst: 18.09.2005 22:57
von Join7
Hallo
wie ihr hier
http://www.join7.de/index.php sehen könnt hab ich die recent.php installiert und alles läuft soweit ganz gut. jedoch möchte ich die schrift des datums und des nicknames genauso klein haben wie die des themas und ich möchte dazwischen natürlich auch eine leerzeile bekommen, weiß aber nicht wie. Zusätzlich eventuell noch eine Fettschrift.
Code: Alles auswählen
// ############## output ##############
echo '<tr>
<td valign="top" nowrap="nowrap">'. $last_time .''. $last_author .'<a href="'. $topic_url .'">'. $topic_title .'</a></td>
</tr>
<tr>
';
// ############## output ##############
So sieht das immo als Code aus.
Vielen dank für eure hilfe!
Verfasst: 19.09.2005 00:45
von Join7
ich gebe mal die ganze recent.php preis, vielleicht hilft das ja weiter. Man sieht dass ich zwar die Schrift die verlinkt ist anpassen konnte, aber wie passe ich den Rest, also das Datum und den Nickname an? Hilfe! *g
Code: Alles auswählen
<style type="text/css">
<!--
a:link {
text-decoration: bold;
color: #A30000;font-family:Verdana;
font-size:8pt
}
a:active {
text-decoration: bold;
color: #A30000;font-family:Verdana;
font-size:8pt
}
a:visited {
text-decoration: bold;
color: #A30000;font-family:Verdana;
font-size:8pt
}
a:hover {
text-decoration: bold,underline;
color: #A30000;
font-family:Verdana;
font-size:8pt
}
input, select, textarea, output {
border:1px solid #000000;
font-family:Verdana;
font-size:8pt
}
-->
</style> <?php
// ############ Edit below ########################################
$topic_length = '30'; // length of topic title
$topic_limit = '10'; // limit of displayed topics
$special_forums = '0'; // specify forums ('0' = no; '1' = yes)
$forum_ids = ''; // IDs of forums; separate them with a comma
$config_path = '/sieben/'; // path to config.php
$root_path = '/sieben/'; // link path
// ############ Edit above ########################################
$path = dirname(__FILE__);
include_once($path.$config_path .'config.php');
mysql_connect($dbhost, $dbuser, $dbpasswd) OR die('Unable to select server.');
mysql_select_db($dbname) OR die('Unable to select database.');
// ############## output ##############
echo '<table width="100%" cellpadding="1" cellspacing="1" border="0" align="center">
<tr>
<th colspan="2"></th>
</tr>';
// ############## output ##############
$where_forums = ( $special_forums == '0' ) ? '' : 't.forum_id IN ('. $forum_ids .') AND ';
$sql = "SELECT t.*, f.forum_id, f.forum_name, u.username AS first_poster, u.user_id AS first_poster_id, u2.username AS last_poster, u2.user_id AS last_poster_id, p.post_username AS first_poster_name, p2.post_username AS last_poster_name, p2.post_time
FROM ". $table_prefix ."topics t, ". $table_prefix ."forums f, ". $table_prefix ."users u, ". $table_prefix ."posts p, ". $table_prefix ."posts p2, ". $table_prefix ."users u2
WHERE $where_forums t.topic_poster = u.user_id AND f.forum_id = t.forum_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
ORDER BY t.topic_last_post_id DESC LIMIT $topic_limit";
$result = mysql_query($sql);
if( !$result )
{
die('SQL Statement Error: '. mysql_error());
exit();
}
$line = array();
while( $row = mysql_fetch_array($result) )
{
$line[] = $row;
}
for( $i = 0; $i < count($line); $i++ )
{
$forum_id = $line[$i]['forum_id'];
$forum_url = $root_path .'viewforum.php?f='. $forum_id;
$topic_id = $line[$i]['topic_id'];
$topic_url = $root_path .'viewtopic.php?t='. $topic_id;
$topic_title = ( strlen($line[$i]['topic_title']) < $topic_length ) ? $line[$i]['topic_title'] : substr(stripslashes($line[$i]['topic_title']), 0, $topic_length) .'...';
$topic_type = ( $line[$i]['topic_type'] == '2' ) ? 'Announcement ': '';
$topic_type .= ( $line[$i]['topic_type'] == '3' ) ? 'Global Announcement ': '';
$topic_type .= ( $line[$i]['topic_type'] == '1' ) ? 'Sticky ': '';
$topic_type .= ( $line[$i]['topic_vote'] ) ? 'Poll ': '';
$views = $line[$i]['topic_views'];
$replies = $line[$i]['topic_replies'];
$first_time = date('d.m.Y', $line[$i]['topic_time']);
$first_author = ( $line[$i]['first_poster_id'] != '-1' ) ? '<a href="'. $root_path .'profile.php?mode=viewprofile&u='. $line[$i]['first_poster_id'] .'">'. $line[$i]['first_poster'] .'</a>' : ( ($line[$i]['first_poster_name'] != '' ) ? $line[$i]['first_poster_name'] : 'guest' );
$last_time = date('d.m.Y', $line[$i]['post_time']);
$last_author = ( $line[$i]['last_poster_id'] != '-1' ) ? $line[$i]['last_poster'] : ( ($line[$i]['last_poster_name'] != '' ) ? $line[$i]['last_poster_name'] : 'guest' );
$last_url = '<a href="'. $root_path .'viewtopic.php?p='. $line[$i]['topic_last_post_id'] .'#'. $line[$i]['topic_last_post_id'] .'">'. $last_author .'</a>';
// ############## output ##############
echo '<tr>
<td valign="top" cellpadding="1" cellspacing="1" nowrap="nowrap">'. $last_time .''. $last_author .'<a href="'. $topic_url .'">'. $topic_title .'</a></td>
</tr>
<tr>
';
// ############## output ##############
}
echo '</table>';
mysql_close();
?>
Verfasst: 19.09.2005 09:38
von Markus67
Hi ...
füge folgendes im Styleabschnitt ein:
Code: Alles auswählen
.recent { font-size : 8pt; color : #000000;}
a.recent { color: #006699; text-decoration: none; }
a.recent:hover { color: #DD6900; text-decoration: underline; }
Die Formatierungen musst du entsprechend anpassen.
suche
Code: Alles auswählen
<td valign="top" cellpadding="1" cellspacing="1" nowrap="nowrap">'. $last_time .''. $last_author .'<a href="'. $topic_url .'">'. $topic_title .'</a></td>
ersetze mit:
Code: Alles auswählen
<td class="recent" valign="top" cellpadding="1" cellspacing="1" nowrap="nowrap">'. $last_time .''. $last_author .'<a href="'. $topic_url .'">'. $topic_title .'</a></td>
Markus
Verfasst: 19.09.2005 13:55
von Join7
Hey super danke! Das hat soweit geklappt.
Jetzt hätte ich gerne nur noch ein paar Leerzeilen jeweils zwischen Datum, Nickname und Topic-Url. Das wäre super wenn das noch klappt.
Verfasst: 19.09.2005 14:04
von AceVentura
Code: Alles auswählen
<td class="recent" valign="top" cellpadding="1" cellspacing="1" nowrap="nowrap">'. $last_time .' '. $last_author .' <a href="'. $topic_url .'">'. $topic_title .'</a></td>
Verfasst: 19.09.2005 14:04
von Markus67
Hi ...
Code: Alles auswählen
<td class="recent" valign="top" cellpadding="1" cellspacing="1" nowrap="nowrap">'. $last_time .' '. $last_author .' <a href="'. $topic_url .'">'. $topic_title .'</a></td>
Markus
Verfasst: 19.09.2005 14:12
von Join7
Super!!!! Danke!!!
Aber noch ein allerletzter Wunsch und dann gebe ich Ruhe
Wäre es möglich noch die Uhrzeit reinzubringen und dass dann insgesamt so darzustellen?:
"19.09.2005 Faultier um 15.03 Uhr Topic-Url..."
Verfasst: 19.09.2005 14:42
von Markus67
Hi ...
nicht ganz .. aber fast ...
suche:
ersetze mit:
Code: Alles auswählen
$last_time = date('d.m.Y, H:i', $line[$i]['post_time']);
Markus
Verfasst: 19.09.2005 15:27
von Join7
VIELEN, VIELEN, VIELEN DANK!!!