Jump to content

Simple php error


Recommended Posts

I have been working on installing a script called Fantastic News from    http://fscripts.com 

I have been trying to make it so I can use the news.php on other pages

Right now im getting an Unable to Open Template error

http://www.ipetrescue.com/arts/articles.php


[b]Here are the instructions....[/b]
If you plan on including news.php on a page rather than calling it directly you can use the include("news.php"); if you're page is php or if its just straight html use the ssi equivalent.  You'll also need to put the config.php file in the location where you do the include so that the script can read the config.php file If you are including it make sure to set that in your settings so that the script knows not to include the header and footer templates on your news.php file. You'll also need to include a script path so that the script can find the location of your templates and internal functions that the script uses. This feature is not recommended however doing this can make it possible but please note you'll need to move your config.php file over everytime you change settings also since this won't be the config.php file it usually uses


here is my articles.php file
[code]<?php
// +----------------------------------------------------------------------+
// |                        Fantastic News                              |
// +----------------------------------------------------------------------+
// |                          By Tony Baird                              |
// |                  Copyright (c) 2003 Fantastic Scripts                |
// |                          http://fscripts.com                        |
// +----------------------------------------------------------------------+
// | Fantastic News Can be modified freely as long as the copyright at    |
// | the bottom of every page and is visible.  This copyright header must |
// | also be left intact on php file                                      |
// +----------------------------------------------------------------------+
// | news.php                                                            |
// +----------------------------------------------------------------------+
include("/home/ipetresc/public_html/fnews/FNews/news.php");
require_once($CONFIG['script_path']."/home/ipetresc/public_html/arts/config.php");
require_once($CONFIG['script_path']."/home/ipetresc/public_html/fnews/FNews/functions/functions.php");
require_once($CONFIG['script_path']."/home/ipetresc/public_html/fnews/FNews/functions/mysql.php");
require_once($CONFIG['script_path']."/home/ipetresc/public_html/fnews/FNews/functions/template.php");
if (empty($tpl))
{[/code]


can anyone help?


Link to comment
Share on other sites

Try this instead:

[code]require_once("/home/ipetresc/public_html/arts/config.php");
include($CONFIG['script_path'] . '/news.php');
require_once($CONFIG['script_path'] . '/functions/functions.php');
require_once($CONFIG['script_path'] . '/functions/mysql.php');
require_once($CONFIG['script_path'] . '/functions/template.php');[/code]

$CONFIG['script_path'] won't be defined until after you include the config file, and since it's the path to the FNews directory (I think), you don't need to append it to the full server path.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.