Sunday, December 20, 2009

Link Building Tip

Here is a simple TIP I am using for my link building.

Common practise in link building is the exchanging of links A.K.A Reciprocal links, however too many reciprocal links can damage your own Page Rank. I have created a links page on one of my websites and am using a meta tag to stop that page from being indexed by search engines:

To prevent all robots from indexing a page on your site, place the following meta tag into the section of your page:

< meta content="noindex" name="robots">< /meta>

To allow other robots to index the page on your site, preventing only Google's robots from indexing the page:

< meta content="noindex" name="googlebot">< /meta>

http://www.google.com/support/webmasters/bin/answer.py?answer=93710

Thursday, December 17, 2009

Joomla 1.5 Community Builder and Virtuemart auto user sync

######## Solution 1: (Just cron job) ########

Example:

DB Username: username
DB Password: password
Database name: database
Host: cmysql5-1.host.com
Port: 3306
NB: change jos_ if you are using an alternative prefix e.g. joom_
Note: The info below goes into your “Command” line, you need to configure how often you want to run the cron job in the cron job settings while scheduling/setting up the cron job. For more info on setting up your cron job please contact your website host or go to our support forum: http://gxi.co.za/webmaster-forum.html

// SIMPLE:

Use this if your sql host is “localhost” (default in most cases)

mysql -uusername -ppassword database -e "INSERT IGNORE INTO jos_comprofiler(id,user_id) SELECT id,id FROM jos_users";

e.g (will run every hour):

* */1 * * * mysql -uusername -ppassword database -e "INSERT IGNORE INTO jos_comprofiler(id,user_id) SELECT id,id FROM jos_users";

// ADVANCED:

Use this if your sql host is not “localhost” and you need to enter a host address and port (cmysql5-1.host.com: 3306 etc)

mysql -uusername -ppassword -hcmysql5-1.host.com -P3306 database -e "INSERT IGNORE INTO jos_comprofiler(id,user_id) SELECT id,id FROM jos_users";

e.g (will run every hour):

* */1 * * * mysql -uusername -ppassword -hcmysql5-1.host.com -P3306 database -e "INSERT IGNORE INTO jos_comprofiler(id,user_id) SELECT id,id FROM jos_users";

--------------------------------------------------------------------------

######## Solution 2: (Cron job + File) ########

Create a PHP file somewhere with the following information (be sure to correct to your database settings), when you setup you crone job ensure you include the full path i.e.

* */1 * * * php /full/path/to/script.php

The PHP file must contain:

< ?php

$server = 'localhost';
$username = 'mysql_username';
$password = 'mysql_password';
$database = 'mysql_database_name';

### connects to the database, or dies with error
$connection = mysql_connect($server,$username,$password);
if (!$connection)
{
die( mysql_error() );
}

### selects the db of choice, or dies with error
$db_selection = mysql_select_db($database, $connection);
if (!$db_selection)
{
die( mysql_error() );
}

### selects all tables in the db of choice, or dies with error
$alltables = mysql_query("SHOW TABLES") or die ( mysql_error() );

### loops through all of the tables and optimizes each, or dies with error
while ( $table = mysql_fetch_array($alltables) )
{
mysql_query("INSERT IGNORE INTO jos_comprofiler(id,user_id) SELECT id,id FROM jos_users") or die( mysql_error() );
}

### closes the mysql connection
mysql_close($connection);

?>

Joomla 1.5 & 1.0 - Specific modules/script based on URL (PHP Hack)

The "%" in <%script src='XXXXX' type='text/javascript'><%/script> is simply there to show this code but would be removed

< ?php
$currentpage = $_SERVER['REQUEST_URI'];
if($currentpage=="/" || $currentpage=="/index.php" || $currentpage=="" ) {
echo "<%script src='XXXXX' type='text/javascript'><%/script>";
} else {
echo "";
};
?>


This will show your script on http://yourdomain.com/ , http://yourdomain.com/index.php and http://yourdomain.com . And will not show this on any other page.

The first echo ""; will be what is shown on these pages (Your script/module) and the second echo ""; will be what is shown on all the other pages (In this case nothing)

You can change ($currentpage=="/" || $currentpage=="/index.php" || $currentpage=="" ) to represent your pages.

You can change <%script src='XXXXX' type='text/javascript'><%/script> to to load module position special (Joomla 1.5)

Joomla 1.5 eWeather - Show the Forecast City in Title

Joomla 1.5 eWeather

How to show the forecast city in title of the of the page instead of the component / link name.

For example on the distribution websites demo: http://www.robertjlavey.com/index.php?option=com_eweather&Itemid=9

You will see the page title is eWeather with no reference to the weather conditions in "Siloam Springs, AR"

To correct this you will need to edit the components/com_eweather/eweather.html.php

Find the following 2 lines:

function displayWeather(&$weather, $weatherIconStyle){
$url = JUri::base(true);


Directly under these 2 lines you need to add:

$document =& JFactory::getDocument();
$document->setTitle($weather->loc_city);


It will now look like:

function displayWeather(&$weather, $weatherIconStyle){
$url = JUri::base(true);
$document =& JFactory::getDocument();
$document->setTitle($weather->loc_city);