Thứ Tư, 29 tháng 10, 2014

Jquery replace tag by new tag HTML

Des: replace tag with new tag
Example: change all from h2 to h1 tag
Script:
$('h2').each(function () {
        $(this).replaceWith( "<h1>" + $(this).html() + "</h1>" );
});

Thứ Ba, 21 tháng 10, 2014

Module add field editor safe html


File edit: module .xml
Add field:
<field
name="field_name"
type="editor"
label="Editor"
description="Editor" width="300" 

filter="safehtml" />

Description: filter="safehtml": save html not clear inner tag.

Thứ Sáu, 17 tháng 10, 2014

Jevent module calendar Joomla 3.x link hover inner


File edit: modules\mod_jevents_cal\tmpl\default\calendar.php
Line 398:
$content .= $this->htmlLinkCloaking($currentDay["link"], $currentDay['d'], array('class'=>"mod_events_daylink",'title'=> JText::_('JEV_CLICK_TOSWITCH_DAY')));
//Check Recorrd>d                           
if(count($currentDay['events'])){   
    $content .= '<div class="event_items_container"><div class="inner">';   
    foreach ($currentDay['events'] as $row) {                                   
        $content .= '<div class="event_item">';
            $content .= '<div class="event_title">'.$row->title.'</div>';
            $content .= '<div class="clr"></div><div class="event_buttons">';
        //AssigleModulRegiser
                $content .= '<a class="register_button" href="'.$row->link().'">Register here</a>';
                $content .= '<a class="viewdetail_button" href="'.$row->link().'">View details</a>';
            $content .= '<div class="clr"></div></div>';
        $content .= '</div>';
}
$content .= '</div></div>';

Thứ Tư, 15 tháng 10, 2014

RSFORM Calandar choose date future only



Step1: calendar field-> atributes->min date set: 01/01/2012
Step2 : Components > RSForm!Pro > Manage forms > select your form > Properties > PHP Scripts
add code:
$futureDate = date('m/d/Y', strtotime("+2 days"));  
$formLayout = str_replace("{'mindate': '01/01/2012'}", "{'mindate': '".$futureDate."'}", $formLayout);


Explain: this code will be replace time 01/01/2012 with new date setting
This code from: http://www.rsjoomla.com/support/documentation/view-article/706-how-can-i-prevent-the-user-from-selecting-a-date-in-the-calendar-field.html

Thứ Bảy, 11 tháng 10, 2014

com_guru 3.2.0.1 create new teacher error

Detail: Create new teacher, input form -> click button -> view error: ...
SQL=insert into _user_usergroup_map(`user_id`, `group_id`) values('870', '6')

Reason: teacher change group to register
Solved: joomla administrator->component menu->com Guru->Setting->Teacher->choose group register

Thứ Tư, 8 tháng 10, 2014

com_communityquiz version 3.1.8 SEF URL not work

File edit: components\com_communityquiz\router.php
Line 107
Remove:
if($vars['task'] == 'quiz'){   
    switch($vars['task']){       
        case 'tag':
            $vars['id']     = $segments[1];
            break;
        default:
            $vars['id']     = $segments[1];
            $vars['catid']    = $segments[1];
            break;
    }
}

Replace: //just remove if condition
switch($vars['task']){       
    case 'tag':
        $vars['id']     = $segments[1];
        break;
    default:
        $vars['id']     = $segments[1];
        $vars['catid']    = $segments[1];
        break;
}