PHP
  Home arrow PHP arrow Page 4 - Chatter
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Chatter
By: Roger Stringer
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 28
    2004-11-08

    Table of Contents:
  • Chatter
  • Configuration
  • View Chatter
  • Manage the Chatter
  • Secure it

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Chatter - Manage the Chatter


    (Page 4 of 5 )

    Now for a simple script to manage your chatterblock entries. This script will display all entries and give you the option of deleting any that you don't think are appropriate.

    <? include("accesscontrol.php"); ?>
    <table width=100% border=1>
    <tr>
    <td><b>Name</b></td>
    <td><b>Message</b></td>
    <td><B>Date Entered</b></td>
    <td><b>IP Address</b></td>
    <td>&nbsp;</td>
    </tr>
    <?php
    include('chatter.php');
    if($del){
    mysql_query("DELETE FROM chatterblock WHERE id='$del'");
    }
    if($banip){
    mysql_query("INSERT INTO blocked_ips SET ip='$banip'");
    }
    if($abanip){
    mysql_query("DELETE FROM blocked_ips WHERE ip='$abanip'");
    }
    if($bann){
    mysql_query("INSERT INTO blocked_nicks SET name='$bann'");
    }
    if($abann){
    mysql_query("DELETE FROM blocked_nicks WHERE name='$abann'");
    }
    $q = "select * from chatterblock order by id desc ";
    $result = mysql_query($q);
    while ($row = mysql_fetch_array($result)){
    $id = $row["id"];
    $name=$row["name"];
    $url = $row["url"];
    $msg = $row["msg"];
    $entered = $row["entered"];
    $ip = $row["ip"];
    echo "<tr>";
    echo "<td><b><a href=\"$url\" target=\"new\">$name</a></b></td>";
    echo "<td> $msg</td>";
    echo "<td>$entered</td>";
    echo "<td>$ip</td>";
    echo "<td><a href='cbadmin.php?del=$id'>delete</a> |";
    $blockedip = "select * from blocked_ips WHERE ip='".$ip."'";
    $ipcheck = mysql_query($blockedip);
    if( mysql_num_rows($ipcheck) > 0){
    echo "<a href='cbadmin.php?abanip=$ip'>unban ip</a> |";
    }else{
    echo "<a href='cbadmin.php?banip=$ip'>ban ip</a> |";
    }
    $bname = "select * from blocked_nicks WHERE name='".$name."'";
    $ncheck = mysql_query($bname);
    if( mysql_num_rows($ncheck) > 0){
    echo "<a href='cbadmin.php?abann=$name'>unban name</a></td>";
    }else{
    echo "<a href='cbadmin.php?bann=$name'>ban name</a></td>";
    }
    echo "</tr>";
    }
    ?>

    Save this file as cbadmin.php

    More PHP Articles
    More By Roger Stringer


       · Once again, after criticising the "Building a Quick and Easy Tag Board" article, I...
       · I was to trying the scripts but when others user posting into it ..iframe shout box...
     

       

    PHP ARTICLES

    - Authentication Scripts for a User Management...
    - Utilizing the Use Keyword for Namespaces in ...
    - Building a User Management Application
    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT