MyBB Community Forums

Full Version: Sorry you need X post
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I have the plugin that lets me use PhP in templates but what is the PhP code to make it so a user needs X post EACH DAY to click on a link? Excluding staff.
Some thing like this; (didn't tested though)
$one_day = TIME_NOW - 24*60*60;
$required_posts = "25"; // Edit this value
$query = $db->query("SELECT SUM(pid) AS odp FROM ".TABLE_PREFIX."posts WHERE uid='".$mybb->user['uid']."' AND dateline > $one_day");
$one_day_posts = $db->fetch_field($query, "odp");

if ($one_day_posts < $required_posts)
{
   error("Sorry we need X amount of posts in order to see this link.");
}
Ok, now, where would I add this into it?

<a href="{$mybb->settings['homeurl']}">{$mybb->settings['homename']}</a><a href="{$mybb->settings['bburl']}/index.php">Forums</a>
You've to do it yourself. Because I don't know the code of your plugin.
It's not a plugin, just going to edit the code my self but I will figure it out.