Monday, September 13, 2010

Print Mysql Database Structure Using PHP

 <?php  
 $HOSTNAME          = 'localhost';  
 $USERNAME          = 'root';  
 $PASSWORD          = '';  
 $DBNAME               = 'rizvi_test_db';  
  mysql_select_db($DBNAME, mysql_connect($HOSTNAME, $USERNAME, $PASSWORD)) or die(mysql_error());   
  $result = mysql_query("SHOW TABLES;") or die(mysql_error());   
   while($row = mysql_fetch_array($result)){  
  echo $row[0]; //print the table name  
  $result2 = mysql_query("DESCRIBE ".$row[0].";") or die(mysql_error()); //get details schema for each table  
  echo "<table border='1' width='70%'>";  
  echo "<tr><td>Field</td><td>Type</td><td>Null</td><td>Key</td><td>Default</td><td>Extra</td>";  
  while($row2 = mysql_fetch_array($result2)){  
  for($i=0; $i<6; $i++){   
   if($row2[$i] == "" || $row2[$i] == NULL){  
   $row2[$i] = " ";  
   }  
  }    
  echo "<tr>";  
  echo "<td>".$row2[0]."</td><td>".$row2[1]."</td><td>".$row2[2]."</td><td>".$row2[3]."</td><td>".$row2[4]."</td><td>".$row2[5];  
  echo "</tr>";  
  }  
  echo "</table>";   
  echo "<br/>";  
 }  
 ?>  

Wednesday, September 01, 2010

How to remove mootools.js and caption.js from Joomla1.5 ?



 
 
  <script type="text/javascript" src="/media/system/js/mootools.js"></script>  
  <script type="text/javascript" src="/media/system/js/caption.js"></script>  
To remove above javascript's import, you just need to 
add the following code at the top of your template's index.php file.
 <?php   
           //remove mootools.js and caption.js  
           $headerstuff=$this->getHeadData();  
           reset($headerstuff['scripts']);  
           foreach($headerstuff['scripts'] as $key=>$value){  
            unset($headerstuff['scripts'][$key]);  
           }            
           $this->setHeadData($headerstuff);  
 ?>  

Thursday, May 27, 2010

മെയ്‌ 26 2009

അന്ന് "മെയ്‌ 26 2009 " , പ്രത്യേകിച്ചു ലക്ഷ്യ ബോധം മില്ലാതെ എഴുന്നേറ്റ ഒരു പകല്‍ .

Btech കഴിഞ്ഞിട്ടു ഒരു മാസം ആകാറായി , നാലഞ്ച് interview ഒക്കെ അറ്റന്‍ഡ് ചെയ്തു ചൊറിയും കുത്തിയിരിക്കുന്ന സമയം , മേനിയാന്നത്തെ പത്രതില്ലേ പരസ്യം കണ്ടു ഒരു PHP interview ന്നു എറണാകുളം പോകാന്‍ നില്‍ക്കുന്നു . കഴിയ്യില്ല് w3schools ന്നും അടിച്ചുമാറ്റിയ ചില PHP നോട്ട്സ് മാത്രം .

ഒരു തുള്ളി ജല പാനം പോലലും കഴിക്കാതെ intercity യിലല് ചാടി കയറി ..... 10 30 യോഒടെ EKM എത്തി ........... interview ക്ക് എത്തിപെട്ടത് ഒരു കൂതറ സ്ഥലത്ത് ....... അവര്‍ക്ക് 6000 രൂ വേണമെന്ന് ........ പോയി പണി നോക്ക്കാന്‍ പറഞ്ഞു ..

ഞാന്‍ ഇറങ്ങി .......... 2 : 15 ന്റെ നേത്രാവതിക്ക് .......കയറാം ...എന്ന് കരുതീ...എറണാകുള തില്ലേ ...ഒടുകത്ത ട്രഫ്ഫികും താണ്ടി .............2 : 15 ന്നു ......എത്തിയപോഴേക്കും ......ട്രെയിന്‍ അതാ പോകുന്നു

