Categorie ‘Wordpress’ » Archiv


2

oh batshit, it’s happened again. thrice

February
19

What a load of bollox! This seems to be the week I experience maximum crashage.

Hard times/drive

First, my shop pc had a hard drive crash. A massive one. The drive wouldn’t even spin! I tried the usual methods found on a Google like putting it in a plastic bag and putting it the freezer which is supposed to fix a jammed disc.

nope.

Then I tried what this page tried. Basically, swapping the logic board from an identical drive to the faulty one. That actually got the drive spinning and recognized in windows but unfortunately, it was completely trashed. Every sector screwed and no matter what software apps I threw at it, it wouldn’t play. (so I took it apart to see how it works)

Lost code

All my backups of my server where on that disc. All.of.them!

In a great wave of relief, I found that 99% of it had been updated to the live server only the day before. The 1% that didn’t just so happened to be my awesome edit of the pay-to-blog plugin which I was about to put on ComLuv. dammit, that was some good coding I added to the plugin.

It would have allowed me to set a free time limit on new blogs of say 30 days and when that runs out, the next time the blog owner tried to log on, they would be presented with a page where they can pay a piddly 5 USD to have the blog enabled for a year. If they didn’t want to or couldn’t pay then they could request a free blog and that would notify me by email and list the request on my admin page.

I’ll have to rewrite the code and I bet I can’t remember how I did it!

New install, new problems

I managed to grab another hard drive and put it in the box to replace the poop one. Installed Ubuntu 9.10 and vwmare and got all the shop POS software working with the ancient equipment we have. Sweet! until… only 24 hours of nice working, it went pooooop. Something to do with i810 video drivers missing. Cue 5 hours pissing about with sudo apt-get and other linux bollox until at last, it is working again.

And then Vmware decided to stop working with the serial port via USB. Pleh!

More sudo apt-get and 2 hours later, I found an old vwmare image for the win98 system and copied over the contents of the .vmx file and ta-da! it worked again.

No more please!

No more. thanks. done it now.

New Wheels

At least the new wheels look good on Twitpic

Even these got delayed by 3 days. Next day delivery bleeeeuuurrgh!

Blog News, Wordpress


0

Taming the Upgrades plugin from http://premium.wpmudev.org

February
2

If you’re lucky enough to have a subscription to Premium WPMU Dev account then you’ll have access to great monetization plugins like the Upgrades or Supporter which take all the pain out of providing a ‘pay for’ service that can handle payments through Paypal, Google or even Amazon gateways.

I downloaded and installed the upgrades plugin a while ago and I’ve used it to monetize certain parts of my ComLuv site. There’s the usual way of adding plugins to the Upgrades directory and configuring them to be used which I’ll go into in a future post but I wanted to use the system slightly differently, and that was to charge users for adding new URLs to an account or to add default links to their returned list of posts.

The advantage of premium

Some of the advantages to using wpmupremium plugins is the support you receive, knowledge that the plugin will be updated to keep it compatible with new changes and my favourite is, the quality of the code.

When you’re getting premium, you’re getting premium code which for me personally, has taught me a LOT about how wordpress works. Particularly custom hooks and actions and filters. That was always a mystery to me until I dissected the plugins I downloaded from their site so it was a breeze to modify the upgrades plugin to work for users who don’t have blogs and start using the internal functions in a daughter template to do what I wanted.

Modifying the upgrades plugin


I needed to allow the upgrades menu to show for regular users because not everyone who joins the Comluv site starts a blog. This was just a simple case of changing the user level so that everyone, not just blog owners can see the menu and buy credits.

There are two places to modify:

/mu-plugins/upgrades-framework.php
line ~ 197-200 (upgrades plug pages framework function)
change add menu and submenu calls to

add_menu_page($upgrades_branding_plural, $upgrades_branding_plural, 0, 'upgrades.php');
add_submenu_page('upgrades.php', __('Credits'), __('Credits'), 0, 'credits', 'upgrades_credits_output' );
add_submenu_page('upgrades.php', __('History'), __('History'), 0, 'history', 'upgrades_log_output' );

line ~ 1919 (upgrades_credits_output function)
change user check to

