MyBB Community Forums

Full Version: help with site news plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
did a search here, but could not find something wich helped me.. so if i missed it, i apologize.

i have installed the site plugin, but get the following eror when i look at news.php to test it.

Warning: require_once(./inc/init.php) [function.require-once]: failed to open stream: No such file or directory in /home/tmntfan/domains/tmntfan.nl/public_html/affa/forum/global.php on line 13

Fatal error: require_once() [function.require]: Failed opening required './inc/init.php' (include_path='.:/usr/local/lib/php') in /home/tmntfan/domains/tmntfan.nl/public_html/affa/forum/global.php on line 13

the code in the news file is the following:

<?php

define("IN_MYBB", 1);
define("KILL_GLOBALS", 1);
define("NO_ONLINE", 1);

// The Directory to the forum you are using this on. 
// You do not need a beggining or trailing slash
$directory_to_forum = "forum"; 

require dirname(__FILE__)."/".$directory_to_forum."/global.php";

$plugins->run_hooks("site_news_plugin_run");

?>

i did follow the instructions, but.. did i miss something, or do something wrong? also, i want to be able to place the news part on a page located in another directory (/HTML) then the index is. is it possible, and if yes, how?

edit: i checked, the files he is missing are there. and the forum in question is working normally.
the only thing i can think of is that you have not got the directory correct.

this line

$directory_to_forum = "forum";

is forum the correct path to your forums ?

as to your other question your other page would have to be php to run the script other than that it is possible for this plugin to waork as you required

FnT...
Hello man i have a big dude.

where do i write the news?

and where i put CSS code

im confused ConfusedSS
fishntassie Wrote:the only thing i can think of is that you have not got the directory correct.

this line

$directory_to_forum = "forum";

is forum the correct path to your forums ?

as to your other question your other page would have to be php to run the script other than that it is possible for this plugin to waork as you required

FnT...

the path is indeed forum... i double checked it myself ((sorry for the late response.. had some rl stuff to take care off first.))

the page is php, also checked that, just in case i accidentally saved it in html.. . its still giving off that error.
Quote:$directory_to_forum = "forum";

require dirname(__FILE__)."/".$directory_to_forum."/global.php";
That is not correct. You need to use "chdir" before you require the global.php.

For example:
$directory_to_forum = "forum"; 

chdir(dirname(__FILE__)."/".$directory_to_forum);
require "./global.php";

Of course this is just example code, and you'll need to modify it to suit your site's structure.
thanks a lot! that worked!
Hello man i have a big dude.

where do i write the news?

and where i put CSS code

im confused ConfusedSS


ANYONE CANS HELP ME PLEASE??


i only see a blank page