Nisi's Work Blog

Nisi's Work Blog

Already a Member? Log In to Your Account

How to disable comments notification for WordPress

Published on 2011-11-21 02:43:00

Do you receive alot of emails sent by your WordPress Blog becouse people comment your posts? You can turn this off like this: 1. Login to your blog admin page 2. Click on Settings -> Discussion 3. Search in that list for “E-mail me whenever:” Now by default you receive email when “Anyone posts a [...]

Unable to find the wrapper “https”

Published on 2011-10-29 00:07:44

Today I had to put a simple script on one of my hosting server where a “Facebook Login” button was available for login. However when I had to run it I encountered the following error: Warning: file_get_contents() [function.file-get-contents]: Unable to find the wrapper “https” – did you forget to enable it when you configured PHP? [...]

$_FILES limitation when uploading files in PHP

Published on 2011-10-14 04:10:01

Along with the “upload_max_filesize” when uploading files with PHP there is another parameter named “max_file_uploads” witch prevent uploading more files that the value of this parameter. Default size of this parameter is 20 and is should be enough for more apps then I can count but today I had to repair a bug in a [...]

7pic – the new free photo hosting service

Published on 2011-05-30 13:42:46

I had stumbled today on 7pic.com website witch is a new and free hosting service for photo sharing. I give it a try and I like it becouse i can use the 7pic uploader to upload picts without to start a browser. Uploaded images are stored in albums and can be shares as an images [...]

How to use call_user_func_array with a simple function and with class methods

Published on 2011-05-28 06:49:58

In this post you will see a example of using call_user_func_array (from PHP) to call a simple function, a public static method from a class and a public method. First I define one function and one class: function add($p1, $p2){    return $p1 + $p2; }   class CSimpleMath{    function __construct($v1) {     [...]

“Progress bar” for long running cron scripts in PHP

Published on 2011-05-12 08:43:54

Long running scripts can be a pain if you dont know how much will be running. If you need to see a progress and flush() or ob_flush() do not work becouse of browser cache you can implement an “email progress bar”. PHP example: $step = 0; $last_percent = 0; $total_rows = while(1) {    $step++; [...]

Apple spy your iOS 4 iPad and iPhone

Published on 2011-04-24 08:18:29

If you want to see what Apple will know about you on your next device sync look for file consolidated.db and open it with a sqlite application or watch it sync over a map with the free application iPhoneTraker (just for MAC users)

Prevent Firefox to load css/js from cache

Published on 2011-03-13 10:40:16

This days I was working on a webpage but to test in Firefox was a pain. Firefox store css and js in cache with the rest of the page. Reloading page with CRTL + F5 combination seems to reload from server the page but not the css/js files. After hours of frustration and complete cache [...]

How to replace substring in MySQL table field

Published on 2011-03-11 06:30:34

This replace will search in every row of the table where condition from WHERE is true and replace function will replace all instances in a string. ex. if you have text “hello world” and you want to replace the “o” letter with “*” this will will transform the text in “hell* w*rld” UPDATE `mytable` SET [...]

PHP: trim spaces in the middle of a string

Published on 2011-02-14 05:29:04

When you let users input text in a textfield or input box iti is always a good ideea to use trim function to remove spaces form the begining or the end of the string. Today I needed a function to trim spaces from the middle of a string and replace with a single space. /* [...]



© 2006-2012 OnToplist.com, All Rights Reserved