1

Topic: Displaying latest topics on front page of website?

Hi there!

I've tried searching for a solution to this problem, but I've had no luck. So, basically I'd like the latest topics in my PunBB forum to show up on the front page of my website. As far as I understand, this involves including extern.php, but since my host doesn't allow remote URL file access this won't work. Is there any way of getting around this?

Thanks.

Re: Displaying latest topics on front page of website?

Does your host allow cURL?

3

Re: Displaying latest topics on front page of website?

I'm not sure. If it does, how would I go about?

Re: Displaying latest topics on front page of website?

<?php
$cp = curl_init("http://terrainland.com/forum/extern.php?action=active&show=7");
curl_exec($cp);
?>

replace the URL with the correct one for you, obviously

5

Re: Displaying latest topics on front page of website?

Thanks! That code worked on my local server, but sadly my host doesn't seem to allow cURL... :S

There isn't any other way? I'm using Wordpress on the rest of the site, if it makes any difference?

Re: Displaying latest topics on front page of website?

Not without modifying some code, no

7

Re: Displaying latest topics on front page of website?

Well I'm all for modifying code if it makes things work! big_smile You've been really helpful, and I'm thankful for that, but could you please guide me how to do the modifications?

Re: Displaying latest topics on front page of website?

Mmm, lets just hack around it this way

$old_get = $_GET;
$_GET = array();
// set all the get parameters you would normally put in the URL here

include PUN_ROOT.'extern.php';

$_GET = $old_get;

9

Re: Displaying latest topics on front page of website?

Hmmm... What file would I edit? I'm sorry, but I know some PHP, but this is beyond me... tongue

Re: Displaying latest topics on front page of website?

This would replace your normal include

11

Re: Displaying latest topics on front page of website?

Sorry to bother you again, but I can't get it to work... Could you please give me an example of the complete code?

Re: Displaying latest topics on front page of website?

I'll give you an example

$old_get = $_GET;
$_GET = array();
$_GET['action'] = 'active';

include PUN_ROOT.'extern.php';

$_GET = $old_get;

13

Re: Displaying latest topics on front page of website?

Thank you! I got it to work now. You're a life saver!

14

Re: Displaying latest topics on front page of website?

Oh my, I have another problem. The latest topics show up just fine, but non-English characters aren't displayed correctly. The character encoding of the page that I'm including the latest topics in is UTF-8, but the characters are still all messed up even if I change the charset to ISO-8859-1. The forum pages are in UTF-8, and all characters display correctly on them. What am I doing wrong?

Re: Displaying latest topics on front page of website?

I would need to see the page to diagnose any issue.