Gå til innhold

endre 3 siste poster i forumet fil


Anbefalte innlegg

Jeg har funnet en 3-siste fra forumet blokk, som jeg gjærne skulle ha endra. Er helt grønn i php, så jeg trenger hjelp.. Den ligger [her]. Skulle ha lagt alt i en ramme og hatt lagt #, Tittel og Svar i en kolonne. Vil også legge til hvem som postet innlegget og ha skriften hakket mindre. Viss noen kunne hjulpet meg med dette hadde jeg blitt svært glad...Eller viss du har noe lignende kan jeg godt ta imot det også... :wink:

 

PS: Det er ett phpBB forum.

 

<?php

// Koble til databasen 
$adresse = "localhost"; 
$brukernavn = "sensur"; 
$passord = "sensur"; 
$database = "sensur"; 
$conncetion = mysql_connect($adresse,$brukernavn,$passord) or die ("Oppkobling mot databasen mislyktes. Prøv igjen senere"); 
echo mysql_error(); 
$db = mysql_select_db($database,$conncetion) or die("Fant ikke valgt database"); 

if (eregi("block-Latest_Forums.php",$PHP_SELF)) {
   Header("Location: index.php");
   die();
}

global $localhost, $juve_db, $sitename, $admin;

$HideViewReadOnly = 1;

$Last_New_Topics  = 3;
$show = "  <tr>
   <td height=\"25\" colspan=\"6\" align=\"center\" class=\"catbottom\" background=\"http://www.juve.shyper.com/fmworld2/images/cellpic1.jpg\"> </td>
 </tr>
</table></td>
       </tr>
     </table></td>
 </tr>
</table>";

$Count_Topics = 0;
$Topic_Buffer = "";
$result = $db->sql_query( "SELECT topic_id, forum_id, topic_last_post_id, topic_title, topic_poster, topic_views, topic_replies, topic_moved_id FROM ".$prefix."_bbtopics ORDER BY topic_last_post_id DESC");
while( list( $topic_id, $forum_id, $topic_last_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $topic_moved_id ) = $db->sql_fetchrow($result))

{
  $skip_display = 0;
  if( $HideViewReadOnly == 1 )
  {
     $result1 = $db->sql_query( "SELECT auth_view, auth_read FROM ".$prefix."_bbforums where forum_id = '$forum_id'");
     list( $auth_view, $auth_read ) = $db->sql_fetchrow($result1);
     if( ( $auth_view != 0 ) or ( $auth_read != 0 ) ) { $skip_display = 1; }
  }

  if( $topic_moved_id != 0 )
  {
  // Shadow Topic !!
     $skip_display = 1;
  }

  if( $skip_display == 0 )
  {
  $Count_Topics += 1;

$result2 = $db->sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$topic_poster'");
list($username, $user_id) = $db->sql_fetchrow($result2);
$avtor=$username;
$sifra=$user_id;

$result3 = $db->sql_query("SELECT poster_id, FROM_UNIXTIME(post_time,'%m/%d/%y @ %l:%i%p') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'");
list($poster_id, $post_time) = $db->sql_fetchrow($result3);

$result4 = $db->sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'");
list($username, $user_id) = $db->sql_fetchrow($result4);

                      $viewlast .="  <tr>
   <td height=\"30\" nowrap bgcolor=\"#f5f5f5\" class=\"row1\"><img src=\"http://www.juve.shyper.com/fmworld/forum/templates/subSilver/images/folder.gif\" border=\"0\" /></td>
   <td width=\"100%\" bgcolor=\"#f5f5f5\" class=\"row1\"> <a href=\"index.php?name=Forums&file=viewtopic&t=$topic_id#$topic_last_post_id\">$topic_title</a></td>
   <td align=\"center\" bgcolor=\"#ececec\" class=\"row2\">$topic_replies</td>
   <td align=\"center\" bgcolor=\"#ececec\" class=\"row3\"><a href=\"index.php?name=Forums&file=profile&mode=viewprofile&u=$sifra\">$avtor</a></td>
   <td align=\"center\" bgcolor=\"#f5f5f5\" class=\"row2\">$topic_views</td>
   <td align=\"center\" nowrap bgcolor=\"#ececec\" class=\"row3\"><font size=\"-2\"><i>  $post_time </i></font><br>
     <a href=\"index.php?name=Forums&file=profile&mode=viewprofile&u=$user_id\">$username</a> <a href=\"index.php?name=Forums&file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\"></a><img src=\"modules/Forums/templates/subSilver/images/icon_minipost_new.gif\"></td>
 </tr>";
}

  if( $Last_New_Topics == $Count_Topics ) { break 1; }

}

   $content .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">
 <tr>
   <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
       <tr>
         <td bgcolor=\"#D1D7DC\"><table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\">
 <tr>
   <th height=\"25\" colspan=\"2\" align=\"center\" nowrap background=\"modules/Forums/templates/subSilver/images/cellpic3.gif\" class=\"thcornerl\"><font color=\"#FFFFFF\"><strong>Topics</strong></font></th>
   <th width=\"50\" align=\"center\" nowrap background=\"modules/Forums/templates/subSilver/images/cellpic3.gif\" class=\"thtop\"><font color=\"#FFFFFF\"><strong> Replies </strong></font></th>
   <th width=\"100\" align=\"center\" nowrap background=\"modules/Forums/templates/subSilver/images/cellpic3.gif\" class=\"thtop\"><font color=\"#FFFFFF\"><strong> Author </strong></font></th>
   <th width=\"50\" align=\"center\" nowrap background=\"modules/Forums/templates/subSilver/images/cellpic3.gif\" class=\"thtop\"><font color=\"#FFFFFF\"><strong> Views </strong></font></th>
   <th align=\"center\" nowrap background=\"modules/Forums/templates/subSilver/images/cellpic3.gif\" class=\"thcornerr\"><font color=\"#FFFFFF\"><strong> Last Post </strong></font></th>
 </tr>";
   $content .= "$viewlast";

$content .= "$show";

?>  

 

Mvh. GTI2 :w00t:

Endret av GTI2
Lenke til kommentar

Opprett en konto eller logg inn for å kommentere

Du må være et medlem for å kunne skrive en kommentar

Opprett konto

Det er enkelt å melde seg inn for å starte en ny konto!

Start en konto

Logg inn

Har du allerede en konto? Logg inn her.

Logg inn nå
  • Hvem er aktive   0 medlemmer

    • Ingen innloggede medlemmer aktive
×
×
  • Opprett ny...