{REQUEST} - Topics Anywhere for phpBB 3.x.

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Anti-Spam Guide
hmmmmmm
Registered User
Posts: 120
Joined: Tue Feb 17, 2009 6:17 pm
Location: Islamabad, Pakistan

Re: {REQUEST} - Topics Anywhere for phpBB 3.x.

Post by hmmmmmm »

Hello there...

It WOrked Fine.....

But when new posts are made, They were Not Updated...

Any Suggestion ?

Regards
blazus
Registered User
Posts: 2
Joined: Thu Mar 26, 2009 4:12 pm

Re: {REQUEST} - Topics Anywhere for phpBB 3.x.

Post by blazus »

Hi! First, I'm sorry for my english. I use code by Ioan Filipov (below)

Code: Select all

<?
        /*** 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="xxx";

        //Password
        $pass="xxx";

        //Database
        $db="xxx";

        //Table prefix
        $table="phpbb_";

        //Show last x topics
        $laforums="5";
     


    $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);
    $result=mysql_query($query);
    while ($row=mysql_fetch_array($result)) {
    extract($row);
    $date = date("d.m.Y", $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);
  echo "<a href='http://".$config_value."/forum/viewforum.php?f=".$forum_id."' target='_blank'>".$row2[forum_name].":</a> <a href='http://".$config_value."/forum/viewtopic.php?f=".$forum_id."&t=".$topic_id."' target='_blank'>".$topic_title."</a><br> odpowiedzi: ".$topic_replies."</font>,<br>ostatni post: ".$topic_last_poster_name.",<br> dodano: ".$date."<br>\n";
    }

    //-------------------------- END
    ?>
It's works, but I have problem with polish letters (I dont see them, only ?, ??) Phpbb3 work with UTF-8, polish letters on my site is in iso-8859-2. I have tried to change my site to UTF-8, but it doesn't help.

How modify this codeby Ioan Filipov, for good view polish letters? Thanks for help. Greetings from Poland!
Last edited by blazus on Thu Mar 26, 2009 10:22 pm, edited 1 time in total.
blazus
Registered User
Posts: 2
Joined: Thu Mar 26, 2009 4:12 pm

Re: {REQUEST} - Topics Anywhere for phpBB 3.x.

Post by blazus »

I just found another script, and little modified...

1. Create file noweposty.php (code below) and put it in board folder

Code: Select all

    <?php
        /** 
    * newest_posts - raw dump of newest posts from forum
    *
    * @copyright (c) 2008 ameeck / Vojtech Vondra - phpBB.cz
    * @license http://opensource.org/licenses/gpl-license.php GNU Public License 
    */
        define('IN_PHPBB', true);
        $phpbb_root_path = './forum/'; 
        $phpEx = substr(strrchr(__FILE__, '.'), 1);
        include($phpbb_root_path . 'common.' . $phpEx);

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

        // Number of posts and grabbing permissions
        // Pocet prspevku pro zobrazen a oprvnen
        $topic_limit = request_var('topic_limit', 5);
        $forums = array_unique(array_keys($auth->acl_getf('f_read', true))); //ignored in sql statement to include all topics despite permissions

    // Select the last topics based on user 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); */

        // Select the last topics ignoring permissions
        // Vybrat posledn tmata ke kterm mme oprvnen
        $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);

        // Proper header since output not buffered
        // Poslat hlavicky pro sprvn kdovn, protoe vpis obsahu je postupn
    //    header('Content-Type: text/html; charset=utf-8');

        // Now let's output the content
        // A ted vypsat obsah
    //    echo '<!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" lang="en" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Last Topics</title></head><body><div id="post_content"><strong>Last Topics:</strong><br/><ul>';
        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']}"; //added fedforum to url

    //old line $url = generate_board_url() . "viewtopic.{$phpEx}?f={$row['forum_id']}&t={$row['topic_id']}&p={$row['post_id']}#p{$row['post_id']}";
            echo '<img src="../index_pliki/dol/strzalka_niebieska.gif"> <a target="_blank" href="' . $url . '">' . $row['post_subject'] . '</a>,<br> autor: ' . ucwords($row['username']) . ',<br> data: ' . date("d.m.Y",$row['post_time']).',<br> godzina: ' . date("H:i", $row['post_time']) . ' <br>';
        }
        echo '</div></body></html>';
        ?>
In $phpbb_root_path enter name board folder

Image can be changed here
<img src="../index_pliki/dol/strzalka_niebieska.gif">


2. Paste on the website this code:

Code: Select all

<?php include("forum/noweposty.php"); ?>

3. Change letters code on website to UTF-8

That's all, enjoy !!!
CMCDragonkai
Registered User
Posts: 483
Joined: Sat Jun 09, 2007 11:37 pm
Location: Australia.. and other parts of the world sometimes...

Re: {REQUEST} - Topics Anywhere for phpBB 3.x.

Post by CMCDragonkai »

If any of you guys are still having trouble you can check the link on my signature, its been in the works for quite a while if any of you had been watching Mod Writers Discussion.
Show phpbb threads as html articles. V.5.03 Thanks Erik! (This will be updated constantly as I or others contribute...) This code is to be used on external HTML page, but if you want a template version see here.

For the best PHPBB total modification to posting - bbcode, embedding... everything! Visit MSSTI's ABBC3 Modification.
keithy joe
Registered User
Posts: 15
Joined: Tue Jul 08, 2008 11:27 am

Re: {REQUEST} - Topics Anywhere for phpBB 3.x.

Post by keithy joe »

This is probably going to be a silly question. Is it possible to get this Topics Anywhere add-on to display the topics from my PHPBB forum to my main *.html index page. At the moment, if I'm reading this correctly - this code provided by you kind folk is for placing PHP > PHP and not to display on a *.html extension. Any advice?
Fusione
Registered User
Posts: 35
Joined: Mon Apr 21, 2003 3:26 pm

Re: {REQUEST} - Topics Anywhere for phpBB 3.x.

Post by Fusione »

I would also be in need of a topics anywhere clone for phpbb3. I have not found a mod that would allow me to include the topics on another site using javascript like with phpbb2.
scandal20
Registered User
Posts: 13
Joined: Thu Sep 01, 2005 2:18 am

Re: {REQUEST} - Topics Anywhere for phpBB 3.x.

Post by scandal20 »

Is there still much of a demand for a clone of Topics Anywhere for phpBB 3.0.x? Seems like some people have found solutions, but others are still left in the dark because they need this functionality for .html pages. I've been looking for a project to work on in my free time so if there's enough interest I might be willing to try to port Topics Anywhere from phpBB2.
acctman
Registered User
Posts: 103
Joined: Thu Feb 09, 2006 5:48 pm

Re: {REQUEST} - Topics Anywhere for phpBB 3.x.

Post by acctman »

scandal20 wrote:Is there still much of a demand for a clone of Topics Anywhere for phpBB 3.0.x? Seems like some people have found solutions, but others are still left in the dark because they need this functionality for .html pages. I've been looking for a project to work on in my free time so if there's enough interest I might be willing to try to port Topics Anywhere from phpBB2.
i still need it, if its just like topic anywhere i'm interested.
Peter77sx
Registered User
Posts: 3260
Joined: Wed Nov 09, 2005 2:51 pm

Re: {REQUEST} - Topics Anywhere for phpBB 3.x.

Post by Peter77sx »

oops, wrong post.
mahdi1234
Registered User
Posts: 13
Joined: Wed Jul 23, 2008 12:55 pm

Re: {REQUEST} - Topics Anywhere for phpBB 3.x.

Post by mahdi1234 »

ameeck wrote:Here's a version I use, its posted in a topic somewhere here, but since this topic is a request just for this:

Code: Select all

   <?php
    /** 
    * newest_posts - raw dump of newest posts from forum
...
Hi ameeck,

is there any way this could be tweaked not to use session management based on whether user is logged or not to forum, but rather connect in the script under certain user and fetch the data?

cheers,
mahdi

[edit]

Removing this line did the trick

Code: Select all

AND ' . $db->sql_in_set('forum_id', $forums) . '
acctman
Registered User
Posts: 103
Joined: Thu Feb 09, 2006 5:48 pm

Re: {REQUEST} - Topics Anywhere for phpBB 3.x.

Post by acctman »

I'm using this code, when I include it on my main page I receive the following error
Fatal error: Call to a member function on a non-object in /home/site/public_html/forums/includes/cache.php on line 51

it seems that the script is not connecting to the database. when i run the script alone it shows the forum but when I include it does not. My site script uses a few global variable I wonder if there is a conflict with phpbb3 when including a script outside of the forum folder.

Code: Select all

<?php
/**
* newest_posts - raw dump of newest posts from forum
*
* @copyright (c) 2008 ameeck / Vojtech Vondra - phpBB.cz
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*/
define('IN_PHPBB', true);
$phpEx = substr(strrchr(__FILE__, '.'), 1); 
$phpbb_root_path = '/home/site/public_html/forums/';

