DIY portal?

Do not post support requests, bug reports or feature requests. Discuss phpBB here. Non-phpBB related discussion goes in General Discussion!
Scam Warning
Post Reply
Shohreh
Registered User
Posts: 49
Joined: Tue Jun 17, 2014 11:32 am

DIY portal?

Post by Shohreh »

Hello,

Newbie question here.

For a small, non-profit organization, a full-fledged portal application like Joomla etc. in addition to phpBB for the forum is overkill.

I was wondering how hard it'd be to write a PHP script that would live at the root of the site, to simply read and display posts written in a specific section of the phpBB forum.

Ie. a simple way to make those posts stand out, while still being available in the forum.

Is it just a matter of reading such and such phpbb_ table off the database?

Thank you.

--
Edit: For instance, reading off those tables?
phpbb_posts: post_username, forum_id, post_subject, post_text
phpbb_topics: topic_title, topic_poster
tvm
Registered User
Posts: 40
Joined: Tue Sep 27, 2022 5:51 am

Re: DIY portal?

Post by tvm »

Correct, query topics, posts and match up with userid and you got plenty to make a script such as "last 10 topics" or similar.
User avatar
cabot
Registered User
Posts: 690
Joined: Sat Jan 07, 2012 4:16 pm
Contact:

Re: DIY portal?

Post by cabot »

Hello,

You could also do this quite simply by scraping the forum section with Ajax or PHP, or even by using the forum feeds.
Shohreh
Registered User
Posts: 49
Joined: Tue Jun 17, 2014 11:32 am

Re: DIY portal?

Post by Shohreh »

I'd be surprised if I were the first phpBB user to need this.
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72343
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: DIY portal?

Post by KevC »

There are a couple of portals for older versions in the extensions database. You could try those on a test installation. Also check the support pages in case a patch has been posted.

Portals were really popular about 15 years ago but they've died out a fair bit these days. Most users go straight to the 'new posts' page.
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
Shohreh
Registered User
Posts: 49
Joined: Tue Jun 17, 2014 11:32 am

Re: DIY portal?

Post by Shohreh »

The "New posts" link is very useful, but I'd like to find a way for admins to make their articles more obvious by also publishing them on the homepage, alongside the forum.

I'll check those older add-on's.
User avatar
KevC
Support Team Member
Support Team Member
Posts: 72343
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: DIY portal?

Post by KevC »

But the users will bookmark the forum index or the new posts page so they'll never see them anyway. Going to a portal page first just adds an extra click to where they really want to go. Feel free to try it but I suspect that's what will happen.
-:|:- Support Request Template -:|:-
Image
"Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb"
Shohreh
Registered User
Posts: 49
Joined: Tue Jun 17, 2014 11:32 am

Re: DIY portal?

Post by Shohreh »

eg.

Code: Select all

<html>
   <head>
      <title>Poor man's portal</title>
   </head>

   <body>
		<?php
		
		$dbhost = 'localhost:3036';
		$dbuser = 'someuser;
		$dbpass = 'somepasswd';

		//PHP Version 5.3.29
		$conn = mysql_connect($dbhost, $dbuser, $dbpass);
		if(! $conn ) {
			die('Could not connect: ' . mysql_error());
		}
		
		echo 'Connected successfully<p>';
		mysql_select_db( 'someDB' );

		$sql = "SELECT topic_title,topic_poster,topic_time,username,user_email FROM phpbb_topics,phpbb_users WHERE topic_poster=user_id";
		$res = mysql_query($sql);
		while ($data = mysql_fetch_assoc($res)) {
			$date_published = date('r', $data['topic_time']);
			echo "Title: " . $data['topic_title'] . "<br>" . "Time: ". $date_published . "<br>" . " Poster: ". $data['username'] . "<br>" .  " Email: ". $data['user_email'] . "<p>";			
		}

		echo "Fetched data successfully\n<p>";

		mysql_close($conn);
		?>
   </body>
</html>
User avatar
Gumboots
Registered User
Posts: 692
Joined: Fri Oct 11, 2019 1:59 am

Re: DIY portal?

Post by Gumboots »

KevC wrote: Wed Oct 12, 2022 11:37 amPortals were really popular about 15 years ago but they've died out a fair bit these days. Most users go straight to the 'new posts' page.
TBH that's one page I never use, to the extent that I removed it from my menu* to save clutter. The only ones I ever use are "Unread posts" and, very occasionally, "Active topics".

*Even on this site, via Stylus.
🇺🇦 Слава Україні! 🇺🇦 Героям слава! 🇺🇦
genshijin
Registered User
Posts: 122
Joined: Fri Nov 09, 2018 2:03 pm
Location: Uk and sometimes Japan
Name: andy duggan
Contact:

Re: DIY portal?

Post by genshijin »

I think the development of some phpBB extensions has made the need for a portal almost redundant. I used to use them with some forums but with a few extensions it is not needed any more.

Board Announcements
Pages
LDMI Multilinks
Simple News Admin
Board Rules
Recent Topics
Random Banner

Apart from php blocks - job done!
Post Reply

Return to “phpBB Discussion”