Archive for December, 2003

12/31/2003 ↓

Now restore and backup in the same script! 8comments

Author: Mark Ghosh Category: WordPress Hack

Thanks for visiting! We would like to serve you better. Please subscribe to our RSS feed for daily updates. This blog posts regular Wordpress news, updates of themes, plugins, ideas, hacks, quick fixes and everything about blogging, especially about Wordpress. You can also receive updates from this blog via email if you want that method of notification.

I have made some changes to the WordPress Backup procedure and added the Restore script to it. Now you have the ability to backup your MySql database and download it locally, backup your WordPress folder and download it locally, and restore your MySql database, all from the comfort of a web interface (which can be integerated into the WP admin interface). There is added password protection thrown in as well.
I had the nasty fortune of using my own backup and restore script this morning which forced me to code some bugfixes and finally emerged into a completely different way of backing up and restoring.

Please download the new version from the same link.

This has not been tested on a Windows web server (and I am not sure if the applications that I use are present in a Windows/MySql installation, but I need some feedback)

Please let me know what you think.
Peace

#EDIT#
Some updates have been added to the original backup and restore hack for WordPress by Dean from http://www.dean-logan.com
These include:
Backup/restore link in the admin-footer
Code to make it so only a certain user level could see the link.
The layout is the same as the other admin pages. Simply added the admin-header.php include and the admin-footer.php include, put div’s with wrap around the outputs and changed some of the tags.

Download the new backup restore files here.

Tags:

12/29/2003 ↓

Remove extra line breaks in WordPress 3comments

Author: Mark Ghosh Category: General

