<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>
                <div class="bmenur">{literal}
                    <script type="text/javascript">
                        $(document).ready(function(){
                            $("select[id='order_type'], select[id='order_category'], select[id='order_timeline']").change(function() {
                                $('#orderGames').submit();
                            });
                        });
                    </script>
                    {/literal}
                    <div id="order_form">
                    <form name="orderGames" id="orderGames" method="get" action="{$relative}/search">
                        <input name="search_query" type="hidden" value="{$search_query|escape:'url'}" />
                        <input name="search_type" type="hidden" value="games" />
                        <input name="o" type="hidden" value="{$order}" />
                        <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].category_id}"{if $category == $categories[i].category_id} selected="yes"{/if}>{$categories[i].category_name|escape:'html'}</option>
                            {/section}
                        </select>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
            <div class="bsubmenu">
                <div class="bsubmenul">
                    {if $order == 'bp'}Being Played{else}<a href="{url base='games' strip='o' value='bp'}">Being Played</a>{/if} <strong>&middot;</strong>
                    {if $order == 'mr'}Most Recent{else}<a href="{url base='games' strip='o' value='mr'}">Most Recent</a>{/if} <strong>&middot;</strong>
                    {if $order == 'mp'}Most Played{else}<a href="{url base='games' strip='o' value='mp'}">Most Played</a>{/if} <strong>&middot;</strong>
                    {if $order == 'tr'}Top Rated{else}<a href="{url base='games' strip='o' value='tr'}">Top Rated</a>{/if} <strong>&middot;</strong>
                    {if $order == 'md'}Most Commented{else}<a href="{url base='games' strip='o' value='md'}">Most Commented</a>{/if} <strong>&middot;</strong>
                    {if $order == 'tf'}Top Favorites{else}<a href="{url base='games' strip='o' value='tf'}">Top Favorites</a>{/if}                                                                                                                    
                </div>
                <div class="bsubmenur">
                    <div id="timeline_form">
                        <span>Timeline: </span>
                        <select name="t" id="order_timeline">
                            <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>
                    </div>
                    </form>
                </div>
                <div class="clear"></div>
            </div>
            <div class="blinkp">
                <div class="blinkcl">Showing <span>{$start_num}</span> to <span>{$end_num}</span> of <span>{$games_total}</span> games.</div>
                <div class="blinkcr"><a href="{$relative}/upload/game">Upload Game</a></div>
                <div class="clear"></div>
            </div>
            {if $games}
            {section name=i loop=$games}
            <div class="video_box">
                <a href="{$relative}/game/{$games[i].GID}/{$games[i].title|clean}"><span class="font-13 font-bold">{$games[i].title|truncate:20:' ...':true|escape:'html'}</span><br /><img src="{$relative}/media/games/tmb/{$games[i].GID}.jpg" title="{$games[i].title|escape:'html'}" alt="{$games[i].title|escape:'html'}" width="160" height="120" /><br />{if $games[i].type == 'private'}<img alt="" style="position: absolute; left: 0px; top: +15px; width: 160px; height: 120px;" src="{$relative_tpl}/images/private-video.png"/>{/if}</a>
                <div class="box_left">
                    {insert name=time_range assign=addtime time=$games[i].addtime}
                    {$addtime}                                                                                                
                </div>
                <div class="box_right">
                    {insert name=rating_small assign=video_rating rating=$games[i].rate}
                    {$video_rating}
                    <div class="clear_right"></div>
                    {$games[i].total_plays} plays
                </div>
                <div class="clear"></div>
            </div>
            {/section}
            <div class="clear_left"></div>
            <div class="pagination"><ul>{$page_link}</ul></div><br />
            {else}
                NO GAMES
            {/if}
        </div>
        {insert name=adv assign=adv group='games_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='games_right'}
              {if $adv}<br /><div class="ads">{$adv}</div><br />{/if}
          </div>
    </div>
    <div class="clear"></div>
</div>
