Здр. можете ли да оправите този скрипт?Тои е за новини:
","</em>",$echo_text);
$echo_text = preg_replace('/\[list\](.*)\[\/list\]/si',"<div style=\"Verdana: 7px\">$1</div>",$echo_text);
$echo_text = preg_replace('/\
Код:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>New Page 1</title>
<style>
BODY {
scrollbar-arrow-color:666666;
scrollbar-3dlight-color:00000;
scrollbar-face-color:333333;
scrollbar-darkshadow-color:000000;
scrollbar-track-color:D0D0AA;
scrollbar-highlight-color:A27B7B;
scrollbar-shadow-color:A27B7B;
}
</style>
</head>
<body link="#FFFFFF" vlink="#FFFFFF" alink="#FFFFFF">
<body bgcolor="#000000">
<p><?php
## Mod Title: fens-bg.com
## Version: by barz_i_iarosten
#############
## Edit Below
#############
// Where to take the topics from
// Always a number
$forum = '1';
// How many topics to show
$limit = '10';
// How to show the topics
// full or blank ('')
$show = 'full';
// How to display the date and time if used
// short or long
$date_time = 'short';
// How top display the topic link if usede
// topic or phpbb
$topic_link = 'topic';
// Comments link - how to send them to comments
// topic or reply
$comment = 'topic';
// Path to your forums directory
// Usually ./forum/ or ./phpBB/ or ./forums/
$phpbb_root_path = './forum/';
#############################################
## No Editing unless you know what your doing
#############################################
if ( !defined('IN_PHPBB') )
{
define('IN_PHPBB', true);
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'config.'.$phpEx);
}
if ($show == '' || $show == 'full')
{
// Select the topic information from the correct forum and set it to $grab_topics
$grab_topics = $db->sql_query("SELECT * FROM `{$table_prefix}topics` WHERE `forum_id` = '{$forum}' ORDER BY `topic_id` DESC LIMIT {$limit}");
}
else if ($show == 'topic')
{
$grab_topics = $db->sql_query("SELECT * FROM `{$table_prefix}topics` WHERE `forum_id` = '{$forum}' AND `topic_id` = '{$_GET['t']}' ORDER BY `topic_id` DESC");
}
// Grab the information using an array and set it to $echo_topic
while ($echo_topic = $db->sql_fetchrow($grab_topics))
{
// Select the post information from the correct forum and set it to $grab_posts
$grab_posts = $db->sql_query("SELECT * FROM `{$table_prefix}posts` WHERE `forum_id` = '{$forum}' AND `topic_id` = '{$echo_topic['topic_id']}' LIMIT 1");
// Grab the information using an array and set it to $echo_post
while ($echo_post = $db->sql_fetchrow($grab_posts))
{
// Now get the post_text using the post_id were looking at and sort it info $grab_posts_text
$grab_posts_text = $db->sql_query("SELECT * FROM `{$table_prefix}posts_text` WHERE `post_id` = '{$echo_post['post_id']}'");
// Grab the information using an array and set it to $echo_text
while($echo_text = $db->sql_fetchrow($grab_posts_text))
{
// Find the user the posted
$find_user = $db->sql_query("SELECT * FROM `{$table_prefix}users` WHERE `user_id` = '{$echo_post['poster_id']}'");
// Sort this users info into array for the post
while ($echo_user = $db->sql_fetchrow($find_user))
{
// Get rid of all those annoying characters from bbcode
$echo_text = preg_replace('/\:[0-9a-z\:]+\]/si', ']', $echo_text);
// BBCode
$echo_text = str_replace("[b]","<strong>",$echo_text);
$echo_text = str_replace("[/b]","</strong>",$echo_text);
$echo_text = str_replace("[i]","<em>",$echo_text);
$echo_text = str_replace("[/i]","</em>",$echo_text);
$echo_text = str_replace("[u]","<u>",$echo_text);
$echo_text = str_replace("[/u]","</u>",$echo_text);
$echo_text = preg_replace('/\[quote="(.*)\"](.*)\[\/quote\]/Usi','<div style=\"Verdana: 7px\">$2</div>',$echo_text);
$echo_text = str_replace("[quote]","<strong>Quote</strong><em>",$echo_text);
$echo_text = str_replace("[/quote]","</em>",$echo_text);
$echo_text = str_replace("[code]","<strong>Code</strong><em>",$echo_text);
$echo_text = str_replace("
$echo_text = preg_replace('/\[list\](.*)\[\/list\]/si',"<div style=\"Verdana: 7px\">$1</div>",$echo_text);
$echo_text = preg_replace('/\
- (.*)\[\/list\]/si',"<div style=\"Verdana: 7px\">$1</div>",$echo_text);
$echo_text = str_replace("","<img src=\"",$echo_text);
$echo_text = str_replace("","\" alt=\"image\" />",$echo_text);
$echo_text = preg_replace('/\[url\](.*)\[\/url\]/Usi','<a href="$1">$1</a>',$echo_text);
$echo_text = preg_replace('/\(.*)\[\/url\]/Usi','<a href="$1">$2</a>',$echo_text);
$echo_text = str_replace("\n", "\n<br />\n", $echo_text);
// Way to display date and time
// long
if($date_time == "long")
{
$echo_topic['topic_time'] = strftime("%A %e %B %H:%M",$echo_topic['topic_time']);
}
// short
if ($date_time == "short")
{
$echo_topic['topic_time'] = strftime("%a %e %b %H:%M",$echo_topic['topic_time']);
}
// Way to display comment link
// Go right to the topic
if ($comment == 'topic')
{
$comment_link = "{$phpbb_root_path}viewtopic.php?t={$echo_topic['topic_id']}";
}
// Go right to the reply box
if ($comment == 'reply')
{
$comment_link = "{$phpbb_root_path}posting.php?mode=reply&t={$echo_topic['topic_id']}";
}
// Topic link types
// This link goes to the topic display
if ($topic_link == 'topic')
{
$topic_link = "?show1=topic&t={$echo_topic['topic_id']}";
}
// This link goes to the actual phpbb topic
if ($topic_link == 'phpbb')
{
$topic_link = "{$phpbb_root_path}viewtopic.php?t={$echo_topic['topic_id']}";
}
##################################
## Edit for look and feel of topic
##################################
// Display just the title
if ($show != 'full' && !isset($_GET['show1']))
{
echo "<a href='{$topic_link}'><font color=\"#FFFFFF\" >{$echo_text['post_subject']}</a><br /></font>";
}
// Display many topics - for news, shoutbox etc
else if ($show == 'full')
{
echo "
<strong><font face=\"Verdana\" color=\"#FF000\" size=\"1\">{$echo_text['post_subject']}</strong>- <strong>{$echo_topic['topic_time']}</font></strong>
<br />
<br /><font face=\"Verdana\" color=\"#FFFFFF\" size=\"1\">
{$echo_text['post_text']}
</front>
<br />
<br />
</font><b><font face=\"Verdana\" color=\"#FFFFFF\" size=\"1\">написано от:</b></font><font face=\"Verdana\" color=\"#339900\" size=\"1\"> <strong> {$echo_user['username']}</strong><font face=\"Verdana\" color=\"#FF000\" size=\"1.5\">
<a href=\"{$comment_link}\" target=\"_blank\"> Коментари {$echo_topic['topic_replies']}</a><hr size=\"1\">
";
}
// Display the topic for when used with the one above, click link and go here
if ($_GET['show1'] == 'topic')
{
echo "
<strong><font color=\"#FFFFFF\" >{$echo_text['post_subject']}</font></strong>- <strong>{$echo_topic['topic_time']}</strong>
<br />
<br /><font face=\"Verdana\" color=\"#FFFFFF\" size=\"1\">
{$echo_text['post_text']}
</font>
<br />
<br />
написано от: <strong>{$echo_user['username']} </strong>
<a href=\"{$comment_link}\" target=\"_blank\">Comments {$echo_topic['topic_replies']}</a>
<hr size=\"1\">
";
}
}
}
}
}
?></p>
</body>
</html>
[/code]