Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Need x post to view
blakefire Offline
Junior Member
**
Posts: 24
Joined: May 2011
Post: #1
Need x post to view
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.
08-10-2011 07:50 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Need x post to view
There isn't really a definite nice solution through conditionals.  But I guess you could always try something like: (requires PHP)

PHP Code:
1
2
3
4
5
6
7
8
9
<?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';
}
}
?>


My Blog
08-10-2011 09:08 AM
Find all posts by this user Quote this message in a reply
blakefire Offline
Junior Member
**
Posts: 24
Joined: May 2011
Post: #3
RE: Need x post to view
Where would the header link go? and I don't need the php tags right? <?php and ?>
08-10-2011 02:49 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #4
RE: Need x post to view
(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.

My Blog
(This post was last modified: 08-10-2011 04:04 PM by ZiNgA BuRgA.)
08-10-2011 04:03 PM
Find all posts by this user Quote this message in a reply
blakefire Offline
Junior Member
**
Posts: 24
Joined: May 2011
Post: #5
RE: Need x post to view
Well i am saying this because I thought this plugin made it possible to use PhP in templates and not needing that.
08-10-2011 04:06 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #6
RE: Need x post to view
Then how is the plugin supposed to know what is PHP and what isn't?

My Blog
08-10-2011 05:03 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: