đường dẫn : Website/ Fckeditor/config.js
bỏ các đường dẫn khác
config.filebrowserUploadUrl = site_live+'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files';
- là ok, cho uploads file xlsx, doc, docx
Code PHP && Ứng Dụng
Thứ Ba, 3 tháng 3, 2026
Lỗi không upload file exel trong FCKeditor
Thứ Hai, 2 tháng 3, 2026
ShopOrder - Show đơn hàng thuộc shopname
$shopid = $userid;
$sql = "SELECT * FROM shop_orders";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)){
$items = json_decode($row['order_text'], true);
foreach($items as $item){
if($item['shop_id'] == $shop_id){
echo "Sản phẩm: ".$item['g_title'];
echo " - Khách: ".$row['order_uname'];
echo "<br>";
}
}
}
Chủ Nhật, 1 tháng 3, 2026
Scroll box + chỉnh item scroll + khi hover mới hiện
.scroll-box {
Thứ Năm, 26 tháng 2, 2026
Send Email Server SMTP
Link tải trực tiếp:
https://github.com/PHPMailer/PHPMailer/archive/refs/tags/v5.2.27.zip
Upload 2 file:
class.phpmailer.php
class.smtp.php
Ghi đè lên bản cũ.
tải file: tại đây
Thứ Tư, 11 tháng 2, 2026
Tab 3 cấp nhóm nghanhnghe
// ===== LẤY TOÀN BỘ MODULE =====
$sql = "SELECT mid, title, parentid FROM ".$catalog."_module ORDER BY id";
$rs = $db->sql_query($sql);
$modules = array();
while ($row = $db->sql_fetchrow($rs)) {
$modules[] = $row;
}
echo '<div class="grid-notfor-supp">';
// ===== CẤP 1: GIAN HÀNG =====
echo '<select id="gian_hang" name="gian_hang" required>
<option value="">-- Gian hàng --</option>';
foreach($modules as $row){
if($row["parentid"] == 0){
echo '<option value="'.$row["mid"].'">'.$row["title"].'</option>';
}
}
echo '</select>';
// ===== CẤP 2: TAB CHA =====
echo '<select id="tab_cha" name="tab_cha" disabled required>
<option value="">-- Tab cha --</option>';
foreach($modules as $row){
if($row["parentid"] != 0){
echo '<option value="'.$row["mid"].'" data-parent="'.$row["parentid"].'">'.$row["title"].'</option>';
}
}
echo'</select>';
// ===== CẤP 3: TAB CON =====
echo'<select id="tab_con" name="tab_con" disabled required>
<option value="">-- Tab con --</option>';
foreach($modules as $row){
if($row["parentid"] != 0){
echo '<option value="'.$row["mid"].'" data-parent="'.$row["parentid"].'">'.$row["title"].'</option>';
}
}
echo'</select>';
echo '</div>';
echo '<div class="error" id="errorMsg">
⚠ Vui lòng chọn đầy đủ Gian hàng, Tab cha và Tab con
</div>';
?>
<style>
form#gycForm-total{
max-width: 720px;
margin: 30px auto;
}
.grid-notfor-supp{
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 12px;
}
.grid-notfor-supp select{
padding: 8px;
width: 100%;
}
.error{
color: #d00;
margin-top: 10px;
display: none;
}
</style>
<script>
(() => {
const form = document.getElementById('gycForm-total');
const gianHang = document.getElementById('gian_hang');
const tabCha = document.getElementById('tab_cha');
const tabCon = document.getElementById('tab_con');
const errorMsg = document.getElementById('errorMsg');
const chaOpts = [...tabCha.querySelectorAll('option')];
const conOpts = [...tabCon.querySelectorAll('option')];
// ===== GIAN HÀNG → TAB CHA =====
gianHang.addEventListener('change', () => {
tabCha.innerHTML = '<option value="">-- Tab cha --</option>';
tabCon.innerHTML = '<option value="">-- Tab con --</option>';
tabCon.disabled = true;
if (!gianHang.value) {
tabCha.disabled = true;
return;
}
chaOpts.forEach(opt => {
if (opt.dataset.parent == gianHang.value) {
tabCha.appendChild(opt.cloneNode(true));
}
});
tabCha.disabled = false;
});
// ===== TAB CHA → TAB CON =====
tabCha.addEventListener('change', () => {
tabCon.innerHTML = '<option value="">-- Tab con --</option>';
if (!tabCha.value) {
tabCon.disabled = true;
return;
}
conOpts.forEach(opt => {
if (opt.dataset.parent == tabCha.value) {
tabCon.appendChild(opt.cloneNode(true));
}
});
tabCon.disabled = false;
});
// ===== VALIDATE =====
form.addEventListener('submit', e => {
if (!gianHang.value || !tabCha.value || !tabCon.value) {
e.preventDefault();
errorMsg.style.display = 'block';
} else {
errorMsg.style.display = 'none';
}
});
})();
</script>
<?php
Thứ Hai, 9 tháng 2, 2026
Fix Lỗi JS ở các trang web
**** Lỗi:
div.querySelectorAll("*,:x")
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
$('div *').addClass('example');
</script>
**** Bỏ stick bên tay phải:
Trong DevTools (F12) → cột phải:
-
❌ Bỏ tick Pause on caught exceptions
-
(giữ nguyên Pause on uncaught cũng được)
Thứ Ba, 20 tháng 1, 2026
Google Translate - ngôn ngữ
/****JS ở Footer******/
<style type="text/css">
.lang-switch {
display: flex;
gap: 8px;
align-items: center;
}
.lang-switch img {
/*width: 22px;
height: 15px;*/
cursor: pointer;
border-radius: 2px;
transition: 0.2s;
}
.lang-switch img:hover {
opacity: 0.7;
}
/* Ẩn Google Translate bar */
.goog-te-banner-frame,
.goog-logo-link,
.goog-te-gadget {
display: none !important;
}
/* Ẩn toàn bộ Google Translate */
.skiptranslate {
display: none !important;
}
/* Fix lỗi bị đẩy trang xuống */
body {
top: 0 !important;
}
.khuyenmai-hots > ul > li > a {
white-space: nowrap;
}
.home-menu > ul > li {
display: flex;
align-items: center;
}
font {
display: inline !important;
line-height: inherit !important;
}
</style>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'vi',
autoDisplay: false
}, 'google_translate_element');
}
function changeLang(lang) {
let select = document.querySelector("select.goog-te-combo");
if (!select) return;
select.value = lang;
select.dispatchEvent(new Event("change"));
}
</script>
<script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
/****body******/
googletranslate__languages();
function googletranslate__languages(){
global $site_live,$ThemeSel;
echo'
<div class="lang-switch language">
<a href="javascript:void(0)" onclick="changeLang(\'zh-TW\')">
<img src="/themes/'.$ThemeSel.'/images/china.png" alt="CN">
</a>
<a href="javascript:void(0)" onclick="changeLang(\'en\')">
<img src="/themes/'.$ThemeSel.'/images/en.png" alt="EN">
</a>
<a href="javascript:void(0)" onclick="changeLang(\'ja\')">
<img src="/themes/'.$ThemeSel.'/images/jp.png" alt="JP">
</a>
<a href="javascript:void(0)" onclick="changeLang(\'ko\')">
<img src="themes/'.$ThemeSel.'/images/kr.png" alt="KR">
</a>
</div>';
echo'<div id="google_translate_element"></div>';
}


