 |

02-25-2008, 07:20 AM
|
 |
WebProWorld Veteran
|
|
Join Date: Nov 2004
Location: UK
Posts: 504
|
|
PHPBB Question
I have taken over some sites, and one has a PHPBB forum running on it. We would like to add a 'latest posts' section to the home page of the site - any ideas how i do this? I have never worked with PHPBB before so any tips greatly appreciated!
thanks
fiona
|

02-25-2008, 12:06 PM
|
|
WebProWorld New Member
|
|
Join Date: Dec 2005
Location: UK
Posts: 16
|
|
Re: PHPBB Question
I haven't worked with PHPBB but some forums have an SSI tool for including forum posts or a login box, you might check their support site for one, alternatively if there is an rss/xml feed of the latest posts you can use an rss feed parser like SimplePie.
__________________
Open Source CMS Integrations & Customisations *website under development*
(Dokuwiki / Simple Machines Forum / Drupal)
|

02-26-2008, 03:59 AM
|
|
WebProWorld Pro
|
|
Join Date: Sep 2005
Location: Manchester, UK
Posts: 253
|
|
Re: PHPBB Question
Which version of phpbb are you using? if it's one of the 2.x series the following code may be of use
Code:
$strSQL = "SELECT * " .
"FROM phpbb_posts INNER JOIN phpbb_users ON phpbb_users.user_id = phpbb_posts.poster_id " .
"INNER JOIN phpbb_topics ON phpbb_topics.topic_id = phpbb_posts.topic_id " .
"ORDER BY post_time DESC " .
"LIMIT 0 , 3 ";
$result = mysql_query($strSQL);
while($row = mysql_fetch_assoc($result))
{
print '<pre>';
print_r( $row );
print '</pre>';
}
mysql_free_result($result);
?>
That should pull out the last 3 posts in your forum.
|

02-26-2008, 08:34 PM
|
|
WebProWorld Member
|
|
Join Date: Oct 2005
Location: In my brain
Posts: 38
|
|
Re: PHPBB Question
What version of phpBB are you using?
They just released version 3, if it is that version, I could give you a bit of advise on how to easily do that. 
|

02-27-2008, 06:12 AM
|
 |
WebProWorld 1,000+ Club
|
|
Join Date: May 2005
Location: Norway
Posts: 4,690
|
|
Re: PHPBB Question
As a default, earlier versions of phpBB had to be installed in a BB subfolder like:
mysite.com/BB
Questions: - How easy is it to install version 3 on mysite.com?
- How easy is it to plug in modifications if you choose 1?
|

03-05-2008, 06:12 AM
|
 |
WebProWorld Veteran
|
|
Join Date: Nov 2004
Location: UK
Posts: 504
|
|
Re: PHPBB Question
MikeSmith, I am using asp pages not php but thank you!
I have found an rss topic feed for our forum so figured I could display this on our home page, I have some asp code that SHOULD display the last few posts. It works perfectly when I put in any RSS feed url - EXCEPT for our PHPBB forum feed - I get an error saying:
msxml3.dll error '800c0005'
The system cannot locate the resource specified.
/default2.asp, line 122
this is the section of code giving an error message:
Set xmlHttp = Server.CreateObject("MSXML2.XMLHTTP.3.0")
xmlHttp.Open "Get", URLToRSS, false
line 122: xmlHttp.Send()
RSSXML = xmlHttp.ResponseText
Set xmlDOM = Server.CreateObject("MSXML2.XMLHTTP.3.0")
xmlDOM.async = False
xmlDOM.validateOnParse = False
xmlDom.resolveExternals = False
Does anyone know why i get this or how to fix it? As i Said, in the code when i put in any other rss feed, say, for example, alistapart, bbc, yahoo, the last posts display perfectly. But the rss feed from our forum (hosted on the same server as the site) gives this error message.
I have searched and searched online but cannot seem to find an answer!
|

03-05-2008, 06:44 AM
|
 |
WebProWorld 1,000+ Club
|
|
Join Date: May 2005
Location: Norway
Posts: 4,690
|
|
Re: PHPBB Question
Quote:
Originally Posted by pagetta
MikeSmith, I am using asp pages not php but thank you!
I have found an rss topic feed for our forum so figured I could display this on our home page, I have some asp code that SHOULD display the last few posts. It works perfectly when I put in any RSS feed url - EXCEPT for our PHPBB forum feed - I get an error saying:
msxml3.dll error '800c0005'
The system cannot locate the resource specified.
/default2.asp, line 122
this is the section of code giving an error message:
Set xmlHttp = Server.CreateObject("MSXML2.XMLHTTP.3.0")
xmlHttp.Open "Get", URLToRSS, false
line 122: xmlHttp.Send()
RSSXML = xmlHttp.ResponseText
Set xmlDOM = Server.CreateObject("MSXML2.XMLHTTP.3.0")
xmlDOM.async = False
xmlDOM.validateOnParse = False
xmlDom.resolveExternals = False
Does anyone know why i get this or how to fix it? As i Said, in the code when i put in any other rss feed, say, for example, alistapart, bbc, yahoo, the last posts display perfectly. But the rss feed from our forum (hosted on the same server as the site) gives this error message.
I have searched and searched online but cannot seem to find an answer!
|
I do not know ASP, but that seems like traditional oop code using ASP's XMLHttpRequest object (??) with a "Send metod". Can you use that method on the same server is my obvious first question? In other words, look up the documentation for the Send method of the xmlHttp object .
Last edited by kgun : 03-05-2008 at 06:48 AM.
|

