Share Mod tử vi vui cho Johncms

  • Thread starter Thread starter dgtupltn95
  • Start date Start date
D

dgtupltn95

New Member
Mod tử vi vui cho Johncms

Mod tử vi vui JohnCms
tuvi.png
Giới thiệu: Cho phép thành viên của bạn xem tử vi vui Hướng dẫn: + Tạo thư mục tên horoscope trong thư mục images và up tất cả hình đi kèm vào. + Tạo một thư mục horoscope trên root và up 3 file đi kèm vào. + Mở file index.php tìm:
Code:
 $trangxinh9x = mysql_connect("localhost","users","password") or die("Không Thể Mở Và Ghi Dữ Liệu"); mysql_select_db("database");
Thay các thông số phù hợp với trang wap của bạn, trong đó: user là tên đăng nhập database password là mật khẩu dăng nhập database database là tên cơ sở dữ liệu làm john + Tiếp theo, tạo thông báo cho thành viên bằng cách: Mở incfiles/head.php tìm:
Code:
 if (!empty($list)) echo '<div class="rmenu">' . $lng['unread'] . ': ' . functions::display_menu($list, ', ') . '</div>'; }
Thêm vào dưới nó:
Code:
 if ($user_id) { if ($datauser['horoscope'] == 0) echo '<div class="rmenu">Có vẻ như bạn chưa tích hợp chức năng Tử Vi Vui của Diễn Đàn. Click <a href="/horoscope/horoscope.php">đây</a> để thiết lập!</div>'; }
+ Cuối cùng, tạo hiển thị cho thành viên bằng cách: Mở pages/mainmenu.php tìm:
Code:
 echo $mp->news;
Thêm vào dưới nó:
Code:
 if ($datauser['horoscope'] != 0) { if ($datauser['horoscope'] == 1) $img = '<img src="/images/horoscope/bachduong.gif"/>'; if ($datauser['horoscope'] == 2) $img = '<img src="/images/horoscope/kimnguu.gif"/>'; if ($datauser['horoscope'] == 3) $img = '<img src="/images/horoscope/songtu.gif"/>'; if ($datauser['horoscope'] == 4) $img = '<img src="/images/horoscope/cugiai.gif"/>'; if ($datauser['horoscope'] == 5) $img = '<img src="/images/horoscope/sutu.gif"/>'; if ($datauser['horoscope'] == 6) $img = '<img src="/images/horoscope/xunu.gif"/>'; if ($datauser['horoscope'] == 7) $img = '<img src="/images/horoscope/thienbinh.gif"/>'; if ($datauser['horoscope'] == 8) $img = '<img src="/images/horoscope/thannong.gif"/>'; if ($datauser['horoscope'] == 9) $img = '<img src="/images/horoscope/nhanma.gif"/>'; if ($datauser['horoscope'] == 10) $img = '<img src="/images/horoscope/maket.gif"/>'; if ($datauser['horoscope'] == 11) $img = '<img src="/images/horoscope/baobinh.gif"/>'; if ($datauser['horoscope'] == 12) $img = '<img src="/images/horoscope/songngu.gif"/>'; $horoscope = mysql_query("SELECT `horoscope` FROM `users` WHERE `id` = '$user_id'"); $horoscopes = mysql_fetch_array($horoscope); $horoscopese = mysql_query("SELECT `text` FROM `horoscope` WHERE `id` = '".$horoscopes['horoscope']."'"); $horoscopeses = mysql_fetch_array($horoscopese); echo '<div class="mainblok"><div class="phdr"><b>Tử Vi</b></div><div class="menu">'.$img.''.$horoscopeses['text'].'</div></div>'; }
Chú ý: Để cập nhập nội dung tử vi thì mỗi ngày bạn chỉ cần chạy 1 lần địa chỉ 404 Not Found để nó tự update nhé, không thì nhờ bác Cron Job giúp cho, Khuyến khích các site chạy nhanh và phỉa hỗ trợ Curl. + Save và Test.
tuvivui.zip
 

Facebook Comments

Similar threads

Admin
Replies
0
Views
432
AdminAdmin is verified member.
Admin
Admin
Replies
0
Views
3K
AdminAdmin is verified member.
Admin
Admin
Replies
0
Views
10K
AdminAdmin is verified member.
Admin
ginbarca
Replies
0
Views
4K
ginbarca
ginbarca
Admin
Replies
0
Views
1K
AdminAdmin is verified member.
Admin
Admin
Replies
0
Views
917
AdminAdmin is verified member.
Admin
Admin
Replies
0
Views
1K
AdminAdmin is verified member.
Admin
Admin
Replies
0
Views
2K
AdminAdmin is verified member.
Admin
Back
Top