........അവസാനത്തെ boogie യും ലക്‌ഷ്യം വെച്ച് ഒരു സിനിമ style chasingനടുത്തി ............ ട്രെയിന്‍ ഇല്ലെക്ക് ചാടിയപ്പോഴേക്കും ........ റെയില്‍വേ പോലീസ് ന്റെ ലാത്തി ...എന്നെ വിഴുത്തി.......platform ഇല്ലെക്ക് തെറിച്ചു വീണ എന്നെ ഒരുത്തനും mind ചെയ്തില്ല .........പോരാത്തതിനു .......പോലീസ് കാരന്റെ ........തെറിയുംമ്മം

........ഒരു വിധം കഷ്ട്ടപെട്ടു .......bench ഇല്ലിരിന്നു ......... എന്നെനി അടുത്ത ട്രെയിന്‍ 4 :20 ന്നെ ഉളു ..... സമയം പോക്കന്‍ വേണ്ടി ...... ജോസ് jn ....left ഇല്ലോട്ടു ഒരു പിടിത്തം പിടിച്ചു ........ ഒരു ഒന്നൊന്നര കിലോ മീറ്റര്‍ ..... കഴിന്നു ... കൊച്ചിന്‍ Shipyard എതിയപോള് ..... ഒരു ആഗ്രഹം .........shipyard കാണണം ..............

തൊട്ടടുത്തുള്ള ....vallamattam estate 5th floorillu കയറി ........Shipyard കണ്ടു ..... കൊള്ളാം !!! ......... തിരിഞ്ഞു നോക്കിയപ്പോള്‍ ..അതാ അവിടെ ....ഒരു സോഫ്റ്റ്‌വെയര്‍ കമ്പനി .........

e2Mars ............ഏതായാലും അവിടെ എത്തി ..........ഒന്ന് കയരികളയാം എന്ന് കരുതി ............ Central Manager സതിഷ് ഫിലിപ്പ് ....... ഇന്നേ കണ്ടു ......കൊറേ സമസാരിച്ചു ....... .... ആദ്യം ഇംഗ്ലീഷ് ആയിരുന്നു ...പിന്നെ .......എന്റെ അവസ്ഥ കണ്ടു അങ്ങേരു മലയാളം ആക്കി .........

എന്റെ കാഴിച്ചപടുക്കള്‍ ....നന്നായി ബോധിച്ചു ........അങ്ങനേ എന്നെ അവിടെ ........ എടുത്തു ....... ഒരു മാസം ........ അപ്പ്രെന്ടിസയിട്ടുഇ .......... 5 ദിവിസം കൊണ്ട് php , html , css ..തുടങ്ങിയവ....പടിച്ചുവര്രാന്‍ പറഞ്ഞു ...........

1st ജൂണ്‍ ഇന് DOJ തന്നു ............

ഇന്നു "മെയ്‌ 26 2010 " ........ ഒരു വര്‍ഷം .......... കഴിഞ്ഞ 21 വര്‍ഷം ജീവിച്ചതിനെക്കള് കുടുതല്ല് ...ഞാന്‍ ജീവിച്ചു

............ കഥ തുടരും ........

Saturday, April 17, 2010

change all text in a column to caps

copy this
code...then go to your workbook...insert module...and paste the code there....Then come back to your workbook...and run the macro name change...it will change all the values in A Column starting from row-1 till last row in upper case...


Sub change()
Dim rng As Range, cell As Range
Set rng = Range("A1:A" & Cells(65536, "A").End(xlUp).Row)
For Each cell In rng
If (cell.Value <> "") Then
cell.Value = UCase(cell.Value)
End If
Next cell

End Sub

Load any module within a joomla 1.5 content article


One of the questions that often gets asked is "How can I load a Joomla! 1.5 Module into a content Article? This is in fact an easy thing to do, and can provide useful solutions such as:

  • Loading in a Paypal Module into an Article.
  • Displaying Advertising within your Content.
  • Including Adsense Modules within your Content Articles.
  • Displaying Audio and Video within Articles.

By default, Joomla! Modules can be placed in any Module Position of the Template, but they do not load into Content Articles.

This tutorial will explain how to enable and use Module loading within your Joomla! Articles, Here are the steps:

Step 1 - Create a new Module or Copy an existing one.

Within your Joomla! Administration, navigate to Extensions > Module Manager.

If you are creating a new Module, click on the New button at the top right of the screen, or you can put a tick in the box next to an existing Module and copy it using the Copy button.

Module in Article Toolbar

