PHP Function: Make non linked links clickable

Recently I came across a problem making a twitter plugin. I needed to make links which had no “a” tag into links. You can do this progamaticly and here is the solution:

If you are going to use this script please download from here: links.php.txt

function makeClickableLinks($text) {

$text = eregi_replace('(((f|ht){1}tp://)[-a-zA-Z0-9@:%_+.~#?&//=]+)',

    '1', $text);

  $text = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_+.~#?&//=]+)',

    '12', $text);

  $text = eregi_replace('([_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3})',

    '1', $text);

return $text;

}

// Usage

// Email address example

$text = "you@example.com";

echo makeClickableLinks($text);

echo "

";

// URL example

$text = "http://www.example.com";

echo makeClickableLinks($text);

echo "

";

// FTP URL example

$text = "ftp://ftp.example.com";

echo makeClickableLinks($text);

Cubecart product compare mod

Cubecart product compare mod allows customers to compare 2 or more products, the customer can see the price,description, image, name and weight. The Cubecart product compare mod also makes it simple to add new fields to the compare mod. For instance if you own a computer shop you can add some custom fields to the inventory table and compare those items on the compare page by just drawing the variable. With a simple installation this mod is a sure win for your cubecart installation.

Price: $15
License: unlimited domain
Demo: https://worcesterwideweb.com/store/index.php?act=viewCat&catId=1

compare.jpg


Restaurant Online Ordering System Beta available!

The Restaurant Biller application is now available! With the features  listed below and the low price it costs to use this application its a sure hit for small business restaurants world wide. Here are the features the Restaurant Biller boasts:

The online restaurant ordering system for small to large businesses. More and more people are going online to search for food in their area rather then using the yellow pages. Restaurant Biller© created an online solution for those restaurants to have an online menu where customers can place orders. This application is very powerful and easy to use with features allowing you to easily control every aspect of your website. Listed below are some of the features included in this application.

  • Easy AJAX powered checkout system
  • Receive the orders directly through email within 30 seconds of placed order
  • Easy customization for those who want to modify their site
  • Modify your home page directly from a control panel
  • Add Edit and delete categories to your menu
  • Add Edit and delete menu items with extented features
  • Each site has a contact us page for customer questions
  • Edit the hours you would like your online store open
  • Add an addition cost for delivery, tax prices or order processing fees
  • Free updates

Click here to view the demo and website
or
Click here to enquire about getting setup on this system

Cubecart Auto Complete – Live Search Mod

I developed another mod which allows you to have a live search or autocomplete on your cubecart page. This mod puts autocomplete into cubecart search, basicly when you search for an item a list of all items will show up below the search box matching what the user typed in. The items are store items built from your database.

autcomplete.jpg

A Demo of the mod can be found here Just search for an item

 To purchase this mod please click the paypal button below. Processing may take between 2-24 hours. Thank you

Single Domain

  

Multi  Domain
  

Cubecart catalog pdf mod

I developed a mod which converts your whole shopping cart into a PDF file. The mod handles the following within the PDF

A Demo of the mod can be found here Just click “Download Catalog”

This mod requires php5 but there is a php4 version in development. The mod also requires the php extention domxml to function properly. To purchase this mod please click the paypal button below. Processing may take between 2-24 hours. Thank you


php 5 and imagecreatefromjpeg() recoverable error: Premature end of JPEG file

Ok I recently came up with a problem creating thumbnails for a project I am working on. I was stumped for hours, it seems that some files that were saved from a mac or certain photo editing programs would cause php to not recognize it a jpg thus giving the error:  

imagecreatefromjpeg() : gd-jpeg, libjpeg: recoverable error: Premature end of JPEG

After researching this problem I realized it was a problem with php 5 and gd2. Heres how to fix it

ini_set(‘gd.jpeg_ignore_warning’, 1);

Doing that will cause gd2,php to ignore the error and continue where it use to just fail and do nothing.

Cubecart custom category order

So I developed another new mod for cubecart, this one allows you to sort out your categories in cubecart the way you want without staying with the normal sort by name or id as seen in other mods. This mod only modifies 3 files and installs one column “pos” to your database to do the ordering. Remember to back up your database and files before attempting any modification on your original files. To download this file click on the link below.

Custom category ordering 1.0

custom_category_order_1.3 (updated for manual ordering)

mysql update from another table

Recently I needed to update a bunch of rows in mysql with information from another table. I will explain how to do this simple process.

  1. Open up phpmyadmin or similar database editor
  2. view the sql query below
UPDATE updatefrom p, updateto pp 
SET pp.last_name = p.last_name 
WHERE pp.visid = p.id

Lets say we have 2 tables one named main and one named updateto and one named updatefrom, In the first line we assign variables to these t tables (p and pp) from there we can call column names using this format table.columname. If we had first_name and last_name in both tables and wanted to update the “updateto” table with the info from “updatefrom” this is how you would write it.