include($phpbb_root_path . 'common.' . $phpEx);

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

require($phpbb_root_path .'includes/functions_user.php'); 

// Number of posts and grabbing permissions
$topic_limit = request_var('topic_limit', 8);

// forum_id to grab topics from (must be a valid forum_id integer)

$forums = array_unique(array_keys($auth->acl_getf('f_read', true)));

// Initial var setup
$forum_id = request_var('f', 0);
$topic_id = request_var('t', 0);
$forum_sql = empty($forum_id) ? '' : (" AND f.forum_id = '$forum_id'");
$topic_sql = empty($topic_id) ? '' : (" AND p.topic_id = t.topic_id AND t.topic_id = '$topic_id'");

// 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_text, p.post_time, u.username
$sql = 'SELECT p.post_id, p.topic_id, p.forum_id, p.post_subject, p.post_time, u.username
FROM '. FORUMS_TABLE .' f,'.TOPICS_TABLE.' t, '.POSTS_TABLE.' p,'.USERS_TABLE.' u
WHERE t.forum_id = f.forum_id
AND t.topic_status != 1
AND u.user_id = p.poster_id' . $forum_sql . $topic_sql . (empty($topic_sql) ? ' AND p.post_id = t.topic_last_post_id ' : '') . '
ORDER BY ' . (empty($topic_sql) ? 't.topic_last_post_time DESC' : 'p.post_time DESC') . '
LIMIT 0,' . $topic_limit;
$result = $db->sql_query($sql);

// Proper header since output not buffered
header('Content-Type: text/html; charset=utf-8');

// Now let's output the content border: 1px solid #734518;background-color:#F5F0D0;
//echo '<div style=""><strong></strong>';
//echo '<ul style="margin-left:0px;list-style-type:none;">';
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']}";
$count = count(@explode($$row['post_subject']," "));
$count = strlen($row['post_subject']) - ( $count - 1 ); 
$subject = strlen($row['post_subject']) > 27? substr($row['post_subject'],0,24)."...": $row['post_subject'];
echo '<div style="padding-bottom:5px;"><a target="_parent" title="'.$row['post_subject'].'" href="' . $url . '">' . $subject . '</a> - ' . $row['username'] . ' : ' . date("D m/d/y, h:ia",$row['post_time']) . ' </div>';
//echo '<li>' . $row['post_text'] . '</li><br><br>';
//echo '<li style="padding-bottom:4px;text-align:right;"> </li>';
}
//echo '</ul></div>';
//echo '</ul>';	
?>
copperknackers
Registered User
Posts: 62
Joined: Fri Feb 29, 2008 4:26 pm

Re: {REQUEST} - Topics Anywhere for phpBB 3.x.

Post by copperknackers »

In the original that was for phpbb2 the posts were displayed/written by a javascript code - is there any way to do that?

Cheers
medianet85
Registered User
Posts: 1
Joined: Thu May 28, 2009 8:09 am

please help me

Post by medianet85 »

these are not successful. please help me and also tel me how edit the registration confirmation email as we want from ACP.
User avatar
Volunteer Forum
Registered User
Posts: 400
Joined: Mon Sep 12, 2005 9:59 pm

Re: {REQUEST} - Topics Anywhere for phpBB 3.x.

Post by Volunteer Forum »

Normaly things get better after time etc. But this seems like a BIG setback.

The topics anywhere for phpBB2 is SUPERIOR to ANY other try for this mod to phpBB3.
NONE have been able to create something similar or more powerfull.
I think that is quite lame..

The thing that makes the real topics anywhere tic is the possibility to not be forced to change in the file
from what forum ID the topics should come from, and NOT be forced to change in the file how many topics/posts etc there should be.

