Thứ Sáu, 26 tháng 12, 2014

Joomla Cache Image issue by AdminTool

Detail: Joomla Cache Image not view when using Admin Tool .htaccess
Reason: Admin tool create .htaccess file prevent view image at cache folder
Solution: Administrator->Component->Admin tool->.htaccess Maker-> Front End directory->Add item cache
Screen guide:

Chủ Nhật, 7 tháng 12, 2014

RSFirewall clear IFRAME

Mô tả: Bài viết sau khi lưu mất iframe.
Lưu ý: ở đây không giống như editor clear iframe. Ở đây là do RSFirewall. Giống như là thêm 1 cấp clear nữa.

Cách xử lý: Vào RSFirewall->BlackList/WhiteList->New->Get current Ip->Set WhiteList ok
Nguyên nhân: Vì tăng cường bảo vệ site RSFirewall clear nội dung. Khi nhận thấy IP trong whitelist sẽ cho phép mà không clear-> giữ được iframe.


Thứ Năm, 6 tháng 11, 2014

Stick menu - short code

Stick menu : demo http://jsfiddle.net/uFq2k/
Desription: Location menu: get offset. Check scroll > current location use new style.

Using JQuery
$(function(){
        // Check the initial Poistion of the Sticky Header
        var stickyHeaderTop = $('#stickyheader').offset().top;
        $(window).scroll(function(){
                if( $(window).scrollTop() > stickyHeaderTop ) {
                        $('#stickyheader').css({position: 'fixed', top: '0px'});
                } else {
                        $('#stickyheader').css({position: 'static', top: '0px'});
                }
        });
  });

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

Thứ Bảy, 27 tháng 9, 2014

Elevate Zoom - Jquery gallery


Mô tả:
Jquery image hover zoom popup ra bên bên ngoài(outer) hoặc zoom bên trong (inner)
Chi tiết:
Trong quá trình thực hiện dự án gặp phải vấn đề zoom kiểu này có thể là Cloud Zoo, Elevate zoom. Theo quá trình tìm hiểu đã download nhiều thư viện thì cái này theo cá nhân ghi nhận là tốt và rõ ràng về source. Dễ trong sử dụng và đưa vào các đoạn script
Link trực tiếp download source : http://www.elevateweb.co.uk/image-zoom/examples

Thứ Sáu, 22 tháng 8, 2014

Joomla 2.5, joomla 3.x plugin loadmodule by name

Content plugin:
 {loadmodule mod_name,mod_title,style}
Mod name: folder mode name
Mod_title:user1,user2,user3,name1,name2,name3...
Style: xhtml,none

Example:
{loadmodule mod_articles_category,user1,xhtml}
{loadmodule mod_articles_category,user2,xhtml}
{loadmodule mod_login,newlogin,xhtml}

Chủ Nhật, 10 tháng 8, 2014

CSS3 text view multi column


Detail: view multi column the same on word (office). Auto height, and balance text all column
CSS:
.divContainer {
    -webkit-column-count: 2; /* Chrome, Safari, Opera */
    -moz-column-count: 2; /* Firefox */
    column-count: 2;
}

Thứ Ba, 29 tháng 7, 2014

Revolution Slider Upload local to host not view image

Detail: Upload local to host, run site. Slide not view. Check html view source wrong link.
Reason: revolution slide need replace string.
Example: http://localhost/site replace by http://domain.com/
Follow the image:

Thứ Năm, 24 tháng 7, 2014

Google map API key Localhost

Google Key javascript V3

AIzaSyBpj7u8XF6sgRzRRnAzmshjKCL3ihcmPH8

Thứ Ba, 15 tháng 7, 2014

Joomla 3.2 register frontend - login faild.

Mô tả: Joomla 3.2 register frontend - login faild.
Error detail: tài khoảng tạo ra sẽ có password ngắn hơn chuẩn.
Example:
Pass registration: 792cf33f581b4a127c80b503f16824cc
Pass standard: ea2715571f3ae14e1807d1dc67005a24:iHTtHgKspS0nSZAUGcTSkZEPoOGt57gq
Version Error: joomla 3.2

File edit:
Edit1: /libraries/joomla/user/helper.php:
line434: $encrypted = ($salt) ? md5($plaintext . $salt) : md5($plaintext);
Replace: $encrypted = ($salt) ? md5($plaintext . $salt) . ':' . $salt : md5($plaintext);

