Author |
Message |
rebelt
Worker


Joined: May 07, 2006
Posts: 172
|
Posted:
Sun Sep 27, 2009 1:13 am |
|
So when mainfile gives the instruction require_once(./config.php)
The response from the system shouldn't then say No such file or directory (local machine), or a blank page |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Sun Sep 27, 2009 1:18 pm |
|
I may have to rethink the first part. But, a blank page is almost never a result of a file not found. mainfile.php has a lot of @ before a function. Remove the @ signs and you will eventually see the error(s) |
|
|
|
 |
rebelt

|
Posted:
Mon Sep 28, 2009 6:21 pm |
|
Quote: | Remove the @ signs and you will eventually see the error(s) |
Did that, Only registered users can see links on this board! Get registered or login!.  |
|
|
|
 |
spasticdonkey
RavenNuke(tm) Development Team

Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA
|
Posted:
Mon Sep 28, 2009 7:50 pm |
|
what about just making a simple module?
wrap in php tags and save as modules/YOUR_MODULE/index.php
Code:if (!defined('MODULE_FILE')) die ('You can\'t access this file directly...');
require_once('mainfile.php');
$module_name = basename(dirname(__FILE__));
// To use Custom CSS in your RavenNuke Module
// place CSS file in themes/YOUR_THEME/style directory
// otherwise comment out
define ('RN_MODULE_CSS','your-css.css');
include('header.php');
// show/hide right side blocks true=show false=hide
define('INDEX_FILE', true);
OpenTable();
// will look for html file in modules/YOURMODULE/yourhtmlfile.html
// your html file should only contain only what
// is inbetween the body tags
include('yourhtmlfile.html');
CloseTable();
include('footer.php');
|
other pages can be added to the module, saving as modules/YOUR_MODULE/whatever.php
and to reach that page:
yoursite.com/modules.php?name=YOUR_MODULE&file=whatever |
|
|
|
 |
rebelt

|
Posted:
Tue Sep 29, 2009 2:08 am |
|
I had considered looking into that, but the problem is, a software program creates the files, and it would mean taking out the information between the head tags in 240 files.
The guy who will be updating these files (some of them will be weekly) doesn't have anything other than notepad.
Thanks for the input though. |
|
|
|
 |
Raven

|
Posted:
Tue Sep 29, 2009 9:15 am |
|
Rebelt,
Please send me a private email and describe your process in intricate detail. I'm not sure the process flow is being understood and so we're shooting in the dark, as they say. |
|
|
|
 |
rebelt

|
Posted:
Wed Sep 30, 2009 7:11 am |
|
|
|
 |
rebelt

|
Posted:
Thu Oct 01, 2009 2:07 am |
|
After a few pm's with Raven (thanks again), I'm using spasticdonkey's idea.
Created the index.php file
Code:<?php
if (!defined('MODULE_FILE')) die ('You can\'t access this file directly...');
require_once('mainfile.php');
$module_name = basename(dirname(__FILE__));
// To use Custom CSS in your RavenNuke Module
// place CSS file in themes/YOUR_THEME/style directory
// otherwise comment out
define ('RN_MODULE_CSS','fixtures.css');
include('header.php');
// show/hide right side blocks true=show false=hide
define('INDEX_FILE', true);
OpenTable();
// will look for html file in modules/YOURMODULE/yourhtmlfile.html
// your html file should only contain only what
// is inbetween the body tags
include('index.htm');
CloseTable();
include('footer.php');
?>
|
http://rebelt.westonpoolleague.org.uk/modules.php?name=Fixtures
That bit works
But when I go to a page I get Sorry, that module file was not found.
In an effort to fix this myself I looked at the nuke howto module, and the index.php has
Code:$ACCEPT_FILE = array();
$ACCEPT_FILE['whatever.html'] = 'whatever.html';
|
So I tried adding that (but with the correct filename ), but still get the same error.
Now I'm stuck again.
Sorry if I'm being a bit of a dumb a**e  |
|
|
|
 |
spasticdonkey

