1
tamarix
Custom block : preview OK but NOK an web site
  • 2004/5/26 15:05

  • tamarix

  • Just popping in

  • Posts: 26

  • Since: 2004/3/1 1


Hello,

I tried to do a custom block that integrate the "java tree menu" of PHPlayersmenu (http://phplayersmenu.sourceforge.net/).

I think a module could be made but my PHP/SQL level is so poor that it shouldn't give anything good !!!

So what I did is to make a new block and add an html script (see end of the message).

When I do a preview, the menu appearance is OK (as the one shown onhttp://phplayersmenu.sourceforge.net/) but when I look at web page, I only have part of the script printed out.

Since I have no error message, I don't in which direction to look at.

Thanks a lot for any advices ...

Franck



<?php
$myDirPath = "$DOCUMENT_ROOT/modules/phplayersmenu/";
$myWwwPath = "/modules/phplayersmenu/";
?>

<link rel="stylesheet" href="<?php print $myWwwPath; ?>layerstreemenu.css" type="text/css"></link>
<style type="text/css">
<!--
@import url("<?php print $myWwwPath; ?>layerstreemenu-hidden.css");
//-->
</style>

<script language="JavaScript" type="text/javascript">
<!--
<?php include ($myDirPath . "libjs/layersmenu-browser_detection.js"); ?>

// -->
</script>
<script language="JavaScript" type="text/javascript" src="<?php print $myWwwPath; ?>libjs/layerstreemenu-cookies.js"></script>



<?php
include ($myDirPath . "lib/PHPLIB.php");
include ($myDirPath . "lib/layersmenu-common.inc.php");
include ($myDirPath . "lib/treemenu.inc.php");

$mid = new TreeMenu();

$mid->setDirroot($myDirPath);
$mid->setLibjsdir($myDirPath . "libjs/");
$mid->setImgdir($myDirPath . "images/");
$mid->setImgwww($myWwwPath . "images/");

$mid->setMenuStructureFile($myDirPath . "layersmenu-vertical-1.txt");
$mid->parseStructureForMenu("treemenu1");
print $mid->newTreeMenu("treemenu1");
/* alternatively:
$mid->newTreeMenu("treemenu1");
$mid->printTreeMenu("treemenu1");
*/
/* alternatively:
$mid->newTreeMenu("treemenu1");
$tree_menu1 = $mid->getTreeMenu("treemenu1");
print $tree_menu1;
*/
?>

2
tjnemez
Re: Custom block : preview OK but NOK an web site
  • 2004/5/26 15:56

  • tjnemez

  • Home away from home

  • Posts: 1594

  • Since: 2003/9/21


hey tamarix,

i think XOOPS adds the php tags <?php .... ?>, so i believe you need to leave these out when making a custom block. do a search or check wiki on custom blocks.


3
m0nty
Re: Custom block : preview OK but NOK an web site
  • 2004/5/26 15:57

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


u could search for treemenuxp module

i think that does the job u maybe requiring..

4
Mithrandir
Re: Custom block : preview OK but NOK an web site

another thing is that if the block is set to be HTML, then it won't really do much to put in PHP code. If you use PHP code, set it to a PHP block (and yes, I think you should leave out the initial <?php and ending ?> tags

5
tamarix
Re: Custom block : preview OK but NOK an web site
  • 2004/5/27 7:26

  • tamarix

  • Just popping in

  • Posts: 26

  • Since: 2004/3/1 1


Thanks a lot for all your answers. Here are some comments/questions :

* I didn't find the treemenuxp module. Where can it be found ?
* Regarding the preliminary question :
From what you said, it seems that if I set the block to be html (that's in fact what I did), the PHP code is not evaluated. But in that case, how do you explain that the preview works fine ?

Franck



Login

Who's Online

210 user(s) are online (122 user(s) are browsing Support Forums)


Members: 0


Guests: 210


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits