PHP Web Host - Quality Web Hosting For All PHP Applications Free RavenNuke(tm) Add Ons
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 138

PostPosted: Sun Sep 27, 2009 1:13 am Reply with quote Back to top

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
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16976
Location: Kansas

PostPosted: Sun Sep 27, 2009 1:18 pm Reply with quote Back to top

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)
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 138

PostPosted: Mon Sep 28, 2009 6:21 pm Reply with quote Back to top

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 to the forums!
. Very Happy
View user's profile Send private message Visit poster's website
spasticdonkey
RavenNuke(tm) Development Team


Joined: Dec 02, 2006
Posts: 1254
Location: Texas, USA

PostPosted: Mon Sep 28, 2009 7:50 pm Reply with quote Back to top

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
View user's profile Send private message
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 138

PostPosted: Tue Sep 29, 2009 2:08 am Reply with quote Back to top

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.
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16976
Location: Kansas

PostPosted: Tue Sep 29, 2009 9:15 am Reply with quote Back to top

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.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 138

PostPosted: Wed Sep 30, 2009 7:11 am Reply with quote Back to top

PM sent
View user's profile Send private message Visit poster's website
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 138

PostPosted: Thu Oct 01, 2009 2:07 am Reply with quote Back to top

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');
?>
Only registered users can see links on this board!
Get registered or login to the forums!


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 Wink ), but still get the same error.

Now I'm stuck again.

Sorry if I'm being a bit of a dumb a**e Smile
View user's profile Send private message Visit poster's website
spasticdonkey
RavenNuke(tm) Development Team


Joined: Dec 02, 2006
Posts: 1254
Location: Texas, USA

PostPosted: Thu Oct 01, 2009 4:53 am Reply with quote Back to top

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...
View user's profile Send private message
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 138

PostPosted: Thu Oct 01, 2009 5:15 am Reply with quote Back to top

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
?>
View user's profile Send private message Visit poster's website
spasticdonkey
RavenNuke(tm) Development Team


Joined: Dec 02, 2006
Posts: 1254
Location: Texas, USA

PostPosted: Thu Oct 01, 2009 5:34 am Reply with quote Back to top

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" />
View user's profile Send private message
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 138

PostPosted: Thu Oct 01, 2009 7:06 am Reply with quote Back to top

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

Shocked

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. Very Happy

Both methods described in this topic should work. Shocked Sad Embarassed Mad
View user's profile Send private message Visit poster's website
spasticdonkey
RavenNuke(tm) Development Team


Joined: Dec 02, 2006
Posts: 1254
Location: Texas, USA

PostPosted: Thu Oct 01, 2009 2:24 pm Reply with quote Back to top

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 Smile
View user's profile Send private message
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 138

PostPosted: Fri Oct 02, 2009 5:34 pm Reply with quote Back to top

Would just like to thank Raven and spasticdonkey for their time and help.
Wave
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16976
Location: Kansas

PostPosted: Fri Oct 02, 2009 10:37 pm Reply with quote Back to top

So, are you fixed or still searching ?
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
rebelt
Worker
Worker


Joined: May 07, 2006
Posts: 138

PostPosted: Fri Oct 02, 2009 11:34 pm Reply with quote Back to top

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
View user's profile Send private message Visit poster's website
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 16976
Location: Kansas

PostPosted: Sat Oct 03, 2009 12:10 am Reply with quote Back to top

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';
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum