(#1)
c0rrupt Offline
Administrator
 
Posts: 201
Join Date: Mar 2010
Location: Canada
White/Blacklist Search with Date/Reason - 11-07-2010, 10:29 AM

Warning page style included, you need to change the html to be in line with your style.



You will need to add extra tables to the database if you do not currently have them.

Blacklist SQL Queries:
Code:
ALTER TABLE wcddl_blacklist ADD COLUMN reason VARCHAR(255)
ALTER TABLE wcddl_blacklist ADD COLUMN dat VARCHAR(15) NOT NULL
ALTER TABLE wcddl_blacklist ADD COLUMN email varchar(50)
Whitelist Queries:
Code:
ALTER TABLE wcddl_whitelist ADD COLUMN reason VARCHAR(255)
ALTER TABLE wcddl_whitelist ADD COLUMN dat VARCHAR(15) NOT NULL
ALTER TABLE wcddl_whitelist ADD COLUMN email varchar(50)
Create a new file named wcddl_searchbw.php and paste the following in it and upload it to your modules folder:
PHP Code:
    <?php
    
/*BEGIN_INFO
    Show if an Site are white/black Listed!<br>
    by jomasaco.
    END_INFO*/
    
if(!defined("WCDDL_GUTS"))
       exit;
       
$modEnabled true//Change to false if don't use
    
if($modEnabled) {
    
$outbw '<form action="'.$_SERVER['PHP_SELF'].'" method="post">
    <fieldset>
    <div class="legend">Check White/Black List:</div>
    <div class="form_row">
            <div class="form_value"><input type="text" size="32" class="text" value="http://" name="url" /></div>
            <input class="button" type="submit" name="submit" value="Submit" />
            </div></fieldset></form>'
;
            if(!empty(
$_POST)) {
            
$surl $_POST['url'];
            
$surl parse_url(trim($surl)); //remove spaces split the url
          
$surl $surl['host']; //get host
          
$surl str_replace("www.","",$surl); //remove the www
            
if (!preg_match('#^[A-Z0-9.-]+\.[A-Z]{2,4}$#i'$surl)) //validate url
            
{
     
$outbw .= '<br /><div class="error"> Please enter a valid Site Url. <b>'.$surl.'</div></b>';
     }
     else { 
//blacklist
            
$sql mysql_query("select * from wcddl_blacklist WHERE url = '".mysql_real_escape_string($surl)."'");
        if(
mysql_num_rows($sql) > 0) {
        
$outbw .= '<div class="error">'.$surl.' In <b>Blacklist</b><br />';
            while (
$row mysql_fetch_array($sql)){
                
$outbw .= '<br/> Site Url: '.$row['url'];
              
$outbw .= '<br/> Date: '.date("d-m-y",$row['dat']);
              
$outbw .= '<br/> Reason: '.$row['reason'].'</div>';
    }
    }
    else {     
//whitelist
      
$sql mysql_query("select * from wcddl_whitelist WHERE url = '".mysql_real_escape_string($surl)."'");
      if(
mysql_num_rows($sql) > 0) {
        
$outbw .= '<div class="success">'.$surl.' In <b>Whitelist</b>.<br />';
    while (
$row mysql_fetch_array($sql)){
        
$outbw .= '<br /> Date: '.date("d-m-y",$row['dat']);
        
$outbw .= '<br/> Site Url: '.$row['url'].'</div>';
        }
    }
    else{
    
$outbw .= '<br /><div class="notice">'.$surl.' NOT In <b>Whitelist</b> or <b>Blacklist</b>.</div><br />';
    }
    }
    }
    }
    
//show the lists
    //blacklist
    
$outbw .= '<div class="clearer"> </div>';
        
$outbw .= '<div class="post">
                            <div class="post_title text_center"><div class="error"><h1>BLACKLISTED</h1></div></div>
                            <div class="post_body">'
;
          
$color1 " class=\"even\"";
          
$color2 '';
          
$row_count 0;
                        
$getit = @mysql_query("SELECT * FROM wcddl_blacklist ORDER BY dat DESC limit 20");
    
$outbw .= '<br /><br /><table class="data_table"><tr><th>URL</th><th>DATE</th><th>REASON</th></tr>';                   
        while (
$row mysql_fetch_array($getit)) {
            
$row_color = ($row_count 2) ? $color1 $color2;
            
$data date("d-m-y",$row[dat]);
        
$outbw .='<tr'.$row_color.'>
        <td><strong>'
.$row['url'].'</strong></td><td>'.$data.'</td><td>'.$row['reason'].'</td>
        </tr>'
;
        
$row_count++;
        }
        
$outbw .= '</table>';
        
$outbw .= '</div></div>';
        
//whitelist
        
$outbw .= '<div class="post">
                            <div class="post_title text_center"><div class="success"><h1>WHITELISTED</h1></div></div>
                            <div class="post_body">'
;
        
$outbw .= '<div class="clearer"> </div>';
                        
$getit = @mysql_query("SELECT * FROM wcddl_whitelist ORDER BY dat DESC limit 20");
         
$outbw .= '<br /><br /><table class="data_table"><tr><th>URL</th><th>DATE</th></tr>';               
        while (
$row mysql_fetch_array($getit)) {
            
$row_color = ($row_count 2) ? $color1 $color2;
            
$data date("d-m-y",$row[dat]);
        
$outbw .= '<tr'.$row_color.'>
        <td><strong>'
.$row['url'].'</strong></td><td>'.$data.'</td>
        </tr>'
;
        
$row_count++;
        }
        
$outbw .= '</table>';
        
$outbw .= '</div></div>';
            
$core->setTemplateVar("searchbw",$outbw);
    }
    
?>
Add the following where you would like it to show:
PHP Code:
<?=$core->templateVar("searchbw")?>
code by jomasaco

**EDIT**----------------------------------------

I have updated the thread and it should work.
(#2)
mannNmeet Offline
Probationary Member
 
Posts: 5
Join Date: Mar 2011
not working - 03-13-2011, 03:25 PM

I want to use this mod.

But its not working on my site ?
I think i didnt recognize right mod/file name. Please mention in mad, which file name we have to use for save it.

Please check the matter ?

http://katzddl.in/sitestatus.php
(#3)
c0rrupt Offline
Administrator
 
Posts: 201
Join Date: Mar 2010
Location: Canada
03-21-2011, 04:38 AM

You will need to name the file wcddl_searchbw.php and save it in your modules folder.
(#4)
MrChinn Offline
Probationary Member
 
Posts: 7
Join Date: Mar 2011
03-21-2011, 06:38 AM

WCDDL encountered an error during execution:
mysql_fetch_array(): supplied argument is not a valid MySQL result resource
Line 75 in /home/****/domains/****/public_html/modules/wcddl_searchbw.php

mysql_fetch_array(): supplied argument is not a valid MySQL result resource
Line 94 in /home/****/domains/****/public_html/modules/wcddl_searchbw.php

Is what I get
(#5)
linkstar Offline
Probationary Member
 
Posts: 17
Join Date: Aug 2011
09-17-2011, 05:50 PM

Quote:
Originally Posted by c0rrupt
You will need to name the file wcddl_searchbw.php and save it in your modules folder.
mate what should I put code in index.php or in page I should create?
I already create wcddl_searchbw.php in /public_html/modules
please show me the guide, thank you
(#6)
c0rrupt Offline
Administrator
 
Posts: 201
Join Date: Mar 2010
Location: Canada
09-17-2011, 07:28 PM

Best thing to do is create a new page and paste the following where you want it displayed

Code:
<?=$core->templateVar("searchbw")?>
(#7)
MrChinn Offline
Probationary Member
 
Posts: 7
Join Date: Mar 2011
12-30-2011, 01:55 PM

thanks c0rrupt, but all it does for me is redirect to the index page :/
(#8)
c0rrupt Offline
Administrator
 
Posts: 201
Join Date: Mar 2010
Location: Canada
12-30-2011, 03:34 PM

Its been a while since I used this mod. I will set it up and take a look and keep you updated.
(#9)
MrChinn Offline
Probationary Member
 
Posts: 7
Join Date: Mar 2011
12-30-2011, 03:40 PM

thank you very much
(#10)
c0rrupt Offline
Administrator
 
Posts: 201
Join Date: Mar 2010
Location: Canada
12-30-2011, 03:41 PM

Just tested and working with no problems



I have updated the first post with better instructions.

Bookmarks

Tags
black, date or reason, list, search, white, white or blacklist

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




Powered by vBulletin


Content Relevant URLs by vBSEO