This is for me to remember, but can be useful to others as well. It took me almost a half hour to hunt down and I dont want to have to hunt it down again!
Find this line in your b2functions.php (inside your b2-include folder):
function wpautop($pee, $br=1) {

Replace it with:
function wpautop($pee, $br=0) {

And no more extra line breaks!

Tags:

Custom error pages for WordPress 3comments

Author: Mark Ghosh Category: WordPress Hack

Here is a question I came across at the WordPress forums:

Let’s say there’s an errant link on my site (ex: /index.php?cat=99, where there’s no such category) Currently, it just returns the main template with the content area blank. Is there a way to have it display a custom message? Not a custom 404 message…that I can do for my site. I’m talking about when there’s an invalid string in WP. Per my example, if there’s a link to /index.php?cat=99, index.php is a valid page (my WP template), so there is no 404 error. However, there’s no category 99 in my WP installation, so it returns an empty template (well, the template has everything it should, but the content area is blank.) Go ahead, try it on you own site: enter a non-existant cat and see what happens. Now, try it again here on the WP site. Try this: http://wordpress.org/index.php?cat=99. See, it doesn’t return a blank template, but a “stock” message….

Here was my answer, I am blogging this because someone else might find it useful.

Here is something you could try.
In your blog.header.php (in the root of your WordPress folder) find the line below:
$posts = $wpdb->get_results($request);

Add this just below that line:
if ($posts == ” && $s == ”) {
$cat = ”;
include($abspath . ‘blog.header.php’);
}

This way, every errant request coming to your blog will be greeted with the default blog template with all posts from all categories.You could modify this to get other output. (Single category, search page, default page, etc…)

PS: Those are two single quotes, not a double quote.

Tags:

12/27/2003 ↓

Autoclosing MT comments on older entries 0comments

Author: Mark Ghosh Category: Cool Scripts

Jeremy has published perl code to autoclose comments for posts in Moveable Type that have grown old to prevent SPAM in those comments. Here is the link to the hack. Thank him of you use his code! There is another trackback entry in that blog which talks about

a small little MT application that will close the entry to comments (and pings if you so desire) for any entries older than a given number of days

Here is a link to that application.

Tags:

12/26/2003 ↓

WordPress One Click Backup 3comments

Author: Mark Ghosh Category: WordPress Hack

A lot of people have been looking for an easy way to make daily backups of their WP Mysql database. Rather than re-inventing the wheel, I modified an existing MySql Backup script to work from inside the admin page in WordPress using the WordPress variables. Click on the link below to download the zip file with the installation instructions. It is very simple to install and lets you download the backup files to your local computer as well. I hope someone finds this useful. Please post comments, questions and suggestions.

Peace.

Download the Backup Zip File

Tags:

SprintPCS Vision moblog hack 1comment

Author: Mark Ghosh Category: WordPress Hack

I now have a modification of my moblog script which lets a SprintPCS Vision customer moblog directly from their phone to WordPress 0.72 using email blogging. If anyone is interested in this, please email me or leave a message on here. I have a couple of moblog posts setup on Mindful Musings.
Peace

Tags:

12/24/2003 ↓

Holiday Wishes 1comment

Author: Mark Ghosh Category: General

Merry Christmas!
Merry Christmas Everyone! Happy Holidays!
Do Good, Spread Warmth and Be Nice to Family!
Feel the Spirit and the Warmth Within You!
Spread the Love!
Be Merry and Have A Good Night!

Tags:

Another Wonderful Templates Resource 0comments

This has to go under Blog Templates because this site hosts templates for a multitude of different blog applications. Please visit NotThatUgly and look through some of the templates they have on display there. Very astute design work combined with a flare of evolutionary coding. I love that site!

Some of the blog applications supported by the templates include Movable Type and b2 as well as diaryland, diary-x and blogger.

If you do download the templates, please remember to read terms of use and leave a comment to say thanks to the author!

Tags:

12/23/2003 ↓

Top 10 Web Design Mistakes for 2003 2comments

Author: Mark Ghosh Category: Web Design

Jakob Nielsen lists the Top 10 Web Design Mistakes of 2003 a MUST READ in my opinion for good web design.

Tags:

12/22/2003 ↓

Interesting BlogRoll like weblog add-on 2comments

Author: Mark Ghosh Category: Weblog Add-Ons

I saw that I was getting liked from Blinkar.com and I wanted to see who they were. The site is in potugese but the Google translation brings this up. Here is a short gist of their services, very interesting.

The BLINKAR is a system of addition of favourite its links to its blogue. It reads the FAQ .

Sounds interesting enough. It might just be another blogroll like link whoring system, but they promote me and I promote them. Take a look…

Tags:

12/21/2003 ↓

Moblog and videoblog hack for WordPress 0.72 4comments

Author: Mark Ghosh Category: WordPress Hack

I have the beginnings of a moblog hack for WordPress 0.72 for which I need some beta testers. My mobile phone is not operational yet and I have no real way of testing this. Just a word of warning: THIS IS BUGGY CODE, USE AT YOUR OWN RISK. I AM NOT RESPONSIBLE FOR ANY FAILURE. BACKUP EVERYTHING.
So here we go…
Download this file http://weblogtoolscollection.com/b2-img/b2mailtest.phps and rename it to b2mailtest.php. Put it in your wordpress folder and follow the instructions for setting up email blogging for WordPress. Remember to setup a cron job with the new b2mailtest.php and NOT the old b2mail.php file. Create a folder called tmp inside your WordPress folder and make it writeable by your webserver. This hack emulates the settings from the main b2mail.php. Once you have email blogging setup, send an email to your blog with the same information as you would when you blog through email(username, password, subject prefix etc), but now you can attach a picture (through your phone, can be used just through email as well, tested with jpeg and gif extensions) to your email which gets added to your entry. I am working on setting up video blogging as well, but I need to get my phone working first. This has a lot of possibilities, including resizing the image, adding the support for categories etc.

Some suggestions to debug problems:
Make sure you use plan text encoding for your email, works the best.
If you are getting “error opening mailbox”, find the following line:
$mailserver = “{”.$mailserver_url.”:”.$mailserver_port.”/pop3/notls}”;
and remove the /notls

Email me or post a note to let me know if there are any problems/suggestions.

Tags:

It is illegal to collect personal information from people under the age of 13 0comments

Author: Mark Ghosh Category: Web Ethics

Because of the Children’s Online Privacy Protection Act, also known as C.O.P.P.A. (or COPPA), it’s illegal to collect personal information from people under the age of 13. This means it’s very important to verify the age of anyone who enters such information into your Web site, but the problem with verifying ages is that the verification properties change every day because we get older every day. Here’s a little function that’s written in PHP and will dynamically check user age input in real time and let you know if you are within the law to collect information about this user. I’ve used this particular piece of code for a few years and it’s a great toolbox piece when you’re collecting user information on your website because it keeps you legal!

< ?php

/*

Name: coppa_check($day, $month, $year)

Author: Jason DeFillippo

Description: This is a down and dirty COPPA age verifier. This function takes 3 arguments. A birthday, a birthmonth and a birthyear and returns the user’s actual age if it’s good and false if it’s non-compliant. Throw this into a general include file and slap it in your library and you won’t have to worry if you’re letting any kids in. This is an important issue since it’s illegal to gather user data if the person is under 13 years old.

*/

function coppa_check($day, $month, $year){

// I declare these variables in the name of France!
//
//we set minimum age which should be 13 as long as
//the law is in effect. We set the max age to be
//the ever fluctuating lifespan of the human animal.
$min_age = 13;
$max_age = 130;

// check to see if we have a 2 digit year. If so
// convert it to standard 4 char format usign 19
// as a base since there are no 13 year olds born
// in 20XX yet.
if (strlen($year) == 2){$year = “19″ . $year;}

//First do a check to see if we have a good date
$isgood = checkdate($month, $day, $year);

//dump it if the date is bad…
if ($isgood != 1){
return FALSE;
}

// do some date to timestamp conversions so we’re all
// talking the same format.
$birthdate = mktime(0,0,0,$month,$day,$year);
$today = time();

// now do them back so we can get some different info.
$old_date = getdate($birthdate);
$current_date = getdate($today);

// error check to make sure the date’s not in the future
// note: add Tardis check for Timelords and the like
if ($current_date[year] < $year){return FALSE;}

// Adjust for day of the month and get final age.
if ($current_date[yday] >= $old_date[yday]){
$age = $current_date[year] - $year;
}else{
$age = ($current_date[year] - $year) -1;
}

// Age range check from vars set at func open
if ($age < $min_age || $age > $max_age){
return FALSE;
}

//fallthru and spit back the actual age just for fun.
return $age;

}//end coppa_check

?>

Example code:

< ?php

//This is a simple validity check to make sure the
//age entered is over $min_age and under $max_age.
//If it is within tolerance $age is returned.
if (! $age = coppa_check(8, 5, 1971)){
echo "Non-compliant age";
}

?>

Excerpt from: LockerGnome Web Development

Tags:

12/20/2003 ↓

Looking for Programming Projects 6comments

Author: Mark Ghosh Category: General

I am looking for a couple of (paid) Programming Projects for the next month or so. Some of the stuff I am capable of doing includes webpage re-design, complete CSS overhaul, XHTML and CSS compliancy, custom programming in languages including perl, PHP, ASP, VB.NET, C#, VC++, Cold Fusion, Linux/UN*X shell scripts and javascript. If you need a custom design for your webpage, graphics template generation, logo design or need a Linux/UN*X/Mac OS X server/workstation installed or setup, please send me an email or leave a comment on this blog. This month should be realtively free for me and I dont charge too much. :-D

Tags:

12/19/2003 ↓

Threaded Comments Hack - WordPress 8comments

Author: Mark Ghosh Category: WordPress Hack

This is the original hack from Dodo for b2, converted (the insides are completely different) to work well with WordPress 0.72. You can see it at work on my blog:
http://dinki.mine.nu/weblog/index.php?p=429&more=1&c=1
Test it out, make lots of comments, see what you think. I have made the instructions as simple and lucid as possible. If you have any questions, post on here or email me. You might have to tweak your CSS to suit yourself. I have tested the installation in both IE and Moz and it looks all right. :-P Let me know what you think!
Here is the link to the hack
Peace

Tags:

12/18/2003 ↓

Sticky posts hack for WordPress 18comments

Author: Mark Ghosh Category: WordPress Hack

I finally had the chance to finish the sticky posts hack for WordPress. Quite simple actually. It lets a blogger indefinitely leave a post on top of their WordPress blog. Here is the link to detailed instructions to install the hack. Let me know if there are any bugs!

Tags:

12/15/2003 ↓

WordPress Hackery (stolen name from Chait) 4comments

Author: Mark Ghosh Category: WordPress Hack

Here is the list of WordPress hacks that I will be working on. Please comment or post an entry if you have more you would like to add or if you would like to work on a particular hack.
1) Blog This - Done - look at this post on TechGnome
2) Link This - Done - Look at this link in WP Forums
3) b2stats - Done - Look at this post WP forums
4) LJUpdate - Not done yet, will look into it :-)
5) Threaded Comments - Done - Look at this link
6) Clickable smilies on the user posting page - Done - Look at this post on the WP forums. I would be interested to know if this works on Opera.
7) Send/print this page hacks - “Send this page” has been worked on . Printing is taken care of through the print CSS. So I consider this done. Please correct me or add more stuff to this.
8) Auto convert friends names to links - Done - Look at this file for the hack.
9) Restructure wordpress so that the index.php installs in the root and the wordpress files run in a subfolder - I think this would be an intrusive hack and would take away from the work of the core developers. I understand that a lot of people want this implemented, but I am going to pass on this one. If anyone else wants to jump in, please do so.
10) Sticky post - Done - look at this link
11) Multiple Blogs - Need more on this
12) Style switcher - done in many ways, with good explanations - Look at this post on WP Forums

