PanBB.Ru wrote:

Разберешься?

    $bquery = array(
        'SELECT'    => 'MIN(bt.id), bt.subject',
        'FROM'        => 'topics AS bt',
        'WHERE'        => 'bt.id>'.$id,
    );
    $bresult = $forum_db->query_build($bquery) or error(__FILE__, __LINE__);
    $back = $forum_db->fetch_assoc($bresult);
    
    if(isset($back['MIN(bt.id)']))
        $tback = '<a href="'.forum_link($forum_url['topic'], array($back['MIN(bt.id)'], sef_friendly($back['subject']))).'">'.$back['subject'].'</a>';
    
    $nquery = array(
        'SELECT'    => 'MAX(nt.id), nt.subject',
        'FROM'        => 'topics AS nt',
        'WHERE'        => 'nt.id<'.$id,
    );
    $nresult = $forum_db->query_build($nquery) or error(__FILE__, __LINE__);
    $next = $forum_db->fetch_assoc($nresult);
    
    if(isset($next['MAX(nt.id)']))
        $tnext = '<a href="'.forum_link($forum_url['topic'], array($next['MAX(nt.id)'], sef_friendly($next['subject']))).'">'.$next['subject'].'</a>';
        
    echo $tback;
    echo $tnext;

will you understand?

Or second embodiment:

    $query = array(
        'SELECT'    => 't.id, t.subject',
        'FROM'        => 'topics AS t',
        'WHERE'        => 't.forum_id='.$cur_topic['forum_id']
    );
    $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
    
    $back = array();
    $next = array();
    while($topics = $forum_db->fetch_assoc($result))
    {
        if($topics['id'] < $id)
            $back[$topics['id']] = $topics['subject'];
        else if ($topics['id'] > $id)
            $next[$topics['id']] = $topics['subject'];
    }
    
    $back_id = max(array_keys($back));
    $back_subject = $back[$back_id];
    
    $next_id = min(array_keys($next));
    $next_subject = $next[$next_id];
    
    $tback = !empty($back_id) ? '<a href="'.forum_link($forum_url['topic'], array($back_id, sef_friendly($back_subject))).'" title="Old topic">'.$back_subject.'&nbsp;&#9668;&#9668;&nbsp;</a>' : '';
    
    $tnext = !empty($next_id) ? '<a href="'.forum_link($forum_url['topic'], array($next_id, sef_friendly($next_subject))).'" title="Next topic">&nbsp;&#9658;&#9658;&nbsp;'.$next_subject.'</a>' : '';
    

I have tried it but i messed up at then end. Is there any alternate route to do so.....!
Infantigo

2

(16 replies, posted in Programming)

Paul wrote:

Back on the original topic. Did you know that if you give a container position:relative then all the text inside the container becomes unselectable in IE6 in strict mode. Use a transitional doctype and everything is OK. For example, if you make the div surrounding posts position:relative then you can no longer select posted text by dragging though you might just accidentally hit on a combinatin which will make it work. Just another little gift from dear Mr. Gates to make life interesting.


It might be the case but not often!
Tragus