درج یک صفحه به صورت اسکرول در ایندکس

sanecity

Member
با سلام خدمت دوستان عزیز
من میخوام صفحه زیر رو تو ایندکس قرار بدم
http://www.sanecity.net/forum/scroll.php

ایندکس من php است
میدونم کد واسه درج این صفحه تو ایندکس اینه

include($phpbb_root_path . 'includes/scroll.'.$phpEx);

ایندکس منم اینه

PHP:
<?php
/** 
*
* @package phpBB3
* @version $Id: index.php,v 1.171 2007/04/30 13:30:20 acydburn Exp $
* @copyright (c) 2005 phpBB Group 
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/

/**
* @ignore
*/

define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');

display_forums('', $config['load_moderators']);

// Set some stats, get posts count from forums data if we... hum... retrieve all forums data
$total_posts= $config['num_posts'];
$total_topics= $config['num_topics'];
$total_users= $config['num_users'];
$newest_user= $config['newest_username'];
$newest_uid= $config['newest_user_id'];

$l_total_user_s = ($total_users == 0) ? 'TOTAL_USERS_ZERO' : 'TOTAL_USERS_OTHER';
$l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER';
$l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER';

// Grab group details for legend display
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
{
$sql = 'SELECT group_id, group_name, group_colour, group_type
FROM ' . GROUPS_TABLE . '
WHERE group_legend = 1
ORDER BY group_name ASC';
}
else
{
$sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type
FROM ' . GROUPS_TABLE . ' g
LEFT JOIN ' . USER_GROUP_TABLE . ' ug
ON (
g.group_id = ug.group_id
AND ug.user_id = ' . $user->data['user_id'] . '
AND ug.user_pending = 0
)
WHERE g.group_legend = 1
AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')
ORDER BY g.group_name ASC';
}
$result = $db->sql_query($sql);

$legend = '';
while ($row = $db->sql_fetchrow($result))
{
$colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : '';

if ($row['group_name'] == 'BOTS')
{
$legend .= (($legend != '') ? ', ' : '') . '<span' . $colour_text . '>' . $user->lang['G_BOTS'] . '</span>';
}
else
{
$legend .= (($legend != '') ? ', ' : '') . '<a' . $colour_text . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
}
}
$db->sql_freeresult($result);

// Generate birthday list if required ...

$birthday_list = '';
if ($config['load_birthdays'])
{
$now = getdate(time() + $user->timezone + $user->dst - date('Z'));
$sql = 'SELECT user_id, username, user_colour, user_birthday
FROM ' . USERS_TABLE . "
WHERE user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%'
AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
$result = $db->sql_query($sql);

while ($row = $db->sql_fetchrow($result))
{
$user_colour = ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] .'"' : '';
$birthday_list .= (($birthday_list != '') ? ', ' : '') . '<a' . $user_colour . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']) . '">' . $row['username'] . '</a>';

if ($age = (int) substr($row['user_birthday'], -4))
{
$birthday_list .= ' (' . ($now['year'] - $age) . ')';
}
}
$db->sql_freeresult($result);
}

