Enjoy!
1: post.php (/components/com_kunena/template/default/)
1.1) Find:
[code]
else if ($do == "deletepostnow")
{
if (!$is_Moderator)
[/code]
1.2) Change to:
[code]
else if ($do == "deletepostnow")
{
$modified_reason = addslashes(mosGetParam($_POST, "modified_reason", null));
$modified_by = $my->id;
$modified_time = CKunenaTools::fbGetInternalTime();
$id = (int) $id;
$database->setQuery("SELECT * FROM #__fb_messages LEFT JOIN #__fb_messages_text ON #__fb_messages.id=#__fb_messages_text.mesid WHERE #__fb_messages.id=$id");
$message1 = $database->loadObjectList();
check_dberror("Unable to load messages.");
$mes = $message1[0];
$userid = $mes->userid;
//Check for a moderator or superadmin
if ($is_Moderator) {
$allowEdit = 1;
}
if ($fbConfig->useredit == 1 && $my->id != "")
{
//Now, if the author==viewer and the viewer is allowed to edit his/her own post the let them edit
if ($my->id == $userid) {
if(((int)$fbConfig->useredittime)==0) {
$allowEdit = 1;
}
else {
$modtime = $mes->modified_time;
if(!$modtime) {
$modtime = $mes->time;
}
if(($modtime + ((int)$fbConfig->useredittime) + ((int)$fbConfig->useredittimegrace)) >= CKunenaTools::fbGetInternalTime()) {
$allowEdit = 1;
}
}
}
}
if (!$allowEdit == 1)
[/code]
1.1.1) Find:
[code]
else if ($do == "delete")
{
if (!$is_Moderator)
[/code]
1.1.2) Change to:
[code]
else if ($do == "delete")
{
$modified_reason = addslashes(mosGetParam($_POST, "modified_reason", null));
$modified_by = $my->id;
$modified_time = CKunenaTools::fbGetInternalTime();
$id = (int) $id;
$database->setQuery("SELECT * FROM #__fb_messages LEFT JOIN #__fb_messages_text ON #__fb_messages.id=#__fb_messages_text.mesid WHERE #__fb_messages.id=$id");
$message1 = $database->loadObjectList();
check_dberror("Unable to load messages.");
$mes = $message1[0];
$userid = $mes->userid;
//Check for a moderator or superadmin
if ($is_Moderator) {
$allowEdit = 1;
}
if ($fbConfig->useredit == 1 && $my->id != "")
{
//Now, if the author==viewer and the viewer is allowed to edit his/her own post the let them edit
if ($my->id == $userid) {
if(((int)$fbConfig->useredittime)==0) {
$allowEdit = 1;
}
else {
$modtime = $mes->modified_time;
if(!$modtime) {
$modtime = $mes->time;
}
if(($modtime + ((int)$fbConfig->useredittime) + ((int)$fbConfig->useredittimegrace)) >= CKunenaTools::fbGetInternalTime()) {
$allowEdit = 1;
}
}
}
}
if (!$allowEdit == 1)
[/code]
2: message.php (/components/com_kunena/template/default_ex/) * NB: default_ex must be the template you are using)
2.1) Find:
[code]
if ($msg_edit) {
echo " | " . $msg_edit;
[/code]
2.2) Change to:
[code]
if ($msg_edit) {
echo " | " . $msg_edit;
echo " | " . $msg_delete;
[/code]
3: view.php (/components/com_kunena/template/default_ex/) * NB: default_ex must be the template you are using)
3.1) Find:
[code]
if($allowEdit)
{
$msg_edit = CKunenaLink::GetTopicPostLink('edit', $catid, $fmessage->id , $fbIcons['edit']?'':_GEN_EDIT);
[/code]
3.2) Change to:
[code]
if($allowEdit)
{
$msg_delete = CKunenaLink::GetTopicPostLink('delete', $catid, $fmessage->id , $fbIcons['delete']?'':_GEN_DELETE);
$msg_edit = CKunenaLink::GetTopicPostLink('edit', $catid, $fmessage->id , $fbIcons['edit']?'':_GEN_EDIT);
[/code]
Tuesday, February 2, 2010
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
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);
?>
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
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)
< ?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
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:
Directly under these 2 lines you need to add:
It will now look like:
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);
Subscribe to:
Posts (Atom)