Help > Hidden News

10 bài đăng
06.05.2016 / 00:32
JackSparrow
Bài đăng: 35
Member

Dear Developers i need Hidden News Link in mainmenu.php

Example:

phonho.net Admin Shared a News.

Welcome in phonho.net wapmasters helping site.

[Hidden News]

so i am Read the news and i can now hide to this News in from my ID, Then i am Click at [Hidden News] Link and the news will be hidden :)

06.05.2016 / 08:04
thaian2009
Bài đăng: 709
Member

On/ Off news àh? Bạn thêm 1 cột news vào bảng user đó :]]

06.05.2016 / 10:13
mad
Bài đăng: 2434
Member
Nhào vô cắn tao đi, tao sợ mày à cắn bừa.

Ẩn cột tin tức của phố nhỏ

06.05.2016 / 11:14
JackSparrow
Bài đăng: 35
Member
thaian2009 đã viết

On/ Off news àh? Bạn thêm 1 cột news vào bảng user đó :]]

Hmm, thưa bà chia sẻ Cột Ví dụ hoặc mã?

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

Thaian là bà :23:

06.05.2016 / 13:30
thaian2009
Bài đăng: 709
Member
SQL
  1. ALTER TABLE `users` ADD `news` INT

Lấy giá trị cột news từ user data và thiết lập chức năng../pages/include/news.php

PHP
  1. $u_news=$datauser["news"];
  2. if($u_news==1)
  3. {
  4. //code tin tức ở đây
  5. }

Cài đặt để ở đâu cũng được..(/pages/include/news.php hoặc /pages/mainmenu.php)

PHP
  1. // Link bật tắt tin tức
  2. $u_news=$datauser["news"];
  3. echo $u_news==1?'<a href="?news=no_news">Xem news: Bật</a>':'<a href="?news=news">Xem news: Tắt</a>';
  4.  
  5. // Lưu cài đặt vào data
  6. $news=functions::fix_xss($_GET["news"]);
  7. if($news=='news' || $news=='no_news')
  8. {
  9. $inews=intval($news=='news'?1:0);
  10. if($user_id){
  11. mysql_query("UPDATE `users` SET `news` = '".$inews."' WHERE `users`.`id` ='".$user_id."';");
  12. header("Location: ".$home);
  13. }
  14. }

//google dịch nữa đi bà :v

07.05.2016 / 14:20
JackSparrow
Bài đăng: 35
Member

Ma'am thaian, i am Creating the Column `news` in Users Table, and i have johncms

V=6.1.2 and in this not is /incfiles/news.php

only news/index.php

so where i am pasting to

$u_news=$datauser["news"];

echo $u_news==1?'<a href="?news=no_news">Xem news: Bật</a>':'<a href="?news=news">Xem news: Tắt</a>';

// Lưu cài đặt vào data

$news=functions::fix_xss($_GET["news"]);

if($news=='news' || $news=='no_news')

{

$inews=intval($news=='news'?1:0);

if($user_id){

mysql_query("UPDATE `users` SET `news` = '".$inews."' WHERE `users`.`id` ='".$user_id."';");

header("Location: ".$home);

}

}

07.05.2016 / 14:23
thaian2009
Bài đăng: 709
Member
JackSparrow đã viết

Ma'am thaian, i am Creating the Column `news` in Users Table, and i have johncms

V=6.1.2 and in this not is /incfiles/news.php

only news/index.php

so where i am pasting to

$u_news=$datauser["news"];

echo $u_news==1?'<a href="?news=no_news">Xem news: Bật</a>':'<a href="?news=news">Xem news: Tắt</a>';

// Lưu cài đặt vào data

$news=functions::fix_xss($_GET["news"]);

if($news=='news' || $news=='no_news')

{

$inews=intval($news=='news'?1:0);

if($user_id){

mysql_query("UPDATE `users` SET `news` = '".$inews."' WHERE `users`.`id` ='".$user_id."';");

header("Location: ".$home);

}

}

Kết quả?

07.05.2016 / 14:54
MrKen
Bài đăng: 2653
Trùm!
Vẫn là A N H

pages/mainmenu.php :)

07.05.2016 / 15:42
JackSparrow
Bài đăng: 35
Member
MrKen đã viết

pages/mainmenu.php :)

Sir. I can't Understand to Ma'am Steps. Can you Explain me ?