virtuemart empty cart link

go to /components/com_virtuemart/controllers/cart.php and add this fuction

public function deleteall() {
$mainframe = JFactory::getApplication();

$cart = VirtueMartCart::getCart();
$cart->emptyCart();
$mainframe->redirect(JRoute::_(‘index.php?option=com_virtuemart&view=cart’));
}

Go to your cart template and add

<a title=“<?php echo JText::_(‘COM_VIRTUEMART_CART_DELETE’) ?>“ align=“middle“ href=“<?php echo JRoute::_(‘index.php?option=com_virtuemart&view=cart&task=deleteall’) ?>“><i></i></a>

С етикет: , , ,
Публикувано в Joomla

run joomla plugin in component module or virtuemart template

$text = JHTML::_(‘content.prepare’, $text );

С етикет: , , , , ,
Публикувано в Joomla

untar only one directory

This is how to extract only one directory with all files from tar archive

tar xf rosen4o-01Dec.tar home/www/root/

С етикет: , , , ,
Публикувано в linux

rrdtool negative value

I have one rrd file in which store information about outside temperature.
Now the temperature is negative so I have problem with storing negative values.
The problem is fixed with rrdtool tune

rrdtool tune temperature.rrd -i temp:-20

С етикет: , , , , ,
Публикувано в linux

mod_evastive

cd /usr/local/src

Download the module
wget http://www.zdziarski.com/blog/wp-content/uploads/2010/02/mod_evasive_1.10.1.tar.gz

Untar
tar zxvf mod_evasive_1.10.1.tar.gz

Go to the folder
cd mod_evasive

Compile it
/usr/sbin/apxs -cia mod_evasive20.c

Add to apache config file
/etc/httpd/conf/httpd.conf

<IfModule mod_evasive20.c>
DOSHashTableSize 3097
DOSPageCount 6
DOSSiteCount 100
DOSPageInterval 2
DOSSiteInterval 2
DOSBlockingPeriod 600
DOSEmailNotify root@domain
</IfModule>

Restart apache
/etc/init.d/httpd restart

You can test the modules with
perl test.pl

С етикет: , , , ,
Публикувано в linux