Tuesday, 17 January 2012

joomla add script and css in module

$document =& JFactory::getDocument();
$document->addStyleSheet(JURI::root().'media/system/css/calendar.css');
$document->addScript(JURI::root().'media/system/js/calendar_shift1.js');
$document->addScript(JURI::root().'media/system/js/validation.js');

joomla default error message popup, joomla error message popup , joomla username password not matching error message

ADD in head



 <?php
JHTML::_('behavior.mootools');
JHTML::_('behavior.modal');
?>
<?php
if ($this->getBuffer('message')) : ?>
<script type="text/javascript">
window.addEvent('domready', function() {
var myel = new Element('a',{'href':'#error_info'});
SqueezeBox.fromElement(myel,{
handler:'adopt',
adopt:'error_info',
});
});
</script>
<?php endif; ?>


ADD after body

<div style="display:none;">
<div id="error_info"><jdoc:include type="message" />
</div>

change password(admin) drupal

UPDATE users SET pass = MD5('newpassword') WHERE uid=1

Thursday, 12 January 2012

redirect a site on www using .htaccess

RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.urbankingsinc\.com)?$
RewriteRule (.*) http://www.urbankingsinc.com/store/$1 [R=301,L]

Monday, 24 October 2011

javascript for conformation on deleting


<script LANGUAGE="JavaScript">
<!--
function confirmSubmit(ttt,id) {
var msg = "Are you sure you want to delete the data ? " + ttt + " - ID= "+id;
var agree=confirm(msg);
if (agree)
return true ;
else
return false ;
}
// -->
</script>



<td><a onClick="return confirmSubmit('<?php echo $row['id']; ?>','<?php echo $row['name']; ?>')" href="delete.php?id=<?php echo $row['id']; ?>"><strong>Delete</strong></a></td>

Wednesday, 14 September 2011

get image upload path for joomla

$folderpath = JPATH_SITE.DS.'components' . DS . 'com_virtuemart' . DS . 'shop_image'. DS .'product/';Barefoot: A Novel

Thursday, 8 September 2011

inner join on more then two tables in php


select k2.id, k2.title, k2.extra_fields from jos_k2_items as k2
INNER JOIN jos_vm_order_item as oitem ON oitem.order_item_name=k2.title
INNER JOIN jos_vm_orders as orders ON orders.order_id=oitem.order_item_id
where orders.user_id=62