Rolex wrote:Thanks, everything works fine. I'll wait for the update which will allow me just mark and send topic to Latest news page.
Hmmm... and what about automatically grab topics title from specified forum?
Rolex wrote:In the update, you may put guests online and registered users online at the foot. I tried here, but I got error.
Use this:
<?php
/**
* Displays custom page with news as links
*
* @copyright (C) 2008-2012 PunBB, partially based on code (C) 2008-2009 FluxBB.org
* @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
* @package PunBB
*/
if (!defined('FORUM_ROOT'))
define('FORUM_ROOT', './');
require FORUM_ROOT.'include/common.php';
// Load the index.php language file
require FORUM_ROOT.'lang/'.$forum_user['language'].'/index.php';
define('FORUM_ALLOW_INDEX', 1);
define('FORUM_PAGE', 'Home');
// Setup breadcrumbs
$forum_page['crumbs'] = array(
array($forum_config['o_board_title'], forum_link($forum_url['index'])),
ucfirst(FORUM_PAGE)
);
require FORUM_ROOT.'header.php';
// START SUBST - <!-- forum_main -->
ob_start();
?> <div class="main-head" style="margin-top: 2em">
<h2 class="hn"><span>Latest news - Home</span></h2>
</div>
<div class="main-content main-message" style="font-size: 17px; text-decoration: underline;">
<ol style="padding: 0 120pt;">
<li><a href="http://nairalanders.com/forum/topic/328/celebrities-tonto-dikeh-flaunts-her-tattoos-in-new-photos/">Tonto Dikeh Flaunts Her Tattoos In New Photos (Pictured)</a></li>
<li><a href="http://nairalanders.com/forum/topic/274/music-videos-new-single-wizkid-jaiye-jaiye-ft-femi-kuti/">Jaiye Jaiye ft. Femi Kuti by Wizkid</a></li>
<li><a href="http://nairalanders.com/forum/topic/306/music-videos-dr-sid-lady-don-dada-ft-don-jazzy/">Lady Don Dada ft. Don Jazzy by Dr. Sid</a></li>
<li><a href="http://nairalanders.com/forum/topic/327/politics-why-jonathan-accused-organised-labour-of-corruption-cpc/">Why Jonathan Accused Organised Labour Of Corruption-CPC</a></li>
<li><a href="http://nairalanders.com/forum/topic/326/european-football-qpr-vs-arsenal-today-at-530pm/">QPR Vs Arsenal Today At 5.30pm</a></li>
<li><a href="http://nairalanders.com/forum/topic/324/8-ways-to-keep-your-lady-happy/">8 Ways To Keep Your Lady Happy</a></li>
<li><a href="http://nairalanders.com/forum/topic/323/one-year-after-rasheed-yekini-lives-on-in-our-hearts/">One Year After, Rasheed Yekini Lives On In Our Hearts</a></li>
<li><a href="http://nairalanders.com/forum/topic/319/what-to-do-when-he-is-taking-too-long-to-propose/">What To Do When He Is Taking Too Long To Propose</a></li>
<li><a href="http://nairalanders.com/forum/topic/320/tragic-lagos-polytechnic-student-raped-to-death-3-days-after-graduation/">Lagos polytechnic student raped to death 3 days after graduation</a></li>
<li><a href="http://nairalanders.com/forum/topic/310/boko-haram-now-collecting-ransom/">Boko Haram Now Collecting Ransom</a></li>
<li><a href="http://nairalanders.com/forum/topic/311/celebrities-who-died-of-drug-overdoses-and-how-they-died/">Celebrities Who Died Of Drug Overdoses And How They Died</a></li>
<li><a href="http://nairalanders.com/forum/topic/312/how-is-your-state-governor-fighting-corruption/">How Is Your State Governor Fighting Corruption?</a></li>
<li><a href="http://nairalanders.com/forum/topic/321/private-jet-efcc-probes-amaechi-over-missing-10m/">Private jet-EFCC probes Amaechi over missing $10m</a></li>
<li><a href="http://nairalanders.com/forum/topic/316/age-in-relationships/">Age In Relationships</a></li>
<li><a href="http://nairalanders.com/forum/topic/317/what-is-cheating-in-a-relationshipmarriage/">What Is Cheating In A Relationship/Marriage?</a></li>
<li><a href="http://nairalanders.com/forum/topic/318/if-you-are-single-read-this-a-mothers-letter/">If You Are Single, Read This. (A Mother's Letter)</a></li>
</ol>
</div>
<?php
($hook = get_hook('in_stats_end')) ? eval($hook) : null;
($hook = get_hook('in_users_online_start')) ? eval($hook) : null;
if ($forum_config['o_users_online'] == '1')
{
// Fetch users online info and generate strings for output
$query = array(
'SELECT' => 'o.user_id, o.ident',
'FROM' => 'online AS o',
'WHERE' => 'o.idle=0',
'ORDER BY' => 'o.ident'
);
($hook = get_hook('in_users_online_qr_get_online_info')) ? eval($hook) : null;
$result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
$forum_page['num_guests'] = $forum_page['num_users'] = 0;
$users = array();
while ($forum_user_online = $forum_db->fetch_assoc($result))
{
($hook = get_hook('in_users_online_add_online_user_loop')) ? eval($hook) : null;
if ($forum_user_online['user_id'] > 1)
{
$users[] = ($forum_user['g_view_users'] == '1') ? '<a href="'.forum_link($forum_url['user'], $forum_user_online['user_id']).'">'.forum_htmlencode($forum_user_online['ident']).'</a>' : forum_htmlencode($forum_user_online['ident']);
++$forum_page['num_users'];
}
else
++$forum_page['num_guests'];
}
$forum_page['online_info'] = array();
$forum_page['online_info']['guests'] = ($forum_page['num_guests'] == 0) ? $lang_index['Guests none'] : sprintf((($forum_page['num_guests'] == 1) ? $lang_index['Guests single'] : $lang_index['Guests plural']), forum_number_format($forum_page['num_guests']));
$forum_page['online_info']['users'] = ($forum_page['num_users'] == 0) ? $lang_index['Users none'] : sprintf((($forum_page['num_users'] == 1) ? $lang_index['Users single'] : $lang_index['Users plural']), forum_number_format($forum_page['num_users']));
($hook = get_hook('in_users_online_pre_online_info_output')) ? eval($hook) : null;
?>
<div id="brd-online" class="gen-content">
<h3 class="hn"><span><?php printf($lang_index['Currently online'], implode($lang_index['Online stats separator'], $forum_page['online_info'])) ?></span></h3>
<?php if (!empty($users)): ?>
<p><?php echo implode($lang_index['Online list separator'], $users) ?></p>
<?php endif; ($hook = get_hook('in_new_online_data')) ? eval($hook) : null; ?>
</div>
<?php
($hook = get_hook('in_users_online_end')) ? eval($hook) : null;
}
($hook = get_hook('in_info_end')) ? eval($hook) : null;
$tpl_temp = forum_trim(ob_get_contents());
$tpl_main = str_replace('<!-- forum_info -->', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <!-- forum_main -->
require FORUM_ROOT.'footer.php';