Edit 2:/libraries/joomla/user/user.php:
line625: $array['password'] = $crypt . ':' . $salt;
Replace: $array['password'] = $crypt;

Mark by: http://alterbrains.com/blog/100-joomla-3-2-passwords-issue-problem-solution

Thứ Năm, 10 tháng 7, 2014

CSS3 Gear Effect

Mô tả: Gear là hình bánh răng, gear effect : bánh răng chuyển động.Ở đây sử dụng CSS 3.
Kết quả:
CSS3 Gear Effect
HTML & CSS example:
<div class="GearContainer" style="height: 250px; position: relative;">
<div class="counterContainer">
<div class="gear" id="gear1">
</div>
<div class="gear" id="gear2">
</div>
<div class="gear" id="gear3">
</div>
</div>
</div>
<style type="text/css">

/*CounterPageGEAR*/
/* CSS3 keyframes */
@-webkit-keyframes ckw {
    0% {
        -moz-transform: rotate(0deg);
        -webkit-transform: rotate(0deg);
    }
    100% {
        -moz-transform: rotate(360deg);
        -webkit-transform: rotate(360deg);
    }
}
@-moz-keyframes ckw {
    0% {
        -moz-transform: rotate(0deg);
        -webkit-transform: rotate(0deg);
    }
    100% {
        -moz-transform: rotate(360deg);
        -webkit-transform: rotate(360deg);
    }
}
@-webkit-keyframes cckw {
    0% {
        -moz-transform: rotate(360deg);
        -webkit-transform: rotate(360deg);
    }
    100% {
        -moz-transform: rotate(0deg);
        -webkit-transform: rotate(0deg);
    }
}
@-moz-keyframes cckw {
    0% {
        -moz-transform: rotate(360deg);
        -webkit-transform: rotate(360deg);
    }
    100% {
        -moz-transform: rotate(0deg);
        -webkit-transform: rotate(0deg);
    }
}

/* gears */
.gear {
    float: none;
    position: absolute;
    text-align: center;

    -moz-animation-timing-function: linear;
    -moz-animation-iteration-count: infinite;
    -moz-animation-direction: normal;
    -moz-animation-delay: 0;
    -moz-animation-play-state: running;
    -moz-animation-fill-mode: forwards;

    -webkit-animation-timing-function: linear;
    -webkit-animation-iteration-count: infinite;
    -webkit-animation-direction: normal;
    -webkit-animation-delay: 0;
    -webkit-animation-play-state: running;
    -webkit-animation-fill-mode: forwards;
}
#gear1 {
    background: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQj-G_4sRwPWy9telLRspn4pv8JoemNUpemLaYH7BvPlw300OWfcxArkAr4HeKSxKTH3jqPFkfGqU_MQoIJOYy-VPhwGN_TqHPupsVved-cpdCXtGg5t5-Qdk1YUlhR1etusC6LNmdDxT_/s1600/g1.png') no-repeat 0 0;
    height: 85px;
 left: 170px;
    top: 110px;
    width: 85px;
   
    -moz-animation-name: ckw;
    -moz-animation-duration: 10s;

    -webkit-animation-name: ckw;
    -webkit-animation-duration: 10s;
}
#gear2 {
    background: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCLZjKT6BlyUHIHeR1q9SZcpAXbceKsKpg8gF2pbY3ZqOQCHMp-r7rsYjStmXaPicXwc1Sg_G04uQ8Pf4pCW0oWTdWqOFHT8ZZc4e6Kk16Gj4TPDdkuBeiPZNwV_RD0C-1E5oSgbq345kn/s1600/g2.png') no-repeat 0 0;
    height: 125px;
    left: 90px;
    top: 20px;
    width: 125px;
   
    -moz-animation-name: cckw;
    -moz-animation-duration: 16.84s;

    -webkit-animation-name: cckw;
    -webkit-animation-duration: 16.84s;
}
#gear3 {
    background: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyF6RpM_fEG2sIKt2Pzs0cPT9u6F00pVTnLyIjSOPFp8h76OeGTwKkf14UclmEfar90ojyM0HYFb1RRvHml8svH-OcDgNXh2AbWUerHySSdxn4BPxLBck6Pgi9ay84fdeWtjD5Du66iPYU/s1600/g3.png') no-repeat 0 0;
    height: 103px;
    left: 201px;
    top: 12px;
    width: 103px;
   
    -moz-animation-name: ckw;
    -moz-animation-duration: 13.5s;

    -webkit-animation-name: ckw;
    -webkit-animation-duration: 13.5s;
}</style> 