|
Posted:
Thu Oct 01, 2009 4:53 am |
|
your getting closer, i noticed one url you had formatted almost correctly (you don't need .php on the end):
rebelt.westonpoolleague.org.uk/modules.php?name=Fixtures&file=ws_2009_tables_division_1.php
you get this message because it's not able to find the file
Sorry, that module file was not found.
you should have this file in your module
rebelt.westonpoolleague.org.uk/modules/Fixtures/ws_2009_tables_division_1.php
and if it includes an html file like so:
include('somefile.html');
you should have this file in your module
rebelt.westonpoolleague.org.uk/modules/Fixtures/somefile.html
you can also set
$display_errors = TRUE;
in config.php which may show you some additional error info, just remember to set to false when your done... |
|
|
|
 |
rebelt

|
Posted:
Thu Oct 01, 2009 5:15 am |
|
I only had the one link formated because that was the only file I'd uploaded whilst trying to get it working.
changed the link new error.
Parse error: syntax error, unexpected '<' in /homepages/24/d229158065/htdocs/RebelT/modules/Fixtures/ws_2009_tables_division_1.php on line 2
And line 2 is
<P class=hc2>Division 1 Table</P>
File starts
Code:<?php
<P class=hc2>Division 1 Table</P>
the other html
?>
|
|
|
|
|
 |
spasticdonkey

|
Posted:
Thu Oct 01, 2009 5:34 am |
|
ya you cant use html inside of php tags like that.
echo '<P class=hc2>Division 1 Table</P>';
would work but really it's easier to format ws_2009_tables_division_1.php like my example above, and if you need to do html have a separate file and include it.
include('somefile.html');
php will escape to html mode and return to php automatically without the need for special formatting. The only reason to write html in php is if you need to use variables or retrieve/post info to/from the db.
btw, although it will look for the html file in:
rebelt.westonpoolleague.org.uk/modules/Fixtures/somefile.html
modules.php loads it as though it were in the root dir
rebelt.westonpoolleague.org.uk/somefile.html
so any image or file paths in the html have to be relative to the root dir, like:
<img src="images/myimage.gif" /> or
<img src="modules/Fixtures/images/myimage.gif" /> |
|
|
|
 |
rebelt

|
Posted:
Thu Oct 01, 2009 7:06 am |
|
Grey is the new blonde because I must be missing something.
in index.php I have include('index.htm'); which works fine.
ws_2009_tables_division_1.htm which is definately there but it doesn't find
edit.
Changed it back to ws_2009_tables_division_1.php. Finds the file but only displays content.
Trying different things
Added another file ws_2009_tables_division_2.php with the includes for header mainfile etc. Different errors.
I really don't have a scooby and am running out of straws.
Both methods described in this topic should work.  |
|
|
|
 |
spasticdonkey

|
Posted:
Thu Oct 01, 2009 2:24 pm |
|
if you can archive a couple of the html pages into .zip or .7z, and post or pm a link to download, I'll do you up a simple sample  |
|
|
|
 |
rebelt

|
Posted:
Fri Oct 02, 2009 5:34 pm |
|
Would just like to thank Raven and spasticdonkey for their time and help.
 |
|
|
|
 |
Raven

|
Posted:
Fri Oct 02, 2009 10:37 pm |
|
So, are you fixed or still searching ? |
|
|
|
 |
rebelt

|
Posted:
Fri Oct 02, 2009 11:34 pm |
|
Once I received the simple sample, I realised I needed a filename.php for every filename.html.
I have to create a load of files now but it should only need doing once.
I must admit though, I'm curious as to why the ../mainfile.php route didn't work |
|
|
|
 |
Raven

|
Posted:
Sat Oct 03, 2009 12:10 am |
|
My intuition tells me it's still an issue of relative directory access. When I get stumped like this I start using absolute paths everywhere. For instance, you set a constant like define('BASEPATH','/home/userid/public_html/somepath/'); where somepath is where mainfile.php resides. then everything is relative to BASEPATH.
Instead of guessing like include '../../mainfile.php'; it now becomes include BASEPATH . 'mainfile.php'; or include BASEPATH . 'config.php'; |
|
|
|
 |
|