Author Topic: problem with phx  (Read 3643 times)

0 Members and 1 Guest are viewing this topic.

Offline crackers

  • Administrator
  • Full Member
  • *****
  • Posts: 166
  • Karma: +0/-0
problem with phx
« on: March 01, 2011, 12:43:37 AM »
temans .... i have new problem with phx


begini jadi aku bikinsnippet buat check login standart danmo ganti menu jika dia sudah login
seperti ini snippetnya


login snippet



Code: [Select]
if(!isset($_SESSION['webInternalKey']))
return 0;
return 1;


terus tak panggilah di phx template seperti ni

Code: [Select]
[+phx:if=`[!login!]`:is=`1`:then=`{{mainmenu}}`:else=`{{mainmenu2}}`+]

tapi ga muncul menunya yang selalu muncul mainmenu2 untuk kasus ini


terus tak coba seperti ini
Code: [Select]
[+phx:if=`[!login!]`:is=`1`:then=`{{mainmenu}}`:else=``+]
[+phx:if=`[!login!]`:is=`0`:then=`{{mainmenu2}}`:else=``+]

malah ga muncul semuanya........


tapi dari tutorial
Code: [Select]
[+phx:if=`[!UltimateParent!]`:is=`1`:and:isnot=`[*id*]`:then=`{ {ChildChunk} }`:else=`{ {ParentChunk} }`+]


mungkin dari sobat-sobat semua ada ide lain?





« Last Edit: March 01, 2011, 12:46:51 AM by crackers »

Offline goldsky

  • tweets @_goldsky
  • Administrator
  • Sr. Member
  • *****
  • Posts: 345
  • Karma: +1/-0
  • Less is more
    • Virtudraft Intermedia Telematika
Re: problem with phx
« Reply #1 on: March 01, 2011, 12:48:27 AM »
Code: [Select]
<?php
if(!isset($_SESSION['webInternalKey']))
    return 
'0';
return 
'1';

coba snippetnya return sebagai string, bukan bool.
Rico
Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!

Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets | IE 6 must die !

Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

PING ME ON TWITTER @_goldsky

Offline crackers

  • Administrator
  • Full Member
  • *****
  • Posts: 166
  • Karma: +0/-0
Re: problem with phx
« Reply #2 on: March 01, 2011, 12:51:06 AM »

snippet
Code: [Select]
if(!isset($_SESSION['webInternalKey']))
    return 'no';
return 'yes';



phx
Code: [Select]
[+phx:if=`[!login!]`:is=`yes`:then=`{{mainmenu}}`:else=`{{mainmenu2}}`+]


kok ga bisa juga yah?


Offline goldsky

  • tweets @_goldsky
  • Administrator
  • Sr. Member
  • *****
  • Posts: 345
  • Karma: +1/-0
  • Less is more
    • Virtudraft Intermedia Telematika
Re: problem with phx
« Reply #3 on: March 01, 2011, 12:56:44 AM »
udah nge-test $_SESSION['webInternalKey'], blum?
Rico
Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!

Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets | IE 6 must die !

Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

PING ME ON TWITTER @_goldsky

Offline crackers

  • Administrator
  • Full Member
  • *****
  • Posts: 166
  • Karma: +0/-0
Re: problem with phx
« Reply #4 on: March 01, 2011, 12:58:37 AM »
udah nge-test $_SESSION['webInternalKey'], blum?


udah dan klo snipetnya jalan sendiri


Code: [Select]
[!login!]


muncul normal tapi klo masuk phx if ajah ga jalan itu

Offline goldsky

  • tweets @_goldsky
  • Administrator
  • Sr. Member
  • *****
  • Posts: 345
  • Karma: +1/-0
  • Less is more
    • Virtudraft Intermedia Telematika
Re: problem with phx
« Reply #5 on: March 01, 2011, 01:04:58 AM »
Terus terang gw gak pernah pake phx.
Bikin tambah mumet. :P

Kenapa gak bikin snippet khusus menunya aja?

snippet "memberNav"
Code: [Select]
<?php
if(!isset($_SESSION['webInternalKey'])) {
    
$o $modx->runSnippet('Wayfinder', array(
        
'startId' => '0',
        
'includeDocs' => '1,2,3,4'
    
));
} else {
    
$o $modx->runSnippet('Wayfinder', array(
        
'startId' => '0',
        
'includeDocs' => '1,2,3,4,5,6,7,8,9'
    
));
}
return 
$o;

Panggil deh:
Quote
[!memberNav!]
« Last Edit: March 01, 2011, 01:08:34 AM by goldsky »
Rico
Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!

Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets | IE 6 must die !

Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

PING ME ON TWITTER @_goldsky

Offline crackers

  • Administrator
  • Full Member
  • *****
  • Posts: 166
  • Karma: +0/-0
Re: problem with phx
« Reply #6 on: March 01, 2011, 01:07:35 AM »
Terus terang gw gak pernah pake phx.
Bikin tambah mumet. :P

Kenapa gak bikin snippet khusus menunya aja?

snippet "memberNav"
Code: [Select]
<?php
if(!isset($_SESSION['webInternalKey'])) {
    
$o $modx->runSnippet('Wayfinder', array(
        
'startId' => 0,
        
'includeDocs' => '1,2,3,4'
    
));
} else {
    
$o $modx->runSnippet('Wayfinder', array(
        
'startId' => 0,
        
'includeDocs' => '1,2,3,4,5,6,7,8,9'
    
));
}
return 
$o;

Panggil deh:
Quote
[!memberNav!]


memang itu harusnya mungkin.....wakakakkak thanks klo begitu tak bikinya satu2 ....xixixixixixi thanks2

Offline goldsky

  • tweets @_goldsky
  • Administrator
  • Sr. Member
  • *****
  • Posts: 345
  • Karma: +1/-0
  • Less is more
    • Virtudraft Intermedia Telematika
Re: problem with phx
« Reply #7 on: March 01, 2011, 01:10:39 AM »
ok, bro :D
Rico
Genius is one percent inspiration and ninety-nine percent perspiration. Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!

Security, security, security! | Indonesian MODx Forum | MODx Revo's cheatsheets | MODx Evo's cheatsheets | IE 6 must die !

Author of Easy 2 Gallery 1.4.x, PHPTidy, spieFeed, FileDownload R, Upload To Users CMP, Inherit Template TV, LexRating, ExerPlan, Lingua, virtuNewsletter, Grid Class Key, SmartTag, prevNext

PING ME ON TWITTER @_goldsky