Tham khảo từ: http://www.script-tutorials.com/demos/247/index.html

Thứ Năm, 3 tháng 7, 2014

IE place holder issue fixed by script

Mô tả:  placeholder dùng tốt trong firefox, chrome, safary. Đối với <IE8 ko hỗ trợ.
Cách xử lý:  Đối với IE7,IE8 cần dùng thư viện hỗ trợ.
Download file script:
https://drive.google.com/file/d/0B785Epf6q5XlV2FFdUdzbGRqaEk/edit?usp=sharing
Load thư viện script vào template ->index.php: trong tag HEAD
<!--[if IE]>
        <script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/js/placeholders.jquery.min.js"></script>   
<![endif]-->

Thứ Ba, 1 tháng 7, 2014

Iframe YOUTUBE over menu - add param transparent

Mô tả: add iframe từ src youtube, flash youtube hiển thị phía trên menu.
Cách thực hiện: Youtube hỗ trợ thêm param thêm vào url ?wmode=transparent.

Example:
<iframe width="640" height="360" src="//www.youtube.com/embed/BdT_QY3o7fw?feature=player_detailpage&amp;wmode=transparent" frameborder="0" allowfullscreen="true"></iframe>

Thứ Sáu, 13 tháng 6, 2014

JShop image SEO name

Mô tả:
Tên MD5 ko tốt cho SEO site
/components/com_jshopping/files/img_products/e04a01a4138a5b598b0ea0583266ddf7.jpg
/components/com_jshopping/files/img_products/thumb_e04a01a4138a5b598b0ea0583266ddf7.jpg
Cách xử lý:
change name file:
components\com_jshopping\lib\uploadfile.class.php

row
var $file_name_md5 = 1;

change to

var $file_name_md5 = 0;
var $file_name_filter = 1;

Tham khảo tại link  http://www.webdesigner-profi.de/joomla-webdesign/joomla-shop/forum/posts/2/2868.html?lang=de

Chủ Nhật, 8 tháng 6, 2014

HTML Select Style CSS

Compatible: all browser
Example

HTML:
<div class="select_container">
    <select class="rsform-select-box">
        <option value="SELECT ONE...">SELECT ONE...</option>
        <option value="TYPE1">TYPE1</option>
        <option value="TYPE2">TYPE2</option>
        <option value="TYPE3">TYPE3</option>
    </select>
</div>

CSS:
.select_container{
    overflow:hidden;
}
.select_container{
    width:100%;
    background:url("../images/select_icon.png") no-repeat right center #d3d4d5;
}
.select_container select{
    width:120%;
    background: transparent;
    border: 0 solid;
}

HTML Radio Style CSS

Compatible: Firefox, chrome, safari, IE9++
Example

CSS:
input[type="radio"]{
    display:none;
}
input[type="radio"] + label{
    padding-left:25px;
    background:url("../images/option.png") no-repeat left top;
}
input[type="radio"]:checked + label{
    background-position: left bottom;
}

Thứ Sáu, 16 tháng 5, 2014

Hide text CSS

Mô tả: nhiều trường hợp cần ẩn text bên trong. Vì chỉ muốn can thiệp bằng css.
Lý do: hiệu chỉnh ở source tìm ra khó khăn, cách xử lý này phù hợp với vấn đề nhỏ. 
Khuyến cáo: xử lý vấn đề nhỏ để css vẫn mang tính chất rõ ràng.
ví dụ: 
a.button{
    text-indent: 100%;
    white-space: nowrap;
    overflow: hidden;
} 

Thứ Tư, 14 tháng 5, 2014

Joomla 3.3 Simple image gallery admin caption issue

Note: simple image gallery pro caption not save on joomla 3.3.
Cause: joomla 3.3 not load core.js
Location file edit : administrator\components\com_sigpro\views\view.php
Line 211 add:              $document->addScript('../media/system/js/core.js');

Thứ Sáu, 11 tháng 4, 2014

Module add Field Editor not remove HTML

Mô tả: thêm field dạng textarea có load editor để dễ dàng  hiệu chỉnh html.
file hiệu chỉnh: root/modules/mod_name/ ... .xml

Thêm vào :
<field filter="raw" name="textarea" type="editor" default="" label="View text area" description="View text area top module" />

