Breathing Spring

Get Num Rows in joomla

No Comments »

March 8th, 2009 Posted 12:01 pm

$db =& JFactory::getDBO();
$query=”select * from #__ etc….’”);
$db->setQuery($query);
$db->Query();
if($db->getNumRows()>0)

As usual silly but I would rather to show code than spending time talking, hope I made it clear

Posted in Joomla

Template URL for joomla

No Comments »

February 15th, 2009 Posted 9:40 am

to get template for URL in joomla

$tmpTools->templateurl()

Posted in Joomla

A quick sample of How to user loadRow and Root Directory

No Comments »

December 15th, 2008 Posted 3:03 pm

$query=”select userid, pgitemfilename from “.$this->_table_prefix.”profilegallery where id=”.$id;
$this->_db->setQuery( $query );
$this->_db->query();
$row=$this->_db->loadRow();
$pgitemfilename=$row[1];
$userid=$row[0];

unlink( JPATH_ROOT.DS.”images”.DS.”comprofiler”.DS.”plug_profilegallery”.DS.$userid.DS.$pgitemfilename);
unlink( JPATH_ROOT.DS.”images”.DS.”comprofiler”.DS.”plug_profilegallery”.DS.$userid.DS.”tn”.$pgitemfilename);

Posted in Joomla

Insert or Replace Plus adding string to string in mysql

No Comments »

December 5th, 2008 Posted 8:06 am

INSERT INTO answers( player, answer )
VALUES (
‘lamis’, ‘-1-0′
) ON DUPLICATE
KEY UPDATE answer = CONCAT(answer, ‘-1-0′)

Posted in mysql

Adding a comment in Zend

No Comments »

November 17th, 2008 Posted 3:26 am

There are two ways of adding comments in Zend development

1- Comment a line (ctrl + / )

2- Comment a block , then it will be ( ctrl + shift + / )

Posted in Zend

Protected: delicate dream

Enter your password to view comments

September 23rd, 2008 Posted 10:26 am

This post is password protected. To view it please enter your password below:


Posted in Personal

Joomla substitue for $_GET and $_POST

No Comments »

September 18th, 2008 Posted 8:01 am

instead of using $_GET, and $_POST in jooma, the frame work use instead JRequest::getVar

actually, I found no reason at first to change $_GET and $_POST with that long string, especially that I’m not a big fan of memorizing things. Frankly, the interesting part about this long function is that it protect your Joomla system from Sql injection, or any sinister undesired passed string.

How does it protect it? I didnt go into the core of this function but I believe its some secure code that stripes tags.

The simplest way to use the function is :

$var = JRequest::getVar( 'var' );

Posted in Joomla

hide show div in javascript

No Comments »

September 17th, 2008 Posted 9:02 am

<script language="javascript">
function toggle() {
	var ele = document.getElementById("toggleText");
	var text = document.getElementById("displayText");
	if(ele.style.display == "block") {
    		ele.style.display = "none";
		text.innerHTML = "show";
  	}
	else {
		ele.style.display = "block";
		text.innerHTML = "hide";
	}
}
</script>
<a id="displayText" href="javascript:toggle();">show</a> <== click Here
<div id="toggleText" style="display: none"><h1>peek-a-boo</h1></div>

another option would be

<script language='javascript'>
			function showme() {
			var ele = document.getElementById('hideme');
	   		ele.style.visibility = 'visible';

			}
			function hideme() {
			var ele = document.getElementById('hideme');
	   		ele.style.visibility = 'hidden';

			} 

</script>

Posted in javascript

TinyMCE Joomla Read more problem

No Comments »

September 16th, 2008 Posted 6:51 am

Giving an hr instead of read more?

The problem seems to be that TinyMCE is cleaning the backslash from the

<hr id="system-readmore" />

tag upon save, even though the ‘cleanup on save’ plugin parameter has been set to ‘Never’.

Or, has the joomla code that checks for the readmore tag when it writes an article to the database become more restrictive? Before did it recognize

<hr id="system-readmore">

and now it only recognizes

<hr id="system-readmore" />

Posted in Joomla

Adding Page to Zen Cart 1.3.8

No Comments »

September 5th, 2008 Posted 8:31 pm

create your html includes file – it is a blank file named define_shopping_cart.php
upload that to your includes/language/english/html_includes and to includes/language/english/html_includes/your folder.

Edit includes/modules/pages/shopping_cart/header.php.php. Add this line
// include template specific file name defines
$define_page = zen_get_file_directory(DIR_WS_LANGUAGES . $_SESSION['language'] . ‘/html_includes/’, FILENAME_DEFINE_SHOPPING_CART, ‘false’);
before
// This should be last line of the script:
$zco_notifier->notify(‘NOTIFY_HEADER_END_SHOPPING_CART’);
———————
Edit includes/filenames.php – add
define(‘FILENAME_DEFINE_SHOPPING_CART’, ‘define_shopping_cart’);
be nice to yourself and put it in alphabetically- line 68

OR

includes/extra_datafiles/define_shopping_cart_filenames.php

with at least this in it
<?php
define(‘FILENAME_DEFINE_SHOPPING_CART’, ‘define_shopping_cart’);
?>

————————


Edit includes/templates/your folder/templates/tpl_shopping_cart_default.php.
line 33
Replace <?php echo TEXT_INFORMATION ?> with <?php echo define_page ?>

Posted in Zen Cart