Tags:

0comments

Author: swtn4everly Category: General

uh hi everyone! ummm this is my first time i joined in wordpress…

Tags:

Many more templates that work on a variety of Blog Applications 2comments

Matt found a wonderful resource on the internet which generates a number of pre-defined templates on the fly. Supported Blogging Tools and CMSs include:

Diaryland
Diary-X
Blogger/Blog-Spot
MT
B2
WordPress

There are about 12 templates and a bunch of built in features which are encoded automatically! If you came here looking for templates for your blog, this is a place to definitely check out!

Tags:

12/11/2003 ↓

Free 500MB web account for 3 years 15comments

Author: Mark Ghosh Category: General

This is definitely worth a long post. I read about this on eWeek and really wanted to see what they were about. 1and1.com has a Free Web Hosting package which lasts for a full three years. i have not figured out what their deal is, as of yet, but they seem to pitch a good story. Three free years of hosting, no obligation, no ads, nothing. I signed up with a phony address, phony name and my real cell phone number. They use this number for authentication rather than just using the email address (they send you a “PIN” which you put into a secure page to get your service). I think they might be playing some game with the phone numbers. But if you are willing to put up with this nuisance or are willing to risk giving someone your phone number, give it a try. I have not gotten done with the authentication process yet, but I cannot wait. They also seem to have a long list of disclaimers (which I did not read, I know…that was my fault). Anyways, if all of this is true and they are not a bogus company, you could possibly end up with the following incredible features!

