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).