| Author |
Message |
philsmithclover
Nuke Cadet


Joined: Jun 28, 2003
Posts: 6
|
Posted:
Sat Jun 28, 2003 5:57 am |
  |
How do I use HTML code in a block? I'm using PHP-Nuke 6.5. |
|
|
   |
 |
Raven
General


Joined: Mar 22, 2003
Posts: 5233
Location: USA
|
Posted:
Sat Jun 28, 2003 6:16 am |
  |
Read the BLOCKS instruction file in your nuke distribution for explanation. |
_________________ Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff |
|
    |
 |
philsmithclover
Nuke Cadet


Joined: Jun 28, 2003
Posts: 6
|
Posted:
Sat Jun 28, 2003 7:25 am |
  |
Thanks, but when I do that, here's what shows up on my site
| Quote: |
Parse error: parse error, unexpected T_STRING in /var/www/clawz.com/philcloverweb/philcloverweb.clawz.com/nuke/blocks/block-Counter.php on line 20
|
Here's the code:
| Code: |
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
if (eregi("block-Sample_Block.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
$content = "<script language="JavaScript1.2" type="text/javascript" src="http://pub24.bravenet.com/counter/code.php?id=357484&usernum=2020326584&groupnum=24&cpv=1"> </script>
<noscript>
<a href="http://counter24.bravenet.com/index.php?id=357484&usernum=2020326584&cpv=1"
target="_top"><img src="http://counter24.bravenet.com/counter.php?id=357484&usernum=2020326584"
alt="Bravenet.com" border="0" /></a>
</noscript>";
?>
|
The filename is block-Counter.php. How can I fix this problem? |
Last edited by philsmithclover on Sat Jun 28, 2003 7:31 am; edited 1 time in total |
|
   |
 |
Raven
General


Joined: Mar 22, 2003
Posts: 5233
Location: USA
|
Posted:
Sat Jun 28, 2003 7:27 am |
  |
You have placed JS code in the middle of PHP code, plus you did not assign the code to the $contents variable. Look at the blocks/block-Sample_Block.php file. A simple way to introduce html/js code into PHP can be found in this link. Don't worry about reading all the discussion in the thread, all were fixed by following my original instructions to the letter. http://nukecops.com/postt2548.html |
_________________ Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff |
|
    |
 |
philsmithclover
Nuke Cadet


Joined: Jun 28, 2003
Posts: 6
|
Posted:
Sat Jun 28, 2003 7:34 am |
  |
So, would the file look like this?
| Code: |
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
if (eregi("block-Sample_Block.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
$messageText = 'Hello World';
$content = <<<_JSCODE_
<script language="JavaScript1.2" type="text/javascript" src="http://pub24.bravenet.com/counter/code.php?id=357484&usernum=2020326584&groupnum=24&cpv=1"> </script>
<noscript>
<a href="http://counter24.bravenet.com/index.php?id=357484&usernum=2020326584&cpv=1"
target="_top"><img src="http://counter24.bravenet.com/counter.php?id=357484&usernum=2020326584"
alt="Bravenet.com" border="0" /></a>
</noscript>
_JSCODE
?>
|
|
|
|
   |
 |
philsmithclover
Nuke Cadet


Joined: Jun 28, 2003
Posts: 6
|
Posted:
Sat Jun 28, 2003 7:36 am |
  |
|
   |
 |
Raven
General


Joined: Mar 22, 2003
Posts: 5233
Location: USA
|
Posted:
Sat Jun 28, 2003 7:39 am |
  |
No, you're missing a few things.
| Code: |
$content = <<<_JSCODE_
<script language="JavaScript1.2" type="text/javascript" src="http://pub24.bravenet.com/counter/code.php?id=357484&usernum=2020326584&groupnum=24&cpv=1"> </script>
<noscript>
<a href="http://counter24.bravenet.com/index.php?id=357484&usernum=2020326584&cpv=1"
target="_top"><img src="http://counter24.bravenet.com/counter.php?id=357484&usernum=2020326584"
alt="Bravenet.com" border="0" /></a>
</noscript>
_JSCODE_; |
Then, you have assigned a PHP variable $messageText but you don't reference it anywhere. I suggest you get a book on beginning PHP and MySQL (you'll need it soon, I'm sure ). Also consult the PHP on-line documentation at php.net. |
_________________ Those who hear not the music think the dancers mad.
Raven Web Hosting|My Scripts & Stuff |
|
    |
 |
philsmithclover
Nuke Cadet


Joined: Jun 28, 2003
Posts: 6
|
Posted:
Sat Jun 28, 2003 7:44 am |
  |
I plan on learning PHP and MySQL soon. It is pretty useful. |
|
|
   |
 |
philsmithclover
Nuke Cadet


Joined: Jun 28, 2003
Posts: 6
|
Posted:
Sat Jun 28, 2003 7:49 am |
  |
Thank you so much!!! It works!!! |
|
|
   |
 |
|
|