Fork me on GitHub

How to add a pnUserPictures pic to a profile  Bottom

  • I'm trying to add a UserPictures picture to display on a users profile. I added the code

    Code

    <!--[pnmodapifunc modname="UserPictures" type="user" func="getPicture"
    uid=$uid template_id="1" assign=picture]-->
    <a href="<!--[$picture.filename]-->" target="_blanc"><!--[$picture.code_thumbnail]--></a>

    and also tried...

    <!--[pnmodapifunc modname="UserPictures" type="user" func="showPicture"
    uid=$uid template_id="1" assign=picture]-->


    to "profile_user_view.htm" under , in the system/profile/pntemplates directory to no avail. Anybody have an idea how I might make this work this way or in any other way? Thanks for your help.

  • I found some code that worked by taking it from the userpictures latest block. I put it after

    Code

    <!--[$uname|pnvarprepfordisplay]--> - <!--[pnml name="_PROFILE_VIEW"]-->
    in the profile_user_view.htm template for profile.

    Code

    <!--[pnmodapifunc modname="UserPictures" type="user" func="getPictures" template_id="1"
     startnumthumb="1" index="1" amount="$amount" assign="thumbnails"]-->

    <!--[foreach from=$thumbnails item="picture"]-->
        <img border="0" src="<!--[$picture.filename]-->.thumb.jpg" title="
    <!--[$picture.comment|pnvarprepfordisplay]-->"
    alt="<!--
    [$picture.comment|pnvarprepfordisplay]-->"
    >
    &nbsp;<br />
       
        <!--[cycle values=$cyclevalue]-->
       
    <!--[/foreach]-->


    This code is an unpolished quick hack. I changed the template id to 1 to display the first admin defined template instead of the "own" gallery pictures that would have displayed with the normal codes template =0. I know this probably isn't the best way to add this in, by modifying the core profile template, but its a quick fix. I'm still open for suggestions if anybody has better ways to do this. I'm just getting started working with PN. I may try to make a block for userpictures which might be a better way. -Chris
  • 0 users

This list is based on users active over the last 60 minutes.