Author Topic: a news script to integrate with 4images  (Read 18617 times)

0 Members ve 1 Ziyaretçi konuyu incelemekte.

Offline Kee-Lo

  • Newbie
  • *
  • Posts: 11
    • View Profile
a news script to integrate with 4images
« on: Ekim 26, 2002, 07:41:22 ÖS »
Hi Jan

I am a real newbie to php, and I was wondering how I would go about installing a news script into the 4images portal.  I have done everything that the script tells me, but when it comes to this code, I get a parser error, I put it in index.php

Code: [Select]
<? include(news/news.php); ?>

Where am I going wrong?
Kee-Lo
=====

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Re: a news script to integrate with 4images
« Reply #1 on: Ekim 26, 2002, 08:27:48 ÖS »
Code: [Select]
<? include(news/news.php); ?>
Try this instead, exactly as shown here:
Code: [Select]
<?php
include(news/news.php);
?>

Offline Kee-Lo

  • Newbie
  • *
  • Posts: 11
    • View Profile
a news script to integrate with 4images
« Reply #2 on: Ekim 26, 2002, 08:47:30 ÖS »
sorry, that doesn't work either I am confused where I should put this code.  Is it in the templates or in index.php on the root?

I want it to show after the "whos logged in" bit

 :?  :?
Kee-Lo
=====

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
templates
« Reply #3 on: Ekim 26, 2002, 10:54:17 ÖS »
In the templates.  Be sure your starting tag is
Code: [Select]
<?php 
Your link assumes the news directory found in news/news.php is at the same location where you have the 4images index.php

Offline Kee-Lo

  • Newbie
  • *
  • Posts: 11
    • View Profile
a news script to integrate with 4images
« Reply #4 on: Ekim 26, 2002, 11:03:16 ÖS »
Quote

Parse error: parse error in template.php(133) : eval()'d code on line 368


 :x

I out it the full http address too :(

whats wrong with this thing?[/quote]
Kee-Lo
=====

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Double quotes needed
« Reply #5 on: Ekim 26, 2002, 11:17:23 ÖS »
Silly me, I missed the double quotes.
Code: [Select]
<?php 
include("news/news.php"); 
?>
URLs won't work in php includes.  Check the php documentation at www.php.net
« Last Edit: Şubat 21, 2006, 03:05:59 ÖS by V@no »

Offline Kee-Lo

  • Newbie
  • *
  • Posts: 11
    • View Profile
Errors Errors Errors
« Reply #6 on: Ekim 27, 2002, 02:05:19 ÖS »
Quote
Warning: Failed opening 'admin/system/error.php' for inclusion (include_path='.:/data/apache/php/mmp_lib') in engine.php on line 3

Warning: Failed opening 'admin/system/functions.php' for inclusion (include_path='.:/data/apache/php/mmp_lib') in engine.php on line 4

Fatal error: Call to undefined function: loadsettings() in engine.php on line 20


Is this a 4images thing, or does my host not support this function?

I also moved the folder to the templates folder and I got this:

Quote
Warning: Failed opening 'news/index.php' for inclusion (include_path='.:/data/apache/php/mmp_lib') in template.php(133) : eval()'d code on line 368
Kee-Lo
=====

Offline Deepu Sudhakar

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • http://deepu.cyanosis.net
a news script to integrate with 4images
« Reply #7 on: Ekim 27, 2002, 07:13:06 ÖS »
im trying to do a similar thing. but i found that php is not supported in the html templates though.

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Latest version?
« Reply #8 on: Ekim 27, 2002, 07:30:54 ÖS »
Quote from: Deepu Sudhakar
im trying to do a similar thing. but i found that php is not supported in the html templates though.


In my experience php is supported in the html templates.  I have several php statements working from variable assignments to includes.

Are you using the latest version?

Also be sure includes/constants.php has this line:
Code: [Select]
// Allow execution of PHP code in templates
define('EXEC_PHP_CODE', 1);

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Re: Errors Errors Errors
« Reply #9 on: Ekim 27, 2002, 07:36:48 ÖS »
Quote from: Kee-Lo
Quote
Is this a 4images thing, or does my host not support this function?

I also moved the folder to the templates folder and I got this:
If you're going to post the error messages, it would help if you also posted the include code from your templates as well.  Otherwise the error messages don't really help.

One last suggestion comes come to mind:

Use the full server path name to the news script.  If your news script is located here:  /home/www/keelo/htmldocs/news/news.php
your include statement should look like this:
Code: [Select]
<?php
include("/home/www/keelo/htmldocs/news/news.php");
?>

« Last Edit: Şubat 21, 2006, 03:06:09 ÖS by V@no »

Offline Deepu Sudhakar

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • http://deepu.cyanosis.net
Re: Latest version?
« Reply #10 on: Ekim 27, 2002, 07:48:05 ÖS »
Quote from: Chris
Quote from: Deepu Sudhakar
im trying to do a similar thing. but i found that php is not supported in the html templates though.


In my experience php is supported in the html templates.  I have several php statements working from variable assignments to includes.

Are you using the latest version?

Also be sure includes/constants.php has this line:
Code: [Select]
// Allow execution of PHP code in templates
define('EXEC_PHP_CODE', 1);

it has that line. i have tried putting simple echo statements in the templatesas a test:
Code: [Select]
<?php echo "helloworld"?>
but it doesnt work

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
more info
« Reply #11 on: Ekim 27, 2002, 08:04:15 ÖS »
Have you tried splitting it into 3 lines?
Code: [Select]
<?php
echo "helloworld"
?>

And where in what template do you place this?

Offline Kee-Lo

  • Newbie
  • *
  • Posts: 11
    • View Profile
a news script to integrate with 4images
« Reply #12 on: Ekim 27, 2002, 08:07:43 ÖS »
The news scipt has now moved to 4images/templates/news/index.php

I get the error:

Quote
Warning: Failed opening 'news/index.php' for inclusion (include_path='.:/data/apache/php/mmp_lib') in template.php(133) : eval()'d code on line 368


Here is where the code is in relation to home.html inside the templates/default_wide/ directory:

Quote

              {whos_online}
              <br />
<?php
include("news/index.php");
?>


Hope this helps a bit more :)
Kee-Lo
=====

Offline Deepu Sudhakar

  • Newbie
  • *
  • Posts: 26
    • View Profile
    • http://deepu.cyanosis.net
Re: more info
« Reply #13 on: Ekim 27, 2002, 08:08:59 ÖS »
Quote from: Chris
Have you tried splitting it into 3 lines?
Code: [Select]
<?php
echo "helloworld"
?>

And where in what template do you place this?

ahhh....that was the problem. the three lines did the trick. thats weird though. in php scripts, it shouldnt matter if the code is in one line or three lines. thats just a style issue and not a syntax issue. thats very odd about 4images

Offline Jaap12

  • Full Member
  • ***
  • Posts: 108
    • View Profile
a news script to integrate with 4images
« Reply #14 on: Ekim 27, 2002, 09:05:14 ÖS »
check this topic:

http://www.4homepages.de/forum/viewtopic.php?t=2298&highlight=

There is no solution for it.
4 images don't support php includes , for more info see the url.