Sometimes I get requests to make changes on an IonCube protected script, but the protection prevents us, to do this.

In some cases we can make smaller changes with and easy solution.

Firts we have to make a wrapper for the protected PHP, what contains the include for that.

 

Example;

The name of the protected PHP is PROTECTED.PHP.

We have to make a wrapper what includes the original file, but before we use the include, we have to turn on the output buffering, so the server wont send the output to the browser immediately, only when reached the end of the script, or when we force this.

 

ob_start(); // Turn on the output buffering

include “PROTECTED.PHP”; // include the IonCube protected script

$output=ob_get_clean(); // read the HTML output to a string variable and clear the contents of the buffer

$new_output=str_replace(“old text”,”new text”,$output); // change the content of the HTML output

echo $new_output; // send out the changed string into the buffer

ob_end_flush(); // send the buffer content out to the browser, and turn off the output buffering.

 

 

On this way, you can easily make smaller changes on the output of a protected script.

 

 

 

 

I had a work, when the customer wanted to add watermark to the uploaded images. I tried some solutions, and finally found that one, what works well. What we need for this task? A png image what contains the watermark image. This must be transparent background, and semi transparent image, otherwise the result won’t be watermark, just an image what merged with another. We need a form too, to upload the image, and a script, what process the request, and add the watermark to the uploaded image.

(more…)

Classipress is a very useful wordpress theme from AppThemes, what add functionality to the sites to post and manage ads. The theme had gateways for lot of payment methods, but there isn’t contains the PayGol payment gateway. The PayGol is a sms based micro-payment solution, with lot of configurable options.

(more…)

I had to expand a site to handle SEO-friendly URL-s. The site was not based on a CMS, but had lot of posts in the database, so I had to do something what isn’t change the actual structure, because the site had lot of references from other sites.

I solved the problem with two easy steps.

(more…)

I have to add some extension to a site, to post tweets onto the site’s Twitter account, when a new post submitted. I tried some version, first the old way with curl, then some versions with oAuth, but all solution based on a manual user login. I don’t want to force the site admin, to every time log in to the twitter too, when submits a post.

Finally I found the most easy solution, what don’t need any specialties. The solution is based on the post of Jaisen Mathai http://www.jaisenmathai.com/articles/twitter-php-oauth.html

(more…)

I had an interesting problem yesterday. We wanted to make a new frontpage for a WordPress site. The frontpage has need the same layout than the category listing page. We used the same code, what called the loop.php to show the posts, and everything was good, except one “small” thing. The WordPress worked differently if we called a category listing page, than on the frontpage. (more…)

My girlfriend made a small image for the site, what figured a fly, and I thought, It can useful to make small gadget. So the fly birth, and come to life.

The code has five main parts, the image, the CSS, the hover procedure, the procedure what moves the fly, and that one what turns off the gadget.

(more…)

One of my friends has a multi-site installation of the WordPress, and he had a problem with the additional sites.

When he wanted to upload images, they uploaded into the proper folder, but the uploader provide wrong URL for the images, and he was not able to use them. The wordpress created the URL for all sites based on the main settings, and provided the “/files/image.jpg” style URL for all of the uploaded files. This setting was worked fine in the case of the main site, because a rewrite rule in the .htaccess file, but not with the sub-sites, because the files of the subsite stored in another folder.

The uploader created the URL based on the main site settings, but uploaded the images into the subsite upload dir. (more…)

I needed to get a part of a website, and show that in a wordpress post, so I made a WP plugin, what use curl to get the data from the site, and cut the appropriate part, what I want to show in the post. (more…)

The not appropriately selected encoding of database tables can cause annoying problems on a website.

Usually the wrong encoding of the database tables or fields causes this kind of problems.
The best solution, to change the encoding of tables & fields to UTF8.

The easiest way to do this change on database tables, the following;

ALTER TABLE {table} CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci

This SQL script changes the encoding of the table and all of that fields in the table to UTF8.