Web sayfamız sadece phpBB 3.0.x sürümlerine destek vermektedir. Konu açmadan, ileti yazmadan önce lütfen site kuralları sayfamıza göz atınız.
$sql_in = array(33,44,55,66);
WHERE ' . $db->sql_in_set('forum_id', $sql_in) . '
<?php
/*
*
* @name recent.php
* @copyright (c) Canver Software - www.canversoft.net
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/* Yazan: Sevdin Filiz
Bu kodların çalışması için phpBB3 sistemine göreceli olarak erişim gerekmektedir.
Kullanılabilir: phpBB3 dizinine eşdeğer seviyedeki bir dizinde veya içiresindeki herhangi bir dizinde, phpBB3 dizinin bir üst seviyesinde.
Kullanılamaz: phpBB3'den farklı bir sunucuda çalışmaz.
$phpbb_root_path değişkeni phpBB3'ün kurulu olduğu dizini göstermeli.
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="tr" xml:lang="tr">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-language" content="tr" />
<meta name="author" content="Canver Software" />
<title>sayfa başlığı</title>
</head>
<body>
<?php
/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = './'; // phpBB3'ün kurulu olduğu dizin
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
// + setup
$config['exclude_forums'] = ''; // exclude forums id
$config['max_topics'] = '10'; // last xx topic
// - setup
//
// Exclude forums
//
$sql_where = '';
if ($config['exclude_forums'])
{
$exclude_forums = explode(',', $config['exclude_forums']);
foreach ($exclude_forums as $i => $id)
{
if ($id > 0)
{
$sql_where .= ' AND t.forum_id != ' . trim($id);
}
}
}
//
// Recent topic (only show normal topic)
//
$sql = 'SELECT t.topic_title, t.forum_id, t.topic_id, f.forum_id
FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f
WHERE t.topic_status <> 2
AND t.topic_approved = 1
AND t.topic_type = 0
AND t.forum_id = f.forum_id
' . $sql_where . '
ORDER BY t.topic_time DESC';
$result = $db->sql_query_limit($sql, $config['max_topics']);
?>
<table border="0">
<tr>
<th colspan="3">Son konular</th>
</tr>
<tr>
<td>Konu başlığı</td>
</tr>
<?php
while( ($row = $db->sql_fetchrow($result)) && ($row['topic_title'] != '') )
{
// auto auth
if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($row['forum_id'] == '0') )
{
?>
<tr>
<td> <a href="<?=append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'])?>"><?=censor_text($row['topic_title']); ?></a> </td>
</tr>
<?php
}
}
$db->sql_freeresult($result);
?>
</table>
</body>
</html>
ALEXIS yazdı:Bu konu phpBB3 ile alakalı değil, direk PDO ile veya herhangi bir SQL classı ile bağlanıp çekmek daha mantıklı, phpBB3 dosyalarını boş yere include etmemiş oluruz..
$sql = 'SELECT t.topic_title, t.forum_id, t.topic_id, f.forum_id
FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f
WHERE t.topic_status <> 2
AND t.topic_approved = 1
AND t.topic_type = 0
AND t.forum_id = f.forum_id
' . $sql_where . '
ORDER BY t.topic_time DESC';
$result = $db->sql_query_limit($sql, $config['max_topics']);
$forum_list = array(33,44,55,66); //Sadece bu dizideki forum_id degerleri olan forumlardan konu cekmek istiyoruz
$sql = 'SELECT t.topic_title, t.forum_id, t.topic_id, f.forum_id
FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f
WHERE t.topic_status <> 2
AND t.topic_approved = 1
AND t.topic_type = 0
AND t.forum_id = f.forum_id
AND ' . $db->sql_in_set('t.forum_id', $forum_list) . '
' . $sql_where . '
ORDER BY t.topic_time DESC';
$result = $db->sql_query_limit($sql, $config['max_topics']);
$forum_list = array(35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74); //Sadece bu dizideki forum_id degerleri olan forumlardan konu cekmek istiyoruz
$sql = 'SELECT t.topic_title, t.forum_id, t.topic_id, f.forum_id, f.forum_name, f.forum_image, t.topic_replies, u.user_id, u.username
FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . ' f, ' . USERS_TABLE . ' u
WHERE t.topic_status <> 2
AND t.topic_approved = 1
AND t.topic_type = 0
AND t.forum_id = f.forum_id
AND p.topic_id = t.topic_id
AND p.poster_id = u.user_id
AND p.post_id = t.topic_last_post_id
AND ' . $db->sql_in_set('t.forum_id', $forum_list) . '
' . $sql_where . '
ORDER BY t.topic_time DESC';
$result = $db->sql_query_limit($sql, $config['max_topics']);
Woodenlove yazdı:bunu bırde en cok okunanlar yada en cok cevaplanlar seklınde yapa bılırmıyız.... acaba
ORDER BY t.topic_time DESC';
ORDER BY t.topic_views DESC';
ORDER BY t.topic_replies DESC';
<?php
while( ($row = $db->sql_fetchrow($result)) && ($row2 = $db->sql_fetchrow($result2)) && ($row['topic_title'] != '') && ($row2['topic_title'] != '') )
{
// auto auth
if ( ($auth->acl_get('f_read', $row['forum_id'])) || ($auth->acl_get('f_read', $row2['forum_id'])) || ($row['forum_id'] == '0') || ($row2['forum_id'] == '0') )
{
?>
Bu forumu görüntüleyenler: Kayıtlı kullanıcı yok ve 1 misafir