PHP
  Home arrow PHP arrow Page 3 - 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 - View Chatter


    (Page 3 of 5 )

    The iframe in chatter.html will load this 'View Chatters' page. You can format this page to look how you want the chatterblock to be displayed. Let's take a look at the code.

    <body onload=window.setTimeout("location.href='view.php'",120000)>
    <?php
    include('chatter.php');
    $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"];
    echo "<b><a href=\"$url\" target=\"new\">$name</a></b>: $msg<hr>";
    }
    ?>

    Basically code selects all the entries in the chatterblock to be listed, in the order of oldest last, newest first (chronological order). I only put in some basic format to display the entries; you can insert CSS, tables or whatever you like inside this part. In the above code, a user's name is displayed in bold with a hyperlink to the url entered.

    Note: It'll display the hyperlink regardless of whether a url is entered or not. if you want it to be more intelligent, run a simple if check to see if $url has a value. If $url is empty, then don't display the hyperlink.

    The message is displayed at the side of the name. Each entry is separated by a horizontal rule.

    Save this file as view.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 2 hosted by Hostway
    Stay green...Green IT