miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /  
 

Posting allowed with > num_posts

 
Author Anonymous
Guest
#1 | Posted: 7 Aug 2007 12:23 
I was just thinking of a cool hack/addon. I was wondering how easy it would be to change the viewing of a topic by the number of posts you have. Take it someone with less than 100 posts can't view the topic. I am currently using the language hack for topic 11 so noone not registered can't view the posts. Is there a way to edit this code for another topic?

/* Hack - hiding all forums from not logged users */
if($forum!=0 and $user_id==0) {
if(!isset($clForums[11])) $clForums[]=11;
if(!isset($clForumsUsers[11])) $clForumsUsers[11]=array();
}
/* --Hack - hiding all threads from not logged users */

Author Paul
Lead Developer 
#2 | Posted: 7 Aug 2007 14:12 
Sorry, the question is not quite clear.

Would you like to allow POSTING or VIEWING?

Some specific topic or any topic?

The hack you're referring to specifies FORUMS, not TOPICS...

Author Anonymous
Guest
#3 | Posted: 7 Aug 2007 14:39 
Yeah thats what I meant was forums, right now I am using the above hack to stop the viewing of the forum number 11 if your not registered. I was just wondering if you could do something with the same effect but with num_posts, so if someone doesn't have over 100 posts they cannot view the forum and get the Access_Denied text like with the above hack. I think it could be a cool way to attract posting and maybe a neat way of creating a Members forum.

Author tom322
Active Member
#4 | Posted: 8 Aug 2007 00:37 
You could try to add: $user_num_posts<100 condition, so:

/* Hack - hiding all forums from not logged users */
if($forum!=0 and ($user_id==0 or $user_num_posts<100)) {
if(!isset($clForums[11])) $clForums[]=11;
if(!isset($clForumsUsers[11])) $clForumsUsers[11]=array();
}
/* --Hack - hiding all threads from not logged users */

Author Paul
Lead Developer 
#5 | Posted: 8 Aug 2007 06:14 
tom322

Since $user_num_posts is generated after the language pack included, and this hack is applied for language pack, most probably it won't work.

Try to paste this at the top of bb_plugins.php:

/* Premium forums hack allowing access based on user_num_posts */

$premiumForums=array(9); // here define premium forums IDs
$premiumForumsPosts=100; // here define amount of postings to access

if(in_array($forum, $premiumForums) and ($user_id==0 or $user_num_posts<$premiumForumsPosts) ){
$errorMSG='You can\'t access this forum until you make at least '.$premiumForumsPosts.' postings!'; $correctErr='';
$title=$title.$errorMSG;
$metaRobots='NOINDEX,NOFOLLOW';
echo load_header(); echo ParseTpl(makeUp('main_warning'));
//Loading footer
$endtime=get_microtime();
$totaltime=sprintf ("%01.3f", ($endtime-$starttime));
if(isset($includeFooter) and $includeFooter!='') include($includeFooter); else echo ParseTpl(makeUp('main_footer'));
exit;
}

/* --Premium forums hack */

Author tom322
Active Member
#6 | Posted: 8 Aug 2007 08:59 
Since $user_num_posts is generated after the language pack included, and this hack is applied for language pack, most probably it won't work.
I learn something everyday :).

Author Anonymous
Guest
#7 | Posted: 4 Oct 2007 10:46 
as it is possible to be done by subjects?

and another forum that a certain amount of subjects requires and post?

Author Paul
Lead Developer 
#8 | Posted: 5 Oct 2007 03:52 
Sorry, the question doesn't sound clear.

Author Anonymous
Guest
#9 | Posted: 5 Oct 2007 09:40 
sorry I used google traslator...

my question is

"Posting allowed with > num_topics"

and other forum ... "Posting allowed with > num_topics + num_posts"

for example: FORUM=19 if num_topics <50 and num_posts<50 :D

Author Paul
Lead Developer 
#10 | Posted: 5 Oct 2007 10:56 
> num_posts already means they are total posts. Topics + messages.

If you mean user should have access to forum only after making certain amount of posts, then I have such solution available, but not distributing it for free ;-) Make your bid and I could sell it to you.

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 Posting allowed with > num_posts
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Proceed with the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