if(!current_user_can('level_0')) {

Creating the daughter template

Adding another page you can use as a template is pretty easy, you just need to create a new php file in your theme directory and make sure it has the correct remarks at the top to identify it as a template page.


/*
Template Name: ComLuv purchase url
*/

Next just copy and paste the main calls from another template, you’ll be deleting most of it like the loop to display posts and replacing it with your own hard coded form and text. Be sure to keep the divs that surround the content intact.

I wrote a description of the item being sold and added a form.
(DON’T copy and paste from this page, I had to remove the beginning < characters from the code so it displays properly)

form action='/member/additional-urls/' method="POST">
input name="addurl" type="text" size="30"/>
input type="submit" name="submit1" value="Submit"/>

/form>

I also added a finish_page() function which just closes the /div tags so I could easily break out of what I was displaying without rendering the rest of the custom code below it.

You set the action to the page slug you’re publishing the page as and put a nonce field in there so you can check it with the next bit of code to prevent a naughty user from trying to call the purchase directly.

Handling the purchase

Next, you need to handle the data that gets submitted by your form and do the magic with the users credits.

if(isset($_POST['submit1'])){
$nonce=$_REQUEST['_wpnonce'];
if(!wp_verify_nonce($nonce,'addurl1')){
echo 'Page request deformed, please go back and try again. (b1s1)';
finish_page();
}
if(!$_POST['addurl']){
echo 'Please go back and enter a value';
finish_page();
}
// check if user has enough credits
global $user_ID;
$credits = upgrades_user_credits_available($user_ID);
if($credits < 3){
echo 'h2>Error - Insufficient Credits/h2>';
echo 'p>You will need to purchase some credits to register another URL, you currently have strong>'.$credits.'/strong>';
echo 'p>a href="/wp-admin/upgrades.php?page=credits">Click here to visit the purchase page/a>';
finish_page();
}
// if we're here then everything is ok to provide service and deduct credits
$credits = upgrades_user_credits_available($user_ID);
$credits -= 3;
upgrades_user_credits_update($credits);
upgrades_log_add_msg($user_ID,'You paid 3 credits for an additional URl - '.$url);
do_add_url($url,$user_ID);
echo 'h2>Site added, 3 credits used on your account/h2>';
echo 'p>You have '.$credits.' credits remaining';
echo 'p>a href="/member/additional-urls/">Click here to refresh the page/a>';

The first bit gets the nonce you created and checks it and displays an error message if it doesn’t match
Next, check the field you’re expecting and spit out an error if it is empty.
Next, check the user has enough credits and spit out an error if they don’t.
If everything is fine, continue.

use $credits = upgrades_user_credits_available($user_ID); to get the users current credits total
use upgrades_user_credits_update($credits); to set the users credits total to $credits (after you deduct what your item/upgrade costs)
use upgrades_log_add_msg($user_ID,’You paid 3 credits for an additional URl – ‘.$url); to add a message to the users Credits history page so they know they used some.

That’s it, easy peasy! Here’s an idea, use credits to sell digital downloads on another page, just check and deduct the users credits before allowing a dowload.

I’ll post a follow up to this soon on how to use the upgrades plugin to add a new package that enables the RSS widget for a blog (I’ll show you how to disable the rss widget too)

You can get over 100 plugins and themes of premium quality at http://premium.wpmudev.org and they all help to make your wpmu site better than the jones’s :)

Blog Tools, Making / Made Money, PHP, Wordpress


7

Making a takeaway website – my story

October
11

Fired Wok Chinese Takeaway

Some of you may know that I run a Chinese takeaway and delivery shop in Lancaster, UK with my partner and her brother. My role is strictly ‘front-of-house’, customer service, chief geekster and go-and-get-stuff-from-Preston’er (among other things like doing the weekly books and tracking the cost of goods sold etc)

I can’t for the life of me go in the kitchen where it’s all fire and wok but, I can do all the other great things like come up with great marketing ideas, develop online solutions for advertising, answer the phone and understand the myriad of different accents you get when you run a delivery orientated business in a two University town.

Pretty Vs Useful

One of the things that was inevitable for me to do was, The Website.

Now, I class myself as a developer not a designer. The difference? read more… »

Blog Tools, Business Software, Wordpress, ecommerce


165

WP-Twitip-ID Plugin – Add a twitter field to your comment form (easily)

October
8

Version 1.0 (updated 11 Feb 09)
Requires: Wordpress 2.6 (could work with lesser)
Tested up to : Wordpress 2.7b3

This plugin is no longer supported, please download TwitterLink-Comments which will do a much better job and will still be able to use the existing database table and labels.

Download TwitterLink Comments

Blog News, Blog Tools, Code, PHP, Wordpress


6

New url registration page or new plugin settings?

August
5

I took a day off this week and it extended itself to another half which then puts me in contemplation mode.

I’m used to this happening after finishing a particularly complex series of things, I kind of get a sugar crash which puts me into day off mode, that then leads to search for new source of sugar.

It happened last week, I managed to work out how to upgrade the WPMU version ComLuv site to 2.8.2 and then expand the single db into 256 smaller ones. This was a big thing for me, it was either get the site working with 256 databases or fork out another bundle of cash every month for an extra gig or two of RAM on the server!

Luckily, after seeing it work fine for about a week with the new db configuration and no scary cpu usage alerts coming, I think I can concentrate on the next stage of development. I’m really itching to get a decent url registration page up and I’m considering opening up the ability to have up to 5 urls or sources registered with your account without needing anything other than a standard commentluv account.

I’ve already started sketching out what I want the page to look like (which I really should have done the first time around!)..
Sketching out new url registration page on Twitpic

Another thing I really want to do is convert commentluv to use a plugin framework so I can really do wonders with the settings page and not worry about htmlspecialchars this and mysqlescape that.
Doing this would allow me to put in some needed features to the commentluv plugin like full editing of the css used.

I’m tempted to update the plugin first, I have just received a Russian translation to go in with it and I want to update the readme so it is formatted to display fully in the plugin browser of a wp blog.

Oh the quandary! I can’t decide which one to do, they both need doing and both need to be done on their own or else distractifications occur!

What’s more important to you?
1. comluv update to make the whole url registration process nicer and add 5 sources to your acocunt
2. fix plugin so you can edit your own styles and have a prettier and easier to understand settings page?

Blog News, Code, Wordpress


1

A day of other peoples code

June
24

Support Tickets

I did some pretty fancy tweaking of code today to see if I can replace the support tickets system on ComLuv, the system at the moment isn’t bad but the last support ticket management software I used was far superior and allowed me to reply to closed tickets and create canned responses.

It will need some more work to integrate it into the dashboard of the site but I’m pretty confident I can do it.

Theme

I feel the need to tweak themes too, I found an old mockup image on my hard drive that I had for a client that never took up the job and I contacted someone about converting it to a WP theme. I love how it looks and I’d really like to have the format for ComLuv so I can start on tutorials and other features.

That’s not to say the current one isn’t great, it’s just that I’m all for “get it done” then “make it work” and then “make it pretty” and then “do it all again until I have what I want.

Newsletter

I had a bit of a nightmare with my newsletter software taking up too much resources while being on the same server as ComLuv so I took steps to transfer it to another server and use the ComLuv SMTP connection to do all the sending. Hopefully this will fix any issues I was seeing..

Tutorials & Videos

I have the new pc set up with a screen recorder and I have a list of videos that I’d like to produce for tutorials on the ComLuv site. I tested it out and my quad core monster can handle the capture on a widescreen so I can do HD videos and host them on Vimeo

Remote Images & Scripts

I have done some serious optimization on the blogger version of CommentLuv so that now there are very few calls to the ComLuv server for images and scripts. This one thing should dramatically decrease the server load during busy times.

Work

And now I have to tweak the system in the shop.  The tweaking never ends!

Blog News, PHP, Social Networking, Wordpress


1

Time flies!

June
21

I usually spend the first part of Sunday doing the weekly books for the takeaway, it takes up most of the morning to go through each days takings and tot it up in an accounts package and check the figures off the parallel sheet. It’s a good system and helps me to know exactly where any errors have happened.

Today though, I did my usual shower, shave, coco-pops and coffee and started fiddling with some bits of the site, which took me off on many tangents of code and template glory until I had a fully moved fiddyp.co.uk on the ComLuv network and rebranded parts of the whole network to be in line with the CommentLuv feel.

6 hours I was at it! I really must get a bumper sticker ..

“WPMu admins can be at it all night”

:-)

But really, I’m having so.much.fun!

It Grows!

Looks like the network is growing rapidly and the latest version of CommentLuv hasn’t had a support ticket about a bug for the last 12,000 downloads. Can I has stable? :)

