her er koden til Bloq/forum/foto elemente som vi bruger her på siden
man tilføre det i Administration - System - Elementer
Kode echo "<left><table width='100%'><tr>
<td valign='top' width='33%'>";
if (!defined("IN_FUSION")) { header("Location:../../index.php"); exit; }
if (file_exists(INFUSIONS."ti_blog_system/locale/".LOCALESET."blog_panel.php")) {
include INFUSIONS."ti_blog_system/locale/".LOCALESET."blog_panel.php";
} else {
include INFUSIONS."ti_blog_system/locale/English/blog_panel.php";
}
// In pixels
$height = 25;
$width = 25;
// Until the subject should trim - Bigger sidepanels might want a higher value
$trim = 50;
// Limit
$limit = 5;
openside($locale['TIBLBP001']);
$result = dbquery("SELECT * FROM ".$db_prefix."ti_blog_system bs
LEFT JOIN ".DB_PREFIX."users bu ON bs.blog_writer=bu.user_id
ORDER BY blog_id DESC LIMIT 0,$limit");
while ($data = dbarray($result)) {
$cmts = dbcount("(comment_id)", DB_COMMENTS, "comment_type='BS' AND comment_item_id='".$data['blog_id']."'");
echo "<table cellspacing='0' cellpadding='0' width='100%'><tr>\n";
echo "<td align='left' width='30' class='side-small'><a href='".BASEDIR."blog.php?page=bloguser&id=".$data['blog_writer']."' title='".($data['user_name'] ? $data['user_name'] : $locale['TIBLBP002'])."'><img style='border:0;' src='".($data['user_avatar'] ? IMAGES."avatars/".$data['user_avatar'] : INFUSIONS."ti_blog_system/images/noavatar.gif")."' height='$height' width='$width' alt='".$data['user_name']."' /></a></td>\n";
echo "<td align='left' class='side-small'>» <a href='".BASEDIR."blog.php?page=blog_id&id=".$data['blog_id']."' title='".$data['blog_subject']."'>".trimlink($data['blog_subject'], $trim)."</a></td>\n";
echo "<td align='right' class='side-small'>[".$cmts."]</td>\n";
echo "</tr></table>\n";
echo "<br style='clear:both;' />";
}
closeside();
echo "</td> ";
echo "<td valign='top' width='33%'>";
openside($locale['global_020']);
echo "<div class='side-label'><strong>".$locale['global_021']."</strong></div>\n";
$result = dbquery("
SELECT tt.forum_id, tt.thread_id, tt.thread_subject, tt.thread_lastpost, tt.thread_postcount FROM ".DB_THREADS." tt
INNER JOIN ".DB_FORUMS." tf ON tt.forum_id=tf.forum_id
WHERE ".groupaccess('forum_access')." ORDER BY thread_lastpost DESC LIMIT 4
");
if (dbrows($result)) {
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n";
while($data = dbarray($result)) {
$itemsubject = trimlink($data['thread_subject'], 60);
echo "<tr>\n<td class='side-small'>".THEME_BULLET." <a href='".FORUM."viewthread.php?thread_id=".$data['thread_id']."' title='".$data['thread_subject']."' class='side'>$itemsubject</a></td>\n";
echo "<td align='right' class='side-small'>[".($data['thread_postcount'] - 1)."]</td>\n</tr>\n";
}
echo "</table>\n";
} else {
echo "<div style='text-align:center'>".$locale['global_023']."</div>\n";
}
echo "<div class='side-label'><strong>".$locale['global_022']."</strong></div>\n";
list($min_posts) = dbarraynum(dbquery("SELECT thread_postcount FROM ".DB_THREADS." ORDER BY thread_postcount DESC LIMIT 4,5"));
$result = dbquery("
SELECT tf.forum_id, tt.thread_id, tt.thread_subject, tt.thread_postcount
FROM ".DB_FORUMS." tf
INNER JOIN ".DB_THREADS." tt USING(forum_id)
WHERE ".groupaccess('forum_access')." AND tt.thread_postcount >= '$min_posts'
ORDER BY thread_postcount DESC, thread_lastpost DESC LIMIT 5
");
if (dbrows($result) != 0) {
echo "<table cellpadding='0' cellspacing='0' width='100%'>\n";
while($data = dbarray($result)) {
$itemsubject = trimlink($data['thread_subject'], 60);
echo "<tr>\n<td class='side-small'>".THEME_BULLET." <a href='".FORUM."viewthread.php?thread_id=".$data['thread_id']."' title='".$data['thread_subject']."' class='side'>$itemsubject</a></td>\n";
echo "<td align='right' class='side-small'>[".($data['thread_postcount'] - 1)."]</td>\n</tr>\n";
}
echo "</table>\n";
} else {
echo "<div style='text-align:center'>".$locale['global_023']."</div>\n";
}
closeside();echo "</td>";
echo "<td valign='top' width='33%'>";
@openside("Fra fotoalbummet...");
$result = dbquery(
"SELECT photo_id, album_id, photo_thumb1 FROM ".$db_prefix."photos ORDER BY RAND() LIMIT 1 ");
if (dbrows($result) != 0) {
$data = dbarray($result);
echo "<div style='text-align:center'>";
echo "<a href='".BASEDIR."photogallery.php?photo_id=".$data['photo_id']."' title='Klik for at se billedet i fotoalbummet' alt='Klik for at se billedet i fotoalbummet'>";
echo "<img src='".IMAGES."photoalbum/album_".$data['album_id']."/".$data['photo_thumb1']."'
heigth='113' width='155' alt='' border='0' />";
echo "<br></a></div>";
}
@closeside();echo "</td>
</tr></table></left>";
for at denne her kode skal virke efter planen skal man også have ti_blog_panel lagt ind.
HUSK at læse reglerne for Brug af Debatten - Spørgsmål i privat beskeder og på msn, besvares ikke uden aftale.
Ekspert.
En ekspert er en, der har begået om ikke alle, så i hvert fald de groveste fejltagelser inden for sit felt
Niels Bohr, atomfysiker, 1865-1962
|