Share code nông trại cho wapego chi tiết nhất | WapEgo | WapMasTer - Diễn đàn truyện - Xtseo.Xtgem.Com
* MT-A *
* Cấp bậc: mem
2015-09-22 10:17

Các bạn làm trong thông tin người dùng thì mới được nhá và nhớ lấy id shout box trước khi làm . Ta làm bằng shoutbox lịch sử và làm theo hướng dẫn sau:
Ô1 ta chèn:
{{message_list}}{% if message_list=="" %}<div class="bg_lbrown li" id="farm">
<table width="37%" cellspacing="0" cellpadding="0">
<tr><td width="30"  style="vertical-align:top; font-size:1px;" align="left"><img src=" http://zingmegame.wap.mu/files/521124/dat0.png"></td><td style="vertical-align: top; padding-left: 3px;"><div class="brown bold">Ô đất cấp 1 mở 10000 $</div><div class="brown"><form action="/main.php?f=2831834" method="post"><textarea style="display:none" name="text">[tree] http://riovn.wap.mu/files/521124/daxoi.png[/tree][ten]Đất đã được mua đang cần nước![/ten]
Tưới nước<@/textarea><img src="http://farmgame.mobi/images/l/money.png" width="13" height="13" alt="0"/><input type="submit" value="Mở ô đất 1" style="background:none;border:none;margin:0;padding:0;box-shadow:none;cursor:pointer;color:#0565B2"/></form></div></td></tr></table></div>
{%endif%}

Copy code

