We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16429
    • 254 Posts
    This is an auto-generated support/comment thread for Personalize 2.0.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    Checks to see if webusers are logged in and displays a chunk if the user is logged or another chunk if user is not logged.
      kudo
      www.kudolink.com - webdesign (surprised?)

      [img]http://www.kudolink.com/kudolinkcom.png[/img] [sup]proudly uses[/sup] [img]http://www.kudolink.com/modx.png[/img]
      • 11541
      • 26 Posts
      I’m a bit confused (and a newb to all this).

      What would be the line I’d insert in my template to display the username?

        • 33337
        • 3,975 Posts
        You can read on download page:

        &ph : set a placeholder to display the username in the yesChunk [optional]

        now you can use it like:
        [[Personalize? &yesChunk=`xyz` &noChunk=`xyz` &ph=`username`]]
        


        Place [+username+] in &yesChunk template.

        Hope it helps.

        regards.
          Zaigham R - MODX Professional | Skype | Email | Twitter

          Digging the interwebs for #MODX gems and bringing it to you. modx.link
          • 11541
          • 26 Posts
          Helped perfectly.

          That was exactly what I needed - and lets me understand the process much better.

          Thank you.

          David
            • 27751
            • 45 Posts
            MODx .95 installed and is working fine on my Server with PHP5 and MySQL5, Apache2, etc..

            The Template calls a chunk called "SidebarRight" and inside of this Chunk I call:

            [[LoggedOrNot? &yesChunk=`rightChPass` &noChunk=`rightRegister`]]

            "rightChPass" just has a link to the page for a user to change their password
            "rightRegister" has a link to the registration page

            Below this is "[[WebLogin? &tpl=`Login`]]" and this is working perfectly. Personalize 2.0 returns no chunk regardless if the user is logged in or not.

            I am pretty new and this is not the first thing that couldn’t get working. Any help is appreciated.
              Dedicated CENTOS 5.5 x86_64 standard WHM 11.28.64
              Apache/2.2.17 | PHP/5.2.15
              MySQL Version 5.0.91 | MODx Revolution
              • 25663 MODX Staff
              • 12,272 Posts
              Try calling it uncached: [!LoggedOrNot? &yesChunk=`rightChPass` &noChunk=`rightRegister`!]
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 27751
                • 45 Posts
                Thanks for the quick response!

                [! - !] didn’t do it. I tried just putting it "[!LoggedOrNot? &yesChunk=`rightChPass` &noChunk=`rightRegister`!]" on a page to test it and it does not work just on the home page either.
                  Dedicated CENTOS 5.5 x86_64 standard WHM 11.28.64
                  Apache/2.2.17 | PHP/5.2.15
                  MySQL Version 5.0.91 | MODx Revolution
                  • 27751
                  • 45 Posts
                  Seems it is only listed as compatable with .9.2.1 not .95. My bad.
                    Dedicated CENTOS 5.5 x86_64 standard WHM 11.28.64
                    Apache/2.2.17 | PHP/5.2.15
                    MySQL Version 5.0.91 | MODx Revolution
                    • 27751
                    • 45 Posts
                    Is there any timeline for Personalize 2.0 to work with .96? I never did get it working in .95 or .96.
                      Dedicated CENTOS 5.5 x86_64 standard WHM 11.28.64
                      Apache/2.2.17 | PHP/5.2.15
                      MySQL Version 5.0.91 | MODx Revolution
                      • 4041
                      • 788 Posts
                      Not trying to step on toes, but perhaps it would be better just to check if the $_SESSION[’webValidated’] is set or either $_SESSION[’webShortname’] is set as opposed to the getloginUserName() call....

                      someone try this modification and seeif it helps:

                      # prepare params and variables
                      $o = '';
                      $yesChunk = (isset($yesChunk))? $yesChunk : '';
                      $noChunk = (isset($noChunk))? $noChunk : '';
                      
                      # do the work
                      //$test = $modx->getLoginUserName();
                      //if ($test) {
                      if(isset($_SESSION['webShortname'])){
                          $test = $_SESSION['webShortname'];
                          $o = $modx->getChunk($yesChunk);
                        } else {
                          $o = $modx->getChunk($noChunk);
                      }
                      
                      if (isset($ph)) {
                      	$modx->setPlaceholder($ph,$test);
                      	return $o;
                      } else {
                      	return $o;
                      }

                        xforum
                        http://frsbuilders.net (under construction) forum for evolution