Important announcements from CouchCMS team
148 posts Page 13 of 15
Previous 1 ... 10, 11, 12, 13, 14, 15 Next
@atisz
Is it possible to change the sent emails Title, email address, email body content?
You can do that from 'addons\member\config.php'.

Hope it helps.
Thank you, KK! ;)
I have found a topic on how to use a default gravatar image if email address doesn't has an image associated with gravatar.
How about using a default avatar in member module, if member doesn't upload an own avatar image? Is it possible? How should I change the code bellow in order to display a default avatar till member will upload his avatar image?
Code: Select all
<cms:if k_member_logged_in >
                     <cms:pages masterpage=k_member_template id=k_member_id>
                    <div id="about_pic"><!-- Start about_pic -->
                     <cms:show_securefile 'avatar' >
                         <cms:if file_is_image >
                             <a href="<cms:cloak_url link=file_id />"><img src="<cms:cloak_url link=file_id thumbnail='1' />" /></a><br />

                         <cms:else />
                             <a href="<cms:cloak_url link=file_id />"><cms:show file_name /></a> (<cms:size_format file_size />)
                         </cms:if>
                     </cms:show_securefile>
                    </div><!-- End about_pic -->
                  </cms:pages>
               </cms:if>
Thanks!
@atisz, this has been discussed in the following thread - viewtopic.php?f=4&t=8582

Following the mentioned discussion, this code should do what you are looking for -
Code: Select all
<cms:show_securefile 'avatar' >
    <cms:if file_is_image >
        <a href="<cms:cloak_url link=file_id />"><img src="<cms:cloak_url link=file_id thumbnail='1' />" /></a><br />
    </cms:if>
   
    <cms:set has_avatar='1' 'global' />
</cms:show_securefile>
           
<cms:if "<cms:not has_avatar />" >
    <!-- No avatar. Use the default image -->
    <img src=".." />
</cms:if>

Hope it helps.
KK wrote: @atisz, this has been discussed in the following thread - viewtopic.php?f=4&t=8582

Following the mentioned discussion, this code should do what you are looking for -
Code: Select all
<cms:show_securefile 'avatar' >
    <cms:if file_is_image >
        <a href="<cms:cloak_url link=file_id />"><img src="<cms:cloak_url link=file_id thumbnail='1' />" /></a><br />
    </cms:if>
   
    <cms:set has_avatar='1' 'global' />
</cms:show_securefile>
           
<cms:if "<cms:not has_avatar />" >
    <!-- No avatar. Use the default image -->
    <img src=".." />
</cms:if>

Hope it helps.


Thanks, KK! It helps, but.... There is a problem because, for example, in index.php I have to display in the main div the member details: avatar, name, address,.... but member avatar and name are displayed in the sidebar, also. And using the code above will display in sidebar both the default avatar and user chosen avatars only if I'm visiting a page (eg members/index.php?p=79) where user has no own avatar and default avatar is displayed. Otherwise, because of
Code: Select all
<cms:set has_avatar='1' 'global' />
the sidebar doesn't display the default avatar. Is there a workaround to display the correct avatar type in the sidebar?
Thanks.
Something strange is happening :shock: If I use the following code
Code: Select all
<ul class="list">
              <cms:pages masterpage=k_member_template id="NOT <cms:show k_member_id />" orderby='page_title' order='asc'>
                <li>
                  <div class="avatar">
                     <cms:show_securefile 'avatar' >
                         <cms:if file_is_image >
                             <a href="<cms:show k_page_link />"><img src="<cms:cloak_url link=file_id thumbnail='1' />" /></a>
                           </cms:if>
   
                         <cms:set has_avatar='1' 'global' />
                     </cms:show_securefile>
           
                     <cms:if "<cms:not has_avatar />" >
                         <!-- No avatar. Use the default image -->
                         <a href="<cms:show k_page_link />"><img src="<cms:get_custom_field 'defaultavatar' masterpage='members/globals.php' />" /></a>
                     </cms:if>
                  </div>
                     <h3 class="name"><a href="<cms:show k_page_link/>"><cms:show k_page_title /></a></h3>
               </li>
               </cms:pages>
              </ul>
the default avatar image is not displaying. But if I remove orderby='page_title' order='asc' from
Code: Select all
<cms:pages masterpage=k_member_template id="NOT <cms:show k_member_id />" orderby='page_title' order='asc'>
the default avatar gets displayed. Why happens this? What orderby has to do with displaying/not displaying the default avatar?
@atisz,
I was not aware you are using the code in a loop (cms:pages in this case).
We'll need one small modification to make it work in a loop - reset the 'has_avatar' variable to 0 at every iteration as follows
Code: Select all
<cms:pages masterpage=k_member_template id="NOT <cms:show k_member_id />" orderby='page_title' order='asc'>
<li>
  <div class="avatar">

    <cms:set has_avatar='0' 'global' />
   
    <cms:show_securefile 'avatar' >
        <cms:if file_is_image >
            <a href="<cms:show k_page_link />"><img src="<cms:cloak_url link=file_id thumbnail='1' />" /></a>
        </cms:if>

        <cms:set has_avatar='1' 'global' />
    </cms:show_securefile>

    <cms:if "<cms:not has_avatar />" >
        <!-- No avatar. Use the default image -->
        <a href="<cms:show k_page_link />"><img src="<cms:get_custom_field 'defaultavatar' masterpage='members/globals.php' />" /></a>
    </cms:if>
  </div>
  <h3 class="name"><a href="<cms:show k_page_link/>"><cms:show k_page_title /></a></h3>
</li>
</cms:pages>

Does this work?
KK wrote: @atisz,
I was not aware you are using the code in a loop (cms:pages in this case).
We'll need one small modification to make it work in a loop - reset the 'has_avatar' variable to 0 at every iteration as follows
Code: Select all
<cms:pages masterpage=k_member_template id="NOT <cms:show k_member_id />" orderby='page_title' order='asc'>
<li>
  <div class="avatar">

    <cms:set has_avatar='0' 'global' />
   
    <cms:show_securefile 'avatar' >
        <cms:if file_is_image >
            <a href="<cms:show k_page_link />"><img src="<cms:cloak_url link=file_id thumbnail='1' />" /></a>
        </cms:if>

        <cms:set has_avatar='1' 'global' />
    </cms:show_securefile>

    <cms:if "<cms:not has_avatar />" >
        <!-- No avatar. Use the default image -->
        <a href="<cms:show k_page_link />"><img src="<cms:get_custom_field 'defaultavatar' masterpage='members/globals.php' />" /></a>
    </cms:if>
  </div>
  <h3 class="name"><a href="<cms:show k_page_link/>"><cms:show k_page_title /></a></h3>
</li>
</cms:pages>

Does this work?

Super, KK! Now I'm able to display the necessary avatars inside and outside a loop, on the same page. Thanks a lot for your help!
The sign up template contains, beside the mandatory member module editables, a few extra editables like editable1, editable2, editable3, editable4. Is it possible (on new account creation) to automatically fill editable4 as joined values of editable1, editable2 and editable3 (something like editable4=editable1editable2-editable3, eg. A8-36)?
editable4 will serve as a custom id field.
Thanks!
I'm a little late to the party here, but I have a question on the functionality of this module. I'm working on a website for a school, and I'm wondering if this does what I'm hoping it does.

Basically, I need to be able to create pages for the parents of the students to login and view grades and attendance. Obviously I can create cloned pages with all the editable regions I need, but I need a way to make sure that once logged in Parent A can't see the grades for Parent B.

Is this doable with the members module?
Previous 1 ... 10, 11, 12, 13, 14, 15 Next
148 posts Page 13 of 15