03-05-2008, 11:24 AM
|
|
WebProWorld New Member
|
|
Join Date: Dec 2005
Location: UK
Posts: 16
|
|
Re: PHPBB Question
kgun makes sense, I don't know asp either.
I'd try checking that you can view the feed in your browser, and if not, check that the feed is enabled perhaps somewhere in phpBB settings. Also check that guests can view the feed. I'm not sure of phpBB group permissions system, it would be what I would try in another forum software first. Then I might experiment with the url/path used in the feed parser. Hope that helps.
__________________
Open Source CMS Integrations & Customisations *website under development*
(Dokuwiki / Simple Machines Forum / Drupal)
|

03-05-2008, 12:05 PM
|
 |
WebProWorld Veteran
|
|
Join Date: Nov 2004
Location: UK
Posts: 504
|
|
Re: PHPBB Question
thnx for the tips
the feed definitely displays normally in a browser. I will have a look at the phpbb settings see what i can find
thanks!
|

03-07-2008, 02:57 PM
|
|
WebProWorld Pro
|
|
Join Date: Sep 2005
Location: Manchester, UK
Posts: 253
|
|
Re: PHPBB Question
it's been a long time since i did any ASP but the sql statement I provided should allow you to pull out the records in ASP also. You'd just have to use the ASP syntax for calling that query.
Just seems a bit overkill to be using an rss feed reader to display records from the same site.
|

03-08-2008, 04:24 AM
|
|
WebProWorld New Member
|
|
Join Date: Dec 2005
Location: UK
Posts: 16
|
|
Re: PHPBB Question
Just a note to add that some php feed readers cache the feed data for specified period so that scripts and queries don't need to be run every page visit, saving on server loads which can be crucial to a high traffic website.
__________________
Open Source CMS Integrations & Customisations *website under development*
(Dokuwiki / Simple Machines Forum / Drupal)
|

03-11-2008, 08:41 AM
|
 |
WebProWorld Veteran
|
|
Join Date: Nov 2004
Location: UK
Posts: 504
|
|
Re: PHPBB Question
thnx mike I will have a go with that script then.
can i ask what you mean by overkill? the forum is only one part of the site, so surely having latest feeds running on the home page will encourage people to click through and use it?
|

03-12-2008, 04:19 AM
|
|
WebProWorld Pro
|
|
Join Date: Sep 2005
Location: Manchester, UK
Posts: 253
|
|
Re: PHPBB Question
Sorry I'll clear that point up. I'm not against the idea of having the latest forum posts on your homepage and in fact have done this myself on a number of occasions. What seems overkill to me is using an rss feed reader to achieve this, unless of course you're forced to because the forum is hosted on another server.
For me it would seem much simpler to just pull the posts from the db directly, as per my example.
Hope that makes sence and if you need any more help with the query please let me know.
|

03-17-2008, 11:19 AM
|
 |
WebProWorld Veteran
|
|
Join Date: Nov 2004
Location: UK
Posts: 504
|
|
Re: PHPBB Question
hi mike - i am a a complete newbie to all of this - how woud i translate that PHP into ASP syntax?! thnx so much for the help!
|

03-17-2008, 03:31 PM
|
|
WebProWorld Pro
|
|
Join Date: Sep 2005
Location: Manchester, UK
Posts: 253
|
|
Re: PHPBB Question
Hi again
Before I start do you really need to do this in ASP? It's just how have you got phpbb running if you need to use ASP?
Had to ask.
Anyway on to the ASP. This will be really rough as like I said previously i've not touched ASP in a long time, plus I don't know anything about your server setup.
Assuming you're using ODBC to connect to your database the following code may be useful
Code:
sql = "SELECT * FROM phpbb_posts INNER JOIN phpbb_users ON phpbb_users.user_id = phpbb_posts.poster_id INNER JOIN phpbb_topics ON phpbb_topics.topic_id = phpbb_posts.topic_id ORDER BY post_time DESC LIMIT 0 , 3 "
set conn=Server.CreateObject("ADODB.Connection")
conn.Open "northwind"
set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql, conn
While Not rs.EOF
Response.Write( rs("title") );
rs.MoveNext
Loop
Hopefully this will get you started. If you can provide some more information about your server set up I may be able to guide you further.
Hope this helps
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|