Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Mambo controlled menu in templates

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-14-2003, 12:35 PM
 
johnnyfunk johnnyfunk is offline
 

Newbie
  
Join Date: Sep 2003
Posts: 2
 

Default Mambo controlled menu in templates

I've placed X-cart within a site that is primarily run by Mambo Open Source and I'm having trouble placing the drop-down menu into an X-cart template.
The main site is here:
http://wbi.johnlevenson.com/content
and the store is here:
http://wbi.johnlevenson.com/content/shop/customer/home.php

The error I get on the page is:
---------------------------
Warning: Smarty error: problem writing temporary file '/home/wbi/public_html/content/shop/templates_c/%%151/%%1512206380/3f8c5d601d4d4' in /home/wbi/public_html/content/shop/Smarty-2.5.0/Smarty.class.php on line 1042

Warning: touch(): Utime failed: Operation not permitted in /home/wbi/public_html/content/shop/Smarty-2.5.0/Smarty.class.php on line 1575
-------------------------

Here is the code from customer/home.tpl:
Code:
{* $Id: home.tpl,v 1.50 2003/04/09 07:41:05 olga Exp $ *} { config_load file="$skin_config" } <html> <head> <title>{$lng.txt_site_title} {php} <?php include_once ('../editor/editor.php'); ?> {/php} {if $main eq "catalog"} {if $location eq ""} {$lng.txt_subtitle_home} {else} {strip} {section name=position loop=$location start=0 } {if %position.last% eq "true"} - {$location[position].0|escape}{/if} {/section} {/strip} {/if} {elseif $main eq "product"} {if $product.product ne ''} - {$product.product}{/if} {elseif $main eq "help"} {$lng.txt_subtitle_help} {elseif $main eq "cart"} {$lng.txt_subtitle_cart} {elseif $main eq "checkout"} {$lng.txt_subtitle_checkout} {elseif $main eq "order_message"} {$lng.txt_subtitle_thankyou} {/if} </title> { include file="meta.tpl" } <link rel="stylesheet" href="{$SkinDir}/{#CSSFile#}"> {literal} <SCRIPT LANGUAGE="JavaScript" SRC="../../templates/waterbirth/js/JSCookMenu.js"></SCRIPT> {/literal} <LINK HREF="../../templates/waterbirth/js/ThemeOffice/theme.css" REL="stylesheet" TYPE="text/css" /> {literal} <SCRIPT LANGUAGE="JavaScript" SRC="../../templates/waterbirth/js/ThemeOffice/theme.js"></SCRIPT> {/literal} {php} <?php initEditor(); ?> <?php // Custom MainMenu extension with JSCookMenu by Stefan Kellenberger - www.cyberdine.ch $mymenu_content = <<<EOT <SCRIPT LANGUAGE="JavaScript"><!-- var myMenu = [ EOT; $database->setQuery("SELECT * FROM #__menu WHERE menutype = 'mainmenu' AND published ='1' ORDER BY ordering"); $menus = $database->loadObjectList(); // mainmenu list $subs = array(); // sub menus // first pass to collect sub-menu items foreach ($menus as $row) { if ($row->parent) { if (!array_key_exists( $row->parent, $subs )) { $subs[$row->parent] = array(); } $subs[$row->parent][] = $row; } } foreach ($menus as $row) { // second pass to insert main-menu items if ($row->parent == 0 && (trim( $row->link ) || array_key_exists( $row->id, $subs ))) { $name = addslashes( $row->name ); $alt = addslashes( $row->name ); $link = $row->link ? "'$row->link" : "null"; if ($row->type != "url") { $link .= "&Itemid=$row->id'"; } else { $link .= "'"; } $mymenu_content .= "\n ['<img src=\"'+cmThemeOfficeBase+'darrow.png\">','$name',$link,null,'$alt'"; if (array_key_exists( $row->id, $subs )) { $mymenu_content .= ','; foreach ($subs[$row->id] as $sub) { // third pass to insert sub-menu items $name = addslashes( $sub->name ); $alt = addslashes( $sub->name ); $link = $sub->link ? "'$sub->link" : "null"; if ($sub->type != "url") { $link .= "&Itemid=$sub->id'"; } else { $link .= "'"; } $mymenu_content .= "\n ['<img src=\"'+cmThemeOfficeBase+'sections.png\">','$name',$link,null,'$alt'"; if (array_key_exists( $sub->id, $subs )) { $mymenu_content .= ','; foreach ($subs[$sub->id] as $sub2) { // fourth pass to insert subsub-menu items $name = addslashes( $sub2->name ); $alt = addslashes( $sub2->name ); $link = $sub2->link ? "'$sub2->link" : "null"; if ($sub2->type != "url") { $link .= "&Itemid=$sub2->id'"; } else { $link .= "'"; } $mymenu_content .= "\n ['<img src=\"'+cmThemeOfficeBase+'sections.png\">','$name',$link,null,'$alt'],"; } } $mymenu_content .= "],"; } } $mymenu_content .= "],"; } } $mymenu_content .= "];\n"; $mymenu_content .= "--></SCRIPT>\n"; echo $mymenu_content; ?> {/php} </head> <body LEFTMARGIN=0 TOPMARGIN=0 RIGHTMARGIN=0 BOTTOMMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0> { include file="rectangle_top.tpl" } { include file="head.tpl" } <table border=0 width="100%" cellpadding=0 cellspacing=0 align="center"> <tr> <td class="rightborder" width=150 valign=top> { include file="customer/categories.tpl" } {if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu eq "Y"} { include file="modules/Bestsellers/menu_bestsellers.tpl" } {/if} {if $active_modules.Gift_Certificates ne "" or $active_modules.Product_Configurator ne ""} {include file="customer/special.tpl"} {/if} { include file="help.tpl" } </td> <td class="mainbody" valign=top> {include file="customer/home_main.tpl"} </td> <td class="leftborder" width=150 valign=top> { include file="customer/menu_cart.tpl" } {if $login eq "" } { include file="auth.tpl" } {else} { include file="authbox.tpl" } {/if} { include file="news.tpl" } {if $active_modules.Interneka ne ""} { include file="modules/Interneka/menu_interneka.tpl" } {/if} { include file="poweredby.tpl" } </td> </tr> </table> { include file="rectangle_bottom.tpl" } </body> </html>

I've inserted {literal} and {php} where I thought necessary but am still getting errors, though the menu gets built.

Any help getting rid of the errors would be greatly appreciated.

Thanks,
Johnny
Reply With Quote
  #2  
Old 10-14-2003, 10:23 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

This looks like a file permissions issue for the main shop directory.

Try renaming the templates_c directory and setting :

chmod 777 .

Not sure where you have the images on the drop down but if you are using relative links to these, they should be relative to the customer directory.

hth
__________________
ex x-cart guru
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:47 PM.

   

 
X-Cart forums © 2001-2020