PROPOSAL: Some Summary Page fixes(polishing)

PROPOSAL: Some Summary Page fixes(polishing)

Postby chromos on Thu Jul 10, 2008 2:47 pm

1. On the UserList page from the summary page you are able to see unconfirmed blogs which shouldn't be possible.
Same behavior if you are going to a UserProfile page.

2. It'd also be nice to have that you can choose whether the blogs you are assigned to are shown or not.

3. As I have already written in the other thread. I'd really like to make a UserProfile page private, also a whole blog (iirc there'd be fixes needed for the summary page as the secret plugin is providing a similar behavior)

If I find the time I will have a look into some of the minor glitches.
chromos
 
Posts: 274
Joined: Wed Mar 09, 2005 2:22 pm
LifeType Version: 1.2.9-devel

Re: PROPOSAL: Some Summary Page fixes(polishing)

Postby jondaley on Fri Jul 11, 2008 3:59 am

please report #1 on bugs.lifetype.net, I thought that had already been fixed.

I don't know how many people will care about #2, but you can try and see if anyone feels like adding it. Please add them in different reports, as #1 will likely get fixed in 1.2.9, since I expect it to be really easy.

What does "private" mean for #3? Who gets to see it? Only if you are logged in?
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: PROPOSAL: Some Summary Page fixes(polishing)

Postby jondaley on Fri Jul 11, 2008 4:12 am

Well, I just took a look at #1 - it probably won't get fixed for 1.2.9 - it wasn't trivial to fix like I thought it would be.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: PROPOSAL: Some Summary Page fixes(polishing)

Postby chromos on Fri Jul 11, 2008 6:16 am

