Mr.Seo
(Admin)
[Off] 14-08-2016 |
Top này mình xin share cách fix lỗi idvn cho ae bằng cách thủ công. Khi nào rảnh mình sẽ fix cái tool kia.
Fix lỗi "xtscript timeout"
- Nguyên nhân: mình dùng xtscript để chèn guestbook vào (replace)...
- Cách fix: tạo hoặc thay thế các file sau đây:
1. /index
<!DOCTYPE html>
<html>
<!--parser:xtscript-->
# Code by mrducz95 | 01255.237.567
<xt:include file="/code/var.xt" />
print <xt:blog t_name="idvn" t_tags="index_a.txt" t_post="$var" /><xt:guestbook comments_per_page="10" comments_sort="-1" parse_html="0" format="ago" t_name="index_cmt" /><xt:blog t_name="idvn" t_tags="index_b.txt" t_post="$var" />
<!--/parser:xtscript-->
</html>
<html>
<!--parser:xtscript-->
# Code by mrducz95 | 01255.237.567
<xt:include file="/code/var.xt" />
print <xt:blog t_name="idvn" t_tags="index_a.txt" t_post="$var" /><xt:guestbook comments_per_page="10" comments_sort="-1" parse_html="0" format="ago" t_name="index_cmt" /><xt:blog t_name="idvn" t_tags="index_b.txt" t_post="$var" />
<!--/parser:xtscript-->
</html>
2. /_xtgem_templates/app/idvn/index_a.txt
{% use 'app/idvn/info.txt' %}
<head>
{{block('w_meta')}}
{{block('w_css')}}
<title>{{w[3]}} - {{w[1]}}</title>
</head>
<body>
{% include 'app/idvn/head.txt' %}
<h1 class="h1_home box">{{w[4]}}</h1>
<div class="box"><div class="menu" id="posts">{{w[5]}}</div>{% set vk='posts' %}{% include 'app/idvn/list_posts.txt' %}</div>
<div class="box"><div class="menu" id="posts"><a href="/guestbook" title="{{w[9]}}" style="color:while;">{{w[9]}}</a></div>
<head>
{{block('w_meta')}}
{{block('w_css')}}
<title>{{w[3]}} - {{w[1]}}</title>
</head>
<body>
{% include 'app/idvn/head.txt' %}
<h1 class="h1_home box">{{w[4]}}</h1>
<div class="box"><div class="menu" id="posts">{{w[5]}}</div>{% set vk='posts' %}{% include 'app/idvn/list_posts.txt' %}</div>
<div class="box"><div class="menu" id="posts"><a href="/guestbook" title="{{w[9]}}" style="color:while;">{{w[9]}}</a></div>
3. /_xtgem_templates/app/idvn/index_b.txt
</div>
</div>
<div id="right">
<div class="box"><div class="menu">{{w[6]}}</div>{% include 'app/idvn/list_posts_random.txt' %}</div>
<div class="box"><div class="menu">{{w[11]}}</div>{% include 'app/idvn/list_categorys.txt' %}</div>
{% include 'app/idvn/foot.txt' %}
</body>
</html>
</div>
<div id="right">
<div class="box"><div class="menu">{{w[6]}}</div>{% include 'app/idvn/list_posts_random.txt' %}</div>
<div class="box"><div class="menu">{{w[11]}}</div>{% include 'app/idvn/list_categorys.txt' %}</div>
{% include 'app/idvn/foot.txt' %}
</body>
</html>
4. /code/var.xt
get id
get page
get chap
get idcm
get p
get err
var $url = <xt:url type="path" />
var $full_url = <xt:url type="domain" /><xt:url type="path" />
var $ip = <xt:ipaddress type="1" />
var $url_base64 = call base64_encode $val=$full_url
var $url_base64 = call base64_encode $val=$url_base64
var $var = #$url#$id#$idcm#$page#$p#$chap#$url_base64#$ip#$err#
get page
get chap
get idcm
get p
get err
var $url = <xt:url type="path" />
var $full_url = <xt:url type="domain" /><xt:url type="path" />
var $ip = <xt:ipaddress type="1" />
var $url_base64 = call base64_encode $val=$full_url
var $url_base64 = call base64_encode $val=$url_base64
var $var = #$url#$id#$idcm#$page#$p#$chap#$url_base64#$ip#$err#
5. /_xtgem_templates/idvn_gb/index_cmt.txt
{% include 'app/idvn_gb/cmt.txt' %}{{ data.comments_pagination_html|replace({'<div class="xt_pagination">':'<div class="more pagenavi">', '<span class="selected">':'<span class="NowPage">', '<a href="http://quangtri.yn.lt/index?__xtguestbook_comment_page':'<a href="http://quangtri.yn.lt/guestbook/?__xtguestbook_comment_page'})|raw }}
== Thành công rồi đó ===
fix lỗi comment không hiện ở index
- Mở file cmt.php vừa giải nén ở host. Tìm đến đoạn
md_guestbook('http://quangtri.yn.lt/code/gb/form',$nick,$comment.' @['.$id.']');
Thay thành wap bạn... Lưu ý là link "http://quangtri.yn.lt/code/gb/form" chuyển thành "http://wap-ban.com/guestbook" nhé.
== Thành công ==
SHOW MỘT CHUYÊN MỤC RA INDEX THÌ LÀM NTN
tạo file _xtgem_templates/app/idvn/show_category.txt thêm code
{% set data_list=include(db~'/category/'~show_category~'/cat_list.txt') %}
{% set data=data_list|split('#') %}
{% set count=data_list|length - data_list|replace({'#':""})|length %}
{% set page_max=(count/v[1])|round(0,'ceil') %}
{% if page>page_max %}{% set page=page_max %}{% endif %}
{% set d=(page*v[1])-v[1]+1 %}{% set c=d+v[1]-1%}{% if c>count %}{% set c=count %}{% endif %}
{% for j in d..c %}{% set i=(count-j+1) %}
{% set posts=include(db~'/posts/'~data[i]~'/posts_mini_index.txt', ignore_missing = true)|split('<[mrducz95]>') %}{% set count_chaper=include(db~'/count/posts/'~data[i]~'.txt', ignore_missing = true) %}
<div class="list"> • <a href="/{{posts[2]}}/{{data[i]}}/" title="{{posts[1]}}">{{posts[1]}}</a>{% if count_chaper>0 %}<span class="right"><a href="/{{posts[2]}}/{{data[i]}}/#chaper">{{count_chaper}} chương</a></span>{% endif %}</div>{% endfor %}
{% if page_max>1 and pt!='no' %}{% include 'app/idvn/page_list_posts.txt' %}{% endif %}
{% set data=data_list|split('#') %}
{% set count=data_list|length - data_list|replace({'#':""})|length %}
{% set page_max=(count/v[1])|round(0,'ceil') %}
{% if page>page_max %}{% set page=page_max %}{% endif %}
{% set d=(page*v[1])-v[1]+1 %}{% set c=d+v[1]-1%}{% if c>count %}{% set c=count %}{% endif %}
{% for j in d..c %}{% set i=(count-j+1) %}
{% set posts=include(db~'/posts/'~data[i]~'/posts_mini_index.txt', ignore_missing = true)|split('<[mrducz95]>') %}{% set count_chaper=include(db~'/count/posts/'~data[i]~'.txt', ignore_missing = true) %}
<div class="list"> • <a href="/{{posts[2]}}/{{data[i]}}/" title="{{posts[1]}}">{{posts[1]}}</a>{% if count_chaper>0 %}<span class="right"><a href="/{{posts[2]}}/{{data[i]}}/#chaper">{{count_chaper}} chương</a></span>{% endif %}</div>{% endfor %}
{% if page_max>1 and pt!='no' %}{% include 'app/idvn/page_list_posts.txt' %}{% endif %}
ra chổ muốn show thêm code này
{% set show_category='truyen-ngan' %}{{include('app/idvn/show_category.txt')}}
Edited Mr.Seo