MyBB Hacks

Full Version: Need x post to view
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can you tell me how to make a nav bar link only available to members who posted 5 post THAT day, and when the next day comes they will need another 5 post? Also make it so I can add a custom message and what groups this applies to? I asked at the mybb forums but they wherent much help.
There isn't really a definite nice solution through conditionals.  But I guess you could always try something like: (requires PHP)

PHP Code:
<?php
if($mybb->user['uid']) {
global $db;
$postcount_day = $db->fetch_field($db->simple_select('posts', 'count(pid) as pc', 'uid='.$mybb->user['uid'].' AND dateline>'.(TIME_NOW-86400)), 'pc');
if($postcount_day >= 5 && $mybb->user['usergroup'] == 5) {
  echo 'some custom message';
}
}
?>

Where would the header link go? and I don't need the php tags right? <?php and ?>
(08-10-2011 02:49 PM)blakefire Wrote: [ -> ]Where would the header link go?
No idea.
Note: I assume everyone on here is familiar with HTML/CSS.
If not, come back when you are.

(08-10-2011 02:49 PM)blakefire Wrote: [ -> ]and I don't need the php tags right? <?php and ?>
I didn't put them there for aesthetic purposes.
Well i am saying this because I thought this plugin made it possible to use PhP in templates and not needing that.
Then how is the plugin supposed to know what is PHP and what isn't?
Reference URL's