Image Caption

Friday, August 10, 2012

Joomla 2.5 Lightbox Tell a Friend Module [Free]

Feature of Popup Tell a Friend Module
1. Open in Lightbox
2. Change Lightbox width, height, and style
3. Share the current page link


Click to Download [File >>> Download]

Thursday, August 9, 2012

Chronoform dynamic field with validation [Demo Code]

Easy way to add dynamic field validation to chronoform 

<script type="text/javascript">
 function addfieldcat() {
 var comcat= jq("select[name=ComCategory]").val();
if(comcat=="Animation") {
jq('.comcat_ani').toggle({display: 'block'});
 jq('.comcat_arc').css({display: 'none'});
 jq('.comcat_man').css({display: 'none'});
}
 if(comcat=="Manufacturing") {
jq('.comcat_man').toggle({display: 'block'});
jq('.comcat_ani').css({display: 'none'});
jq('.comcat_arc').css({display: 'none'});
}
 if(comcat=="Architecture") {
 jq('.comcat_arc').toggle({display: 'block'});
 jq('.comcat_ani').css({display: 'none'});
 jq('.comcat_man').css({display: 'none'});
 }
if(comcat=="Please Select")
{
jq('.comcat_ani').css({display: 'none'});
jq('.comcat_man').css({display: 'none'});
 jq('.comcat_arc').css({display: 'none'});
 }
 }
 </script>

<div style="background:#fff;color:#000; padding:100px;">
<div style="" id="autoID-ec36e458c4ffaca305dc9310e8acf92c_container_div" class="ccms_form_element cfdiv_select"><label>Competition category : </label><select  name="ComCategory" container_id="0" title="" class="validate['required']" onchange="addfieldcat();" size="1" >
<option value="">Please Select</option>
<option value="Animation">Animation</option>
<option value="Manufacturing">Manufacturing</option>
<option value="Architecture">Architecture</option>
</select>
<div class="clear"></div><div id="error-message-input_select_39"></div></div>



<div class="comcat_ani" style="display:none;">
<div style="" id="autoID-5c2e6f2a9946f83772d6d63d9a774efd_container_div" class="ccms_form_element cfdiv_text"><label>Youtube URL 1 :</label><input type="text" name="YoutubeURL1" value="" container_id="0" title="" class="step2" size="30" maxlength="150">
<div class="clear"></div><div id="error-message-YoutubeURL"></div></div>
</div>

<div class="comcat_man" style="display:none;">
<div style="" id="autoID-5c2e6f2a9946f83772d6d63d9a774efd_container_div" class="ccms_form_element cfdiv_text"><label>Youtube URL 2 :</label><input type="text" name="YoutubeURL2" value="" container_id="0" title="" class="step2" size="30" maxlength="150">
<div class="clear"></div><div id="error-message-YoutubeURL"></div></div>
</div>

<div class="comcat_arc" style="display:none;">
<div style="" id="autoID-5c2e6f2a9946f83772d6d63d9a774efd_container_div" class="ccms_form_element cfdiv_text"><label>Youtube URL 3 :</label><input type="text" name="YoutubeURL3" value="" container_id="0" title="" class="step2" size="30" maxlength="150">
<div class="clear"></div><div id="error-message-YoutubeURL"></div></div>
</div>
<input name="input_submit_11" class="" value="Submit" type="submit" container_id="0">
</div>

Joomla Multilanguage login redirect issue [solved]

Step:1
Open the file: home directory/components/com_users/controllers/user.php

Step:2
Search the below code near line:61

// Perform the log in.
if (true === $app->login($credentials, $options)) {
// Success
$app->setUserState('users.login.form.data', array());
$app->redirect(JRoute::_($app->getUserState('users.login.form.return'), false));
} else {
// Login failed !
$data['remember'] = (int)$options['remember'];
$app->setUserState('users.login.form.data', $data);
$app->redirect(JRoute::_('index.php?option=com_users&view=login', false));
}

Step:3
After login  redirect to Home page and same language

$reu=JRequest::getVar('lang', '', 'get', 'lang');
$app->redirect('index.php?lang='.$reu);

Replace the below line with above code

$app->redirect(JRoute::_($app->getUserState('users.login.form.return'), false));


Joomla redirect after login [Custom Url]


Step:1
Open the file: home directory/components/com_users/controllers/user.php


Step:2
Search the below code near line:61

// Perform the log in.
if (true === $app->login($credentials, $options)) {
// Success
$app->setUserState('users.login.form.data', array());
$app->redirect(JRoute::_($app->getUserState('users.login.form.return'), false));
} else {
// Login failed !
$data['remember'] = (int)$options['remember'];
$app->setUserState('users.login.form.data', $data);
$app->redirect(JRoute::_('index.php?option=com_users&view=login', false));
}


Step:3

After login set a Custom redirect

$app->redirect('index.php?option=com_chronocontact&chronoformname=Contact&Itemid=5&lang=en');

Replace the below line with above code

$app->redirect(JRoute::_($app->getUserState('users.login.form.return'), false));


Wednesday, August 8, 2012

Store Multi language form to mysql Database Table

1. Create New table to Store Multi language form 

-----Query to create table-----

CREATE TABLE ` TableName ` (

  `user_id` int(20) NOT NULL,
  `permissions` varchar(20) character set utf8 collate  utf8_bin default NULL,
  PRIMARY KEY  (`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


2. Store Multi language form to Already Exit mysql table

1. Login to phpmyadmin
2. open the site database
3. Select Structure tab [Right side menu]

4. It show the list of cell in the table
5. Click the Check All link [Bottom of the listed cell ]
6. Click Change icon [right side to the check all link]
7. Change the all Collation column value to uft8_bin then click save [bottom]

Thursday, August 2, 2012

Joomla redirect after email activation

[Note: Tested in Joomla 2.5]
Step:1
Open the file: home directory/components/com_users/controllers/registration.php


Step:2
Search the below code near line:68


if ($useractivation == 0)
{
$this->setMessage(JText::_('COM_USERS_REGISTRATION_SAVE_SUCCESS'));
$this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false));
}
elseif ($useractivation == 1)
{
$this->setMessage(JText::_('COM_USERS_REGISTRATION_ACTIVATE_SUCCESS'));
$this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false));
}
elseif ($return->getParam('activate'))
{
$this->setMessage(JText::_('COM_USERS_REGISTRATION_VERIFY_SUCCESS'));
$this->setRedirect(JRoute::_('index.php?option=com_users&view=registration&layout=complete', false));
}
else
{
$this->setMessage(JText::_('COM_USERS_REGISTRATION_ADMINACTIVATE_SUCCESS'));
$this->setRedirect(JRoute::_('index.php?option=com_users&view=registration&layout=complete', false));
}

Step:3

After email activation. set Custom redirect to home page

$this->setRedirect('index.php');

Replace the below line with above code

$this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false));