$CFG[num_recent_topic] = '10';
$CFG[forum_recent_topic] = '2'; // forum id
$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u
WHERE t.forum_id = $CFG[forum_recent_topic]
AND t.topic_status <> 2
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u.user_id
ORDER BY p.post_id DESC
LIMIT " . $CFG[num_recent_topic];
........
<?php
/***************************************************************************
* blocks_imp_recents_topic.php
* -------------------
* begin : Saturday, March 20, 2004
* copyright : (C) 2004 masterdavid - Ronald John David
* website : http://www.integramod.com
* email : webmaster@integramod.com
*
* note: removing the original copyright is illegal even you have modified
* the code. Just append yours if you have modified it.
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}
if(!function_exists(imp_recent_topics_block_func))
{
function imp_recent_topics_block_func()
{
global $user, $template, $portal_config, $userdata, $board_config, $db, $phpEx;
$sql = "SELECT * FROM ". FORUMS_TABLE . " ORDER BY forum_id";
if (!$result1 = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
$forum_data = array();
while( $row1 = $db->sql_fetchrow($result1) )
{
$forum_data[] = $row1;
}
$is_auth_ary = array();
$is_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata, $forum_data);
if( $portal_config['md_except_forum_id'] == '' )
{
$except_forum_id = '\'start\'';
}
else
{
$except_forum_id = $portal_config['md_except_forum_id'];
}
for ($i = 0; $i < count($forum_data); $i++)
{
if ((!$is_auth_ary[$forum_data[$i]['forum_id']]['auth_read']) or (!$is_auth_ary[$forum_data[$i]['forum_id']]['auth_view']))
{
if ($except_forum_id == '\'start\'')
{
$except_forum_id = $forum_data[$i]['forum_id'];
}
else
{
$except_forum_id .= ',' . $forum_data[$i]['forum_id'];
}
}
}
if ($portal_config['md_approve_mod_installed'])
{
$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
FROM " . TOPICS_TABLE . " AS t LEFT OUTER JOIN " . APPROVE_POSTS_TABLE . " AS a ON (t.topic_first_post_id = a.post_id), " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u
WHERE t.forum_id NOT IN (" . $except_forum_id . ")
AND t.topic_status <> 2
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u.user_id
AND a.post_id is NULL
ORDER BY p.post_id DESC
LIMIT " . $portal_config['md_num_recent_topics'];
}
else
{
$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u
WHERE t.forum_id NOT IN (" . $except_forum_id . ")
AND t.topic_status <> 2
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u.user_id
ORDER BY p.post_id DESC
LIMIT " . $portal_config['md_num_recent_topics'];
}
if (!$result1 = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not query recent topics information', '', __LINE__, __FILE__, $sql);
}
$number_recent_topics = $db->sql_numrows($result1);
$recent_topic_row = array();
while ($row1 = $db->sql_fetchrow($result1))
{
$recent_topic_row[] = $row1;
}
if ($portal_config['md_recent_topics_style'])
{
$style_row = 'scroll';
}
else
{
$style_row = 'static';
}
$template->assign_block_vars($style_row,"");
for ($i = 0; $i < $number_recent_topics; $i++)
{
$topic_author = ( $recent_topic_row[$i]['user_id'] != ANONYMOUS ) ? '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $recent_topic_row[$i]['user_id']) . '" class="gensmall">' : '';
$topic_author .= ( $recent_topic_row[$i]['user_id'] != ANONYMOUS ) ? $recent_topic_row[$i]['username'] : ( ( $recent_topic_row[$i]['post_username'] != '' ) ? $recent_topic_row[$i]['post_username'] : $user->lang('Guest') );
$topic_author .= ( $recent_topic_row[$i]['user_id'] != ANONYMOUS ) ? '</a>' : '';
$template->assign_block_vars($style_row . '.recent_topic_row', array(
'U_TITLE' => append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $recent_topic_row[$i]['post_id']) . '#' .$recent_topic_row[$i]['post_id'],
'L_TITLE' => $recent_topic_row[$i]['topic_title'],
'POSTER' => $topic_author,
'S_POSTTIME' => create_date($board_config['default_dateformat'], $recent_topic_row[$i]['post_time'], $board_config['board_timezone'])
)
);
}
//
// Recent Forum 1
//
$sql = "SELECT * FROM ". FORUMS_TABLE . " ORDER BY forum_id";
if (!$result1 = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
$forum_data = array();
while( $row1 = $db->sql_fetchrow($result1) )
{
$forum_data[] = $row1;
}
$is_auth_ary = array();
$is_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata, $forum_data);
if( $portal_config['md_siir_forum_id'] == '' )
{
$siir_forum_id = '35'';
}
else
{
$siir_forum_id = $portal_config['md_siir_forum_id'];
}
for ($i = 0; $i < count($forum_data); $i++)
{
if ((!$is_auth_ary[$forum_data[$i]['forum_id']]['auth_read']) or (!$is_auth_ary[$forum_data[$i]['forum_id']]['auth_view']))
{
if ($siir_forum_id == '\'start\'')
{
$siir_forum_id = $forum_data[$i]['forum_id'];
}
else
{
$siir_forum_id .= ',' . $forum_data[$i]['forum_id'];
}
}
}
if ($portal_config['md_siir_approve_mod_installed'])
{
$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
FROM " . TOPICS_TABLE . " AS t LEFT OUTER JOIN " . APPROVE_POSTS_TABLE . " AS a ON (t.topic_first_post_id = a.post_id), " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u
WHERE t.forum_id NOT IN (" . $siir_forum_id . ")
AND t.topic_status <> 2
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u.user_id
AND a.post_id is NULL
ORDER BY p.post_id DESC
LIMIT " . $portal_config['md_num_siir_recent_topics'];
}
else
{
$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . USERS_TABLE . " AS u
WHERE t.forum_id NOT IN (" . $siir_forum_id . ")
AND t.topic_status <> 2
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u.user_id
ORDER BY p.post_id DESC
LIMIT " . $portal_config['md_num_siir_recent_topics'];
}
if (!$result1 = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not query recent topics information', '', __LINE__, __FILE__, $sql);
}
$number_recent_topics = $db->sql_numrows($result1);
$recent_topic_row = array();
while ($row1 = $db->sql_fetchrow($result1))
{
$recent_topic_row[] = $row1;
}
if ($portal_config['md_recent_topics_style'])
{
$style_row = 'scroll';
}
else
{
$style_row = 'static';
}
$template->assign_block_vars($style_row,"");
for ($i = 0; $i < $number_recent_topics; $i++)
{
$topic_author = ( $recent_topic_row[$i]['user_id'] != ANONYMOUS ) ? '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $recent_topic_row[$i]['user_id']) . '" class="gensmall">' : '';
$topic_author .= ( $recent_topic_row[$i]['user_id'] != ANONYMOUS ) ? $recent_topic_row[$i]['username'] : ( ( $recent_topic_row[$i]['post_username'] != '' ) ? $recent_topic_row[$i]['post_username'] : $user->lang('Guest') );
$topic_author .= ( $recent_topic_row[$i]['user_id'] != ANONYMOUS ) ? '</a>' : '';
$template->assign_block_vars($style_row . '.siir_recent_topic_row', array(
'U_TITLE' => append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $recent_topic_row[$i]['post_id']) . '#' .$recent_topic_row[$i]['post_id'],
'L_TITLE' => $recent_topic_row[$i]['topic_title'],
'POSTER' => $topic_author,
'S_POSTTIME' => create_date($board_config['default_dateformat'], $recent_topic_row[$i]['post_time'], $board_config['board_timezone'])
)
);
}
}
}
imp_recent_topics_block_func();
?>
<table class="tablebg" cellspacing="1" width="100%">
<tr>
</tr>
<tr>
<td class="row1"><strong>Son Duyurular</strong></td>
<td class="row1"><strong>Son Popüler Konular</strong></td>
<td class="row1"><strong>Son Konular</strong></td>
</tr>
<tr>
<td class="row1" width="33%" valign="top">
<!-- BEGIN scroll -->
<script language="javascript" type="text/javascript" src="./includes/js_portalMarquee.js"></script>
<div id="marqueecontainer" onmouseover="copyspeed=pausespeed" onmouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: absolute; width: 100%;">
<!-- BEGIN recent_topic_row -->
» <a href="{scroll.recent_topic_row.U_TITLE}" class="gensmall"><b>{scroll.recent_topic_row.L_TITLE}</b></a> › Yazar : {scroll.recent_topic_row.POSTER} <br />
› by {scroll.recent_topic_row.POSTER} on {scroll.recent_topic_row.S_POSTTIME}<br /><hr />
<!-- END recent_topic_row -->
</div>
</div>
<!-- END scroll -->
<!-- BEGIN static -->
<!-- BEGIN recent_topic_row -->
» <a href="{static.recent_topic_row.U_TITLE}" class="gensmall"><b>{static.recent_topic_row.L_TITLE}</b></a> › Yazar : {static.recent_topic_row.POSTER} <br /><hr />
<!-- END recent_topic_row -->
<!-- END static -->
</td>
<td class="row1" width="33%" valign="top">
<!-- BEGIN scroll -->
<script language="javascript" type="text/javascript" src="./includes/js_portalMarquee.js"></script>
<div id="marqueecontainer" onmouseover="copyspeed=pausespeed" onmouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: absolute; width: 100%;">
<!-- BEGIN siir_recent_topic_row -->
» <a href="{scroll.siir_recent_topic_row.U_TITLE}" class="gensmall"><b>{scroll.siir_recent_topic_row.L_TITLE}</b></a> › Yazar : {scroll.siir_recent_topic_row.POSTER} <br />
› by {scroll.siir_recent_topic_row.POSTER} on {scroll.siir_recent_topic_row.S_POSTTIME}<br /><hr />
<!-- END siir_recent_topic_row -->
</div>
</div>
<!-- END scroll -->
<!-- BEGIN static -->
<!-- BEGIN siir_recent_topic_row -->
» <a href="{static.siir_recent_topic_row.U_TITLE}" class="gensmall"><b>{static.siir_recent_topic_row.L_TITLE}</b></a> › Yazar : {static.siir_recent_topic_row.POSTER} <br /><hr />
<!-- END siir_recent_topic_row -->
<!-- END static -->
</td>
<td class="row1" width="33%" valign="top">
<!-- BEGIN latest_topics -->
<a href="{latest_topics.U_VIEW_TOPIC}">{latest_topics.TITLE}</a><br />
<!-- END latest_topics 1 -->
</td>
</tr>
<br />
<tr>
<td class="row1"><strong>Son Duyurular</strong></td>
<td class="row1"><strong>Son Popüler Konular</strong></td>
<td class="row1"><strong>Son Konular</strong></td>
</tr>
<td class="row1" width="33%" valign="top">
<!-- BEGIN latest_topics -->
<a href="{latest_topics.U_VIEW_TOPIC}">{latest_topics.TITLE}</a><br />
<!-- END latest_topics 1 -->
</td>
<td class="row1" width="33%" valign="top">
<!-- BEGIN latest_topics -->
<a href="{latest_topics.U_VIEW_TOPIC}">{latest_topics.TITLE}</a><br />
<!-- END latest_topics 1 -->
</td>
<td class="row1" width="33%" valign="top">
<!-- BEGIN latest_topics -->
<a href="{latest_topics.U_VIEW_TOPIC}">{latest_topics.TITLE}</a><br />
<!-- END latest_topics 1 -->
</td>
</table>
<br />
<?php
/***************************************************************************
* blocks_imp_recent_topics.cfg
* -------------------
* begin : Tuesday, May 25, 2004
* copyright : (C) 2004 masterdavid - Ronald John David
* website : http://www.integramod.com
* email : webmaster@integramod.com
*
* note: removing the original copyright is illegal even you have modified
* the code. Just append yours if you have modified it.
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}
$block_count_variables = 3;
// array( <Field label>, <Field Info>, <Config Name>, <Options>, <Field Values>, <Control Type>, <Block>, <Default Value>);
$block_variables = array(
array('Number of recent topics', 'number of topics displayed', 'md_num_recent_topics', '', '', '1', 'recent_topics', '10'),
array('Approve MOD installed?', 'tick if Approve MOD is installed', 'md_approve_mod_installed', '', '', '4', 'recent_topics', '0'),
array('Recent Topics Style', 'choose static display or scrolling display', 'md_recent_topics_style', 'Scroll,Static', '1,0', '3', 'recent_topics', '1')
array('Siir Number of recent topics', 'number of topics displayed', 'md_num_siir_recent_topics', '', '', '1', 'siir_recent_topics', '10'),
array('Siir Approve MOD installed?', 'tick if Approve MOD is installed', 'md_siir_approve_mod_installed', '', '', '4', 'siir_recent_topics', '0'),
array('Siir Recent Topics Style', 'choose static display or scrolling display', 'md_siir_recent_topics_style', 'Scroll,Static', '1,0', '3', 'siir_recent_topics', '1')
);
?>
Bu forumu görüntüleyenler: Kayıtlı kullanıcı yok ve 0 misafir