

)

<?php
/*-------------------------------------------------------------------------
| MKPortal IPB 2.1.x Last Posts Table with Permissions 2.1 (for center block) 17.05.2006
| for MKP 1.1 x IPB 2.1.x
| by visiblesoul <visiblesoul.net>
| Support: http://www.visiblesoul.net/resources/forum/
+--------------------------------------------------------------------------
Want to show your appreciation for this block?
Link to me on your website using the link code below:
Get free <a href="http://www.visiblesoul.net/" target="_blank">MKPortal modules, blocks, hacks, and skins</a> at <a href="http://www.visiblesoul.net/" target="_blank">Visible Soul Web Design - Corpus Christi, Texas</a>!
---------------------------------------------------------------------------
Config:
--------------------------------------------------------------------------*/
$prefix = "ibf_"; // Database prefix
$limit = 15; // Number of forum posts to show in block
$cutoff = 40; // Number of characters to display in title
$startformat = "long"; // Formats the start date.
//Options are short, time, small, normal, long or leave blank for default.
$lastformat = "short"; // Formats the last post date.
//Options are short, time, small, normal, long or leave blank for default.
/*------------------------------------------------------------------------*/
$content = "
<tr>
<td>
<table class=\"moduleborder\" cellspacing=\"1\" width=\"100%\">
<tr>
<th class=\"tdblock\" width=\"50%\" style=\"padding-left: 10px;\">Titre du sujet</th>
<th class=\"tdblock\" width=\"40%\" style=\"padding-left: 10px;\">Dernier message</th>
<th class=\"tdblock\" width=\"30%\" style=\"padding-left: 10px;\">Date</th>
<th class=\"tdblock\" width=\"5%\" style=\"text-align: center;\">Vue(s)</th>
<th class=\"tdblock\" width=\"5%\">Réponse(s)</th>
</tr>
";
$DB->query("SELECT id, password, permission_array FROM ".$prefix."forums");
while( $f = $DB->fetch_row() ) {
$perms = unserialize(stripslashes($f['permission_array']));
if ($mklib_board->check_permissions($perms['read_perms']) != TRUE or ($f['password'] != "" ) ) {
$bad[] = $f['id'];
} else {
$good[] = $f['id'];
}
}
if ( count($bad) > 0 ) {
$qe = " AND forum_id NOT IN(".implode(',', $bad ).") ";
}
$DB->query("SELECT t.last_post, t.tid, t.title, t.views, t.posts, t.start_date, t.starter_name, t.last_poster_name, t.last_poster_id, t.forum_id
FROM ".$prefix."topics t
LEFT JOIN ".$prefix."forums f ON (t.forum_id = f.id)
WHERE state!='closed' AND approved=1 AND (moved_to IS NULL or moved_to='') $qe
GROUP BY t.title
ORDER BY t.last_post DESC LIMIT 0,$limit");
while ( $post = $DB->fetch_row() ) {
$post['title'] = strip_tags($post['title']);
$post['title'] = str_replace( "!" , "!" , $post['title'] );
$post['title'] = str_replace( """, "\"", $post['title'] );
if (strlen($post['title']) > $cutoff) {
$post['title'] = substr( $post['title'],0,($cutoff - 3) ) . "...";
$post['title'] = preg_replace( '/&(#(\d+;?)?)?(\.\.\.)?$/', '...',$post['title'] );
}
$title = $post['title'];
$tid = $post['tid'];
$views = $post['views'];
$posts = $post['posts'];
$starter = $post['starter_name'];
$lastname = $post['last_poster_name'];
$lastid = $post['last_poster_id'];
$forum_id = $post['forum_id'];
$startdate = $this->create_date($post['start_date'], $startformat);
$lastdate = $this->create_date($post['last_post'], $lastformat);
$content .= "
<!-- topic begin -->
<tr>
<td class=\"modulecell\" style=\"padding-left: 10px; text-align: left;\">
<a style=\"text-decoration: none; font-weight: bold;\" href=\"$mkportals->forum_url/index.php?act=ST&f=$forum_id&t=$tid\" title=\"Topic started by $starter on $startdate\">$title</a>
</td>
<td class=\"modulecell\" style=\"padding-left: 10px; text-align: left;\">
<a href=\"$mkportals->forum_url/index.php?act=ST&f=$forum_id&t=$tid&view=getlastpost\" title=\"Go to last post...\">Dernier message</a> par <a href=\"$mkportals->forum_url/index.php?showuser=$lastid\" title=\"Last poster: $lastname\"><b>$lastname</b></a>
</td>
<td class=\"modulecell\" style=\"padding-left: 10px; text-align: left;\">$lastdate</td>
<td class=\"modulecell\" style=\"padding-right: 10px; text-align: right;\">$views</td>
<td class=\"modulecell\" style=\"padding-right: 10px; text-align: right;\">$posts</td>
</td>
</tr>
<!-- topic end -->
";
}
$content .= "
</table>
</td>
</tr>
";
unset($prefix);
unset($limit);
unset($cutoff);
unset($startformat);
unset($lastformat);
unset($perms);
unset($good);
unset($bad);
unset($qe);
unset($post);
unset($tid);
unset($title);
unset($views);
unset($posts);
unset($startdate);
unset($lastdate);
unset($starter);
unset($lastname);
unset($lastid);
unset($forum_id);
?>
<?php
/********************************************************/
/* Flashchat block v1.2 for Mkportal 1.0 + */
/* By: Ice2003 */
/* http://www.mkportal.it */
/* Copyright 2005 and Beyond by Ice2003 */
/********************************************************/
global $DB;
$flashchatprefix = "forum_fc_"; //Edit this to refelect the prefix of flashchat ie _fc_ or smf_fc_ ect,ect
// Don't change anything under this line or your server will self destruct :)
$curchat = "Les différents Salons:";
$amtchatters = "Chatteur(s) en ligne";
// ok lets count how many rooms are available
$result = $DB->query("SELECT * FROM ".$flashchatprefix."rooms WHERE ispublic IS NOT NULL");
$files = $DB->get_num_rows($result);
// How many chatters are currently yacking in the rooms
$result = $DB->query("SELECT userid, state, color, lang, roomid FROM ".$flashchatprefix."connections WHERE userid IS NOT NULL");
$cats = $DB->get_num_rows($result);
$content .= "<br> $amtchatters: <b>$cats</b><br></b>";
// Lets print out a list of the rooms for all to see
$content .= "<center><br><b>".$curchat."</b></center>";
$a = 1;
$result = $DB->query("SELECT id, name FROM ".$flashchatprefix."rooms WHERE ispublic IS NOT NULL");
while(list( $id, $name) = mysql_fetch_row($result)) {
$title2 = ereg_replace("_", " ", $name);
$content .= " $a- <a href=\"/forum/chat/flashchat.php?lang=en&room=$id\">$title2</a><br>";
$a++;
}
unset($result);
unset($cats);
unset($files);
// yeaaaaa its the php end thingy it means i have finished
?>