Search by Type/File Host
Author Message
c0rrupt
Administrator


Posts: 250
Joined: Mar 2010
Post: #1
Search by Type/File Host
0
0
Search by Type/File Host

This mod will allow your guests to search by Type and File Hosts(Need file host module by t3od0r)


Create a new file called wcddl_search.php and paste the following in it:
PHP Code: (Select All)
<?php
    
/*BEGIN_INFO
    This module the search form will be whit the types to search for.<br />
    by jomasaco.
    END_INFO*/
    
if(!defined("WCDDL_GUTS"))
       exit;
         
$modEnabled true//Change to false if don't use
           
$showtype true//Show the drop down box whit type category
           
$showhost false// show the drop down box for file host
        
if($modEnabled) {    
    
$searchtml '<form action="'.$core->siteurl.'index.php" method="post" id="searchform">
    <input type="text" name="q" id="s" value=""/ size="35"> 
    '
;
    if(
$showtype) {
    
$searchtml .= '<SELECT name="type" id="s">
    <OPTION selected value="">All Types</option>'
;
    foreach(
$core->allowed_types as $type)
    {
    
$searchtml.= '<OPTION class="'.strtolower($type).'" value="'.$type.'">'.ucfirst($type).'</option>';
    }
    
$searchtml.= '</select> ';
    }
    if(
$showhost) {
    function 
gethost($m) {
          global 
$mhosts,$titles;
         
$a=explode(',',$m);
            
$b=str_replace($mhosts,$titles,$a);
            
$count=count($a);
          for(
$i=0;$i<count($a);$i++)
                
$html $b[$i];    
    return 
$html;
        }
    
$searchtml.= '<SELECT name="shost" id="s">
    <OPTION selected value="">All Hosts</option>'
;
    foreach (
$mhosts as $title)
    {
    
$searchtml.= '<OPTION class="'.$title.'" value="'.$title.'">'.gethost($title).'</option>';
    }
    
$searchtml.= '</select> '; }
    
$searchtml.= '<input type="submit" id="sbutt" value="SEARCH" />';
    
$searchtml.= '</div></form>';
    
$core->setTemplateVar("search",$searchtml);
    }
    
?>

Upload the file to your modules folder.

Add the following code where you want it displayed:
PHP Code: (Select All)
<?=$core->templateVar("search")?>

Be sure to visit WCDDL.org Affiliates
07-26-2012 04:59 PM


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  White/Blacklist Search with Date/Reason c0rrupt 15 455 07-08-2012 01:49 PM
Last Post: c0rrupt
  Search As Mirror (on leftbar) c0rrupt 0 129 04-16-2010 12:40 PM
Last Post: c0rrupt
  Search As Mirror (index page) c0rrupt 0 138 04-16-2010 12:29 PM
Last Post: c0rrupt



User(s) browsing this thread: 1 Guest(s)

This forum uses Lukasz Tkacz MyBB addons.