Kênh 360 Công Nghệ Kênh 360 Công Nghệ

Trang chủ - Joomla - Giới thiệu - Hướng dẫn - Cách tạo module hiển thị tỉ giá ngoại tệ, thông tin thị trường trong Joomla

Cách tạo module hiển thị tỉ giá ngoại tệ, thông tin thị trường trong Joomla

Bài viết sau sẽ trình bày cách tạo module hiển thị tỉ giá ngoại tệ, giá vàng, thông tin thị trường trong Joomla 1.5.x một cách đơn giản và nhanh chóng. Dữ liệu được lấy từ website VNExpress.net
Các bước thực hiện như sau:
1. Đăng nhập vào trang quản trị Joomla Backend
2. Tạo một module mới bằng cách
Truy cập Phần mở rộng > Quản lý module > Tạo mới
hoặc
Extensions > Module > New.

3.1 Cách 1: Chọn Module Tùy chỉnh HTML mod_custom.
Sau đó chèn đoạn mã sau vào phần soạn thảo tùy chỉnh
Thay đổi độ rộng theo ý bạn
<div style="width: 100%;">
<script type="text/javascript"
src="http://www.vnexpress.net/Service/Forex_Content.js"></script>
<script type="text/javascript"
src="http://www.vnexpress.net/Service/Gold_Content.js"></script>

<table style="width: 180px;" border="1px" cellpadding="0" cellspacing="0">
<tbody>
<tr>       
<td style="background-image:url(img/footerbg.gif);">
<label class="BoxTitle">Giá vàng (VND)</label>
</td>       
</tr>
<tr>       
<td style="padding-top: 4px;">
<div id="divGoldPrice">
<div><table></table></div>
</div>
</td>      
</tr>

</tbody></table>

<script type="text/javascript">

var divGoldPrice = document.getElementById("divGoldPrice");
divGoldPrice.innerHTML = "<div><table>";

divGoldPrice.innerHTML = divGoldPrice.innerHTML + "<tr>
<td style='width:60px'><b>Mua vào</b></td>
<td>"+ vGoldBuy +"</td></tr>";
divGoldPrice.innerHTML = divGoldPrice.innerHTML + "<tr>
<td style='width:60px'><b>Bán ra</b></td>
<td>"+ vGoldSell +"</td></tr>";

divGoldPrice.innerHTML = divGoldPrice.innerHTML + "</table></div>";
</script>

<table style="width: 180px;" border="0" cellpadding="0" cellspacing="0">
<tbody><tr>

<td style="background-image: url('/cntt/{../footerbg.gif');">
<label class="BoxTitle">Ngoại tệ (VND)</label>
</td>

</tr>
<tr>

<td style="padding-top: 4px;">
<div id="divForex">
<div><table></table></div>
</div>

</td>

</tr>

</tbody></table>

<script type="text/javascript">

var divForex = document.getElementById("divForex");
divForex.innerHTML = "<div><table>";
for( i = 0; i <= 12; i ++ )
{
divForex.innerHTML = divForex.innerHTML + "<tr>
<td style='width:60px'><b>" + vForexs[i]  +"</b></td>
<td>"+ vCosts[i] +"</td></tr>";
}
divForex.innerHTML = divForex.innerHTML + "</table></div>";
</script>
</div>


3.2. Cách 2: Lưu đoạn mã trên thành file tigia.html. Upload lên host.

Chọn mod_wrapper, nhập địa chỉ URL của file tigia.html để tạo iframe.

Chọn vị trí của module. Mặc định là left. Bật module.
Sau đó Lưu lại
Xem thêm Cách tạo module thông tin chứng khoán trong Joomla


Tin liên quan:
Tin mới hơn:
Tin cũ hơn:

Lần cập nhật cuối ( Thứ bảy, 13 Tháng 6 2009 00:15 )  

Kênh 360 công nghệ

  • Nổi bật
  • Tin mới
  • Game mới
  • PrestaShop Guide
  • PrestaShop

Có thể bạn quan tâm

Download nhiều nhất

11/12
Download PES 2011 - FIFA 11
181
18/12
binkw32 dll
117
18/12
TeamViewerQS
38

Quảng cáo

English French German Japanese Korean