So far, the new API has given some luv to more than 50k comments on blogs around the world and has attracted more than 200 new blogs and hundreds more registered users. The new-started-only-last-week database has already recorded approximately 20k unique websites (those that have a feed), processed 4k info page displays and recorded over 9k clicks from users on peoples last blog/tweet/digg links.

happy boy!

It’s just starting..

There’s still a huge amount for me to do with regards to the site like adding advertising options, custom themes, editable css files, affiliate payments for selling adverts, custom text link ads and much much more. Stick around, you might see something you’d like to take advantage of. I have big plans for this network, I hope you can be part of the fun too.

Let me know if you’d like to see anything in particular on the site or in the plugin..

Blog News, Social Networking, Wordpress


8

Having an issue with dbDelta to add table to wp db (resolved)

February
11

I’m having some issues with trying to put the WP-Twitip-ID plugin into the final version.

Right now, the beta version stores the twitter ID in the post meta for each post but that’s not really ideal because it can only show the twitter id on the comments of the post that the user has already commented on. New post comments require the user to add their twitter id again. Not too much trouble because if they have entered a twitter id in a previous comment then the plugin sets a cookie on their machine and adds it to the field when they comment again.

What I’d rather do is store the twitter id in the database so it’s accessible outside the post meta. I could store the id’s in wp_options but that would probably cause loading time issues because wp_options values get loaded automatically and considering the amount of comments a blog gets, it would bloat it out massively.