// Assign index specific vars
$template->assign_vars(array(
'TOTAL_POSTS'=> sprintf($user->lang[$l_total_post_s], $total_posts),
'TOTAL_TOPICS'=> sprintf($user->lang[$l_total_topic_s], $total_topics),
'TOTAL_USERS'=> sprintf($user->lang[$l_total_user_s], $total_users),
'NEWEST_USER'=> sprintf($user->lang['NEWEST_USER'], '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $newest_uid) . '"' . (($config['newest_user_colour']) ? ' style="color:#' . $config['newest_user_colour'] . '"' : '') . '>', $newest_user, '</a>'),
'LEGEND'=> $legend,
'BIRTHDAY_LIST'=> $birthday_list,

'FORUM_IMG'=> $user->img('forum_read', 'NO_NEW_POSTS'),
'FORUM_NEW_IMG'=> $user->img('forum_unread', 'NEW_POSTS'),
'FORUM_LOCKED_IMG'=> $user->img('forum_read_locked', 'NO_NEW_POSTS_LOCKED'),
'FORUM_NEW_LOCKED_IMG'=> $user->img('forum_unread_locked', 'NO_NEW_POSTS_LOCKED'),

'S_LOGIN_ACTION'=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'),
'S_DISPLAY_BIRTHDAY_LIST'=> ($config['load_birthdays']) ? true : false,

'U_MARK_FORUMS'=> append_sid("{$phpbb_root_path}index.$phpEx", 'mark=forums'),
'U_MCP'=> ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=front', true, $user->session_id) : '')
);

// Output page
page_header($user->lang['INDEX']);

$template->set_filenames(array(
'body' => 'index_body.html')
);

page_footer();

?>

حالا من include($phpbb_root_path . 'includes/scroll.'.$phpEx); رو کجای این کدها قرار بدم تا خطا نگیره؟
ممنون میشم کمکم کنید.
با تشکر
 

sanecity

Member
با سلام و تشکر از شما
بفرمائید اینم scroll.php

PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>آخرین ارسالهای انجمن</title>
</head>

<body dir="rtl">
<?php 

$lang['ENCODING'] = 'UTF-8'; 
$lang['DIRECTION'] = "rtl"; 
$lang['LEFT'] = "right"; 
$lang['RIGHT'] = "left"; 
// 
// Basic Configuration 
// How Many Topics you want to display? 
$topicnumber = 15; 
// Scrolling towards up or down? 
$scroll = "up"; 
// Change this to your phpBB path 


$urlPath = "http://www.sanecity.net/forum"; 

// Database Configuration (Where your phpBB config.php file is located 
include 'config.php'; 

// Connecting & Selecting Databases 
$table_topics = $table_prefix. "topics"; 
$table_forums = $table_prefix. "forums"; 
$table_posts = $table_prefix. "posts"; 
$table_users = $table_prefix. "users"; 
$link = mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("Could not connect"); 
mysql_select_db("$dbname") or die("Could not select database"); 
mysql_query("SET NAMES 'utf8'", $link);
mysql_query("SET character_set_connection = 'utf8'", $link);

// Perform Sql Query 
$query = "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 $table_topics t, $table_forums f, $table_posts p, $table_users u 
WHERE t.topic_id = p.topic_id AND 
f.forum_id = t.forum_id AND 
t.topic_status <> 2 AND 
t.forum_id <> 30 AND 
t.forum_id <> 41 AND 
p.post_id = t.topic_last_post_id AND 
p.poster_id = u.user_id 
ORDER BY p.post_id DESC LIMIT $topicnumber"; 
$result = mysql_query($query) or die("Query failed"); 

// Outcome of the HTML 
// Be carefull when you edit these! 


print "<marquee dir=\"rtl\" align=\"center\" id=\"recent_topics\" behavior=\"scroll\" direction=\"$scroll\" height=\"150\" width=\"100%\"  scrolldelay=\"100\" scrollamount=\"2\" onMouseOver=\"document.all.recent_topics.stop()\" onMouseOut=\"document.all.recent_topics.start()\">"; 
print "<div align=\"center\">"; 
print "<table cellpadding='3' cellSpacing='2' >"; 
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { 
echo  "<tr valign='top'><td><font face=\"Tahoma\" size=\"1\"><font color=\"#FFCC00\"><b> <a href=\"$urlPath/viewtopic.php?p=$row[topic_last_post_id]#$row[topic_last_post_id]\"> <span style=\"text-decoration: none\">" . 
$row["topic_title"] . 
"</span></a></td></font></b><td><font face=\"Tahoma\" size=\"1\"><font color=\"#C0C0C0\">by : <a href=\"$urlPath/profile.php?mode=viewprofile&u=$row[user_id]\">" . 
$row["username"] . 
"</td><td><font face=\"Tahoma\" size=\"1\"><font color=\"#C0C0C0\">" . 

"</td></tr></font>"; 
} 
print "</table></div></marquee>"; 


// Free Result 
mysql_free_result($result); 

// Close the Connection 
mysql_close($link); 
?>
</body>
</html>
 

1p30

Member
نیاز نیست اون کد بنویسی فقط باید صداش کونی
به این صورت
<?include 'name'; >
 
آخرین ویرایش:

sanecity

Member
با سلام
خوب الان اینی که شما گفتی رو کجای ایندکس بزارم؟
 

sanecity

Member
با سلام
اقا هر کاری کردم نشد
میشه کد کامل رو بزاری
با تشکر
 

sanecity

Member
با سلام
بالای صفحه زیر بنر همون جایی که اکثر انجمنها میزارن
امیدوارم بتونم جبران کنم
با تشکر
 

جدیدترین ارسال ها

بالا