cuzzmunger wrote:... my forums is on a subdomain & home page is on the main domain...
Code: Select all
$phpbb_root_path = './forum/'; // Path to phpbb folder
cuzzmunger wrote:... my forums is on a subdomain & home page is on the main domain...
Code: Select all
$phpbb_root_path = './forum/'; // Path to phpbb folder
Code: Select all
// 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 />
<?
}
?>
Code: Select all
<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><br />
Code: Select all
$phpbb_root_path = './../../forums/'; // Path to phpbb folder
./../forums/
./../../../forums/
/../
you have to add. Code: Select all
Fatal error: Call to a member function sql_escape() on a non-object in C:\xampp\htdocs\test\includes\session.php on line 330
Code: Select all
<?php
define('IN_PHPBB', true);
$phpbb_root_path = 'forum/';
$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();
?>
<?php
// Number of posts and grabbing permissions
$topic_limit = request_var('topic_limit', 10);
$forums = array_unique(array_keys($auth->acl_getf('f_read', true)));
// Select the last topics to which we have permissions
$sql = 'SELECT p.post_id, p.topic_id, p.forum_id, p.post_subject, p.post_time, u.username
FROM ' . POSTS_TABLE . ' p , ' . USERS_TABLE . ' u
WHERE post_approved = 1
AND ' . $db->sql_in_set('forum_id', $forums) . '
AND u.user_id = p.poster_id
ORDER BY post_time DESC
LIMIT 0,' . $topic_limit;
$result = $db->sql_query($sql);
// Now let's output the content
?>
<font color="FFFFFF" size="4"><b>Últimas entradas no fórum:</b></font><br />
<?
while ($row = $db->sql_fetchrow($result))
{
?>
<img style="border: none;margin-bottom: -10px" src="http://www.tvdospobres.com/forum/styles/aero/imageset/forum_unread.png" />
<a href="<?=$phpbb_root_path . 'viewtopic.php?f=' . $row['forum_id'] . '&t=' . $row['topic_id'] . '&p=' . $row['post_id'] . '#p' . $row['post_id'];?> " target="_blank" style="font-size: 15px; color:#FF9900"><?=utf8_decode($row['post_subject']);?></a> <font size="2" color="#FFFFFF">by <?=utf8_decode($row['username']);?></font><br />
<?
}
?>
Code: Select all
[phpBB Debug] PHP Warning: in file /includes/session.php on line 1035: Cannot modify header information - headers already sent by (output started at /var/www/clients/client4/web7/web/topicos.php:1)
[phpBB Debug] PHP Warning: in file /includes/session.php on line 1035: Cannot modify header information - headers already sent by (output started at /var/www/clients/client4/web7/web/topicos.php:1)
[phpBB Debug] PHP Warning: in file /includes/session.php on line 1035: Cannot modify header information - headers already sent by (output started at /var/www/clients/client4/web7/web/topicos.php:1)
Code: Select all
<?
define('IN_PHPBB', true);
$phpbb_root_path = './'; // 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();
?>
Code: Select all
<?
/*** 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>
stmirec wrote:Hi, i used this:right after <body> tag ..Code: Select all
<? define('IN_PHPBB', true); $phpbb_root_path = './'; // 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(); ?>
and this :in the place i want to display the list..Code: Select all
<? /*** 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>
It shows me only little error square on that place .. any idea how to fix this please ?
I think that my forum is instaled directly on the server .. no folder.
my forum is http://www.stavba-az.sk
You've to edit the page you want to display latest post. For example, it's worth if you use a custom index page for your forum, not the standard index.php that comes with phpbb. Remember that typically it must be an PHP page.Jadenizm wrote:In all of these 9 pages, no one has actually specified where these mods go, which files need the editing... Am I crazy? Am I the only one who's noticed this??
Code: Select all
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './forum/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
$topic_limit = request_var('topic_limit', 5);
$forums = array_unique(array_keys($auth->acl_getf('f_read', true)));
$sql = 'SELECT p.post_id, p.topic_id, p.forum_id, p.post_subject, p.post_time, u.username
FROM ' . POSTS_TABLE . ' p , ' . USERS_TABLE . ' u
WHERE post_approved = 1
AND u.user_id = p.poster_id
ORDER BY post_time DESC
LIMIT 0,' . $topic_limit;
$result = $db->sql_query($sql);
echo '<ul class="arrows">';
while ($row = $db->sql_fetchrow($result))
{
$url = generate_board_url() . "/viewtopic.{$phpEx}?f={$row['forum_id']}&t={$row['topic_id']}&p={$row['post_id']}#p{$row['post_id']}";
echo '<li>';
echo '<a target="_blank" href="' . $url .'">' . $row['post_subject'] . '</a>';
echo '</li>';
}
echo '</ul>';
?>