My solution is to create a new table on the database and add the twitter id and email address in there, that way I only have to update the db once when a new twitter id is entered.

The problem I am having is creating the table! for some reason, it’s not adding it. I’ve even copied and pasted another plugins code to do it and it still wont work!

here’s my code :

function atf_install() {
global $wpdb;
global $atf_db_version;
add_option("atf_db_version", $atf_db_version);

$table_name = $wpdb->prefix . "wptwitipid";
if($wpdb->get_var("show tables like '$table_name'") != $table_name) {
$sql = "CREATE TABLE " . $table_name . " (
id mediumint(9) NOT NULL AUTO_INCREMENT,
email varchar(120) NOT NULL,
twitid varchar(120) NOT NULL,
KEY email (email)
);";
require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
dbDelta($sql);
}
}
$atf_db_version = "1.0";
register_activation_hook(__FILE__, 'atf_install');

There’s a problem with the $atf_db_version too. It adds an option to wp_options for the key of “atf_db_version” but no value and it’s really starting to piss me off!

anyone out there in geek land that can help me here?

Fixed!!

A massive thanks to @clearskynet who answered and solved the problem within minutes of me posting this.

hurray!!

Code, PHP, Wordpress


41

Why the hell would anyone use twitter anyway?

December
7


The title of this post is the question I asked myself many times.. before I used it myself that is.

For the first months of Twitter being talked about I deliberately kept away from it thinking that ‘micro-blogging’ was a complete waste of time. Who the hell would want to know if I’m going for a coffee or what page I’m interested in at the moment?.. turns out, quite a lot of people do actually.

I’ve been using Twitter through an application called Tweedeck for a couple of months now and I’ve really grown used to it taking up almost all of my second monitor space. I’ve discovered many reasons to use Twitter and I thought I’d share my thoughts on twitter here;

It’s not an IM

I hate IM programs, msn, yahoo, gtalk and all the rest because they just suck time away from you while you wait for someone to respond. I’m a fast typist so it’s painful to wait 3 minutes watching the “soandso is typing..” only to get a “yeah, I know!” in the message window.

They’re distracting too, I hate having a “tiddly-dum” noise happening all the bleedin time while I’m trying to watch something. Even though I’m committed to the tv at the time, a “tiddly-dum” will cause me to come to the computer to see what it was. 9 times out of 10 it could have waited but like brown on finger, it had to be investigated.

I’ve switched off all my IM stuff now and my productivity has massively increased! That’s why I like twitter, it’s like a thought catcher. It allows you to put up in less than 140 characters what’s on your mind without needing an immediate response.

If someone asks me a question via Twitter, it doesn’t make a flashing button on the taskbar appear demanding immediate attention. Instead, I can see it when the tweetdeck window gets the focus on my many many windows open.

You can download tweetdeck here, I really recommend using it. This is what my screen with twitter window looks like.

I use 3 columns. One for replies, one for the whole tweet stream and one for direct messages.

It can change the world (in 48 hours)

I donated some money to an organisation that wants to build a new classroom for a school in Tanzania. It was set up by http://tweetsgiving.org during the thanksgiving run up in America. The whole point was to raise 10,000 dollars in 48 hours by using twitter to promote it.

It was an amazing idea and executed wonderfully, people were retweeting messages about it all through the 2 days and before the time was up, 10 grand was raised just from the kindness of tweeters.

It’s not full of spam (yet)

I have seen very little spamming going on with it which is such a change for a 2.0 web thingy. Usually the first thing any popular company does is switch on the money making adverts or get bombarded with cialis (ab)users.