: Webspace - 500 MB.
: Your URL - Domain,Subdomain.
: Upload Method - FTP,Telnet.
: Forced Ads - No.
: Your Ads - Allowed.
: Scripting - CGI,Perl,PHP,SSI,FrontPage Extensions.
: Email - POP3.
: SSL - Yes.
: Database - MySQL.
: Statistics - Yes.
: Custom error pages - Yes.
: Advanced Password Protection
: 5 FTP accounts
: Cron Jobs
: SSH Secure Shell Access

Last date is January 14th and there is no obligation to get anything after your three years is up. This is really too good to be true. I wonder if I am setting myself up for some hurt. Nothing in this world is THIS free! Hmmmm….

Tags:

12/10/2003 ↓

Blog This bookmarklet for Mozilla 1comment

Author: Mark Ghosh Category: WordPress Hack

TechGnome has

built a “Blog This” bookmarklet that, when clicked, will popup a blog entry form, with the Title, and TrackBack URL prefilled with the web page’s title & URL. The body of the post will come pre-filled with a hyperlink to the page as well.

Here is the link to the hack. Good job TechGnome!!

Tags:

Friends

Translate

Translate to German Translate to Spanish Translate to French Translate to Italian Translate to Portuguese Translate to Japanese Translate to Korean Translate to Russian Translate to Chinese

Latest Videos

S2