I needed a way to log the date and time the last time a user logged in I looked around for a plugin to do this for me, but found none, so I decided to try and write a function myself.
This one I struggled with and in the end it came out like something of a abomination of a function, but at least it gets the job done. It uses the WP_AUTHENTICATE hook to call the function where a simple login check is done, and if successful, the timestamp is writted to the wp_users table.
You can either insert a new field called user_lastlogin (or what you prefer) in wp_users like I did, or you can make a new table to store the login log.
The code follows below. Happy logging!
Continue reading →
Popularity: 6% [?]
It’s not rocket science, but it took me a while to figure out how to run a cron job on a PHP script with Godaddy shared hosting. Without further ado, here it is:
/web/cgi-bin/php "$HOME/html/yourpath/yourpath/yourscript.php"
Hope it helps someone.
Popularity: 4% [?]
About a year ago I started with the idea that I should build and host a blog community with dozens of bloggers writing every day, slowly building an blogging empire. I hardly knew what a blog is (yes it’s true) and I hardly knew any PHP. Needless to say my blogging empire never happened, and other blog projects, as my Steve Pavlina wannabe blog, were disbanded and is now not being updated at all.
My ambition one year ago was to make a welcome side income from web publishing/advertizing and during this year I’ve tried affiliate marketing, domain trading and web site publishing. I’ve learnt that success may come unexpectely, in our case from a site about pregnancy and maternity (Bli Mamma gravid), an idea that actually my wife came up with. From a quiet start this site now has about 2,000 page views per day and generates from $3 to $40 per day depending on current advertizing campaigns. At the moment we use a combo of AdSense and Tailsweep ads, something that has proven successful.
My other project, called Hyrprylen.se, which is basically a classified ad site for rentals of gadges and property, is yet to be launched. I coded this site from scratch, thus it is a bit rough. But it might have a potential, especially as we will port it to other languages as well. The platform can also be easily be used for realty, traditional classifieds and vacation home rentals. We’ll see about that one.
Continue reading →
Popularity: 3% [?]
Every now and then comes along a tool that is just so awsome you have to tell about it. Todat I stumbled over a Firefox add-on called GraphSense. This tool allows you to create graphs on-the-fly directly in your browser from Advanced AdSense reports.
This is of course every web publishers wet dream; another tool to visualize your AdSense earnings, and now easier than ever. Ever since AdSense notifier stopped working a couple of months ago I’ve been dying to find a new tool/toy and now I’ve found it.
Installing it takes about 30 seconds (seriously) and testing it another 30. It works perfecly and is very very handy.
Continue reading →
Popularity: 3% [?]
I’ve been looking for a long time for a solution to produce the oh so popular rounded corners on my DIV elements and finally I found what I was looking for over at A list apart where Dan Cederholm describes his take on the issue of rounded corners. The solution he presents are decievingly simple in it’s approach, and surprisingly flexible in its application.
The design uses two transparent gif masks (easily created in for example GIMP) and a short, organized CSS:
dl {
width: 240px;
margin: 0 0 20px 20px;
background: #999 url(box_bottom.gif) »
no-repeat bottom left;
} dt {
margin: 0;
padding: 10px;
background: #999 url(box_top.gif) »
no-repeat top left;
}
Continue reading →
Popularity: 3% [?]