We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2762
    • 1,198 Posts
    Nicola (Banzai) Reply #1, 20 years ago
    Ok it’s a strange question..:)
    is there any way to get author photo (from user profile - userphoto) in Ditto templates?

    can i wish to see it in any next release? laugh
      Free MODx Graphic resources and Templates www.tattoocms.it
      -----------------------------------------------------

      MODx IT  www.modx.it
      -----------------------------------------------------

      bubuna.com - Web & Multimedia Design
      • 18397
      • 3,250 Posts
      MARKSVIRTUALDESK Reply #2, 20 years ago
      You can try this (untested)

      Snippet AuthorPic
      $uinfo = $modx->getUserData($id);
      return $uinfo['photo'];
      


      And then in your Ditto template

      [!AuthorPic?id=`[+createdby+]`!]
      
        • 2762
        • 1,198 Posts
        Thanks a lot Mark but does not work undecided

        PHP error debug
          Error: 	getuserdata(/home/httpd/vhosts/domain.com/httpdocs/manager/includes/extenders/getuserdata.extender.php): failed to open stream: No such file or directory	 
          Error type/ Nr.: 	Warning - 2	 
          File: 	/home/httpd/vhosts/domain.com/httpdocs/manager/includes/document.parser.class.inc.php	 
          Line: 	1700	 
          Line 1700 source: 	include_once $this->config["base_path"] . "manager/includes/extenders/getuserdata.extender.php"; 	 
         
          Free MODx Graphic resources and Templates www.tattoocms.it
          -----------------------------------------------------

          MODx IT  www.modx.it
          -----------------------------------------------------

          bubuna.com - Web & Multimedia Design
          • 10487 MODX Staff
          • 1,535 Posts
          Hi Banzai,

          The error, I think, is that the filename is case-sensitive so it should be: getUserData.extender.php (I’ll check that out later and get it amended if needs be in SVN.) EDIT: Changes now submitted to my branch in SVN.

          Anyway, that function is not what you need, try:
          $modx->getUserInfo($id)

          (very similar names but will give you completely different information wink )

          Hope that helps,
          Garry

            Garry Nutting
            Senior Developer
            MODX, LLC

            Email: [email protected]
            Twitter: @garryn
            Web: modx.com
            • 2762
            • 1,198 Posts
            Thanks Garry I’ll try it soon as possible wink
              Free MODx Graphic resources and Templates www.tattoocms.it
              -----------------------------------------------------

              MODx IT  www.modx.it
              -----------------------------------------------------

              bubuna.com - Web & Multimedia Design
              • 17282
              • 283 Posts
              Im trying to get this to work as well .. any updates?
                Everytime you use Flash ... a puppy dies .....
                R.G Taylor
                • 4195
                • 398 Posts
                You can also try installing the PHx plugin.

                and then you could use:

                <img src="[+phx:input=`[+authorid+]`:userinfo=`photo`+]" />
                


                or to display only when a photo is present:

                [+phx:if=`[+phx:input=`[+authorid+]`:userinfo=`photo`:len+]`:gt=`0`:then=`
                  <img src="[+phx:input=`[+authorid+]`:userinfo=`photo`+]" />
                `+]
                

                  Armand Pondman
                  MODx Coding Team
                  :: Jot :: PHx
                  • 2762
                  • 1,198 Posts
                  Wow! how i missed it? seems exactly what I need, I’m working with a lot of Tv and placeholder.
                  Thanks Bs wink
                    Free MODx Graphic resources and Templates www.tattoocms.it
                    -----------------------------------------------------

                    MODx IT  www.modx.it
                    -----------------------------------------------------

                    bubuna.com - Web & Multimedia Design
                    • 17282
                    • 283 Posts
                    Quote from: bS at Oct 11, 2006, 06:07 AM

                    You can also try installing the PHx plugin.

                    and then you could use:

                    <img src="[+phx:input=`[+authorid+]`:userinfo=`photo`+]" />
                    


                    or to display only when a photo is present:

                    [+phx:if=`[+phx:input=`[+authorid+]`:userinfo=`photo`:len+]`:gt=`0`:then=`
                      <img src="[+phx:input=`[+authorid+]`:userinfo=`photo`+]" />
                    `+]
                    



                    that looks cool!

                    installed it .. followed instructions .. but still no go sad
                      Everytime you use Flash ... a puppy dies .....
                      R.G Taylor
                      • 33033
                      • 43 Posts
                      Quote from: Lizard at Oct 11, 2006, 08:11 AM

                      Quote from: bS at Oct 11, 2006, 06:07 AM

                      You can also try installing the PHx plugin.

                      and then you could use:

                      <img src="[+phx:input=`[+authorid+]`:userinfo=`photo`+]" />
                      


                      or to display only when a photo is present:

                      [+phx:if=`[+phx:input=`[+authorid+]`:userinfo=`photo`:len+]`:gt=`0`:then=`
                        <img src="[+phx:input=`[+authorid+]`:userinfo=`photo`+]" />
                      `+]
                      



                      that looks cool!

                      installed it .. followed instructions .. but still no go sad

                      <img src="[+phx:input=`[+createdby+]`:userinfo=`photo`+]"  />

                      Change authorid to createdby and it should work.