Cum pot pune "topicurile active" intr-un php ?

Pentru întrebări legate de facilităţile forumului phpBB 3.0.x, acest loc este cel mai potrivit.
Reguli forum
Aveti o problema si vreti sa primiti ajutor? Click aici ! Nu uitati si de regulamentul forumului !
Închis
megastar
Utilizator înregistrat
Mesaje: 225
Membru din: 24-Dec-2007, 22:28:26

Cum pot pune "topicurile active" intr-un php ?

Mesaj de megastar »

Am reusit sa gasesc un cod pentru "ultimele topicuri".Arata cam asa:

Cod: Selectaţi tot

    <?

    // schimbati calea catre forum
    $path = '../demoforum/';

    // suma topicurilor afisate
    $amount = 5;

    // numarul forumului ce nu trebuie afisat
    $exclude = '';

    // ------ mai jos nu e nevoie sa editati ------ //

    require_once("{$path}config.php");

    $conid = mysql_connect($dbhost, $dbuser, $dbpasswd);
    $db    = mysql_select_db($dbname, $conid);

    unset($dbpasswd);

    $sql_where = 'WHERE `forum_id` > -1 ';

    if($exclude != '')
    {     
        $exclude_forums = explode(',', $exclude);
        foreach ($exclude_forums as $id)
        {
            if ($id > 0)
            {
                $sql_where .= ' AND `forum_id` <> ' . trim($id);
            }
        }
    }

    $sql = "SELECT `topic_id`, `topic_title` FROM `{$table_prefix}topics`  {$sql_where} ORDER BY `topic_time`DESC LIMIT 0, {$amount}";
    $result = mysql_query($sql, $conid);

    $topics_html = '';
    while($topic = mysql_fetch_array($result))
    {
        $topics_html .= "<a href=\"{$path}viewtopic.php?t={$topic['topic_id']}\">{$topic['topic_title']}</a><br />";
    }
    mysql_close($conid);

    echo $topics_html;
    ?>
Ma ajuta si pe mine cineva sa fac unul pentru "topicurile active" ?
Închis

Înapoi la “3.0.x Cum pot să...?”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 1 vizitator