Playstation 3 Game Update error SOLVED

This is for all of you out there who are unable to update games on the Playstation 3 because some nasty error shows up everytime an update is in progress.

The solution is that you have to disable Universal Plug and Play (UPnP) on your Playstation 3.

This can be done using a manual configuration of the network settings.

Posted in Playstation | Leave a comment

Changing header information in a Joomla Template

In some Joomla templates you can change the information in the <head> tags directly by going in the template and adding html code inside the <head> tags. However, some other templates have in the header this line of code:

<jdoc:include type=”head” />

which includes the header information from some file.
If you like to change a <meta> tag, directly in the template file, you should write this PHP code inside the scope of the <head> tags:

<?php $this->setMetaData(‘robots’, ‘noindex, nofollow’); ?>

which is equivalent with:

<meta name=”robots” content=”noindex, nofollow” />

Since I use this technique often, and I often forget about it, i decided to put it in my blog.

Posted in Joomla | 1 Comment

Useful Regular Expressions

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”

Posted in PHP/MySQL | Leave a comment

PHPExcel and Joomla

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');
Posted in Joomla | 2 Comments

JF Twitter module problem fix

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”

Posted in Joomla | 6 Comments

Uncharted 2 beat Lazarevic

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.

Posted in Playstation | Leave a comment

New website with simple pictures from Albania

Simplyalbania.com is a new website which will have photos from Albania. Actually there are only photos from Tirana (the capital).

Posted in Internet | Leave a comment

PHP extract the first x characters of a text

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”).

Posted in PHP/MySQL | 1 Comment

Cancel Friend Request in Facebook

Method 1

First Block the person you sent your friend request, then Unblock him/her in your Privacy Settings.

Method 2

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.

Posted in Internet | 1 Comment

Facebook Face Detection

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”.

Posted in Internet | Leave a comment