![]() |
What's going on: |
|
|
#1 |
|
Forum admin
|
Recent topics in phpBB3
This tutorial/phpbb hack will allow you display recent topics from your forum OUTSIDE of your phpBB3 root folder. The file however MUST still be on the same server! At current this tutorial is for mysql databases only. This tutorial does not use phpBB3's DBAL in order to improve load times. 1. Create a new file called recent-topics.php Paste the below code into your new file: PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
We then create the hyperlink. We use PHP Code:
Putting {} around variables in a PHP stirng using double quotes allows for variable interpolation. This means the variables are replaced by their value when the string is parsed. PHP Code:
PHP Code:
2. Include the file! In order to display the topics all you need to do is include the recent-topics.php file wherever you wish. Remember though that the $path variable in the recent-topics.php file need to be relative to the location of the file you are including it in, rather than the location of recent-topics.php itself. To include the file on your page: PHP Code:
PHP Code:
Any questions or support please ask in this thread Last edited by Josh@SWG; 12-07-2008 at 07:30 AM. |
|
|
|
|
|
#2 |
|
Forum admin
|
For a demo of the result of this tutorial: http://awesomestyles.com/demoforum/recent-topics.php
|
|
|
|
|
|
#3 |
|
Forum admin
|
You can now exclude forums
|
|
|
|
|
|
#4 | |
|
Grand Vizier
Join Date: Jan 2007
Posts: 4,236
Credits: 10,190
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Well I tried this and all I got was this appearing on my forum
|
|
|
|
|
|
|
#5 |
|
Forum admin
|
|
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Jul 2008
Posts: 1
Credits: 120
![]() |
What about displaying the actual text in the post?
Such as using the posts table instead of topics table. substr($topic['post_text'],0,20) This outputs nothing. I noticed in the database the information is stored as BLOB |
|
|
|
|
|
#7 |
|
Forum admin
|
This script gets the information from the topics table whereas the post content is stored in the posts table. So you'd have to carry out another query every topic to get the post content for that topic.
|
|
|
|
|
|
#8 |
|
Spelling and Grammar Queen !!!
Join Date: Jan 2007
Location: Between Heaven and Hell
Posts: 5,478
Credits: 10,656
![]() ![]() ![]() ![]() ![]() ![]() |
HP loving your sig its fab sorry OT
__________________
NEVER EXPLAIN YOURSELF TO ANYONEBECAUSE THE PERSON WHO LIKES YOU DOESN'T NEED IT ![]() AND THE PERSON WHO DISLIKES YOU WONT BELIEVE IT
|
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Aug 2008
Posts: 1
Credits: 20
![]() |
What are the limitations of storing the file. I am having a lot of problemgs getting the result to display.
My forums: http://forums.alphabluetech.com/kjhanlon/index.php Test Display Page: http://www.alphabluetech.com/kjhanlon/testrecent.html Any ideas. The subdomain is different but the server and host info should be the same. Is this limited to an PHP homepage instead of HTML? Any help would be greatly appreciated. -kevin |
|
|
|
|
|
#10 |
|
Member
Join Date: Dec 2007
Location: Plotting Evil on FreeForums.org!
Posts: 81
Credits: 24
![]() |
Try renaming that file from .html to .php.... subdomain does not matter..
Also, don't use the full URL when including, only use the relative URL IE <?php include('http://mysite.com/file.php'); ?> Use.... <?php include('./file.php'); ?> Last edited by mr. bond; 04-08-2008 at 01:08 AM. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Hot Topics Forum | Mental Minnie | General discussions | 52 | 13-10-2007 02:54 PM |
| phpBB3 RC3 | plutomedia | General discussions | 5 | 13-07-2007 06:30 PM |
| can we converse by the medium of thread topics? | scarlett o'hara | General discussions | 0 | 03-07-2007 11:55 AM |