The real topics anywhere is based on one main file where you can do all these settings on one page and use the SAME FILE for multiple settings etc. So if i want to show 5 topics here and 10 there, it should be possibly with only one file.

So to be clear about how it works, take a look at the url that the topics_anywhere creates depending on the settings:
topics_anywhere.php?mode=show&f=1&n=10&sfn=y&fnl=y&r=y&sr=y&h='a\'s\'m\'p\'l\&b=non&lpb=0&lpd=0&lpi=y

This tells the file how many topics/post/forum ID etc to show.. like the part "10&sfn" tells that there should be 10 topics.

The only problem that the real topics anywhere has is the backslash "\" as you can see in the url
That is created when using: Hide labels like:
Announcement:, Sticky:, Moved:, [ Poll ], (Locked)
Because the backslash is a security risk for the server and should not be used..

So yes, im still waiting for "the real deal" like everyone else here...
Everything that is not perfect is a flaw [",]
baba_n
Registered User
Posts: 24
Joined: Mon Mar 30, 2009 3:03 pm

Re: [REQUEST] Recent Posts on Home Page

Post by baba_n »

MartinWh wrote:Well thanks for this -- have now included on my forum index.page http://www.phpbb.com/rules/#rule6a

One small problem is the script is affecting the language calls below it forcing me to put it at the bottom of page and hardcoding the language calls below.

This is the code used for my lastposts section in index_body.html

Code: Select all

		<div class="forabg">
			<div class="inner"><span class="corners-top"><span></span></span>
			<ul class="topiclist">
				<li class="header">
					<dl>
						<dt>Latest Posts</dt>
					</dl>
				</li>
			</ul>
			<ul class="forums">
		<li>
			<dl>
				<dt>
<!-- INCLUDEPHP lastpost.php --><br />
				</dt>
			</dl>
		</li>
			</ul>

			<span class="corners-bottom"><span></span></span></div>
		</div>
and in lastpost.php

Code: Select all

<style>
	a.Latp1:link,a.Latp1:active,a.Latp1:visited {font-family: verdana, arial, helvetica, sans-serif; font-size: 11px;color:#6F6F6F; font-weight: bold; text-decoration:none; line-height: 14px;}
	a.Latp1:hover {font-family: verdana, arial, helvetica, sans-serif; font-size: 11px;color:#B90000; font-weight: bold; text-decoration:none}
	a.Latp2:link,a.Latp2:active,a.Latp2:visited {font-family: verdana, arial, helvetica, sans-serif; font-size: 11px;color:#0F0F0F; font-weight: bold; text-decoration:none; line-height: 14px;}
	a.Latp2:hover {font-family: verdana, arial, helvetica, sans-serif; font-size: 11px;color:#B90000; font-weight: bold; text-decoration:none}
	.Latp {font-family: verdana, arial, helvetica, sans-serif; font-size: 11px;color:#AFAFAF; font-weight: bold; text-decoration:none}
</style>
<?
        /*** 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="REMOVED";

        //Table prefix
        $table="forum_";

        //Show last x topics
        $laforums="10";
      
   //Topic name length
        $tl="40";

        $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("F j, Y, 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 "<TABLE width='98%' cellpadding=2 cellspacing=0 border=0 align=center><TR><TD width='15%' class=Latp><a class=Latp1 href='http://".$config_value."/a1forum/viewforum.php?f=".$forum_id."'>".$row2[forum_name].":</a></TD><TD width='35%' class=Latp><a class=Latp2 href='http://".$config_value."/a1forum/viewtopic.php?f=".$forum_id."&t=".$topic_id."&p=".$topic_last_post_id."#p".$topic_last_post_id."'>".$topic_title."</a></TD><TD width='50%' class=Latp> last poster: ".$topic_last_poster_name." on ".$date."<br /></TD></TR></TABLE>\n";
      }
        //-------------------------- END
        ?>
Hallo,
I've installed this version and works fine for me. The only problem is that my forum is german and the ü, ö, ä, letters are not showing in IE. In Firefox works fine. Could anyone help me to fix the problem?
You can find the working page at www tt600r eu

Thanks
baba

Return to “[3.0.x] MOD Requests”