Archive for September, 2008

Protected: delicate dream

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


Joomla substitue for $_GET and $_POST

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' );

hide show div in javascript

<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>

TinyMCE Joomla Read more problem

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" />

Adding Page to Zen Cart 1.3.8

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 ?>

Zen Cart Cheat Sheet

Remove number of sub-categories :

Admin -> Config -> My Store -> Show Category Counts Set to false

Remove the -> (arrow sign) from sub categories:

admin -> configuration -> layout setting – > categories separator.

Remove Sidebox Header :

#categoriesHeading {
display: none;
}

New products box-2 columns instead of 3:

admin -> configuration -> Index listing -> New Products Columns per Row

Image with no borders : img {border: none;}

Zen_image with Align : zen_image(DIR_WS_CATALOG_IMAGES . PRODUCTS_IMAGE_NO_IMAGE, $pInfo->products_name, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, ‘align=”right” hspace=”5″ vspace=”5″‘)

Adding ID to zen_draw_input_field

zen_draw_input_field(‘fax’, ”, ‘id=”fax”‘)

Main File Locations:

Index body location : templates/tpl_index_default.php

Rokbridge Fatal Error in distribution/includes/db/dbal.php on line 602

In /plugins/user/phpbb3.php, replace line 92:

if(!isset($userid)) {

with:

if (( ! isset( $userid )) || ( strlen( $userid ) == 0 )) {              // it's set, but has no value

It’s the only (isset($userid)) in the file, so should be easy to find.

Get one row values

$result=query(“SELECT * FROM cmspages where page_id=$page_id”);
$row= mysql_fetch_array(($result);
$row['page_name'];

Main MySql Queries

Insert Query :

insert into $table (something,otherthing) values (‘$new’,'$new2′)

Select Query

Select * from $table where something=something

Update query:

Update $table  set feild1=value1 , feild2=value2 where something= something

delete query :

delete * from table where something=something

Return top

INFORMATION

Change this sentence and title from admin Theme option page.