1. I see :(
but it sounds as if i can get the fix from svn?

2. Ok I am going to fill 2 different bug reports.

3. something similar to how blogspot handles it would be nice. Meaning you have to be a user assigned to the blog so you have to log in to see it.
chromos
 
Posts: 274
Joined: Wed Mar 09, 2005 2:22 pm
LifeType Version: 1.2.9-devel

Re: PROPOSAL: Some Summary Page fixes(polishing)

Postby jondaley on Fri Jul 11, 2008 8:28 pm

#1, no the fix isn't in svn, I was playing on my own blog, but couldn't get it to work without more significant changes to the API, (perhaps by adding a status parameter to the user->getBlogs($status) function, that doesn't exist now. It might not be too big of a change if it was added with the default parameter, but I don't particularly want to add it right now, I think.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: PROPOSAL: Some Summary Page fixes(polishing)

Postby chromos on Sat Jul 12, 2008 12:24 pm

I see :(

maybe writing a wrapper is a solution? So you don't need to break the API?

However I will come up with something on my own :)
chromos
 
Posts: 274
Joined: Wed Mar 09, 2005 2:22 pm
LifeType Version: 1.2.9-devel

Re: PROPOSAL: Some Summary Page fixes(polishing)

Postby chromos on Fri Jul 18, 2008 8:01 am

What I don't understand, premised the api is correct:

Why does user->getBlogs() call $users->getUsersBlogs($this->getId()); with only the Id as parameter and not also the status?
In the API getUsersBlogs provides such a parameter, shouldn't it be very easy to add this functionality?
chromos
 
Posts: 274
Joined: Wed Mar 09, 2005 2:22 pm
LifeType Version: 1.2.9-devel

Re: PROPOSAL: Some Summary Page fixes(polishing)

Postby jondaley on Fri Jul 18, 2008 5:42 pm

Yes, I think it is relatively straightforward to add that. I wasn't in the mood for it at the time - and need to make sure that I don't break anything. If you add it to bugs.lifetype.net, we can see about adding it.
jondaley
Lifetype Expert
 
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: PROPOSAL: Some Summary Page fixes(polishing)

Postby chromos on Sat Jul 19, 2008 3:27 pm

ok bugreport is filed bugs.lifetype.net

userinfo.class.php
Code: Select all
function getBlogs( $status = BLOG_STATUS_ALL )
      {
         if( $this->_blogs == null ) {
            lt_include( PLOG_CLASS_PATH."class/dao/users.class.php" );
            $users = new Users();
                      $this->_blogs = $users->getUsersBlogs($this->getId(), $status);
         }
         
         return( $this->_blogs );
      }


user.template
Code: Select all
{if $user->hasPicture()}
   {assign var=picture value=$user->getPicture()}
        <img src="{$picture->getPreviewLink()}"  width="60" height="60" class="postgrav" />
    {else}
        <img src="templates/summary/nouser.gif" class="postgrav" width="60" height="60" alt="{$user->getUsername()|strip_tags}" />   
    {/if}

        <h3><a href="?op=UserProfile&amp;userId={$user->getId()}">{$user->getUsername()}</a></h3>
      <div class="subtitle">
       <b>{$locale->tr("blogs")}:</b>
       {assign var=userBlogs value=$user->getBlogs(1)}
       {foreach from=$userBlogs item=userBlog name=userBlogsLoop}
        {assign var=urlGen value=$userBlog->getBlogRequestGenerator()}
        <a href="{$urlGen->blogLink()}">{$userBlog->getBlog()}</a>{if !$smarty.foreach.userBlogsLoop.last}, {/if}
       {/foreach}
      </div>
      <div class="footer">{$user->getAboutMyself()|strip_tags}</div>
      <div class="clearleft">&nbsp;</div>

Maybe some addition like that would also be nice:
{if $userBlogs}
<b>{$locale->tr("blogs")}:</b>
{else}
<b>{$locale->tr("unconfirmed")}</b>
{/if}

fix for userprofile.template:
Code: Select all
{assign var=userName value=$user->getUsername()}
{assign var=title value=$locale->tr("user")}
{assign var=sectionTitle value="$title $userName"}
{include file="summary/header.template" selected="userslist" section="$title $userName"}
<div id="onecolumn">

   {include file="summary/user.template"}

   {foreach from=$recentArticles item=post}
   {assign var=blog value=$post->getBlogInfo()}
   {assign var=status value=$blog->getStatus()}
   {if $status == 1}
     <h3>
   {assign var=request value=$blog->getBlogRequestGenerator()}
   {assign var=postDate value=$post->getDateObject()}
       <a href="{$request->postPermalink($post)}">{$post->getTopic()|strip_tags|truncate:60}</a>
    </h3>
       
    <div class="subtitle">
       {$locale->tr("posted_in")} <a href="{$request->postPermalink($post)}">{$blog->getBlog()}</a>{if $artGlobalCategory} | {$locale->tr("category")}: <a href="?op=PostList&amp;globalArticleCategoryId={$artGlobalCategory->getId()}">{$artGlobalCategory->getName()}</a>{/if}
    </div>
   
    <p>
        {$post->getText()|strip_tags|truncate:140:"..."}
    </p>
   
    <div class="postinfo">
        <img src="imgs/post.png" width="10" height="11" alt="Author" />
         <strong>{$user->getUsername()}</strong>, {$locale->formatDate($postDate,"%e %B %Y")} |
        <img src="imgs/comment.png" width="11" height="10" alt="{$locale->tr("comments")}" />
        <a href="{$request->postPermalink($post)}#comments">{if $post->getTotalComments() eq 0}{$locale->tr("comment on this")}{else}{$post->getTotalComments()} {$locale->tr("comments")|capitalize}{/if}</a>
    </div>
   {/if}
   {/foreach}

   <p>
    <a href="javascript:history.go(-1);">{$locale->tr("back")}</a>
   </p>

</div>
{include file="summary/footer.template"}


Edit: Fixed a small bug in userprofile.template
Last edited by chromos on Mon Jul 21, 2008 3:10 am, edited 1 time in total.
chromos
 
Posts: 274
Joined: Wed Mar 09, 2005 2:22 pm
LifeType Version: 1.2.9-devel

Re: PROPOSAL: Some Summary Page fixes(polishing)

Postby chromos on Sun Jul 20, 2008 11:26 am

I also added the back link to the
searchresults.template
Code: Select all
{include file="summary/header.template" section=$locale->tr("search_results")}
<div id="onecolumn">
    <h2>{$locale->tr("search_results")}</h2>
    {if $searchtype == 1}
       {foreach from=$searchresults item=result}
          {assign var="post" value=$result->getArticle()}
         {assign var="blog" value=$post->getBlogInfo()}
         {assign var="request" value=$blog->getBlogRequestGenerator()}
          {include file="summary/post.template"}
       {/foreach}
      {** bloglistpager links=$linkslist current=$currentPage **}
   {elseif $searchtype == 2}
       {foreach from=$searchresults item=result}
          {assign var="blog" value=$result->getResult()}
          {include file="summary/blog.template"}
       {/foreach}
   {else}
       {foreach from=$searchresults item=result}
          {assign var="resource" value=$result->getResult()}
          {include file="summary/resource.template"}
       {/foreach}   
   {/if}
  {pager style=links}
   <p>
    <a href="javascript:history.go(-1);">{$locale->tr("back")}</a>
   </p>
</div>
{include file="summary/footer.template"}
chromos
 
Posts: 274
Joined: Wed Mar 09, 2005 2:22 pm
LifeType Version: 1.2.9-devel


Return to LifeType 2.0 Development

cron