1
LazyBadger
PHP2Smarty "translation" wanted

Can anybody "translate" this code-snippet to Smarty?!

$design_1 rand(14);
$design_2 rand(14);

   if( 
$design_1 == ) {
    
$design_1_width 24;
   } elseif( 
$design_1 == || $design_1 == ) {
    
$design_1_width 14;
   } elseif( 
$design_1 == ) {
    
$design_1_width 19;
   }

   if( 
$design_2 == ) {
    
$design_2_width 24;
   } elseif( 
$design_2 == || $design_2 == ) {
    
$design_2_width 14;
   } elseif( 
$design_2 == ) {
    
$design_2_width 19;
   }


(at least first if chain)... I have smarty random plugin, randomizer isn't a question.

And slightly related question. Why, if theme has smarty's "assign" operator in body, theme's changes are not visible ("update theme..." enabled, sure) and single way to update it is clen-up template_c dir?

2
Dave_L
Re: PHP2Smarty "translation" wanted
  • 2005/4/12 15:29

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


<{assign var='design_1' value=1|rand:4}>
<{
assign var='design_2' value=1|rand:4}>

<{if 
$design_1 == }>
   <{
assign var='design_1_width' value='24'}>
<{elseif 
$design_1 == || $design_1 == 3}>
   <{
assign var='design_1_width' value='14'}>
<{else}>
   <{
assign var='design_1_width' value='19'}>
<{/if}>

...


I don't understand your second question.

3
maumed
Re: PHP2Smarty "translation" wanted
  • 2005/4/12 16:56

  • maumed

  • Just popping in

  • Posts: 50

  • Since: 2004/10/18


the option of always checke theme files for changes is valid only to files on /themes/ dir. Modules themes arent checked. And if you have cache enabled, the changes will not be visible till the cache expires.

[]s
Mauricio

4
LazyBadger
Re: PHP2Smarty "translation" wanted

Quote:

Dave_L wrote:
I don't understand your second question.

1. Thanks for code

About question:
if I added <{assign var=...> into theme-file, and edit theme after it - I can't see changes. All cache disabled, all other themes updated in real-time, only theme with smart-assign emdedded doesn't change view. Not a big deal, I only want to understand - why...

5
LazyBadger
Re: PHP2Smarty "translation" wanted

Quote:

maumed wrote:
the option of always checke theme files for changes is valid only to files on /themes/ dir. Modules themes arent checked. And if you have cache enabled, the changes will not be visible till the cache expires.

I know about apdating theme, and it works in intended manner (except one detected exception). I haven't any cache enabled

Login

Who's Online

359 user(s) are online (253 user(s) are browsing Support Forums)


Members: 0


Guests: 359


more...

Donat-O-Meter

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

Latest GitHub Commits