Archives

Home > Blog > Archives

How To Copy Sub-site Media to Admin Site on Upload (WordPress Multisite)

July 16, 2014 by in category Programming, Wordpress tagged as , , , , ,

Jaysus, this one took me ages to understand. I spent so long doing all sorts of things to get it to work but in the end I think I’ve copped it. One important note though: do not remove the “restore_current_blog()” function at the end or move it within the if statement. You’ll end up in […]

0 1 Read more

How to add Custom Post Type menu to Admin Sub-menu WordPress

July 15, 2014 by in category Programming, Wordpress

After a lot of googling, I couldn’t find a solution to my problem. I finally figured it out and have decided to document it below. <?php define(“ICON_URL”, ‘/path/to/icons’); // First we sort out some submenu pages under our custom // menu page function my_add_submenu_pages() { add_submenu_page( ‘my-plugin’, __( ‘All Players’, ‘Players’ ), __( ‘All Players’, ‘Players’ […]

0 1 Read more

Multiple File Uploads In A WordPress Plugin

June 12, 2014 by in category PHP, Programming, Wordpress

In work today, I noticed a distinct lack of solutions for uploading multiple files through the ‘media_handle_upload’ function. Since it assumes that $_FILES is just the normal array of details, it isn’t really adaptable to multi-file uploads.   So, to get around this, you can de-make and re-make several $_FILE arrays and just feed them through the […]

0 1 Read more

What is beautiful about Computer Science?

April 18, 2014 by in category Computer Science, Opinions, Technology tagged as , , , , , ,

The beauty of computer science comes from the abstraction of everything we use and everything we interact with every day. The immaculate integration of computers into our every-day lives with such a gigantic nuclear impact on everything we do now but with such little recognition. To me, the beauty of computer science comes in the […]

0 1 Read more

Interning at a Tech Company

April 13, 2014 by in category Businessy, Personal, Technology tagged as , , , , , , ,

Nearly every summer since I was 16, I’ve been working at  some form of tech company. I’ve worked at hosting companies, gaming companies and I’ve freelanced for a whole slew of other industries and professionals (from python frameworks to javascript to PHP) and there are some things I think people should know. You’re not there […]

0 1 Read more

How to connect to a MySQL database with PHP (Using MySQLi)

April 11, 2014 by in category PHP, Programming tagged as , , , , ,

(FYI: this example assumes you know some basic SQL) There are three main ways that you connect to a MySQL database using PHP: the original MySQL extension (function based), MySQL Improved (MySQLi – Object-oriented) and PHP Data Objects (PDO, Object-oriented). This little piece will be about using MySQLi to insert, update and get data from […]

0 0 Read more

Club Sandwich

April 10, 2014 by in category Cheap, Fast, Sandwiches tagged as , , , , , ,

Ingredients 6 rashers bacon 6 slices bread 6 tablespoons mayonnaise 8 lettuce leaves salt and pepper 2 slices cooked turkey 2 tomatoes, thinly sliced Cooking Instructions Cook the bacon in a large frying pan for 5-7 minutes, turning once, until crisp on both sides, then drain on kitchen paper. Toast the bread on both sides, then spread on side of each slice with […]

0 1 Read more

Chicken Satay

April 10, 2014 by in category chicken, Fast, Recipes tagged as , , , , , ,

(Plus 4 hours marinating) Ingredients 500 chicken breast, cut into slices ready-made satay sauce, to serve Marinade: 1 tablespoon ground cinnamon 1 tablespoon ground cumin 1 teaspoon pepper 150ml vegetable oil 100ml soy sauce 2 tablespoons light brown sugar Garnish raw onion, chopped cucumber, chunks, roughly chopped Cooking Instructions Put the chicken slices in a bowl and add all the ingredients for […]

0 0 Read more

Chilli Bean Bake

April 10, 2014 by in category Recipes, Vegetarian tagged as , , , , ,

Ingredients 3 tablespoons vegetable oil 1 onion, chopped 2 garlic cloves, crushed. 150g mushrooms, halved or quartered if large 2 teaspoons mild chilli powder 400g can of red kidney beans, drained and rinsed 250ml carrot juice 2 tablespoons tomato purée salt and pepper 750g potatoes, sliced Cooking Instructions: Heat the oven to 200°C, Gas Mark 6 Heat the oil in a saucepan, add the onion […]

0 0 Read more

Spicy Tortillas

April 9, 2014 by in category Beef, Recipes tagged as , , , , , ,

Ingredients: 1 tablespoon olive oil 500g beef mince 1 onion, chopped 2 carrots, chopped 2 garlic cloves, crushed 2 teaspoons mild paprika 1 teaspoon ground cumin 415g can baked beans 400g can of chopped tomatoes 200ml chicken or beef stock salt and pepper Cooking Instructions: Heat the oil in a saucepan and add the mince, onion, carrots and garlic. Fry, stirring, until the mince is brown […]

0 0 Read more
© Evan Smith 2009 - 2017