If you copy an existing Module, the new Module will be created or copied and placed within the Module listing.

Step 2 - Edit the Module

Module in Article Module ParametersIf you have created a new Module you will be ready to roll, but if you copied an existing Module click on the title of it to load the Module Edit Screen.

On the left side of the Module Edit Screen you will see some properties such as Module Title, Enabled, Module Position etc. Here is where the power of Joomla! shows itself. Usually we would just click on the Module Position field and select an available Module Position, but it is also possible to enter in your own value here as believe it or not, this field is editable!

We need to edit this field and enter in a custom Module Position Name which will be used for our in-content use. Instead of clicking on the Arrow next to this field, click on the text within the field, and enter in your own value such as, content_custommod

Module in Article - Module Field

If you need to make other changes to your Module parameters then do so and when you are finished, make sure you click the "SAVE" button at the top right of the screen. Your new custom module position will then be saved with this Module.

Step 3 - Check the Plugin

Module Article Plugin ParametersWithin the Administration, navigate to the Extensions > Plugin Manager. Search for a plugin named Content - Load Module, it may already be published but click on the Title of the Plugin to Edit. Once you are in the Plugin Edit Screen, on the right side you will see a list of available Plugin Parameters. Make sure that the option No Wrapping - raw output has been selected, and click Save on the Plugin.

Step 4 - Load Module in Article

Navigate to the Article Manager Screen, and Edit the Article you wish to load the Module within. Click on it's title to load the Article Edit Screen.

Within the desired location of the Article, enter the following syntax in, which is code to tell the Module to load.

Module in Article - Article Tagloadposition is a constant which activates the plugin. modulename is the custom position that we entered into our module field earlier. In our example we used: content_custommod, so the whole tag would look like: . Your Module has now been told to load into your custom Position, and with the help of the included Joomla! Plugin we have told our Article to show the Module in that position within our page. Refresh the front-end of your Joomla! website to see the module.

IMPORTANT NOTE: Do not enter in a common Template Module Position such as "Top" or "Left" into your loadposition tag. This may display all of the modules that are then set to show in that Position.

Monday, April 05, 2010

Tiny Mce Joomla 1.5 Editor Image Browse Is Not Working [SOLVED]

Well the problem is with flash. So if it is not working for you just do this


Go to: administration mode
Menu: Site, Global Configuration
Choose: Enable Flash Uploader [No]

Friday, April 02, 2010

Get Menu Alias in Joomla

function getAlias(){

$theMenu = JSite::getMenu();
$theActiveMenu = $theMenu->getActive();
return $theActiveMenu->alias;
}

Thursday, April 01, 2010

Access joomla session from external pages

define( '_JEXEC', 1 );

define('JPATH_BASE', dirname(__FILE__) );//this is when we are in the root

define( 'DS', DIRECTORY_SEPARATOR );

require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );

require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );

$mainframe =& JFactory::getApplication('site');

$mainframe->initialise();


$session =& JFactory::getSession();

$myUser = $session->get( 'myUser', 'empty' );

a good captcha php implementation link

http://www.white-hat-web-design.co.uk/articles/php-captcha.php

Tuesday, March 30, 2010

Load the Joomla scripts in a Non-Joomla PHP Script


define( '_JEXEC', 1 );
define( '_VALID_MOS', 1 );
// JPATH_BASE should point to Joomla!'s root directory
define( 'JPATH_BASE', realpath(dirname(__FILE__) .'/' ) );
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();
$user =& JFactory::getUser();
$session =& JFactory::getSession();

Joomla User Authentication Script For External websites

$query="SELECT password FROM `jos_users` WHERE username='".$_POST["userid"]."'";
$result = mysql_query($query);

if (mysql_num_rows($result)>0){
$dbpassword=mysql_result($result, 0);
mysql_close($link);
list($md5pass, $saltpass) = split(":", $dbpassword);
if ((md5($_POST["passwd"].$saltpass))==$md5pass) {
echo "Success" ;
} else {$messaggio="Password error:";}
}

Thursday, March 25, 2010

Saturday, January 02, 2010

Happy New Year To All

A new begining to me in the year 2010 . Resigned from e2Mars , kochi after 6 months. And joined GreenLemon at calicut , a more proffessional IT company. Joined there as PHP Developer