1
jimbofoxman
Adding PHP File, not a module?

Is there a way to add a block on the main page that displays a PHP file that is not part of a module. It's a stand alone PHP file.

THANKS

2
smdcom
Re: Adding PHP File, not a module?

Yes. You can create custom block with type PHP.

SMD

3
jimbofoxman
Re: Adding PHP File, not a module?

I missed the "CUSTOM BLOCK" option.......LOL

Do I just cut and paste the php code in there and select PHP Script?

4
JMorris
Re: Adding PHP File, not a module?
  • 2005/10/16 0:17

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Yes, sort of. The exception is you don't include <?php and ?>.

Example:
phpinfo():

Best Regards,

James
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

5
jimbofoxman
Re: Adding PHP File, not a module?

This is what my filename.php contains. I just copied and pasted that into the content part of the custom block, select php script. It shows the block title, but that is it. I tried replacing the <?php? with phpinfo():. Do I need to keep the end ?> on there or not?

<?php
#### All Scripting Done By EvilSniperCQ^INC (http://www.incclan.net) ###
if (eregi("block-Block_Creator.php",$PHP_SELF)) {
    
Header("Location: index.php");
    die();
}
$content  =  "";
$content  .= "<TABLE align="center" cellpadding="5">";
$content  .= "<TR><TD valign="top">";
$content  .= "";
$content  .= "<!-- Server Monitor (The main monitor) | START ------------------------------->";
$content  .= "<!-- NOTE:";
$content  .= "This first segment of code is only for the server monitor itself. ";
$content  .= "If you want to include the server usage graphs, then scroll down to ";
$content  .= "the marked code.";
$content  .= "-->";
$content  .= "";
$content  .= "<SCRIPT LANGUAGE="JavaScript" ";
$content  .= "SRC="http://share1.serverspy.net/cgi-bin/monitor.js?mid=109396">";
$content  .= "</SCRIPT>";
$content  .= "<!-- SERVERSPY GAME CODE END -->";
$content  .= "</TD></TR></TABLE>";

?>

6
Lance_
Re: Adding PHP File, not a module?
  • 2005/10/16 1:18

  • Lance_

  • Home away from home

  • Posts: 983

  • Since: 2004/1/12


phpinfo() was just an example of a php script.

Simply take out the <?php and the ?> from your code since by choosing php in custom block, XOOPS will automatically add it to the code.

Cheers.
GDL-Web.com :: Website development.
Xoopslance.com::Freelancing and Projects
thelionsden-arena.net:: Clan/League/Ladder Hosting

7
jimbofoxman
Re: Adding PHP File, not a module?

I give up, buddy of mine posts that same code in PHPNuke and it works fine, mine is all messed up.

THANKS FOR THE HELP

8
Lance_
Re: Adding PHP File, not a module?
  • 2005/10/16 2:18

  • Lance_

  • Home away from home

  • Posts: 983

  • Since: 2004/1/12


Try an html block with

<TABLE align="center" cellpadding="5">
<
TR><TD valign="top">
<
SCRIPT LANGUAGE="JavaScript" SRC="http://share1.serverspy.net/cgi-bin/monitor.js?mid=109396"></SCRIPT>
</
TD></TR></TABLE>
GDL-Web.com :: Website development.
Xoopslance.com::Freelancing and Projects
thelionsden-arena.net:: Clan/League/Ladder Hosting