Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Thu Aug 11, 2005 8:57 pm Reply with quote

Following a news post on this site from [ Only registered users can see links on this board! Get registered or login! ] who say they have ported this mod (originally from netclectic) I have everything working except one file (news_insert.php)
Strange that when running the file via the forum admin interface it works fine by inserting rss feeds directly into the pre-defined forums but when running the file via cron to automate the news input (as per the readme) I get a number of errors;
Quote:
Warning: main(includes/constants.php): failed to open stream: No such file or directory in /removed/modules/Forums/common.php on line 203
Warning: main(): Failed opening 'includes/constants.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /removed/modules/Forums/common.php on line 203
Warning: main(includes/template.php): failed to open stream: No such file or directory in /removed/modules/Forums/common.php on line 204
Warning: main(includes/sessions.php): failed to open stream: No such file or directory in /removed/modules/Forums/common.php on line 205
Warning: main(includes/auth.php): failed to open stream: No such file or directory in /removed/modules/Forums/common.php on line 206
Warning: main(includes/functions.php): failed to open stream: No such file or directory in /removed/modules/Forums/common.php on line 207
Warning: main(db/db.php): failed to open stream: No such file or directory in /removed/modules/Forums/common.php on line 208
Fatal error: Call to undefined function: encode_ip() in /removed/modules/Forums/common.php on line 220


Looking in common.php (lines 203 to 208) we find;
Code:
 include("includes/constants.php");

    include("includes/template.php");
    include("includes/sessions.php");
    include("includes/auth.php");
    include("includes/functions.php");
    include("db/db.php");


So unless I am mising something, due to lack of sleep, the paths actually appear correct (apart from the last error).
However, if we then look at common.php in more detail we see;
Code:
if (defined('FORUM_ADMIN')) {

    include("../../../db/db.php");
    include("../../../includes/constants.php");
    include("../../../includes/template.php");
    include("../../../includes/sessions.php");
    include("../../../includes/auth.php");
    include("../../../includes/functions.php");
} else {
    include("includes/constants.php");
    include("includes/template.php");
    include("includes/sessions.php");
    include("includes/auth.php");
    include("includes/functions.php");
    include("db/db.php");
}


So I'm wondering if the general errors might be because when calling news_insert.php via cron FORUM_ADMIN is not defined within that file - but when you call news_insert.php via the admin interface manually it has already been defined which might explains the problem.

Anyone else using this and got it working with a 'patched' site before I start hacking away in an attempt to fix this?
The download is available here [ Only registered users can see links on this board! Get registered or login! ] and so far I have found it exceptionally usefully for creating 'instant' forum content for google to chew on.
 
View user's profile Send private message Send e-mail
NoFantasy
Worker
Worker



Joined: Apr 26, 2005
Posts: 114

PostPosted: Sat Aug 27, 2005 5:02 pm Reply with quote

This was actually a mod i found useful too Mr. Green I assume many of my users find it ok to read the daily headlines at one place.
I'm among those who can't use Cron or other tools to automate this, so my question is:

How to make the manual update a bit faster to access? As for now it's 5 clicks away...aaaall the way into the forumadmin, and back... Is there a way to make a simple button in the Nuke-adminpanel whitch updates the whole thing?
No way i'm gonna do the manual update twice a day, every day, without an easier update-procedure *lol*
 
View user's profile Send private message
Guardian2003







PostPosted: Sun Aug 28, 2005 12:19 am Reply with quote

In theory, you should be able to call the file directly by entering the full url to the file - the problem is, it will not work because of the path errors.
Fixing it is on my to-do list but as the list is quite long I couldnt give you a timescale.
 
NoFantasy







PostPosted: Sun Aug 28, 2005 7:25 am Reply with quote

I made my own (very simple) solution:
../admin/links/links.admin_newsfeeds.php
Code:
<?php

if ( !defined('ADMIN_FILE') )
{
   die ("Access Denied");
}
if ($radminsuper==1) {
    adminmenu("modules/Forums/admin/admin_newsfeeds.php", "Update forumfeeds", "forumfeed.gif");
}

?>


and changed the code in
../modules/Forums/mods/netclectic/find_input/includes/functions_news.php
to:
Code:
$success_message = '<br>Completed: <b>successfully</b>:<br>' . ( ($success_message == '') ? 'None' :  $success_message );

    $error_message = '<br>Completed: <b>with problems</b>:<br>' . ( ($error_message == '') ? 'None' : $error_message );
   $end_message = '<br><a href="../../../admin.php"><b>Back to admin</b></a><br>';
   
   return $success_message . '<br><br>' . $error_message . '<br><br>' . $end_message;

Probably not the best solution, but it's an easy and quick way to manual update.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©