Mời bạn đăng ký để giao lưu kết bạn nhé <3
Bạn phải đăng nhập để xem được nội dung, nếu bạn chưa có tài khoản? hãy Đăng ký
x
Vui lòng ghi rõ nguồn http://123discuz.co.cc/bbs/viewthread.php?tid=55&extra=page%3D1
khi share cho bạn bè
Thanks
Demo
Nếu chưa cài Mod Pet Pk do 123Discuz! share thì click vào đây
Khách: Nội dung này bị ẩn, bạn cần bấm Thank để xem.
Hoặc hack theo loại 1 tại đây
Khách: Nội dung này bị ẩn, bạn cần bấm Thank để xem.
1. mở viewthread.php
tìm- SELECT p.*, m.uid, m.username,
Sao chép mã thay bằng- SELECT p.*, mp.*, m.uid, m.username AS username,
Sao chép mã Tìm tiếp- LEFT JOIN {$tablepre}members m ON m.uid=p.authorid
Sao chép mã them dưới- LEFT JOIN {$tablepre}mypetdata mp ON mp.username=p.author
Sao chép mã tìm tiếpthêm vào ngay sauTìm tiếp- $post['attachments'] = array();
Sao chép mã thêm trên- if ($post['mypet']){
- @include DISCUZ_ROOT.'./forumdata/cache/Plugin_pet.php';
- $petdir = $_DPLUGIN['pet']['vars']['imgdir'];
- $petsettings = $_DPLUGIN['pet']['vars'];
- $post['petusername'] = rawurlencode($post['username']);
- $t=time();
- $today = gmdate ("Ymd",$t);
- $post['petdiff'] = time() - $post['petregdate'];
- $post['petregdate']=gmdate ("Ymd",$post['petregdate']);
- $post['pett'] = $today-$post['petregdate'];
- $post['petlevel'] = pow (log10 ($post['mypetexp']), 3);
- $post['petshowlevel'] = floor ($post['petlevel'] + 1);
- $post['levelpic']=intval($post['petshowlevel']/10);
- $post['levelpic'] = $post['levelpic'] > '10' ? '11' : $post['levelpic'];
- $post['level1']=intval($post['petshowlevel']/2);
- $post['level2']=intval($post['petshowlevel']/2);
- $post['petpic']=$post['mypetname'];
- $post['pethp']=$post['mypethp'];
- $post['petatk']=$post['mypetatk']+$post['item1']+$post['item2']+2+$post[level1];
- $post['petdef']=$post['mypetdef']+$post['item3']+$post['item4']+$post['item5']+3+$post['level1'];
- if($post['petshowlevel'] < 2){
- $post['petmaxhp']=$petsettings['basichp'];
- }else{
- $post['petmaxhp']=$petsettings['basichp']+$post['petshowlevel']*5;
- }
- $post['petsp']=$post['mypetsp']-$post['pett']*$petsettings['basicsp2'];
- if($post['petsp']>$petsettings['basicsp']){
- $post['petsp']=$petsettings['basicsp'];
- }
- $post['hpf']= floor (100 * ($post['pethp'] / $post['petmaxhp']));
- $post['spf']= floor (100 * ($post['petsp'] / $petsettings['basicsp']));
- $post['pethp'] = $post['pethp'] < '0' ? '0' : $post['pethp'];
- $post['petsp'] = $post['petsp'] < '0' ? '0' : $post['petsp'];
- $post['petdead'] = $post['pethp'] < '1' || $post['petsp'] < '1' ? 'Dead' : 'Sống';
- $post['petsex'] = $post['mypetsex'] < '2' ? 'Giới tính' : 'Giống đực';
- $post['petpk'] = $post['openpk'] < '2' ? 'PK' : 'đóng PK';
- $post['hpf'] = $post['hpf'] >= '100' ? '100' : $post['hpf'];
- $post['spf'] = $post['spf'] >= '100' ? '100' : $post['spf'];
- }
Sao chép mã 2. mở templates/default/ css_viewthread.htm
thêm dưới cùng- /*-----------userpetinfo-------------*/
- .chart { border: 1px solid {BORDERCOLOR}; width:120px; height:9px; padding: 0em; background: #FFFFFF;}
- .chart img { float:left;}
- .petinfo{border: solid {MENUBORDER};border-width:1px 0; width:100%;padding:4px 0;}
Sao chép mã 3. Mở templates/default/viewthread_node.htm
tìm- <dl class="s_clear">{eval @eval('echo "'.$customauthorinfo[2].'";');}</dl>
Sao chép mã thêm sau- <!--{if $post[mypet]}-->
- {subtemplate userpetinfo}
- <!--{/if}-->
Sao chép mã Tải Khách: Nội dung này bị ẩn, bạn cần bấm Thank để xem. giải nén rồi up lên templates/default
Update cache
xong
Nguồn 123discuz! |