Skip to content

Instantly share code, notes, and snippets.

View idea34's full-sized avatar

Mike Wilson idea34

  • Massachusetts, USA
View GitHub Profile
@idea34
idea34 / Joomla.php
Created December 15, 2012 20:47
Useful Joomla snips
<?php
// Change Joomla user groups programatically
jimport('joomla.user.helper');
JUserHelper::removeUserFromGroup($user_id, $group_id);
JUserHelper::addUserToGroup($user_id, $group_id);
// Get a user's view levels
@idea34
idea34 / useful.php
Created December 10, 2012 16:10
useful php items
<?php // Collection of useful php snippets
// html readable print_r for arrays
echo '<pre>';
print_r($myarray);
echo '</pre>';
?>
@idea34
idea34 / htacess_bot_blocker
Created November 18, 2011 20:53
Add to .htaccess to block common bad bots
#Block comment spammers, bad bots and some proxies
RewriteCond %{REMOTE_HOST} 24.117.121.113 [OR]
RewriteCond %{REMOTE_HOST} ^211.138.198.* [OR]
RewriteCond %{REMOTE_HOST} 216.246.60.183 [OR]
RewriteCond %{REMOTE_HOST} 203.94.229.227 [OR]
RewriteCond %{REMOTE_HOST} 91.121.3.29 [OR]
RewriteCond %{REMOTE_HOST} 210.0.141.247 [OR]
RewriteCond %{REMOTE_HOST} 210.197.97.67 [OR]
RewriteCond %{REMOTE_HOST} 74.95.182.57 [OR]
RewriteCond %{REMOTE_HOST} 222.36.12.42 [OR]
@idea34
idea34 / Joomla_install_htaccess
Created November 18, 2011 20:50
Joomla .htaccess file changes that may help during the install process
# add these to the standard Joomla .htaccess file, depending on the errors you get
# you'll either get a server error or the install warnings will go away
# Replace 'yoursite.com' if you use the fourth one
php_flag register_globals off
php_flag magic_quotes_gpc on
php_flag display_errors on
php_value session.save_path "/var/www/vhosts/yoursite.com/httpdocs/tmp"