To jest tylko wersja do druku, aby zobaczyć pełną wersję tematu, kliknij TUTAJ
phpBB2 by Przemo
Support forów phpBB2 modified by Przemo

Problem z modyfikacją - Limit beer mod

Raduss - 12-06-2015, 18:37
Temat postu: Limit beer mod
Witam

Czy ktoś wie jak dodać limit rozdawanych piw na dzień.
Np maksymalnie 1-2 piwa na dzień dla danego usera?

Tommekk80 - 13-06-2015, 08:53

Na podstawie tego możesz sobie zrobić limit piw na dzień.
Raduss - 15-06-2015, 10:59

Dodałem tylko zostało mi jeszcze to:

Kod:
#-----[ OPEN ]------------------------------------------
#
include/functions_post.php

#
#-----[ FIND ]------------------------------------------
#
                if ( $row = $db->sql_fetchrow($result) )
                {
                    if ( (intval($row['last_post_time']) > 0 && ( $current_time - intval($row['last_post_time']) ) < intval($board_config['flood_interval'])) && $userdata['user_level'] == USER && !$userdata['user_jr'] )
                    {
                        message_die(GENERAL_MESSAGE, $lang['Flood_Error']);
                    }
                }
            }
        }

#
#-----[ AFTER, ADD ]------------------------------------------
#
if (($mode == 'newtopic' || $mode == 'reply') && ($userdata['user_postsperday'] > 0))
{
$today = date('mdY');
$lo = mktime ( 0, 0, 0 , (int)substr($today, 0, 2), (int)substr($today, 2, 2), (int)substr($today, 4, 4));
$hi = mktime ( 23, 59, 59 , (int)substr($today, 0, 2), (int)substr($today, 2, 2), (int)substr($today, 4, 4));
$where_sql = "post_time BETWEEN $lo AND $hi AND poster_id = " . $userdata['user_id'];
$sql = "SELECT COUNT(*) AS posts_today
FROM " . POSTS_TABLE . "
WHERE $where_sql";
if ($result = $db->sql_query($sql))
{
if ($row = $db->sql_fetchrow($result))
{
if (intval($row['posts_today']) >= intval($userdata['user_postsperday']))
{
message_die(GENERAL_MESSAGE, $lang['Posts_Per_Day_Limit']);
}
}
}
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------


i gdzie umieścić ten kod w include/functions_beermod.php ?

[ Dodano: 17-06-2015, 21:14 ]
Proszę pomóż ktoś



Powered by phpBB modified by Przemo © 2003 phpBB Group