Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Free Torrent Source (http://www.bvlist.com/forumdisplay.php?f=25)
-   -   [FIX] FTS 1.1 remove expired warnings (http://www.bvlist.com/showthread.php?t=4612)

Edgein 2nd March 2010 10:42

[FIX] FTS 1.1 remove expired warnings
 
When a user is warned and the warned time is over
the system does not remove the warning automatic

go to /include/libs/cron/cron_class.php
and find

PHP Code:

    public function deadtime()
    { 

above add

PHP Code:

//remove expired warnings
  
$res mysql_query("SELECT id FROM users WHERE warned='yes' AND warneduntil < NOW() AND warneduntil <> '0000-00-00 00:00:00'") or sqlerr(__FILE____LINE__);
  if (
mysql_num_rows($res) > 0)
  {
    
$dt sqlesc(get_date_time());
    
$msg sqlesc("Your warning has been removed. Please keep in your best behaviour from now on.\n");
    while (
$arr mysql_fetch_assoc($res))
    {
      
mysql_query("UPDATE users SET warned = 'no', warneduntil = '0000-00-00 00:00:00' WHERE id = $arr[id]") or sqlerr(__FILE____LINE__);
      
mysql_query("INSERT INTO messages (sender, receiver, added, msg, poster) VALUES(0, $arr[id]$dt$msg, 0)") or sqlerr(__FILE____LINE__);
    }
  }
//end remove expired warnings 

grtzz Edgein

yordanov2010 2nd March 2010 21:04

what is fts? copied/modified version of xam 1.3/3/4/5 series?

btw do you really know anything about coding? if yes please let me know what does following lines means;

PHP Code:

$dt sqlesc(get_date_time());
$msg sqlesc("Your warning has been removed. Please keep in your best behaviour from now on.\n"); 

:lol:

Edgein 3rd March 2010 10:09

lol what a questionto test or skills there are other sites

and what if there are people who love the FTS source
while I find it a hobby to help people whether I am a coder or not

joeroberts 3rd March 2010 14:08

Quote:

Originally Posted by yordanov2010 (Post 21486)
what is fts? copied/modified version of xam 1.3/3/4/5 series?

btw do you really know anything about coding? if yes please let me know what does following lines means;

PHP Code:

$dt sqlesc(get_date_time());
$msg sqlesc("Your warning has been removed. Please keep in your best behaviour from now on.\n"); 

:lol:

:coffee:

Code:

$dt = sqlesc(get_date_time());
is a call to 2 functions to generate a time stamp and set it as a variable {$dt}!
Code:

$msg = sqlesc("Your warning has been removed. Please keep in your best behaviour from now on.\n");
is all call to a function to clean up a message and add forward slashes to all {" ' and "} to help stop sql injections
and to set that message as a variable {$msg}

if you want to test a coder you well need to try harder then that
:wallbash:

yordanov2010 3rd March 2010 14:24

Quote:

Originally Posted by joeroberts (Post 21501)
is a call to 2 functions to generate a time stamp and set it as a variable {$dt}!

You don't need any protection for those both lines. That's why I asked this basic question. get_date_time() should be NOW()

and the second one must be: $msg = "Your warning has been removed.

Please keep in your best behaviour from now on.\n";

joeroberts 3rd March 2010 14:41

some data bases servers run a different time then the php server and using
because some hosts well use a external database server in a different location
[if you do not use localhost you use a
Code:

blabla.ru.co
for your $db_host = "localhost";]
sqlesc() is just a standerd.


All times are GMT +2. The time now is 17:36.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.