There are a couple of advertising options open to twitter users but not by twitter itself. Magpie is one of them, I used it myself recently to promote some ebay listings using keywords like ipod and ebay. It generated a lot of click thrus and coincidence or not, I sold out of everything I advertised. Just before Christmas too! woohoo

It’s organic networking

I really like this part of it, it’s not like other places where you have to join someone and jump through some hoops to be part of their group. You can just click their follow link and get their tweets in your stream of all tweets. If you think they self promote too much, just unfollow and they’re gone!

You get to see what people are like a lot easier than by reading their blog, just 140 characters forces the person to not over-edit or revise their text.

From this you can see who you want to deal with and not be bowled over by a slick sales page or well crafted and heavily edited authority article. Straight to the brain is the game. I love it.

You find out what’s happening straight away

Just seeing a stream of tweets going by you can quickly pick up a repeated phrase, when the Mumbai attacks happened I knew about it before Sky news that was on in the background!

Shopper gets trampled on Black Friday sales in Walmart? I heard it on twitter first.

It really is a way to get a pulse on the world and especially useful if you’re a prolific blogger who’s hungry for news to post. If you’re early on breaking news or big things to happen then you’re on to a stumbleupon golden egg page.

If you need to know something, like, right now

This is fast becoming one of my favourite things about twitter. The ability to throw a question out there and have it answered within a few minutes or see it get retweeted (re-broadcasting the question to ones own network of followers) is just amazing.

My partner wanted to know how to attach a zipper to a home made woolen cardigan. I had no idea but I thought someone out there in the twitterverse (you’ll get used to these twitterisms) might know or at least, know someone who would know.

One of my followers saw the question and broadcasted it to her own network, within a couple of minutes I had a message with a link to a picture of exactly what to do. That’s the first time my pc has got some praise from ‘her indoors’ :-)

You can use the wp-twitip-id plugin!

Ok shameless self promotion here but you can take advantage of the wp-twitip-id plugin which allows you to add a twitter username field to your comment form on your wordpress blog and display a “follow me” link or image next to the comment authors name.

Another reason for people to leave good comments on your site!

You can download wp-twitip-id plugin here

It’s got a really cool api

API or Applications Programming Interface is how so many cool widgets and gadgets get made by the geeky. It’s a way for developers to interact with the twitter server and pull loads of interesting information about the twitterverse.

There will be more and more applications coming out for twitter in the near future, there are already some incredible 2.0 web applications that give a sneak peak of what the internet of the ’10s will be.

Follow me on twitter if you haven’t already and get up to the second updates on my plugins and offers

Follow Me@commentluv

Blog News, Blog Tools, Social Networking, Wordpress


40

A great book for wordpress theme design

November
15


Wordpress Theme Design – Tessa Blakeley Silver
PacktPublishing
Price 35.99 USD (ebook $27.19)

I bought a book recently after seeing it mentioned in the WP dashboard news items, it’s called Wordpress Theme Design by Tessa Blakeley Silver and although a lot of the information regarding the functions of wordpress can be found at the codex, the book gives you so much more like the process gone through to design a theme from scratch.

I do quite a lot of sites in wordpress now and find it much easier to provide a client with a website that can be updated so easily, a few plugins here and there and you can provide a website that does all and more that’s needed.

Usually I get a standard theme and cut it up a bit and change the css to give me my site, or create in photoshop and send off for wordpressing but lately due to some more custom design requests I’ve received and the always dependable mistakes that freelancers can make I have wanted to do the whole thing myself from scratch..

I’ve downloaded a tutorial before about WP theme design from small potato before it was taken over and that was pretty darn useful but was made a little while ago so it wasn’t 2.5 specific.

That’s why I like what Tessa has put her book, it takes you step by step through the process of creating a non-blog wordpress blog, from sketch to WP core code. It’s made a big difference to my initial prototyping of concept sites and has really opened my eyes to what you can do with a bit of manipulation of the wordpress template tags. I’m even working on a magazine style front page for here so I can have a featured post for contests that stays up while it’s open for entries as well as excerpts to the regular posts..

You can buy the book printed or get it as pdf for a bit cheaper (I printed mine out from pdf on someone elses printer lol!) at packet publishing

Packtpublishing is sending me a new book about Wordpress For Business Bloggers , they’re offering a deal if you get both books together. Stay tuned for the review of the new book!

Audio, Reviews, VWD elottery, Wordpress, books