ý nghĩa: filter="raw" joomla sẽ giữ lại cấu trúc html. Nếu ko có dòng filter="raw" thì clear html, lúc này chỉ dạng text ko có cấu trúc ko có style.

Lúc load lên trong folder view:
if($params->get('textarea')){
            echo '<div class="textareaTop">'.$params->get('textarea').'</div>';
}

Chủ Nhật, 6 tháng 4, 2014

Widgetkit Slideshow, slideset page Load height not auto

Mô tả: Widgetkit là component quản lý: slideshow, slideset, tabs, gallery, maps ... theo đánh giá qua nhiều dự án của mình là tốt, đáp ứng được nhiều chức năng. Mức độ ổn định cao.

Điểm yếu duy nhất và gặp thường xuyên: lúc Page load thì chiều cao, chiều rộng slide không đúng.
Cách xử lý: thêm 1 dòng code js

jQuery(window).bind("load", function(){ jQuery(window).resize(); }); 

Điều thú vị ở đây: cách xử lý từ nhóm viết Widgetkit là không có - rất ngạc nhiên khi tìm hiểu thì trên website wedgetkit cách xử lý lại từ 1 lập trình viên khác.
Câu lệnh không có gì đặc biệt vậy mà đáp ứng được hơn mong đợi. Cá nhân cũng cảm thấy vậy.

IE8 Scroll down issue

Mô tả: Scroll xuống bottom tự động nhảy lên, làm scroll có khoảng trống không nằm ở bottom được. Kéo chuột xuống dưới, nhả chuột tự động nhảy lên.
Cách xử lý bằng CSS
    <!--[if lt IE 9]>           
        <link rel="stylesheet" href="css/ie.css" type="text/css" />       
    <![endif]-->
trong file ie.css
/*scroll*/
html   {
    height:100%;
    margin-bottom:0px;
    overflow-y:scroll;
    overflow-x:hidden;
}
html body{
    height:100%;
}


Thứ Tư, 2 tháng 4, 2014

mod_articles_category view intro image

Load image intro trong module article category
Joomla 3.2
Mặc định thì module article category ko load hình ảnh intro (việc này ko biết vì sao joomla ko làm).
File chỉnh sửa: modules\mod_articles_category\tmpl\default.php
line 84 thêm code
<?php
            $images  = json_decode($item->images);
  ?>
            <img class="image_intro" src="<?php echo $images->image_intro; ?>" alt="<?php echo $images->image_intro_alt; ?>"/>   

Thứ Hai, 10 tháng 3, 2014

Module template selector - dành demo cho khách hàng

Module Template Selector
Có từ thời joomla 1.5 cho đến 2.5, 3.x

Module hiển thị selection box ngoài Front End để khách hàng chọn lựa, tùy theo chọn lựa sẽ hiển thị template.
Ví dụ khách hàng muốn xem 3 mẫu, và chọn lựa 1 mẫu phù hợp. Cách làm này rất trực quan, có khi vì điều kiện thời gian ko chuẩn bị kịp thì ... cung cấp bằng hình ảnh không thôi.


Joomla category, article, title, content Tiếng việt lưu xuống load lên thì mất tiếng Việt

Nguyên nhân:
Database đang set charset không phải là UTF8 (tiếng Việt thì dùng UTF8)
Cách thực hiện: tạo lại database, lúc tạo sẽ cho set charset chọn là UTF8-unicode-ci
Sau đó thì import hoặc set joomla lại bình thường.

Tại sao lại nên tạo mới lại database: vì database, table, field đều có cấu hình charset. Nếu vậy phải hiệu chỉnh tất cả tốt thời gian. Khi tạo mới lại database lúc đó chỉ phụ thuộc vào file import. Vả lại những category, article, title, content bị mất tiếng Việt cần phải nhập lại. Vì thế nên tạo mới database.

Chủ Nhật, 23 tháng 2, 2014

Joomla ERROR PAGE - Redirect to URL

