Tag Archives: PHP

Hash 1.1: IRC/HipChat-like chat system built on PHP, jQuery, HTML, & CSS

First off, this is my first post about Hash, a “secret” chat project I’ve been working on to replace my personal IRC woes (mainly IRC logging). Don’t get me wrong, I love IRC, but I also love HipChat, but I hate that HipChat list closed….you get the point. Plus I needed something dead simple, no logins, no signups, just chat…

Hash is a simple IRC-like, HipChat-like (mainly in that it has persistent chat), (PHP, jQuery, HTML/CSS)-based chat system. So anyone can use a Hash install to use.

Screenshot showing Hash collecting nick and hash names

Here’s how it works. All you do is create a room (which I call a hash, because you hash things out), and pick a nick. No login. No password, in fact two people (at the moment) could use a single nick or login as many. Then, chat. Notifications let you know when something new is said. Chat history is persistent.

It’s developer friendly, which only really means it’s easy to create rooms, share them, and assign people nicks because the chat uses ?hash=&nick= to start the person loading the hash off with a hash and a nick. Easy for inviting clients into chat rooms by just giving them a link.

Hash 1.1 will continue to make small improvements to make Hash more useful. I have been using it, and it appears to be stable enough to use, again for private purposes. Not sure about public use yet, but I need it for a few new things, and so 1.1 will get those features.

You can try out Hash on my site where you can make a hash and start chatting away with someone else. I’d love to see people use it and give feedback.

Want to help? Check out Hash on Github. There are some issues that need some help.

Submit WordPress theme without sidebar / register_sidebar hack

Below is what I used to get past Theme Check for WordPress since it required register_sidebar, but I did not have any sidebars.

         * Hack to get past theme check, which requires register_sidebar, 
         * though I am not going to have sidebar option as a part of my theme.
         * I did not want to actually call this because I did not want to have the widgets
         * option show, when I don't even have a sidebar!

XAMPP Sendmail using Gmail account

This is how I did it:

Okay, today, the best answer did not work for me. But, this did:

in sendmail.ini:


in php.ini:

[mail function]
sendmail_path = ""C:xamppsendmailsendmail.exe" -t"

Based on port @: http://support.google.com/mail/bin/answer.py?hl=en&answer=13287


WordPress Change Default Display Name Publicy As for all existing users


//Sets the user's display name (always) to first name last name, when it's avail.
add_action ('admin_head','make_display_name_f_name_last_name');
function make_display_name_f_name_last_name(){

    $users = get_users(array('fields'=>'all'));

    foreach($users as $user){
        $user = get_userdata($user->ID);    

        $display_name = $user->first_name . " " . $user->last_name;

        if($display_name!=' ') wp_update_user( array ('ID' => $user->ID, 'display_name' => $display_name) );
            else wp_update_user( array ('ID' => $user->ID, 'display_name' => $user->display_login) );

        if($user->display_name == '')
            wp_update_user( array ('ID' => $user->ID, 'display_name' => $user->display_login) );


From: WordPress Change Default Display Name Publicy As for all existing users

How to filter / exclude posts by id in list of posts in WordPress Dashboard / Admin

Okay, so I’ve answered my own question. Here is some code on how I did it.

function exclude_list_per_function( $query ) {

    global $wpdb;

//gets all the post ID's, I know this is a bit of a hack
    $querystr = "
        SELECT $wpdb->posts.ID
        FROM $wpdb->posts
    "; $post_ids = $wpdb->get_results($querystr, OBJECT);

        //Go through each post and pass it to a function that returns true if the user_can, and false if the user_can't
        foreach($post_ids as $post_obj){
                //if they_can't, add them to the array to be excluded

        //Set those posts to be excluded from the list.
        if(is_array($posts_not_in)) $query->set( 'post__not_in', array_merge($query->get('post__not_in'), $posts_not_in) );

add_action( 'pre_get_posts', 'exclude_list_per_function');

From How to filter / exclude posts by id in list of posts in WordPress Dashboard / Admin