Author: Antonie Potgieter

Crontab : Disable email notifications

By default, when you schedule a cronjob, the cron daemon will email the administrator with the results of the schedule. You can easily turn off email reporting by appending the string “>/dev/null 2>&1” (without quotes) to the end of the command. Like this : wget http://domain.com >/dev/null 2>&1 Hope this...

Read More

PHP: Random string with numbers and letters

I thought that some of you might find it useful to learn how to generate a random string or a random number with PHP. I wrote a quick function to use PHP to generate random. See it below: There is an easier way to do this with a single line of code but you won’t have as much control over the characters that you want to include/exclude from the random PHP string. Here it...

Read More

PHP : Strip or find a file extension

Getting a file’s extension is essential when working with uploads and other manipulations complying with files. You might have a user uploading a file and you need to rename the file before moving it from the temporary upload directory. In order to do so, you can obtain the file extension and then rename it to whatever you like. Below is a custom function I wrote which will help you to get the extension of any file using PHP. function stripExtension($filename = '') { if (!empty($filename)) { $filename = strtolower($filename); $extArray = split("[/\\.]", $filename); $p = count($extArray) - 1; $extension = $extArray[$p]; return $extension; } else { return false; } } So basically, we split the name of the file on every dot (.). The PHP split() function creates an array of strings for us. We then take the string obtained after the last dot (.). Even though there might be more than one period within the filename, we know that the last string will be the extension. Now, with the full file extension in your possession, you can continue and use it for something specific. I hope that you found this...

Read More

WordPress Pagination Class

I wrote a simple, yet extremely useful WordPress pagination class. The class is not complete yet, and I work on it as I move along and need new features or actions. So you have the freedom to take the class and customize/expand it as you might need to. First off, you can download the class below : WordPress Pagination Class In order to use the class, you’ll need to include the class file. With the class file included, you can initialize the class and then execute the startPaging() class method. Before you execute the method, you need to specify some variable values. See the example below : include_once(ABSPATH . 'wp-content/plugins/yourplugin/class.pagination.php'); $tableName = $wpdb -> prefix . 'yourplugintable'; $tableFields = '`id`, `title`, `description`'; $pagination = new Pagination($tableName, $tableFields); $pagination -> perPage = 10; $pagination -> pluginUrl = '?page=yourplugin.php&'; $allRecords = $pagination -> startPaging($_GET['wpMailinglistPage']); From there, you can simply loop through your records with a foreach(); or something similar to output the records. In order to output the page numbers/links and the “previous”/”next” links, you can echo the pagination(); class method. See the example below : Good luck! I hope this is useful! Please feel free to post your updated source code, ideas and...

Read More

WordPress Mailing List v2.0

The WordPress mailing list plugin v2.0 has been released to the public with a great set of new features. These features include : Multiple mailing lists Email scheduling Newsletter templates Automatic updates indicator Improved sidebar widget with Ajax Post/page opt-in form embedding Email queue CSV and MacOS Address book importing Excel CSV file exporting And much, much more… If you are upgrading from v1.X, you immediately get 25% discount upon...

Read More

contridfx Live Stream

Watch me play live game streams!

Sorry, there’s no live stream at the moment. Please check back later or take a look at all of my videos.

Subscribe/like me on YouTube, Facebook, Mixer or Twitch to be notified when I go live! Thank you for your support!

newsletterjpg
bundlejpg
banner-rotatorjpg
questionsjpg
slideshow-galleryjpg
shopping-cartjpg

Stay up to date

Get one email per month with latest news. You can unsubscribe at any time

Fill in a valid email

captcha

shopping-cartjpg
bundlejpg
newsletterjpg
slideshow-galleryjpg
questionsjpg
banner-rotatorjpg

Pin It on Pinterest

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!