Code: Select all
[phpBB Debug] PHP Notice: in file /newposts.php on line 5: include(./phpBB3/common.php) [function.include]: failed to open stream: No such file or directory
[phpBB Debug] PHP Notice: in file /newposts.php on line 5: include() [function.include]: Failed opening './phpBB3/common.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php')
[phpBB Debug] PHP Notice: in file /newposts.php on line 6: include(./phpBB3/includes/functions_display.php) [function.include]: failed to open stream: No such file or directory
[phpBB Debug] PHP Notice: in file /newposts.php on line 6: include() [function.include]: Failed opening './phpBB3/includes/functions_display.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php')
Fatal error: Call to a member function acl() on a non-object in /home/drtfacom/public_html/phpBB3/newposts.php on line 10
Code: Select all
<? include("newposts.php"); ?>
Code: Select all
Fatal error: Call to a member function acl_getf() on a non-object in /home/drtfacom/public_html/phpBB3/newposts.php on line 22
Code: Select all
// Get forums that current user has read rights to.
$forums = array_unique(array_keys($auth->acl_getf('f_read', true)));
Code: Select all
<?
define('IN_PHPBB', true);
$phpbb_root_path = './cavern/'; // Path to phpbb folder
$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);
// Grab user preferences
$user->setup();
?>
<?
/*** phpBB3 - Last Active Topics System ***/
//Show last x topics
define('TOPICS_LIMIT',10);
// Create arrays
$topics = array();
// Get forums that current user has read rights to.
$forums = array_unique(array_keys($auth->acl_getf('f_read', true)));
// Get active topics.
$sql="SELECT *
FROM " . TOPICS_TABLE . "
WHERE topic_approved = '1' AND " . $db->sql_in_set('forum_id', $forums) . "
ORDER BY topic_last_post_time DESC";
$result = $db->sql_query_limit($sql,TOPICS_LIMIT);
while ($r = $db->sql_fetchrow($result))
{
$topics[] = $r;
}
$db->sql_freeresult($result);
?>
<div>
<?
foreach($topics as $t)
{
// Get folder img, topic status/type related information
$topic_tracking_info = get_complete_topic_tracking($t['forum_id'], $t['topic_id']);
$unread_topic = (isset($topic_tracking_info[$t['topic_id']]) && $t['topic_last_post_time'] > $topic_tracking_info[$t['topic_id']]) ? true : false;
$folder_img = $folder_alt = $topic_type = '';
topic_status($t, $t['topic_replies'], $unread_topic, $folder_img, $folder_alt, $topic_type);
// output the link
?>
<img style="vertical-align: text-bottom" src="<?=$user->img($folder_img, $folder_alt, false, '', 'src');?>" title="<?=$user->lang[$folder_alt];?>" alt="<?=$user->lang[$folder_alt];?>" />
<a href="<?=$phpbb_root_path . 'viewtopic.php?f=' . $t['forum_id'] . '&t=' . $t['topic_id'] . '&p=' . $t['topic_last_post_id'] . '#p' . $t['topic_last_post_id'];?>"><?=html_entity_decode($t['topic_title']);?></a><br />
<?
}
?>
</div>
Code: Select all
<html>
<head>
<title>phpBB3 - Last Active Topics System</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- below is the isolated code that generates the debug info if the user is not logged in -->
<!--
<?php
define('IN_PHPBB', false);
$phpbb_root_path = 'forum/'; // Path to phpbb folder
$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);
// Grab user preferences
$user->setup();
?>
-->
</head>
<body>
<?
/*** phpBB3 - Last Active Topics System ***/
//Show last x topics
define('TOPICS_LIMIT',5);
// Create arrays
$topics = array();
// Get forums that current user has read rights to.
$forums = array_unique(array_keys($auth->acl_getf('f_read', true)));
// Get active topics.
$sql="SELECT *
FROM " . TOPICS_TABLE . "
WHERE topic_approved = '1' AND " . $db->sql_in_set('forum_id', $forums) . "
ORDER BY topic_last_post_time DESC";
$result = $db->sql_query_limit($sql,TOPICS_LIMIT);
while ($r = $db->sql_fetchrow($result))
{
$topics[] = $r;
}
$db->sql_freeresult($result);
?>
<?
foreach($topics as $t)
{
// Get folder img, topic status/type related information
$topic_tracking_info = get_complete_topic_tracking($t['forum_id'], $t['topic_id']);
$unread_topic = (isset($topic_tracking_info[$t['topic_id']]) && $t['topic_last_post_time'] > $topic_tracking_info[$t['topic_id']]) ? true : false;
$folder_img = $folder_alt = $topic_type = '';
topic_status($t, $t['topic_replies'], $unread_topic, $folder_img, $folder_alt, $topic_type);
// output the link
?>
<img src="<?=$user->img($folder_img, $folder_alt, false, '', 'src');?>" align="absmiddle" title="<?=$user->lang[$folder_alt];?>" alt="<?=$user->lang[$folder_alt];?>" />
<a href="<?=$phpbb_root_path . 'viewtopic.php?f=' . $t['forum_id'] . '&t=' . $t['topic_id'] . '&p=' . $t['topic_last_post_id'] . '#p' . $t['topic_last_post_id'];?>" target="_blank"><?=html_entity_decode($t['topic_title']);?></a>
<?
}
?>
</body>
</html>
please somebody help me to do " scroling marquee to bring topics from my forum to website "xDazedx wrote:Embraer195 you and I are on the same page.
I think that mod just lists recent topics on the forum page. I would like to put a small block on a side panel of my main site for recent posts in the forum. I had this before as a scrolling marquee. Helped bring people to the forum.
Code: Select all
<?php
// How Many Topics you want to display?
$topicnumber = 10;
// Scrolling towards up or down?
$scroll = "up";
// Change this to your phpBB path
$urlPath = "/forum";
// Database Configuration (Where your phpBB config.php file is located)
include 'config.php';
$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");
$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.forum_id != 4 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 $topicnumber";
$result = mysql_query($query) or die("Query failed");
print "<marquee id=\"recent_topics\" behavior=\"scroll\" direction=\"$scroll\" height=\"170\" scrolldelay=\"100\" scrollamount=\"2\" onMouseOver=\"document.all.recent_topics.stop()\" onMouseOut=\"document.all.recent_topics.start()\">
<table cellpadding='3' cellSpacing='2' width='100%'>";
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?f=$row[forum_id]&t=$row[topic_id]&p=$row[post_id]#p$row[post_id]\" TARGET=\"_blank\">" .
$row["topic_title"] .
"</a></td></font></b><td><font face=\"Tahoma\" size=\"1\"><font color=\"#C0C0C0\"> by: <a href=\"$urlPath/memberlist.php?mode=viewprofile&u=$row[user_id]\" TARGET=\"_blank\">" .
$row["username"] .
"</td><td><font face=\"tahoma\" size=\"1\"><font color=\"#C0C0C0\">" .
date('F j, Y, g:i a', $row["post_time"]) .
"</td></tr></font>";
}
print "</table></marquee>";
mysql_free_result($result);
mysql_close($link);
?>
Code: Select all
<link rel="stylesheet" href="latest_posts.css">
<?
/*** phpBB3 - Last Active Topics System ***/
//Author: Ioan Filipov
//Email: [email protected]
//Date: 04.06.2007
//------------------------------
//Edit these parameters:
//MySQL server adress
$host="localhost";
//Username
$user="removed";
//Password
$pass="removed";
//Database
$db="forum_new";
//Table prefix
$table="phpbb_";
//Show last x topics
$laforums="6";
//Topic name length
$tl="20";
$link=mysql_connect($host, $user, $pass);
$db=mysql_select_db($db);
$query="select * from $table".topics." WHERE topic_approved = '1' order by topic_last_post_time desc limit 0,$laforums";
$query2="select config_name,config_value from $table".config." where config_name = 'server_name' limit 0,1";
$result2=mysql_query($query2);
$row2 = mysql_fetch_array($result2);
extract($row2);
$posts_per_page = $r3[1];
$result=mysql_query($query);
while ($row=mysql_fetch_array($result)) {
extract($row);
$date = date("g:i a", $topic_last_post_time );
$query3="select forum_name from $table".forums." WHERE forum_id = ".$forum_id."";
$result3=mysql_query($query3);
$row2 = mysql_fetch_array($result3);
if(strlen($topic_title) > $tl)
{
$topic_title = mb_substr($topic_title,0,$tl, 'utf-8').'...';
}
echo "<a href='http://".$config_value."/forum/viewtopic.php?f=".$forum_id."&t=".$topic_id."&p=".$topic_last_post_id."#p".$topic_last_post_id."' target='_top'>".$topic_title."</a> at ".$date."<br>\n";
}
//-------------------------- END
?>