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

Upgrade your site to Smarty 2.6.2

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #21  
Old 05-17-2004, 07:22 PM
  Dmitri's Avatar 
Dmitri Dmitri is offline
 

Senior Member
  
Join Date: Jul 2003
Location: Toronto
Posts: 174
 

Default

I have Smarty 2.6.2 on X-Cart 3.4.11 but web master mode doesn't work for me...
__________________
CartTemplates | ASF Design Inc
~~~
CartTemplates.com | XCart Design - Custom design or Choose from thousands of templates that can be integrated with X-Cart.
tel: +1 (416) 410-9995
Reply With Quote
  #22  
Old 05-17-2004, 07:51 PM
 
GM GM is offline
 

eXpert
  
Join Date: Mar 2004
Location: Canada
Posts: 293
 

Default

I see what you mean now about webmaster mode. I guess mine is only partially operational too. Have you tried replacing each line? Left for Right.(from 1158 down) I'm gonna' try it... No Fear.
__________________
v. 4.0.14 (GM Style)
O.S. Linux
Build Your Own Diamond Ring
Reply With Quote
  #23  
Old 05-17-2004, 08:01 PM
  Dmitri's Avatar 
Dmitri Dmitri is offline
 

Senior Member
  
Join Date: Jul 2003
Location: Toronto
Posts: 174
 

Default

I bet it something to do with this new expression at R1530 adn R2699

__________________
CartTemplates | ASF Design Inc
~~~
CartTemplates.com | XCart Design - Custom design or Choose from thousands of templates that can be integrated with X-Cart.
tel: +1 (416) 410-9995
Reply With Quote
  #24  
Old 05-17-2004, 09:01 PM
 
GM GM is offline
 

eXpert
  
Join Date: Mar 2004
Location: Canada
Posts: 293
 

Default

Line 1769 is the tricky one but I'm working on it... I almost broke it!

Ok.. I fixed it, here it is:

Open 2.6.2 smarty.class.php in a text or other editor.

At the bottom of the page find this:

Code:
/**#@-*/ } /* vim: set expandtab: */ ?>

and change it to this:


Code:
/**#@-*/ # # ADDED FOR WEBMASTER MODE # function webmaster_include($_smarty_compile_path, $tpl_file) { if ($this->webmaster_mode) { $tag = "div"; foreach ($this->tagsTemplates as $tmplt=>$t) { if (ereg("^$tmplt\$", $tpl_file)) { $tag = $t; break; } } if ($tag!="omit") { ?><<?php echo $tag?> id="<?php echo $tpl_file?>" onMouseOver='dmo(event)' onMouseOut='dmu(event)' style="margin:0px;"><?php } } include($_smarty_compile_path); if ($this->webmaster_mode && $tag!="omit") { ?></<?php echo $tag?>><?php } } # # / ADDED FOR WEBMASTER MODE # } /* vim: set expandtab: */ ?>

DONE! The rest of the codes are just smoke and mirrors my friends
__________________
v. 4.0.14 (GM Style)
O.S. Linux
Build Your Own Diamond Ring
Reply With Quote
  #25  
Old 05-17-2004, 09:30 PM
 
GM GM is offline
 

eXpert
  
Join Date: Mar 2004
Location: Canada
Posts: 293
 

Default

I see you tried this already cmtrade... it totally worked for me, maybe you were off a hair in the copy and paste? (new scissors, new glue) Use /**#@-*/ as a reference point and glue to it.
I tried every other combination and got errors. Finally, just pasted the last line and it worked... no problems at all Webmaster mode is completely functional (I'll have to try using it sometime, I've been hard coding)
__________________
v. 4.0.14 (GM Style)
O.S. Linux
Build Your Own Diamond Ring
Reply With Quote
  #26  
Old 05-18-2004, 01:51 AM
 
cmtrade cmtrade is offline
 

Advanced Member
  
Join Date: Dec 2003
Location: Florida
Posts: 30
 

Default

Maybe you changed something else too?

I just downloaded a new copy of smarty 2.6.2 and added the 3 files mentioned in the first post on this thread, and made the addition in smarty.class.php and nothing, it still doesn't work. I am getting a javascript error every time now.
__________________
Dan.
KingWebmaster, LLC
Professional Website Development
http://www.kingwebmaster.com
http://www.autodataentry.com
Reply With Quote
  #27  
Old 05-18-2004, 03:07 AM
 
