Showing posts with label Website Development. Show all posts
Showing posts with label Website Development. Show all posts

Friday, 12 November 2010

QuirkyCars.Net - New features..

Implemented wp-ebay-ads, and integrated it with feedwordpress.
Feedwordpress adds custom field "ebay search" to all syndicated posts.
The template has been edited to call wp-ebay-ads, IF there is something in that custom field.
Et voila, targeted ebay ads on each individual page.
** this ONLY happens on individual pages, not front page **
Full description on Wordpress.org..

Thursday, 11 November 2010

New Banner Advertising - Technical

(see other posts for details of advertisers)

The new banner adverts presented a bit of a technical challenge:

The ads must ONLY appear on the FIRST page of the homepage..

Wordpress has a function called is_home(), which returns true on the homepage, but it also returns true on subsequent pages /page/2.. etc
The solution is to use if (is_home && !is_paged()), which means "on the homepage, but not paged"...

Now, that's fine in a template, but what if the ads are appearing in a text widget?
You can't use php code in a text widget..
The solution is a plugin called exec-php.. which works like a text widget, but allows php code.
The downside to this is that on pages the adverts don't appear, there is a blank box.

Example


Finally, have a close look at the advert for motors.co.uk.. the text "cars for sale" is the ONLY clickable part of the advert. This is for SEO purposes. It ensures that the keywords "cars for sale" are associated with the address "www.motors.co.uk". Neat. :)


We are considering filling the blank with an advert for advertising on the site.. :)

Thursday, 4 November 2010

WORDPRESS: Updating FEEDWORDPRESS by a real CRON Job..

The Background:

I have a Wordpress site (Supercars-For-Sale.Com) running on a free hosting account (with x10hosting - recommended!)

The site uses FEEDWORDPRESS to pull in posts from RSS feeds. It works well.

The problem:

I need the site to automatically update it's posts from the RSS feeds, because I don't have the time to do it manually.
If I set FWP to automatically update (using Wordpress inbuilt scheduling, WP-Cron), the only options are:
- Update before page load (Catastrophic page load times!)
- Update after page load (checks for jobs after every page load..)

Setting either one of these options will get you suspended on x10hosting or 000webhost free accounts.
Rightly so, these are shared servers, and you are hogging them!
(000webhost will CANCEL your account without warning - beware :( . x10hosting will suspend you, but at least they'll tell you about it :) , and unsuspend you on request.)

The solution:
FEEDWORDPRESS has an additional feature: update via web page.
If you send a request to: http://domain-name?update_feedwordpress=1 then all your syndicated input feeds are updated.

To make this work, all you need to do is set up a cron job (Scheduled task), that executes the following statement:
/usr/bin/curl --silent http://domain-name?update_feedwordpress=1

** Don't panic! a "Cron Job" is how a web server (Unix) runs scheduled tasks. You add jobs to it, tell it what to run and how often, and that's it.
"curl" is simply a command that accesses web pages from the command line.
Most webservers will have curl installed. **

x10hosting uses the cpanel graphical interface for everything. Even Cron jobs. Simply set-up the scheduling, enter the command, and that's it. (If it says there was a problem, try it again. It'll then say that the job already exists. Hit F5 to refresh, and the job is there..)

If you are using command-line crontab, then use the following statement:
*/HOURS * * * * /usr/bin/curl --silent http://domain-name?update_feedwordpress=1

Notes:
1. Replace "HOURS" with the number of hours between updates.
2. Replace "domain-name" with YOUR domain-name.

Other things to try:
If you are on a free hosting account, you could try turning off the inbuilt WP-CRON system. It's rubbish anyway, and only checks for jobs exactly when you don't want it to. (just before, or after a pageload). All you need is a big bot visit, and it's Hello, account suspension again. Been there. Done that to death
Simply edit the WP-CONFIG.php file, and add the following entry:

define('DISABLE_WP_CRON', true);

It needs to be at the beginning of the file, with the other "define"s.
** Please note that this will disable all WP_CRON activity. No scheduled jobs will run. (future-dated posts will not appear).

Tuesday, 2 November 2010

Supercars-For-Sale.Com - The saga so far..

Supercars-For-Sale.Com was originally set-up on 000webhost.com That lasted two weeks before they decided that their shared server couldn't cope with simple SQL requests..
The first I knew about it, my account was cancelled. Not suspended. CANCELLED.
No e-mail, nothing. (although I had received a few messages about slow mysql queries)
So, to hell with that. I transferred my site lock, stock and barrel to x10hosting.com, (and removed all the banner advertising for 000webhost). All went well, the site was up in no time at all.
But then I upgraded a couple of plugins and ran into problems. Wassup broke the site!
But worse than that, I couldn't get in to the site as Admin to sort it out!
Using x10hosting.com's file manager to remove Wassup's files worked just fine, though.
It gets worse, though.. the site was suspended for excessive use of resources..
Even though no-one could view the site..
I got it unsuspended, and all appeared OK. (Removed Wassup, remember..).
Overnight, the site was suspended again, for excessive use of resources. Sigh :(
This has to be to do with Feedwordpress being called from wp-cron every time a page is loaded. All it takes is one big bot visit, and we are suspended again.
So, as soon as I can get the site unsuspended again, wp-cron is getting suspended, and I'm manually running FWP's syndication update.

Monday, 11 October 2010

Banner Advertising.

(See earlier post)
NerveJam.Com is now sporting a rather fetching full-width banner advert for Toffeetones Records!

Anyone else?

New Website: Supercars-For-Sale.Com

The new website Supercars-For-Sale is now up-and-running.

It has a vast selection of supercars for sale, and it's about to get better..

It's hosted entirely for free on 000webhost.com. It's running Wordpress 3.0.1, and my usual selection of plugins.


Free Website Hosting

Monday, 9 August 2010

Banner Advertising!

Received an enquiry about banner advertising on NerveJam.Com today.
(Extremely) reputable people, too.. and entirely relevant to the target audience.
Done a mock-up and awaiting their response!
Watch this space...