ProjeXCode Forum: Filter Search (Logic Only)

Title Role Staff

Title Role Senior Member

Title Role Member

Title Role Junior Member

Title Role New Member

Title Badge Moderator

Title Color Moderator

Title Badge Staff

Title Color Staff

Title Badge Member

Title Color Member

Status Info

Status Verified

ADS Title User

Your Time :

Server Time :

  • Filter Search (Logic Only)
    January 13, 2022
    Share this Threads
    Close
    Versi 1 (Untuk Pemahaman) :

    <!DOCTYPE html>
    <html>
    <body>
    <script src='https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script>
    <style>
    #row{padding:5px 0}
    </style>
    
    <!-- List Label -->
    <div id='row'>
    <div>Genre</div>
      <input id='Action' type='checkbox' value="Action"/>
      <label for='Action'>Action</label>
        <input id='Adventurer' type='checkbox' value="Adventurer"/>
      <label for='Adventurer'>Adventurer</label>
    </div>
    <div id='row'>
    <div>Status</div>
      <input id='Ongoing' type='checkbox' value="Ongoing"/>
      <label for='Ongoing'>Ongoing</label>
        <input id='Completed' type='checkbox' value="Completed"/>
      <label for='Completed'>Completed</label>
    </div>
    <button>Search</button>
    
    <!-- Hasil -->
    <div id='res'></div>
    
    <script>
    var loc = 'https://zeistmanga-bt.blogspot.com'; // Alamat Situs bisa diubah dengan = window.location.protocol + '//' + window.location.hostname
    var num = '5'; // Jumlah Yang ditampilkan
    
    $('button').click(function(){
    var o = [];
    
    // List Label jika kondisi checked terpenuhi
    if(document.getElementById('Action').checked){
    o.push(document.getElementById('Action').value);
    }
    if(document.getElementById('Adventurer').checked){
    o.push(document.getElementById('Adventurer').value);
    }
    if(document.getElementById('Ongoing').checked){
    o.push(document.getElementById('Ongoing').value);
    }
    if(document.getElementById('Completed').checked){
    o.push(document.getElementById('Completed').value);
    }
    
    // Executor
    document.getElementById('res').innerHTML = loc + '/search/label/' + o.join('+') + '?&max-results=' + num; // ubah script inner menjadi window.open, contoh window.open(loc + '/search/label/' + o.join('+') + '?&max-results=' + num) agar saat di click lgsg menuju ke link yg diminta
    });
    </script>
    </body>
    </html>
    


    Versi 2 (Untuk Operasional) :

    <script src='https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script>
    <input class='genre' id='genre1' type='checkbox' value='Adventurer'/>
    <label for='genre1'>Adventurer</label>
    <input class='genre' id='genre2' type='checkbox' value='RPG'/>
    <label for='genre2'>RPG</label>
    <input class='genre' id='genre3' type='checkbox' value='FPS'/>
    <label for='genre3'>FPS</label>
    <input class='genre' id='genre4' type='checkbox' value='MMORPG'/>
    <label for='genre4'>MMORPG</label>
    <input class='genre' id='genre5' type='checkbox' value='Action'/>
    <label for='genre5'>Action</label>
    <input class='btn' type='submit'/>
    <div id='result'></div>
    <script>
    var num = 5;
    var newtab = true;
    $('.btn').click(function(){
    var validator = document.getElementsByClassName('genre');
    var o = [];
    for(var i=0;i<validator.length;i++){
       if(validator[i].checked){
        o.push(validator[i].value)
    	}
    }
    window.open(location.protocol+ '//' + location.hostname + '/search/label/' + o.join('+') + '?&max-results=' + num, newtab == true ? '_blank' : '_self');
    });
    </script>
    Last edited : February 12, 2022
    Fri Apr 22, 03:05:00 PM GMT+9
    om buat yg versi option, nih html nya


    <form>
    <option>genre1</option>
    </form&gt
    Sat Apr 23, 09:33:00 PM GMT+9
    itu tinggal kamu buat aja kan udah dikasih logicnya.

    soon bakal ada logic baru namanya "Shot Filter"
    Tue Jul 26, 03:27:00 AM GMT+9
    Min, Kira-kira di blogger itu memungkinkan nggak untuk adanya filter search bedasarkan terpopuler (views terbanyak) and newest (postingan terbaru)?, Soalnya ga pernah liat saya thema² blogger pakai fitur itu, Padahal fitur itu sangat disukai orang banyak, Terutama yang mau mencari Tontonan anime bedasarkan kepopuleran situs tersebut (Termasuk saya)
    Tue Jul 26, 02:55:00 PM GMT+9
    Ya said: Min, Kira-kira di blogger itu memungkinkan nggak untuk adanya filter search bedasarkan terpopuler (views terbanyak) and newest (postingan terbaru)?, Soalnya ga pernah liat saya thema² blogger pakai fitur itu, Padahal fitur itu sangat disukai orang banyak, Terutama yang mau mencari Tontonan anime bedasarkan kepopuleran situs tersebut (Termasuk saya)
    untuk view terbanyak (versi ringan) itu imposible tpi kalo di paksa bisa aja dengan cara mapping value view count (firebase) untuk newest sangat bisa,tinggal tambahkan params by-date=true jadi gini
    https://www.forum.projexcode.com/search?max-results=8&by-date=true

    apabila by-date di false itu di urutkan berdasarkan relevan

    Similar Threads