File hiệu chỉnh: Hiệu chỉnh file templates/yourtemplate/error.php
Nguyên tắc hoạt động: khi jooml báo lỗi link sẽ chạy file error.php, lúc này file sẽ trỏ đến 1 bài viết trong joomla.
Mục đích: để giữ template hiển thị và style.
So sánh: có lợi hơn rất là là nhiều nếu redirect bằng html header <meta http-equiv="refresh" content="0; url=http://example.com/" />, lý do khi gặp file php là đang chạy ở server và redirect. Còn nếu chạy HTML Redirect thì lúc về đến client rồi mới redirect - lúc này người dùng sẽ thấy được trang trắng khoảng 1s.
Source:
<?php
$location=$this->baseurl.'/index.php?option=com_content&view=article&id=126&Itemid=718';
header("Location:".$location); /* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
exit;
?>

Thứ Hai, 17 tháng 2, 2014

joomla 3- Check is homepage

Joomla 3.x
Vào template index.php thên đoạn code. 
 
<?php
$app = JFactory::getApplication();
$menu = $app->getMenu();
if ($menu->getActive() == $menu->getDefault()) {
        echo 'This is the front page';
}

Thứ Hai, 10 tháng 2, 2014

Win XP - Không vào được facebook - cách xử lý

Vấn đề mình gặp phải, lâu lâu không vào được facebook. Nguyên nhân liên quan đến DNS bị chặn.
Cách xử lý là trỏ DNS Server đến nước ngoài, mình hay dùng là 8.8.8.8 của google

Chủ Nhật, 9 tháng 2, 2014

Joomla 2.5- Media manager Upload file format

Trong nhiều trường hợp cần hiệu chỉnh joomla 2.5 (joomla 1.5, hay 3.x gần giống) cho phép upload 1 số file chưa chưa cho phép.
Cách thực hiện:
Administrator->Menu content->media manager->Options->Legal extension(file types) thêm các tên file

Thứ Năm, 30 tháng 1, 2014

Background tr chrome image issue

Vấn đề gặp phải: background image <tr trình duyệt chrome tự động bắt đầu cho td. Làm cho image background lặp đi lặp lại.

Cách xử lý CSS:
tr{
    display:inline-table;
    width:598px;   
}


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

Joomla 3.x Tunr off all tooltip, Disable ToolTip

Hiệu chỉnh file libraries\cms\html\bootstrap.php
Đến function line 454 thay thế đoạn code:
    public static function tooltip($selector = '.hasTooltip', $params = array())
    {
        return;
    }

Thứ Ba, 21 tháng 1, 2014

Google Capchar key

Lưu trữ dùng để dùng nhanh captchar trong  Joomla

Public Key:  6LcPMusSAAAAAIGLcUhzWMYgfTYnr9qSk8gZQk8s
Private Key: 6LcPMusSAAAAABDF5OFfeqkrYKAhzK

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

joomla Error displaying the error page: Application Instantiation Error

Xử lý lỗi jooma 3.2 - gặp phải ngày 15 tháng 01 năm 2013
Xử lý lần lượt theo từng cách
1. Change file configuration.php $dbtype = 'mysqli'; đổi thành $dbtype = 'mysql';
2. Change đường dẫn tmp, logs đúng trên host
3. Kiểm configuration.php $dbprefix = 'xxxxx_'; thành $dbprefix = 'xxx_'; (nhiều kí tự xuống 3 kí tự - Trường hợp mình gặp giải quyết xong ở bước này)
4. Fix database trong admin của joomla tham khảo từ andrewbrettwatson.com
5. Fix database bằng phpmyadmin tham khảo từ andrewbrettwatson.com
Chọn table, xuống bên dưới cuối cùng sẽ có check all và select Repair table

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

Joomla - Easytagcloud giới thiệu

Căn bản nghĩa từ Tag: có nghĩa là thẻ. Thẻ dùng để phân loại ở đây là bài viết.
Thẻ này thường không cần định nghĩa sẵn mà hệ thống tự kiểm tra và tạo mới.
Sau đó thiết lập các liên kết các bài viết có cùng thẻ. Những bài viết có cùng thẻ sẽ được hiển thị như Loại, Phân vùng, Quốc gia, Tỉnh Thành, Kiểu, Kích thước...

Nguyên lý hoạt động: tự động lấy meta Keyword của bài viết tạo thành tag hiển thị ở module


Link download (Free) bản dùng chung joomla 2.5,3.x : http://www.joomlatonight.com/downloads/category/3-easytagcloud.html

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

Plugin mở rộng phần Assign menu

Tên extension: Advanced Module Manager Free
Chức năng: mở rộng module assign.
Phiên bản joomla hỗ trợ: 1.5, 1.6, 1.7, 2.5 ... 3.x
Link download: http://www.nonumber.nl/extensions/advancedmodulemanager
Cảm nghĩ cá nhân: đây là phần hỗ trợ tuyệt với đối với việc assign module (assign: ở đây có nghĩa là phân quyền hiển thị). Bình thường joomla có sẵn hỗ trợ module assign chỉ theo menu.  Ở đây extension hỗ trợ assign theo menu,category, article,user,language, ... thêm url.
Rất là tuyệt vời.


Sau khi setup thì vào Admin>module managerment>module sẽ có thêm phần mở rộng như hình:

Thêm module vào Article bài viết

Trong joomla có Content - Load Modules đây là plugin mặc định có sẵn của joomla.
Chức năng: load module vào trong bài viết với cấu trúc quy định
Cấu trúc:
Load module position {loadposition user1} load theo tên của postion
Modules by name {loadmodule mod_login} load theo loại module (giống tên folder trong modules/mod_name)

Hình ảnh bật plugin trong joomla 3.x


Thứ Ba, 7 tháng 1, 2014

Import RSS to Artilce by FeedGator

Giới thiệu:
FeedGator là 1 component có vài plugin hỗ trợ để import dữ liệu từ RSS đến category. Có cấu hình 1 số thông số mặc định.
Cách thực hiện thêm nhiều FEED url vào.
Import bằng tay.
Import tự động

Plugin mặc định:
Plugin Import vào article joomla
Plugin Import và K2 Item
Plugin Import auto (cái này chưa kiểm tra)

Download: http://joomlacode.org/gf/project/feedgator/frs/


Các phiên bản:
Joomla 2.5 download phiên bản feedgator2.x
Joomla 3.x download phiên bản  feedgator3.x

Hiệu chỉnh code đối với phiên  feedgator3.x mặc định có 1 lỗi:(vào thời điểm 07 tháng 01 năm 2013)
Thông báo lỗi:
Feed [object Object] (ID=1): Error -
Close this window
 
Cách fix:
Edit the file: /administrator/components/com_feedgator/models/feed.php
Line: 130
Find the:
function _setFolderParams($preview,&$fgParams) {
Replace with:
function _setFolderParams($preview,&$fgParams) {
jimport( 'joomla.filesystem.folder' );

Thực hiện thêm mới và import:
1. Tạo mới 1 category ví dụ: Facebook Category
2. Tạo mới feed theo hình ảnh
link rss của facebook ví dụ: http://www.facebook.com/feeds/page.php?format=atom10&id=5791561181

3. Ra ngoài nhấn import đợi kết quả.
4. Kiểm tra vào category article

Một số link rss import thử nghiệm:
Pinterest RSS Feeds: http://pinterest.com/labnol/people-i-admire/rss
Image RSS Feeds: http://api.flickr.com/services/feeds/photos_public.gne?tags=facebook,instagram
Blog: http://phuongtranbaoloc.blogspot.com/feeds/posts/default

Chủ Nhật, 5 tháng 1, 2014

Google 2 location Distance Meter

Cách lấy khoảng cách bằng mét của 2 vị trí trong google map.

Kết quả:
Location 1:-33.8668283734,151.20648918209997
Location 2:-34.8668283734,151.20648918209997
Range Meter(m):111195(m)

Source 1 file html
<?xml version="1.0"?>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>Google 2 location Distance Meter</title>   
    <script src="https://maps.googleapis.com/maps/api/js?sensor=false&amp;libraries=places,visualization&amp;v=3.exp"
type="text/javascript"></script>
    <script type="text/javascript">
var location1 = new google.maps.LatLng(-33.8668283734, 151.2064891821);
var location2 = new google.maps.LatLng(-34.8668283734, 151.2064891821);
function initialize() {
        var range=distance(location1,location2);
        //alert(range);
        var outputDiv = document.getElementById('outputDiv');
        var html='Location 1:'+location1.lat()+','+location1.lng()+'<br/>';
        html=html+'Location 2:'+location2.lat()+','+location2.lng()+'<br/>';
        html=html+'Range Meter(m):'+range+'(m)';
        outputDiv.innerHTML = html;
}
//Fucntion Distance
function distance(location1,location2) {
        var lat1=location1.lat();
        var lon1=location1.lng();
        var lat2=location2.lat();
        var lon2=location2.lng();
        var R = 6371; // km (change this constant to get miles)
        var dLat = (lat2-lat1) * Math.PI / 180;
        var dLon = (lon2-lon1) * Math.PI / 180;
        var a = Math.sin(dLat/2) * Math.sin(dLat/2) +
                Math.cos(lat1 * Math.PI / 180 ) * Math.cos(lat2 * Math.PI / 180 ) *
                Math.sin(dLon/2) * Math.sin(dLon/2);
        var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
        var d = R * c;
        //if (d&gt;1) return Math.round(d)+"km";
        //else if (d&lt;=1)
        return Math.round(d*1000);//meter      
        //return d;
}
google.maps.event.addDomListener(window, 'load', initialize);

   
</script>
  </head>
  <body>
    <div id="outputDiv"></div>   
  </body>
</html>



Source file https://drive.google.com/file/d/0B785Epf6q5XlLTR0QnMyaDNpb2M/edit?usp=sharing

Google map Change Icon in radius


Sử dụng thư viện từ google
<script src="https://maps.googleapis.com/maps/api/js?sensor=false&libraries=places,visualization&v=3.exp"></script>
Thêm đoạn script
<script>
var map;
var infoWindow;
var service;
var distanceRange=10000;//1km
var types=['bank'];
var iconInRange="in_range.png";
var iconOutRange="out_range.png";
var mylocation = new google.maps.LatLng(-33.8668283734, 151.2064891821);
function initialize() {
   
  map = new google.maps.Map(document.getElementById('map-canvas'), {
    center: mylocation,
    zoom: 10, 
  });

  infoWindow = new google.maps.InfoWindow();
  service = new google.maps.places.PlacesService(map);
       
  google.maps.event.addListenerOnce(map, 'bounds_changed', performSearch); 
}

function performSearch() {
  var request = {
    bounds: map.getBounds(),   
    types:types
  };
  service.radarSearch(request, callback);
}

function callback(results, status) {
  if (status != google.maps.places.PlacesServiceStatus.OK) {
    alert(status);
    return;
  }
  for (var i = 0, result; result = results[i]; i++) {
    createMarker(result);
  }
}

function createMarker(place) {
        var distance1=1000;//1km
        //BEGIN DISTANCE           
        var glatlng1 = mylocation;
        var glatlng2 = place.geometry.location;
        //Fucntion Distance
        //alert(glatlng1.lng());
        var distance1=distance(mylocation,glatlng2);
        //alert(distance1);

        //END DISTANCE
        var marker;
        //IN
        if(distance1<distanceRange){
            marker = new google.maps.Marker({
                map: map,
                position: place.geometry.location,     
                icon:iconInRange
            });
            //alert('in');
        }
        //OUT
        else{
            marker = new google.maps.Marker({
                map: map,
                position: place.geometry.location,     
                icon:iconOutRange
            });
            //alert('out');
        }
 

  google.maps.event.addListener(marker, 'click', function() {
    service.getDetails(place, function(result, status) {
      if (status != google.maps.places.PlacesServiceStatus.OK) {
        alert(status);
        return;
      }
      infoWindow.setContent(result.name);
      infoWindow.open(map, marker);
    });
  });
}
//Fucntion Distance
function distance(location1,location2) {
    var lat1=location1.lat();
    var lon1=location1.lng();
    var lat2=location2.lat();
    var lon2=location2.lng();
    var R = 6371; // km (change this constant to get miles)
    var dLat = (lat2-lat1) * Math.PI / 180;
    var dLon = (lon2-lon1) * Math.PI / 180;
    var a = Math.sin(dLat/2) * Math.sin(dLat/2) +
        Math.cos(lat1 * Math.PI / 180 ) * Math.cos(lat2 * Math.PI / 180 ) *
        Math.sin(dLon/2) * Math.sin(dLon/2);
    var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
    var d = R * c;
    //if (d>1) return Math.round(d)+"km";
    //else if (d<=1)
    return Math.round(d*1000);//meter   
    //return d;
}
google.maps.event.addDomListener(window, 'load', initialize);
    </script>



Thứ Tư, 1 tháng 1, 2014

Chọn Time Zone joomla 3.

Đối với TimeZone sẽ tác động đến lưu trữ thời gian ở server theo đúng quốc gia hiện tại.
Trường hợp Server bên Mỹ mà mình sử dụng giờ VN thì cần phải set lại thời gian để lúc lưu trữ bài viết hoặc publíc các bài viết hoặc sự kiện đúng.

 Đối với Việt Nam thì chọn Asia>Bangkok hoặc jakarta. (vì Việt Nam dùng GMT +7 cùng giờ với Bankok và Jakarta).