Joomla

HOTLINE : 0943.286.326 ||--||--||website : ADSLVietNam.com
Dow
Xem thêm : Hướng dẫn cài đặt Joomla

1 số lỗi thường gặp - cách fix lỗi
Ở đây template mình dùng là gk_your shop, những template khác tương tự.
1. Nếu bạn muốn chỉnh cỡ chữ mặc định của tiêu đề các bài viết trong joomla thì bạn chỉnh file CSS trong template đang dùng 1. Chỉnh cỡ chữ của tiêu đề bài viết (bài viết ở đây là các article của joomla) trong file template-của-bạn/css/joomla.css đoạn code giống như .contentheading Hoặc không có thì thêm đoạn code này vào file đó
div.itemHeader h2.itemTitle, div.catItemHeader h3.catItemTitle, h2,
.contentheading{ font-size:35px; }
2. Chỉnh cỡ chữ của tiêu đề sản phẩm (đây là tiêu đề các sản phẩm - item của k2 community) tại dòng 108 trong file gk_shop/css/k2.css
3. Trường hợp Xmap bị lỗi (khi bạn cài Xmap có thể và thường thì sẽ xảy ra lỗi này) loading preference: thì vào plugin manager disabled plugin System - Mootools Upgrade
4. Lỗi khi cài joomfish:
Khi bạn cài joomfish thường sẽ xảy ra lỗi này: Deprecated: Function ereg_replace() is deprecated in C:\XAMPP\xampp\htdocs\sitesname\plugins\system\jfd atabase\jfdatabase_inherit.php on line 537
--> Tìm dòng 537 (nếu báo lỗi dòng 537) trong file plugins\system\jfdatabase\jfdatabase_inherit.php thay
$tableName = ereg_replace( '^#__', '', $table); thành $tableName = preg_replace( "/^#__/", "", $table);
5. Để mở cửa sổ mới khi kích chuột vào GK3 image slide show khi click vào slide (Tức là khi bạn dùng một module nào đó để hiển thị ảnh, ví dụ như image slide show như của VietCanh thì làm tương tự như sau)
--> Chỉnh trong file templates\gk_yourshop\html\mod_gk_image_show\content.php thêm targer=_blank vào thuộc tính href
6. Lỗi hiển thị SP trong K2 hoặc hiển thị cả category sau khi cài joomla fish (lỗi này thường có khi bạn cài joomfish):
- Vào administrator/components/com_joomfish/views/translate/tmpl/edit.php bỏ readonly="yes"
- Khi translate các module hay menu thì xóa link trong textBox của joomfish translate rồi nhấn save
7. Muốn thêm position (thêm position vào template joomla): Thêm một vị trí module mới vào template, Tạo vị trí mới trong template joomla...
Vào file templatedetail.xmp thêm tên position sau đó vào file php tương ứng tạo thêm vị trí để load module ở position đó.
Ví dụ thêm vị trí đển chèn tùy chọn nhiều ngôn ngữ như trên VietCanh:
- Vào file templates\gk_yourshop\templatedetail.xml thêm vị trí để chèn module language selection ta thêm đoạn code <position>lang</position>
- Sau đó thêm vào file templates\gk_yourshop\layouts\blocks\top.php đoạn:
<?php if($this->countModules('lang')) : ?>
<jdoc:include type="modules" name="lang" style="none" />
<?php endif; ?>
=> Hiển thị module language ở position lang. Chú ý là dùng tem nào thì vào xml tem đó để chỉnh nhé, ở đây mình dùng gk_yourshop.
8. Thêm k2iteam alias trong joomfish (Tức là khi bạn dùng joomfish để bạn dịch một item nào trong k2 thì sẽ có một box là dịch title, một box là dịch alias của title đó. Nhưng thiếu mất box k2item alias):
- Vào file k2item.xml trong joomfish (Joomfish có một thư mục chứa các file xml của các module khác để hỗ trợ dịch sang ngôn ngữ khác cho cả các module) thêm đoạn code
<field type="text" name="alias" length="50" maxlength="255" translate="1" posthandler="filterTitle">Alias</field>
9. Cách thêm tham số Cache cho module Joomla
Chỉnh sửa file XML của module
Bạn thêm vào đoạn mã sau (trong cặp <install>):
<params group="advanced">
<param name="cache" type="list" default="1" label="Caching"
description="Select whether to cache the content of this module">
<option value="1">Use global</option>
<option value="0">No caching</option>
</param>
<param name="cache_time" type="text" default="900"
label="Cache Time" description="The time before the module is recached" />
</params>
10. Tạo banner_adv trên top (tức là thêm một vị trí như kiểu là logo trên banner để phục vụ việc quản cáo)
- Vào file templates\gk_yourshop\layouts\blocks\top.php thêm đoạn code:
<?php if ($this->getParam('logoType')=='image'): ?>
<h1 class="tao_logo"> <a href="http://đường dẫn đến 1 trang html nào đó" title="<?php echo $this->sitename(); ?>" rel="nofollow" target="_blank"><span><?php echo $this->sitename(); ?></span></a> </h1>
<?php elseif($this->getParam('logoType')=='text') : ?>
<div class="logo text">
<h1><a href="index.php" title="<?php echo $this->sitename(); ?>"><span><?php echo GK_LOGO; ?></span></a></h1>
<p class="site-slogan"><?php echo GK_SLOGAN;?></p>
</div>
<?php endif; ?>
- Tạo một class tao_logo trong file templates\gk_yourshop\css \template.css với nội dung
h1.tao_logo { float:right; height:103px; padding:0; width:250px; }
h1.tao_logo a { background:transparent url('../images/style1/ảnh_logo.png') no-repeat 0 0; display:block; height:103px; margin:0; text-indent:-999em; width:250px; }
div.tao_logo { height:69px; width:auto; float:right; }
div.tao_logo h1 { font-size:27px; line-height:32px; font-family:Arial, sans-serif; font-weight:bold; margin:10px 10px 4px 10px; }
div.tao_logo h1 a { color:#46660b!important; font-size:27px!important; text-decoration:none!important; }
div.tao_logo p { font-size:10px; font-family:Verdana, sans-serif; line-height:12px; color:#000; margin-right:10px; }
11.Lỗi Warning: get_class() expects parameter 1 to be object, null given in C:\xampp\htdocs\ja_mesolite\templates\ja_mesolite\ ja_menus\Base.class.php on line50
Cách fix: Tìm trong file base.class.php rồi bỏ đoạn code
Mã:
$menu = @JMenu :: getInstance();
if(strtolower(get_class($menu)) == 'jexception') {
$menu = @JMenu :: getInstance('site');
}
12.Phần phân trang của các menu sẽ xuất hiện lỗi: Một dòng code nguyên sơ hiện ra cuối trang với nội dung: JPAGE_CURRENT_OF_TOTAL.
Lỗi này xảy ra do phiên bản mới của Joomla cập nhật thêm trường JPAGE_CURRENT_OF_TOTAL trong phần phân trang (pageination) trong khi các file ngôn ngữ chưa có trường này.
Vào public_html/language/vi-VN/vi-VN.ini - tìm dòng 258, thêm 1 dòng trắng, dán thêm dòng này vào:
JPAGE_CURRENT_OF_TOTAL=Trang %s trong tổng số %s trang.
13.Lỗi : Deprecated: Assigning the return value of new by reference is deprecated in
Cách sửa: Tìm đến dòng nó báo warning trong file php nó báo lỗi
Ttìm dòng đại loại như:
$tên_biến = & new abc;
Bỏ kí tự "&" đi là hết.
14.Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a reference, value given in C:\Users\tim\Desktop\timothy\xampp\htdocs\domains\ joomla\libraries\joomla\cache\handler\callback.php on line 99
Lỗi này bạn vào module bị lỗi và thay đổi thuộc tính type của nó thành Legacy Vertical:
1. Vào Extensions->Module Manager trong danh sách module bạn chọn module bị lỗi
2. Tại phần Paramenters của module trong thuộc tính type bạn chọn là Legacy Vertical.
15.Khi gặp phải lỗi "Error: Any articles to show" bạn cần thử một vài cách sau.
Lỗi này thường đi kèm với lỗi "DB function failed with error number 1030" trong administrator và kèm theo lỗi "PHP Warning: Invalid argument supplied for foreach()" ở một số module.
Trước hết bạn vào PHPMyadmin và REPAIR TABLE, sau đó xóa hết cache của website.
Nếu vẫn không được bạn cần liên hệ ngay tới nhà cung cấp gói hosting đó cho bạn. Có thể nhiều phần là lỗi từ trên server và lỗi này thường do đĩa cứng của server bị đầy. Bạn đừng vội vàng tác động đến data files và database gì vội nếu trước đó bạn không hề có thay đổi bất thường tới dữ liệu trên host của mình.
16.Khắc phục lỗi "Strict Standards: Static function JDatabase::test() should not be abstract in.." trêm XAMPP
ví dụ:
Strict Standards: Accessing static property JCache::$_handler as non static in C:\xampp1\htdocs\Joomla_17\libraries\joomla\cache\ cache.php on line 394
Strict Standards: Static function JDatabase::test() should not be abstract in C:\xampp1\htdocs\Joomla_17\libraries\joomla\databa se\database.php on line 350
Bạn vào file php.ini trong mục C:\XAMPP\php
- Tìm đến chỗ có chữ "display_errors" và thiết lập giá trị on của nó thành off.
- Tìm đến error_reporting = E_ALL | E_STRICT thay bằng error_reporting = E_ALL & ~E_NOTICE
+ Nếu vẫn chưa được thì trong file configuration.php của XAMPP bạn thay chỗ $error_reporting = '-1'; thành $error_reporting = '6135';
+ Nếu vẫn chưa được thì Thêm vào trước dòng 516 "error_reporting = E_ALL | E_STRICT"
Làm lần lượt từng bước một, au đó khởi động lại apache và MySQL nha.
17.Lỗi "Parse error: syntax error, unexpected $end, expecting T_FUNCTION in"
Lỗi này thường do bị sai thiếu code, đến dòng báo lỗi trong file đó và thêm dấu } vào là ok!
18. Sau khi chuyển host vào virtuemart bị lỗi đường dẫn?
Fix: Đầu tiên bạn vào administrator\components\com_virtuemart
Tìm file virtuemart.cfg
Tìm đến đoạn code :
define( 'URL', 'http://localhost/Shopbluexanh/Sourc/' );
define( 'SECUREURL', 'http://localhost/Shopbluexanh/Sourc/' );
Thay thành 2 dòng sau :
define( 'URL', $mosConfig_live_site.$app );
define( 'SECUREURL', $mosConfig_live_site.$app);
Giờ bạn chuyển host thoải mái mà ko sợ lỗi url nữa
19. Lỗi Invalid argument supplied for foreach() in
Lỗi vd:
Warning: Invalid argument supplied for foreach()in /home/user/public_html/libraries/joomla/html/html/select.php on line 68
in certain compiled php-configs.
Fix: Tìm tới dòng 68 trong file : select.php
Sửa : foreach ($arr as $i => $option)
Thành: foreach ( (array)$arr as $i => $option)
Được tạo bởi Blogger.