1. Matching an URL
There are many regular expressions out there that match an URL, but this is the best I’ve found so far:
‘#((https?://|www\.)([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)#‘
2. Match email
“/[\._a-zA-Z0-9-]+@[\._a-zA-Z0-9-]+/i”
There are many regular expressions out there that match an URL, but this is the best I’ve found so far:
‘#((https?://|www\.)([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)#‘
2. Match email
“/[\._a-zA-Z0-9-]+@[\._a-zA-Z0-9-]+/i”
When you try to include the PHPExcel library into a joomla article (using a plugin for inserting PHP code into an article), it doesn’t work. It displays a white screen. I found a solution for that. It maybe not the best way to fix this since I’ve modified the Joomla core.
Go to /libraries/loader.php and replace:
function __autoload($class)
{
if(JLoader::load($class)) {
return true;
}
return false;
}
with:
function Joomla_Autoload($class) {
if(JLoader::load($class)) {
return true;
}
return false;
}
/*** specify extensions that may be loaded ***/
spl_autoload_extensions('.php, .class.php, .lib.php');
/*** register the loader functions ***/
spl_autoload_register('Joomla_Autoload');
If you have experienced this error in your webpage:
Fatal error: Cannot use object of type stdClass as array in /modules/mod_jf_twitter/helper.php on line 38
Then it is a problem of “JF Twitter” module. Do the following on /modules/mod_jf_twitter/helper.php/helper.php on line 38:
Change this:
if(!empty($this->tweets)) {
$profile = $this->tweets[0]->user;
}
To this:
if(count($this->tweets)>1 and !empty($this->tweets)) {
$profile = $this->tweets[0]->user;
} else {
echo "";
}
I am not sure why this problem occurs, but I think it is because an application can do a fixed number of calls per hour on the Twitter API. The first time this error hapened to me was when Twitter.com was over capacity, but it happened again when Twitter.com was working. This happened on “JF Twitter V.2.3″
I found a very easy way to beat lazarevic.
Hang down the cliff near the stairs, Lazarevic will come there and shoot you, but you can’t get hit of him if you are hanging. Then just stay there and shoot the blue resin, and wait for it to refill.
Simplyalbania.com is a new website which will have photos from Albania. Actually there are only photos from Tirana (the capital).
This function extracts the first x characters of a given text, which we get from a database.
This is usually performed on posts on a blog, where you don’t want to display the whole post in the homepage, but just let’s say 500 characters of the post. Ok here is the function:
function extract($post_id, $length) {
$sql = "SELECT id, LEFT(info, $length) as extraction FROM posts WHERE id = $post_id";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query)) {
$extraction = $row['extraction'];
$space = strrpos($extraction, ' ');
return substr($extraction, 0, $space);
}
}
$post_id is the id of the post in the database.
$length is the length of the extraction.
Then I’ve used the $space do get the position of the last occurence of a space (‘ ‘) in the $extraction.
This is needed to not return a text which is broken in half (for example “this pages address is klevismi”, instead of “this pages address is klevismiho.com”).
First Block the person you sent your friend request, then Unblock him/her in your Privacy Settings.
Go to Account then Edit Friends
There you have a list with your friends and pending friend requests.
Click on the X to remove a pending friend request.
I just noticed that facebook has added a new feature in the photo tagging.
A face detection mechanism.
The thing here is that if there is a photo with people in it, and you hover the mouse over a face,
there will be a rectangle frame over the face with the caption “Tag This Photo”.
The bug
When I run MISE.exe, I get an error that X3Daudio1_6.dll is missing. The game won’t open.
The Solution
Download the Directx End-User Runtime from microsoft.
1. include()
2. isset()
3. mysql_query()
4. mysql_fetch_array()
5. substr()