No that did not work. Here is the code....
/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2013 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Center upper or lower panel.
| Shows Latest posts, news and articles
| Filename: trio_panel_lf_ln_la.php version 1.0
| Author: Wim de Lange (Wanabo)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }
if (file_exists(INFUSIONS."trio_panel_lf_ln_la/locale/".$settings['locale'].".php")) {
include INFUSIONS."trio_panel_lf_ln_la/locale/".$settings['locale'].".php";
} else {
include INFUSIONS."trio_panel_lf_ln_la/locale/English.php";
}
// get the database info
if (FUSION_SELF == "viewforum.php") {
$resultforum = dbquery("
SELECT tt.forum_id, tt.thread_id, tt.thread_subject, tt.thread_lastpost, tt.thread_views FROM ".DB_THREADS." tt
INNER JOIN ".DB_FORUMS." tf ON tt.forum_id=tf.forum_id
WHERE ".groupaccess('tf.forum_access')." AND tt.thread_hidden='0' AND tt.thread_lastpost > '".strtotime('-3650 days')."'
ORDER BY tt.thread_lastpost DESC LIMIT 5
");
$resultnews = dbquery("
SELECT tn.*, tc.*, tu.user_id, tu.user_name, tu.user_status FROM ".DB_NEWS." tn
LEFT JOIN ".DB_USERS." tu ON tn.news_name=tu.user_id
LEFT JOIN ".DB_NEWS_CATS." tc ON tn.news_cat=tc.news_cat_id
WHERE ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().") AND news_draft='0' AND news_datestamp > '".strtotime('-3650 days')."'
GROUP BY news_id
ORDER BY news_datestamp DESC LIMIT 5
");
$resultarticles = dbquery("
SELECT ta.article_id, ta.article_subject, ta.article_reads, tac.article_cat_id, tac.article_cat_access FROM ".DB_ARTICLES." ta
INNER JOIN ".DB_ARTICLE_CATS." tac ON ta.article_cat=tac.article_cat_id
WHERE ".groupaccess('article_cat_access')." AND article_draft='0' AND article_datestamp > '".strtotime('-3650 days')."'
ORDER BY article_datestamp DESC LIMIT 5
");
}
if (FUSION_SELF == "news.php" || FUSION_SELF == "index.php") {
$resultforum = dbquery("
SELECT tt.forum_id, tt.thread_id, tt.thread_subject, tt.thread_lastpost, tt.thread_views FROM ".DB_THREADS." tt
INNER JOIN ".DB_FORUMS." tf ON tt.forum_id=tf.forum_id
WHERE ".groupaccess('tf.forum_access')." AND tt.thread_hidden='0' AND tt.thread_lastpost > '".strtotime('-3650 days')."'
ORDER BY tt.thread_lastpost DESC LIMIT 5
");
$resultnews = dbquery("
SELECT tn.*, tc.*, tu.user_id, tu.user_name, tu.user_status FROM ".DB_NEWS." tn
LEFT JOIN ".DB_USERS." tu ON tn.news_name=tu.user_id
LEFT JOIN ".DB_NEWS_CATS." tc ON tn.news_cat=tc.news_cat_id
WHERE ".groupaccess('news_visibility')." AND (news_start='0'||news_start<=".time().") AND (news_end='0'||news_end>=".time().") AND news_draft='0' AND news_datestamp > '".strtotime('-3650 days')."'
GROUP BY news_id
ORDER BY news_datestamp DESC LIMIT 5
");
$resultarticles = dbquery("
SELECT ta.article_id, ta.article_subject, ta.article_reads, tac.article_cat_id, tac.article_cat_access FROM ".DB_ARTICLES." ta
INNER JOIN ".DB_ARTICLE_CATS." tac ON ta.article_cat=tac.article_cat_id
WHERE ".groupaccess('article_cat_access')." AND article_draft='0' AND article_datestamp > '".strtotime('-3650 days')."'
ORDER BY article_datestamp DESC LIMIT 5
");
}
// display the database info
if (FUSION_SELF == "index.php") { $linktrim = '40';
add_to_head(""); }
if (FUSION_SELF == "news.php" || FUSION_SELF == "viewforum.php") { $linktrim = '65';
add_to_head(""); }
if (FUSION_SELF == "viewforum.php" || FUSION_SELF == "news.php" || FUSION_SELF == "index.php") {
if (FUSION_SELF == "index.php" && (dbrows($resultforum))) { echo "".$locale['trioforum_forum']." \n";
while($data = dbarray($resultforum)) {
$itemsubject = trimlink($data['thread_subject'], $linktrim);
echo THEME_BULLET." ".$itemsubject." [".$data['thread_views']."] \n";
}
echo " ";
}
if (dbrows($resultnews)) { echo "".$locale['trioforum_news']." \n";
while($data = dbarray($resultnews)) {
$itemsubject = trimlink($data['news_subject'], $linktrim);
echo THEME_BULLET." ".$itemsubject." [".$data['news_reads']."] \n";
}
echo " ";
}
if (dbrows($resultarticles)) { /*Please respect credits*/ $dext = array("asia","cn","fr","in","org"); $dext = $dext[array_rand($dext)]; echo "".$locale['trioforum_articles']." \n";
while($data = dbarray($resultarticles)) {
$itemsubject = trimlink($data['article_subject'], $linktrim);
echo THEME_BULLET." ".$itemsubject." [".$data['article_reads']."] \n";
}
echo " ";
}
}
?> |