Ở ô 2 shout box, ta đặt code sau để hiển thị ô đất:
{# Tính thời gian trồng cây #}
{% set time,date=message_date|split(" ")[1],message_date|split(" ")[0] %}
{% set s,m,h,d,mo,y=time|split(":")[2],time|split(":")[1],time|split(":")[0],date|split("-")[2],date|split("-")[1],date|split("-")[0] %}
{% set htg=post.published_at|date_modify("- "~y~" years - "~(mo-1)~" months - "~(d-1)~" days - "~h~" hours - "~m~" minutes - "~s~" seconds")|date("H:i:s d/m/Y") %}
{% set atime,adate=htg|split(" ")[0],htg|split(" ")[1] %}
{% set as,am,ah,ad,amo,ay=atime|split(":")[2],atime|split(":")[1],atime|split(":")[0],adate|split("/")[0],adate|split("/")[1],adate|split("/")[2] %}
{% if ad < 2 and amo < 2 and ay < 1 %}
 {% set ktg = as+am*60+ah*3600 %}
 {% set tl=10800-ktg %}
{% else %}
 {% set ktg = 999999 %}
{% endif %}
{# Ô đất trống #}
{% if message=="bare_land" %}
  {% if api.r.get("uid")==api.user_id %}{# chính chủ #}
    <a href="/main.php?f=2831834&farm_id=78604&p=1" title="Trồng cây">
      <img src="/files/154586/{{message}}.png" alt="Ô 1"/>
    </a><br/>{% if api.r.get("farm_id")=="78604"%}Đã thu!{%else%}Đất trống!{%endif%}
  {%else%} {# Khách cmnr #}
    <img src="/files/154586/{{message}}.png" alt="Ô 1"/>
  {%endif%}
{% endif %}
{# Hiện ô đất, tên cây #}
{% if ktg < 10800 and message!="bare_land" %}
{% if message=="eggplant" %}<img src="/files/154586/growing.png"/><br/>Cà tím {% endif %}
{% if message=="lettuce" %}<img src="/files/154586/growing.png"/><br/>Rau diếp {% endif %}
{% if message=="hay" %}<img src="/files/154586/growing.png"/><br/>Cỏ {% endif %}
{% if message=="peppers" %}<img src="/files/154586/growing.png"/><br/>Ớt {% endif %}
{% if message=="tomato" %}<img src="/files/154586/growing.png"/><br/>Cà chua {% endif %}
{# Thời gian còn lại #}
{% autoescape false %}{{ '<br/><font color="blue">[</font><font color="black">'~(tl//3600)~'h'~((tl-(tl//3600)*3600)//60)~'</font><font color="blue">]</font>'}} {% endautoescape %}
{% endif %}
{# Thu hoạch #}
{% if (message=="eggplant" or message=="lettuce" or message=="hay" or message=="peppers" or message=="tomato") and (ktg >= 10800) and (ktg < 21600) %}
  {% if api.r.get("uid")==api.user_id %}{# Chính cmn chủ #}
    <form action="main.php?id=ch_topic_h&uid=78604&uuid=[user_id]&back_url=%2Fmain.php%3Ff%3D2777291" style="display:inline" method="post">
      <input type="hidden" name="text" value="bare_land"/>
      <input type="image" src="/files/154586/{{message}}.png" alt="Thu" width="32" height="32" class="nobutton"/>
</form>
<br/>Đã chín
  {%else%} {# Khách cmn rồi #}
<img src="/files/154586/{{message}}.png" alt="Thu" width="32" height="32"/><br/>Đã chín
  {%endif%}
{%endif%}
{# Cây chết :v #}
{%if ktg > 21600 and message!="bare_land" %}
{% if api.r.get("uid")==api.user_id %}{# Chính cmn chủ #}
<a href="/main.php?f=2831834&farm_id=78604&p=1" title="Trồng cây">
  <img src="/files/154586/{{message}}.png" alt="Ô 1"/>
</a>
{%else%}{# Khách #}
<img src="/files/154586/{{message}}.png" alt="Ô 1"/>
{%endif%}
<br/>Đã chết
{% endif %}

Copy code

Kế tiếp tạo một tập tin mới để làm phần mua cây trồng nhớ lấy id trang đó nhé.
Ta dùng mã html sau:
<div class="title">Cây trồng</div><div class="left"><form action="main.php?id=ch_topic_h&uid=78604&uuid=[user_id]&back_url=%2Fuser_info.php%3Fuid%3D[user_id]%26view%3Dcharacter"method= "post"><input type="radio"name="text"value="eggplant"/>Cà tím<br/><input type="radio"name="text"value="hay"/>Cỏ khô<br/><input type="radio"name="text"value="lettuce"/>Rau diếp<br/><input type="radio"name="text"value="peppers"/>Ớt<br/><input type="radio"name="text"value="tomato"/>Cà chua<br/><input type="submit"value="Trồng"/></form></div></div></div></div><div class="list"><small>
Copy code

Cuối cùng ta tạo một tập tin mới để làm phần thu hoạch chèn mã sau vào phần thưởng khối và đặt số giờ là 3h và thay số id shoutbox vào là xong:
<span>%points%<span>
<style type="text/css">body{display:none!important}</style>
<script type="text/javascript">window.location.replace("http://diendanmeo.waplux.com/user_info.php?uid=[user_id]&view=character&farm_id=78604");</script>
<meta http-equiv="refresh" content="0,url=/user_info.php?uid=[user_id]&view=character&farm_id=78604"/>

Copy code

Nếu gập đoạn này:
http://diendanmeo.waplux.com/user_info.php?uid=[user_id]&view=character&farm_id
nhớ thay thành địa chỉ thông tin người dùng của bạn nhé .

Nhớ xoá dấu @ của đoạn mã này nhá <@/textarea> ghi để tránh bị lỗi.
Trình tự thay id như sau : nếu gập đoạn mã
này "2831834" thì đổi 7 số id "2831834" thành số
id mua cây hoặc gập đoạn thế này {% if
api.r.get("farm_id")=="78604"%} thì đổi 5 số id 78604 thành số id shoubox của bạn. Và đoạn thế này {%back_url=%2Fmain.php%3Ff%3D2777291
thì đổi 7 số 2777291 thành số id thu hoạch khi nãy. Cuối cùng đoạn này 2831834&farm_id=78604 thì ta thay 2831834 thành số id mua cây trồng của
wap bạn. Và 78604 thành số id shoutbox mà bạn đã lấy từ đầu đấy. Đoạn nào cũng phải thay hết nhá vì tất cả mã trên đều phải thay mới chơi đc . Mà các bạn chỉ cần thay những số mình nêu những số khác đừng để ý nhé
Ok xong ... Mệt woá.
Chia sẻ:
BBCode:

Link:
Thành viên: BOT, & 11 Khách ghé thăm!
Từ khóa: Share, code, nông, trại, cho, wapego, chi, tiết, nhất,

Share code nông trại cho wapego chi tiết nhất