Index'te Konu aramayi genislestir

Son güncelleme: 18.01.2007 23:08
  • Size ana Sayfa icin daha detayli bir arama icin ufak bir Hack sunuyorum

    Boardlarinizin en alt tarafinda Son 24 Saat icindeki aktiv Konulari göster diye bir Link var,
    bunu benim sunacagim kücük bir degisiklik sayesinde ilerletebilirsiniz

    yani Son 48 Saat icindeki aktiv Konulari ve Son 7 gün icindeki aktiv Konulari göster diye....



    search.php acin

    ARA:
    /* new threads 24h */
    if ($_GET['action'] == '24h') {
    $boardids = '';
    list($boardcount) = $db->query_first("SELECT COUNT(*) FROM bb".$n."_boards");

    $result = $db->query("SELECT boardid FROM bb".$n."_boards WHERE password='' AND boardid IN (0".getSearchableBoards().")");
    if ($db->num_rows($result) < $boardcount) {
    while ($row = $db->fetch_array($result)) {
    if ($boardids != '') $boardids .= ','.$row['boardid'];
    else $boardids = $row['boardid'];
    }
    if (!$boardids) redirect($lang->get("LANG_GLOBAL_ERROR_SEARCHNORESULT"), "search.php" . $SID_ARG_1ST);
    }

    $savepostids = '';
    $datecute = time() - 86400;
    $result = $db->unbuffered_query("SELECT p.postid FROM bb".$n."_posts p, bb".$n."_threads t WHERE p.threadid=t.threadid AND p.visible=1 AND p.posttime>'$datecute'
    ".(($boardids) ? ("AND t.boardid IN ($boardids)") : ("")));
    while ($row = $db->fetch_array($result)) $savepostids .= ','.$row['postid'];

    if (!$savepostids) redirect($lang->get("LANG_GLOBAL_ERROR_SEARCHNORESULT"), "search.php" . $SID_ARG_1ST);
    $result = $db->query_first("SELECT searchid FROM bb".$n."_searchs WHERE searchhash = '".getQueryHash($savepostids, 0, 'lastpost[/swf2][swf3]desc', $wbbuserdata['userid'], $REMOTE_ADDR)."'");
    if ($result['searchid']) {
    header("Location: search.php?searchid=".$result['searchid'].$SID_ARG_2ND_UN);
    exit();
    }
    $db->query("INSERT INTO bb".$n."_searchs (searchhash,postids,showposts,sortby,sortorder,searchtime,userid,ipaddress)
    VALUES ('".getQueryHash($savepostids, 0, 'lastpost[/swf2][swf3]desc', $wbbuserdata['userid'], $REMOTE_ADDR)."','$savepostids','0','lastpost','desc','".time()."','$wbbuserdata[userid]','$REMOTE_ADDR')");
    $searchid = $db->insert_id();

    header("Location: search.php?searchid=$searchid".$SID_ARG_2ND_UN);
    exit();
    }


    ALTINA EKLE:
    /** Search Erweiterung onIndex Baslangic **/
    /* new threads 48h */
    if ($_GET['action'] == '48h') {
    $boardids = '';
    list($boardcount) = $db->query_first("SELECT COUNT(*) FROM bb".$n."_boards");

    $result = $db->query("SELECT boardid FROM bb".$n."_boards WHERE password='' AND boardid IN (0".getSearchableBoards().")");
    if ($db->num_rows($result) < $boardcount) {
    while ($row = $db->fetch_array($result)) {
    if ($boardids != '') $boardids .= ','.$row['boardid'];
    else $boardids = $row['boardid'];
    }
    if (!$boardids) redirect($lang->get("LANG_GLOBAL_ERROR_SEARCHNORESULT"), "search.php" . $SID_ARG_1ST);
    }

    $savepostids = '';
    $datecute = time() - 172800;
    $result = $db->unbuffered_query("SELECT p.postid FROM bb".$n."_posts p, bb".$n."_threads t WHERE p.threadid=t.threadid AND p.visible=1 AND p.posttime>'$datecute'
    ".(($boardids) ? ("AND t.boardid IN ($boardids)") : ("")));
    while ($row = $db->fetch_array($result)) $savepostids .= ','.$row['postid'];

    if (!$savepostids) redirect($lang->get("LANG_GLOBAL_ERROR_SEARCHNORESULT"), "search.php" . $SID_ARG_1ST);
    $result = $db->query_first("SELECT searchid FROM bb".$n."_searchs WHERE searchhash = '".getQueryHash($savepostids, 0, 'lastpost[/swf2][swf3]desc', $wbbuserdata['userid'], $REMOTE_ADDR)."'");
    if ($result['searchid']) {
    header("Location: search.php?searchid=".$result['searchid'].$SID_ARG_2ND_UN);
    exit();
    }
    $db->query("INSERT INTO bb".$n."_searchs (searchhash,postids,showposts,sortby,sortorder,searchtime,userid,ipaddress)
    VALUES ('".getQueryHash($savepostids, 0, 'lastpost[/swf2][swf3]desc', $wbbuserdata['userid'], $REMOTE_ADDR)."','$savepostids','0','lastpost','desc','".time()."','$wbbuserdata[userid]','$REMOTE_ADDR')");
    $searchid = $db->insert_id();

    header("Location: search.php?searchid=$searchid".$SID_ARG_2ND_UN);
    exit();
    }

    /* new threads 7Days */
    if ($_GET['action'] == '7tage') {
    $boardids = '';
    list($boardcount) = $db->query_first("SELECT COUNT(*) FROM bb".$n."_boards");

    $result = $db->query("SELECT boardid FROM bb".$n."_boards WHERE password='' AND boardid IN (0".getSearchableBoards().")");
    if ($db->num_rows($result) < $boardcount) {
    while ($row = $db->fetch_array($result)) {
    if ($boardids != '') $boardids .= ','.$row['boardid'];
    else $boardids = $row['boardid'];
    }
    if (!$boardids) redirect($lang->get("LANG_GLOBAL_ERROR_SEARCHNORESULT"), "search.php" . $SID_ARG_1ST);
    }

    $savepostids = '';
    $datecute = time() - 604800;
    $result = $db->unbuffered_query("SELECT p.postid FROM bb".$n."_posts p, bb".$n."_threads t WHERE p.threadid=t.threadid AND p.visible=1 AND p.posttime>'$datecute'
    ".(($boardids) ? ("AND t.boardid IN ($boardids)") : ("")));
    while ($row = $db->fetch_array($result)) $savepostids .= ','.$row['postid'];

    if (!$savepostids) redirect($lang->get("LANG_GLOBAL_ERROR_SEARCHNORESULT"), "search.php" . $SID_ARG_1ST);
    $result = $db->query_first("SELECT searchid FROM bb".$n."_searchs WHERE searchhash = '".getQueryHash($savepostids, 0, 'lastpost[/swf2][swf3]desc', $wbbuserdata['userid'], $REMOTE_ADDR)."'");
    if ($result['searchid']) {
    header("Location: search.php?searchid=".$result['searchid'].$SID_ARG_2ND_UN);
    exit();
    }
    $db->query("INSERT INTO bb".$n."_searchs (searchhash,postids,showposts,sortby,sortorder,searchtime,userid,ipaddress)
    VALUES ('".getQueryHash($savepostids, 0, 'lastpost[/swf2][swf3]desc', $wbbuserdata['userid'], $REMOTE_ADDR)."','$savepostids','0','lastpost','desc','".time()."','$wbbuserdata[userid]','$REMOTE_ADDR')");
    $searchid = $db->insert_id();

    header("Location: search.php?searchid=$searchid".$SID_ARG_2ND_UN);
    exit();
    }
    /** Search Erweiterung onIndex Son**\



    ACP -> Templates degistir -> index.tpl acin

    ARA:
    <a href="search.php?action=24h{$SID_ARG_2ND}">{$lang->items['LANG_START_CURRENT_THREADS']}</a>

    ARKASINA EKLE:
    | <a href="search.php?action=48h{$SID_ARG_2ND}">{$lang->items['LANG_START_CURRENT_48H']}</a> | <a href="search.php?action=7tage{$SID_ARG_2ND}">{$lang->items['LANG_START_CURRENT_7DAYS']}</a>



    son olarakta 2 Dil Kategorisi olustuyoruz...

    ACP -> Dil Kategorisi Olu_tur

    Kategori::START
    Dil Degiskeni: LANG_START_CURRENT_48H
    Degisken Degeri: Son 48 Saat içindeki Aktif Konulari Göster

    Kategori: START
    Dil Degiskeni: LANG_START_CURRENT_7DAYS
    Degisken Degeri: Son 7 Gün içindeki Aktif Konulari Göster
#18.01.2007 23:08 0 0 0