Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Hi all,

I;ve come across another problem with relation to this page.

On the members profile page i want to show just the users post. I've used this code here.

Code: Select all
  <cms:pages masterpage='members/articles/index.php' folder=k_member_name> 
  <cms:show linkprofile />
<div id="user_post_img"><cms:show art_img /></div>
<div id="user_post_title"><cms:show art_title /></div>
<div id="user_post_content"><cms:excerpt count='290' truncate_chars='1'><cms:show art_information /></cms:excerpt></div>
</cms:pages>


I've also included within the template

Code: Select all
 <!-- every template dealing with members has to begin with the following tag -->
    <cms:member_check_login />
   
   
<!-- this is secured page. login first to access it -->
    <cms:if k_member_logged_out >
        <cms:redirect "<cms:member_login_link />" />
    </cms:if >   
    <cms:if k_member_logged_out >
     
    </cms:if>
   
  <cms:if k_member_logged_in >
   <cms:pages masterpage=k_member_template id=k_member_id>


This then outputs at showing all the posts within the members profile rather than the registered users posts.
its listing everything. And not just listing posts from lets say ''Simon Opie''


Listing content without being logged in
would there also be a way to lists the same like above but without the member being logged in. As the members index.php page is showing the users public profile, so this can be viewed by none-logged in members. Your members account you joined up with is still active. and ive not changed any FTP details so if you want to do a backend check

Thank you All.




Full Code is here


<body id="aprofile">
<cms:template title='Member Profile Main' hidden='1' />




<!-- every template dealing with members has to begin with the following tag -->
<cms:member_check_login />


<!-- this is secured page. login first to access it -->
<cms:if k_member_logged_out >
<cms:redirect "<cms:member_login_link />" />
</cms:if >
<cms:if k_member_logged_out >

</cms:if>

<cms:if k_member_logged_in >
<cms:pages masterpage=k_member_template id=k_member_id>



<?php include('http://tsmsport.co.uk/includes/nav_top.html'); ?>





















<div id="page_profile_content">

<div id="cover_pro" > <cms:show cover_pro /></div>
<div id="page_profile_content1">
<!--- PLACE YOUR CONTENT HERE --------->
<div id="profile_main_img"><cms:show profile_img /> </div>
<div id="profile_cats">
<div id="profile_cat1"><cms:show k_page_title />
</div>
<div id="profile_cat2"><span style="color:#999999">Job Title </span> <cms:show job_title /></div>
<div id="profile_cat2"><span style="color:#999999">Company</span> <cms:show company_name /></div>
<div id="profile_cat2"><span style="color:#999999">Web</span> <cms:show company_url /></div>
<div id="profile_cat2"><span style="color:#999999">Account</span> <span style="color:#0099FF; font-weight:bold;"> <cms:show account_type /></span></div>
</div>
<div id="profile_edits">
<div id="profile_edits_cat">Registered on <strong><cms:date k_page_date format='jS M, Y' /></strong></div>
<div id="profile_edits_cat"><a href="index.php?p=<cms:show k_member_id />" style="color:#999999; text-decoration:none;">Share Profile </a></div>
</div>
</div>


<div id="page_profile_content1" style="margin-top:20px;">
<div style="background-color:#000000; width:100px; height:40px; font-family: 'Open Sans', sans-serif; color: #FFFFFF; padding: 0px 10px 0px 10px; line-height: 40px; font-weight: bold;"> Background </div>
<div style="width:600px; padding:20px; height:auto; font-size:12px; margin-top: 20px;">
<span style="font-size:12px; color:#666666;">
<cms:show bio_profile /></span>


<cms:pages masterpage='members/articles/index.php' folder=k_member_name>
<cms:show linkprofile />
<div id="user_post_img"><cms:show art_img /></div>
<div id="user_post_title"><cms:show art_title /></div>
<div id="user_post_content"><cms:excerpt count='290' truncate_chars='1'><cms:show art_information /></cms:excerpt></div>
</cms:pages>

</div>
<!--- PLACE YOUR CONTENT HERE --------->
</div>
</div>


<!-- give an option to logout -->
<div id="page_profile_content"></div>
<!-- give an option to logout -->
<div id="page_profile_content"></div>





</cms:pages>
</cms:if>







</body>

Hi,

The part of the code which is supposed to show pages belonging only to the logged-in user is
<cms:pages masterpage='members/articles/index.php' folder=k_member_name>

The code above is basically fetching pages from a folder that has the same name as the logged-in member.

So, have you created folders with the same name as the members and made sure all pages posted by them are placed in the right folder?
KK wrote: Hi,

The part of the code which is supposed to show pages belonging only to the logged-in user is
<cms:pages masterpage='members/articles/index.php' folder=k_member_name>

The code above is basically fetching pages from a folder that has the same name as the logged-in member.

So, have you created folders with the same name as the members and made sure all pages posted by them are placed in the right folder?


Hi kk,

That's a good point. Within the articles/index.php page I've not created a folders part. Can you advise me on how this should correctly be to shown within the Template. Would this also need to be added to the databound form aswell?

I've added in on the databound form to
Save the members details.
Simon, if I am not wrong, the context of this thread is your other question here where I showed how to associate a logged-in member with the pages she posts -
viewtopic.php?p=16426#p16426

If so, I have just added another reply there that shows how to list the pages-
viewtopic.php?p=16473#p16473

Does this help?
4 posts Page 1 of 1
cron