Archive

Archive for the ‘Joomla 1.5’ Category

Joomla and CodeSniffer

June 19, 2012 1 comment

Joomla provides custom coding standard for the PHP CodeSniffer, read more about CodeSniffer. Download Joomla coding standard from here Joomla coding standards for more information see here. Read Joomla coding standards here.

Login in Joomla 1.5 through curl

December 1, 2011 3 comments

First of all we need three inputs.
$uname = “test”;
$upswd = “123456”;
$url = ‘http://localhost/joomla/index.php?option=com_user&view=login’

//Initialize curl. This is one time curl session no need another session.
$ch = curl_init();

//Try to loging in[Joomla]
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE );
curl_setopt($ch, CURLOPT_COOKIEJAR, ‘./cookie.txt’);
curl_setopt($ch, CURLOPT_COOKIEFILE, ‘./cookie.txt’);
curl_setopt($ch, CURLOPT_HEADER, FALSE );
$ret = curl_exec($ch);//access login page
if (!preg_match(‘/name=”([a-zA-z0-9]{32})”/’, $ret, $spoof)) {
preg_match(“/name='([a-zA-z0-9]{32})’/”, $ret, $spoof);
}
// Collecting all POST fields
$postfields = array();
$postfields[‘username’] = $uname;
$postfields[‘passwd’] = $upswd;
$postfields[‘lang’] = ”;
$postfields[‘option’] = ‘com_user’;
$postfields[‘task’] = ‘login’;
$postfields[$spoof[1]] = ‘1’;
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
$ret = curl_exec($ch);//Get result after login page.
//Close curl and free server recourses.
curl_close($ch);

Categories: Joomla 1.5

Module creator

July 8, 2011 3 comments

This is a tool that will cut some time of work of any custom Joomla Module development. Simply enter the name of your new Joomla 1.5 module and this tool will create a ready to install zip file with all the right files inside all correctly extending the right classes etc.

Follow this link to create module Joomla 1.5 or create module Joomla 1.7 .

Open modal box window

March 5, 2010 Leave a comment

ModalBox is a JavaScript technique for creating modern (Web 2.0-style) modal dialogs or even wizards (sequences of dialogs) without using conventional popups and page reloads. Joomla gives simple way to open this window it uses moo tool’s library. Let’s start ..

To open modal box add this very top of your template in php tag.
JHTML::_(‘behavior.modal’);
Now you are ready to open modal box window.
Write this code ……….
in anchor tag
href=”your Url” rel=”{handler:’iframe’, size:{x:500, y:500}}” close anchor.
To close modal window
window.parent.document.getElementById(‘sbox-window’).close();

To open modal box add this very top of your template in php tag.JHTML::_(‘behavior.modal’);
Now you are ready to open modal box window.Write this code ……….in anchor taghref=”your Url” rel=”{handler:’iframe’, size:{x:500, y:500}}” close anchor.

To close modal windowwindow.parent.document.getElementById(‘sbox-window’).close();

How to Add Fields in Registration Form

November 18, 2009 Leave a comment

soon!

Send mail through Joomla 1.5

November 18, 2009 Leave a comment

Joomla gives simple way to send e-mail. Do not need to write multi line code, write one line code and send e-mail. Follow these steps ..

Step 1. First of all include utility class if it is not included.
jimport(‘joomla.utilities.utility’);

Step 2. Now call this function :
JUtility:: sendMail($from, $fromname, $recipient, $subject, $body, $mode, $cc, $bcc, $attachmentl, $replyto, $replytoname) ;

these are optional parameters
$mode=0, (default is ‘0’(zero) for plain text, 1 for html text)
$cc=null,
$bcc=null,
$attachment=null,
$replyto=null,
$replytoname=null

Joomla 1.5x Importent variable and object

November 10, 2009 Leave a comment

Receive variable:
$variable  =  JRequest::getCmd(‘name’, ‘default’, ‘hash’);
$variable  =  JRequest::getInt(‘name’, ‘default’, ‘hash’, ‘mask’);
$variable  =  JRequest::getString(‘name’, ‘default’, ‘hash’, ‘mask’);

Get database information through  database object:
$database  = &JFactory::getDBO();

Get Current user information through user object:
$user          = &JFactory::getUser();

Categories: Joomla 1.5
%d bloggers like this: