Hi everyone!
I am trying to get some of my forum data on my web sites home page but having trouble.
I want to run this script from my web site but this little statement is confusing me: $phpbb_root_path = '../../../'; I need to point this to my forum (I think) I have tried so many combinations now I give up :glare:
Along with fixing the above to point to the right location I am thinking I can just paste this in my home page and it should work right? according to the mod I have made the "mods" folder and put all associated files there.
<?php
$phpbb_root_path = '../../../';
define ('IN_PHPBB', true);
include_once ($phpbb_root_path . 'extension.inc'); // always need on all scrips
include_once ($phpbb_root_path . 'common.' . $phpEx); // always need on all scrips
include_once ($phpbb_root_path . 'includes/bbcode.' . $phpEx); // always need on all scrips
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/common.' . $phpEx); // commons is shared code
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/posts.' . $phpEx); // this one depends on your goal
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
$news = phpbb_fetch_posts();
phpbb_disconnect();
?>
<ul>
<?php for ($i = 0; $i < count($news); $i++) { ?>
<li><?php echo $news[$i]['topic_title']; ?></li>
<?php } ?>
</ul>
Thanks!!