Tạo icon trước nick bằng biến hồ sơ ego

9 bài đăng
Tags:
27.08.2015 / 11:03
thaian2009
Bài đăng: 709
Member

Tạo 1 trang đặt tên là chọn icon xong post code này.

TWIG
  1. {%set user=api.u.get(api.r.get("uid"))%}
  2. {%set birt=api.r.get("birt")%}
  3. <form action="dating.php?ses={{ses}}&id=edit" method="post">
  4.  
  5. <div class="center">
  6.  
  7. <input name="name" value="{{user.name|raw}}" type="hidden"/>
  8.  
  9. <input name="y" value="{{birt|slice(0,4)}}" type="hidden"/>
  10.  
  11. <input name="m" value="{{birt|slice(5,2)}}" type="hidden"/>
  12.  
  13. <input name="d" value="{{birt|slice(-2)}}" type="hidden"/>
  14.  
  15. <input name="education" value="{{user.education|raw}}" type="hidden"/>
  16.  
  17. <input name="more_info" value="{{user.more_info|raw}}" type="hidden"/>
  18.  
  19. <input name="hobby" value="{{user.hobby|raw}}" type="hidden"/>
  20.  
  21. <input name="f_book_film" value="{{user.f_book_film|raw}}" type="hidden"/>
  22.  
  23. <input name="f_music" value="{{user.f_music|raw}}" type="hidden"/>
  24.  
  25. <input name="weight" value="{{user.weight|raw}}" type="hidden"/>
  26.  
  27. <input name="height" value="{{user.height|raw}}" type="hidden"/>
  28.  
  29. <input name="city" value="{{user.city|raw}}" type="hidden"/>
  30.  
  31. <select name="country"><option value="00">Xóa icon</option>{%for i in 51..99%}<option value="{{i}}" {%if i==user.country%}selected{%endif%}>Icon {{i}}</option>{%endfor%}</select>
  32.  
  33. <input name="ses" value="{{user.ses|raw}}" type="hidden"/>
  34. <input type="submit" value="Đồng ý">
  35. </div>
  36. </form>
  37. <hr/>
  38. {%for i in 51..99%}- Icon {{i}} - <img src="/files/1066027/{{i}}.gif"/>{%if i% 4==0%}<br/>{%endif%}{%endfor%}

Vào Tập tin hồ sơ người dùng post cái này để cho người dùng nhấn vào đổi icon.

TWIG
  1. {%if (api.u.get(api.r.get("uid")).level > 50 and api.u.get(api.r.get("uid")).level < 100) and (user.name|length>=1 or user.city|length>=1 or user.age>=1 or user.country|length>=1)%}<div class="menud"><a href="/main.php?f=3394133&uid={{api.r.get("uid")}}&birt=[birthday]&music=[music]">Thay đổi icon nick</a> <b style="color:red">(New)</b></div>{%endif%}

Thay 3394133 thành id trang icon vừa tạo lúc nảy.

Ở shoutbox hoặc nơi muốn đặt icon trước nick chèn code này

TWIG
  1. {%set user=api.u.get(nick|slice(27,8))%}{%if user.level>50 and user.level < 100 and user.country|length > 1 and (user.country|slice(0,2) > 50 and user.country|slice(0,2) < 100)%}<img src="/files/1066027/{{user.country|slice(0,2)}}.gif" style="border:none;width:auto;height:auto"/>{%endif%}
Đã chỉnh sửa. MrKen (29.04.2016 / 10:49)
27.08.2015 / 11:10
mrcuong
Bài đăng: 149
Member
Thích Bị Gái Chịch

Bóc tem

27.08.2015 / 11:20
hanhphucao
Bài đăng: 2470
Admin
Admin là người tận tâm và luôn hành xử đúng mực.

:m12:

27.08.2015 / 11:25
anhhuyx12
Bài đăng: 44
Member

có đến mức phức tạp vậy không ạ !

27.08.2015 / 11:28
mrcuong
Bài đăng: 149
Member
Thích Bị Gái Chịch

Làm như vậy ko tốn dung lượng wap so với tạo bằng shoutbox

27.08.2015 / 11:45
thaian2009
Bài đăng: 709
Member

Giới hạn từ lv 50 đến 99 =))

27.08.2015 / 12:31
mrcuong
Bài đăng: 149
Member
Thích Bị Gái Chịch

Đã tes thử ko hiển thị

27.08.2015 / 12:31
mrcuong
Bài đăng: 149
Member
Thích Bị Gái Chịch

có thể thay đổi đc giới hạn level

27.08.2015 / 13:15
katori
Bài đăng: 16
Member

Vãi code dài bá đạo