jeremye jeremye is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Philadelphia, PA
Posts: 158
 

Default

I am still having issues as well. I added the webmaster_include function and still no webmaster mode. Maybe it's a version issue at this point if you have it working on 3.5.7 and 3.4.14 doesn't work?

Has anyone else gotten their webmaster mode fixed?
__________________
Jeremy
X-Cart Gold v3.4.14 [Linux/Apache]
Heavily Modded
Reply With Quote
  #28  
Old 05-18-2004, 04:48 AM
 
jeremye jeremye is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Philadelphia, PA
Posts: 158
 

Default

Ok, I did some more research into what was changed from 250 to 262 from a Smarty perspective. Some variable names have been changed, etc, so I tested everything out. Using the file comparison listed above, I looked at all of the variables surrounding it in the 262 version and checked to see if they changed any variable names etc. I found multiple instances.

NOTE: These changes DO NOT work for me, but I believe they are a step closer to solving the problem if others can look at it and see something I don't.

I made the following changes, but it actually made no improvement to the functionality of the code; nothing now works that didn't before. It's the same situation.

In Smarty-2.6.2/Smarty.class.php:

Line 1266, replace:
Code:
include($_smarty_compile_path);
with:
Code:
$this->webmaster_include($_smarty_compile_path, $resource_name);

Line 1273, replace:
Code:
include($_smarty_compile_path);
with:
Code:
$this->webmaster_include($_smarty_compile_path, $resource_name);

Line 1400, replace:
Code:
if ($_params['resource_timestamp'] <= filemtime($compile_path)) {
with:
Code:
if (($_params['resource_timestamp'] <= filemtime($compile_path)) && (!preg_match("/cu[s]?tom[e]?r\/m[a]?in\/p[r]?od[u]?ct.t[p]?l/i", $resource_name))) {

Line 1911, replace:
Code:
include($_smarty_compile_path);
with:
Code:
$this->webmaster_include($_smarty_compile_path, $params['smarty_include_tpl_file']);

And of course, add this to the bottom of the file, underneath "/**#@-*/":
Code:
# # ADDED FOR WEBMASTER MODE # function webmaster_include($_smarty_compile_path, $tpl_file) { if ($this->webmaster_mode) { $tag = "div"; foreach ($this->tagsTemplates as $tmplt=>$t) { if (ereg("^$tmplt\$", $tpl_file)) { $tag = $t; break; } } if ($tag!="omit") { ?><<?php echo $tag?> id="<?php echo $tpl_file?>" onMouseOver='dmo(event)' onMouseOut='dmu(event)' style="margin:0px;"><?php } } include($_smarty_compile_path); if ($this->webmaster_mode && $tag!="omit") { ?></<?php echo $tag?>><?php } } # # / ADDED FOR WEBMASTER MODE #

Again, I am putting this up here in the hopes that someone else will try this out and see a problem that I didn't see. Let me know if anyone tries it and it DOES work!

Thanks.
__________________
Jeremy
X-Cart Gold v3.4.14 [Linux/Apache]
Heavily Modded
Reply With Quote
  #29  
Old 05-18-2004, 12:54 PM
 
GM GM is offline
 

eXpert
  
Join Date: Mar 2004
Location: Canada
Posts: 293
 

Default

I don't understand this? Mine works. My cart is pretty heavily modded but I can't see that being the problem??? (or cure) I have uploaded my version you can try it here: http://www.goldmisers.com/Smarty2.6.2Upgrade.zip

KEEP IN MIND THAT THIS IS FOR XCART 3.5.7

Also, when you enter "Webmaster Mode":
http://www.goldmisers.com/edit.jpg
__________________
v. 4.0.14 (GM Style)
O.S. Linux
Build Your Own Diamond Ring
Reply With Quote
  #30  
Old 05-19-2004, 04:59 AM
 
jeremye jeremye is offline
 

Senior Member
  
Join Date: Apr 2004
Location: Philadelphia, PA
Posts: 158
 

Default

Hmm, that's odd. I tried using your Zipped file but to no avail. When you upgraded to 2.6.2, did you copy over the NEW Smarty.class.php file, or did you keep the old 2.5.0 version of the file?

I can't wrap my head around this one.
__________________
Jeremy
X-Cart Gold v3.4.14 [Linux/Apache]
Heavily Modded
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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:55 AM.

   

 
X-Cart forums © 2001-2020