<div id="content">
    <div class="left span-755">
        <div class="box">
            
            <div class="bmenu">
                <div class="bmenul">
                    <h2>SEARCH RESULTS FOR '{$search_query|truncate:30:' ...':true|escape:'html'}'</h2>
                </div>{literal}
                <script type="text/javascript">
                $(document).ready(function(){
                    $("select[id='order_type'],select[id='order_category'],select[id='timeline_order']").change(function() {
                        $('#orderAlbums').submit();
                    });
                });
                </script>
                {/literal}                                                                                                                                                        
                <div class="bmenur">
                    <div id="order_form">
                        <form name="orderAlbums" id="orderAlbums" method="get" action="{$relative}/search">
                            <input name="o" type="hidden" value="{$order}" />
                            <input name="search_query" type="hidden" value="{$search_query|escape:'url'}" />
                            <input name="search_type" type="hidden" value="photos" />
                            <span class="mleft">Type: </span>
                            <select name="type" id="order_type">
                            <option value=""{if $type == ''} selected="yes"{/if}>All</option>
                            <option value="public"{if $type == 'public'} selected="yes"{/if}>Public</option>
                            <option value="private"{if $type == 'private'} selected="yes"{/if}>Private</option>
                            </select>
                            <span class="mleft">Category: </span>
                            <select name="c" id="order_category">
                            <option value="0"{if $category == '0'} selected="yes"{/if}>All</option>
                            {section name=i loop=$categories}
                            <option value="{$categories[i].CHID}"{if $category == $categories[i].CHID} selected="yes"{/if}>{$categories[i].name}</option>
                            {/section}
                            </select>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
            <div class="bsubmenu">
                <div class="bsubmenul">
                    {if $order == 'mr'}Most Recent{else}<a href="{url base='search' strip='o' value='mr'}">Most Recent</a>{/if} <strong>&middot;</strong>
                    {if $order == 'mv'}Most Viewed{else}<a href="{url base='search' strip='o' value='mv'}">Most Viewed</a>{/if} <strong>&middot;</strong>
                    {if $order == 'mp'}Most Photos{else}<a href="{url base='search' strip='o' value='mp'}">Most Photos</a>{/if} <strong>&middot;</strong>
                    {if $order == 'tr'}Top Rated{else}<a href="{url base='search' strip='o' value='tr'}">Top Rated</a>{/if} <strong>&middot;</strong>
                    {if $order == 'md'}Most Commented{else}<a href="{url base='search' strip='o' value='md'}">Most Commented</a>{/if} <strong>&middot;</strong>
                    {if $order == 'tf'}Top Favorites{else}<a href="{url base='search' strip='o' value='tf'}">Top Favorites</a>{/if}
                </div>
                <div class="bsubmenur">
                    <div id="timeline_form">
                        <span>Timeline: </span>
                        <select name="t" id="timeline_order">
                        <option value="t"{if $timeframe == 't'} selected="yes"{/if}>Today</option>
                        <option value="w"{if $timeframe == 'w'} selected="yes"{/if}>This Week</option>
                        <option value="m"{if $timeframe == 'm'} selected="yes"{/if}>This Month</option>
                        <option value="a"{if $timeframe == 'a'} selected="yes"{/if}>All</option>
                        </select>
                        </form>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
            
            <div class="blinkp">
                <div class="blinkcl">Showing <span>{$start_num}</span> to <span>{$end_num}</span> of <span>{$albums_total}</span> albums.</div>
                <div class="blinkcr"><a href="{$relative}/upload/photo">Create New Photo Album</a></div>
                <div class="clear"></div>
            </div>
            {if $albums}
            {section name=i loop=$albums}
            <div class="album_box">
                <a href="{$relative}/album/{$albums[i].AID}/{$albums[i].name|clean}"><span class="font-11 font-bold">{$albums[i].name|truncate:23:' ...':true|escape:'html'}</span><br /><img src="{$relative}/media/albums/{$albums[i].AID}.jpg" title="{$albums[i].name|escape:'html'}" alt="{$albums[i].name|escape:'html'}" width="120" /><br />{if $albums[i].type == 'private'}<img alt="" style="position: absolute; left: 0px; top: +13px; width: 120px; height: 140px;" src="{$relative_tpl}/images/private-album.png"/>{/if}</a>
                <div class="album_info">
                    <div class="album_left">
                        {$albums[i].total_photos} {if $albums[i].total_photos > 1}photos{else}photo{/if}<br />
                    </div>
                    <div class="album_right">
                        {insert name=rating_small assign=album_rating rating=$albums[i].rate}
                        {$album_rating}
                    </div>
                    <div class="clear"></div>
                    From: <a href="{$relative}/user/{$albums[i].username}">{$albums[i].username|escape:'html'}</a><br />
                    {insert name=time_range assign=addtime time=$albums[i].addtime}
                    Added: {$addtime}                                                                        
                </div>
            </div>
            {/section}
            <div class="clear_left"></div>
            <div class="pagination"><ul>{$page_link}</ul></div><br />
            {else}
                <br />&nbsp;Your search did not return any results. Please try again!<br /><br />
            {/if}
        </div>
        {insert name=adv assign=adv group='search_photos_bottom'}
        {if $adv}<br /><div class="ads">{$adv}</div><br />{/if}
    </div>
    <div class="right span-200">
        <div class="box">
            
            <div class="btitle"><h2>SPONSORS</h2></div>
            {insert name=adv assign=adv group='search_photos_right'}
            {if $adv}<br /><div class="ads">{$adv}</div><br />{/if}
        </div>
    </div>
    <div class="clear"></div>
</div>
