Improved search result template
authorMarcel Werk <burntime@woltlab.com>
Wed, 25 Jun 2014 16:44:25 +0000 (18:44 +0200)
committerMarcel Werk <burntime@woltlab.com>
Wed, 25 Jun 2014 16:44:25 +0000 (18:44 +0200)
com.woltlab.wcf/templates/searchResultList.tpl

index 162a53837c18f4192549c0975dbb66e40299d88e..f31f855b35174b6e12a6f3e678c71f9b853c6379 100644 (file)
@@ -3,16 +3,39 @@
                {foreach from=$objects item=message}
                        <li>
                                <div class="box48">
-                                       <a href="{link controller='User' object=$message->getUserProfile()}{/link}" title="{$message->getUserProfile()->username}" class="framed">{@$message->getUserProfile()->getAvatar()->getImageTag(48)}</a>
+                                       {if $message->getUserProfile()}
+                                               {if $message->getUserProfile()->userID}
+                                                       <a href="{link controller='User' object=$message->getUserProfile()}{/link}" title="{$message->getUserProfile()->username}" class="framed">{@$message->getUserProfile()->getAvatar()->getImageTag(48)}</a>
+                                               {else}
+                                                       <p class="framed">{@$message->getUserProfile()->getAvatar()->getImageTag(48)}</p>
+                                               {/if}
+                                       {else}
+                                               <p class="framed"><span class="icon icon48 fa-file-o"></span></p>
+                                       {/if}
                                        
                                        <div>
                                                <div class="containerHeadline">
                                                        <h3><a href="{$message->getLink($query)}">{$message->getSubject()}</a></h3>
-                                                       <p>
-                                                               <a href="{link controller='User' object=$message->getUserProfile()}{/link}" class="userLink" data-user-id="{@$message->getUserProfile()->userID}">{$message->getUserProfile()->username}</a>
-                                                               <small>- {@$message->getTime()|time}</small>
-                                                               {if $message->getContainerTitle()}<small>- <a href="{$message->getContainerLink()}">{$message->getContainerTitle()}</a></small>{/if}
-                                                       </p> 
+                                                       
+                                                       {if $message->getUserProfile() || $message->getTime() || $message->getContainerTitle()}
+                                                               <p>
+                                                                       {if $message->getUserProfile()}
+                                                                               {if $message->getUserProfile()->userID}
+                                                                                       <a href="{link controller='User' object=$message->getUserProfile()}{/link}" class="userLink" data-user-id="{@$message->getUserProfile()->userID}">{$message->getUserProfile()->username}</a>
+                                                                               {else}
+                                                                                       {$message->getUserProfile()->username}
+                                                                               {/if}
+                                                                       {/if}
+                                                                       
+                                                                       {if $message->getTime()}
+                                                                               <small>{if $message->getUserProfile()}- {/if}{@$message->getTime()|time}</small>
+                                                                       {/if}
+                                                                       
+                                                                       {if $message->getContainerTitle()}
+                                                                               <small>{if $message->getUserProfile() || $message->getTime()}- {/if}<a href="{$message->getContainerLink()}">{$message->getContainerTitle()}</a></small>
+                                                                       {/if}
+                                                               </p>
+                                                       {/if}
                                                        <small class="containerContentType">{lang}wcf.search.object.{@$message->getObjectTypeName()}{/lang}</small>
                                                </div>