vForums Support > Programming & Coding :: Code Requests & Support :: > [F] View Threads By Post Count?

[F] View Threads By Post Count? - Posted By rosebud (rosebud) on 18th Jun 08 at 1:36am
I wasn't sure what the proper title of this code should be, but is it possible to have a code where a member has to have a certain post count set by the admin in order to view a thread/threads?

Re: View Threads By Post Count? - Posted By Marc (cr0w) on 18th Jun 08 at 1:49am
While yes, this would be possible, it would not work perfectly. A member could easily add /noheaders/1/ to the URL and bypass the code, as well as viewing the source code to see what was posted. Also, slower computers will show the topic prior to the code fully loading.

However, if you would like, I'll still code this up for you. {Smile}

Re: View Threads By Post Count? - Posted By rosebud (rosebud) on 18th Jun 08 at 2:06am
Is there perhaps another way to go about it to make the code more secure? It'd just be nice to make a topic where only certain members with a certain post count can view it, but the admin can edit the amount of threads and posts and what not.

If not, please code this up for me. Thank-you.

Re: View Threads By Post Count? - Posted By Marc (cr0w) on 18th Jun 08 at 2:19am
 
Is there perhaps another way to go about it to make the code more secure? It'd just be nice to make a topic where only certain members with a certain post count can view it, but the admin can edit the amount of threads and posts and what not.

If not, please code this up for me. Thank-you.


Unfortunately, anyone who knows about the noheaders URL trick would be able to bypass this code; no matter how secure it was made.

However, a code will keep out the majority of general users, so I'll get it coded up for you either in a few minutes if I don't fall asleep, or tomorrow afternoon. {Smile}

Re: View Threads By Post Count? - Posted By rosebud (rosebud) on 18th Jun 08 at 2:23am
I think most of them wouldn't know how to break the code or would even think of use "view source."

Thank-you!

Re: View Threads By Post Count? - Posted By Michael (wrighty) on 18th Jun 08 at 8:16am
You can restrict BOARDS based on posts - so how about doing that? {Smile}

Re: View Threads By Post Count? - Posted By rosebud (rosebud) on 18th Jun 08 at 4:58pm
Except this one is for viewing certain threads, not certain boards. I want my members and guests to see the rest of the threads in the forum. Also, another reason why I want this code is to give members a type of reward, but they'd have to remain active. I don't want the members to join for the sake of seeing them.

Re: View Threads By Post Count? - Posted By Michael (wrighty) on 18th Jun 08 at 7:38pm
I can code this for you! Have you checked the database just to make sure - as I remember doing something like this in past, I could be wrong though! {Tongue Out}

Re: View Threads By Post Count? - Posted By rosebud (rosebud) on 18th Jun 08 at 7:51pm
I have checked the database. There are a lot of codes, though. I could have easily missed it if it was already made?

Re: View Threads By Post Count? - Posted By Michael (wrighty) on 18th Jun 08 at 8:02pm
Yup, it's not in the index. I'll get to it later tonight - shower first! {Tongue Out}

Re: View Threads By Post Count? - Posted By rosebud (rosebud) on 18th Jun 08 at 8:09pm
I thought Marc was coding it? o-o

Re: View Threads By Post Count? - Posted By Michael (wrighty) on 18th Jun 08 at 8:14pm
Psh marc sucks... I'll code it for you! {Smile}

Marc coded it! {Grin}

Re: View Threads By Post Count? - Posted By Marc (cr0w) on 18th Jun 08 at 8:32pm
I said I'd code it so I did. {Unsure}

<script type="text/javascript">
<!--
/*
Restrict Topics By Post Count
Coded by Cr0w
Copyright 2008
*/

var min_posts = 500;
var except = "test|admin|test2";
var topic = 1;

// No more edits
if(vf_posts<min_posts && !vf_username.match(except) && location.href.match("topic/"+topic)){
get('forum_table','id').style.display = "none";
var tbl = '<table cellspacing="1" cellpadding="3" class="border" align="center" width="' + vf_width + '">';
tbl += '<tr><td class="title1" style="font-weight: bold">';
tbl += 'An Error Has Occurred';
tbl += '</td></tr>';
tbl += '<tr><td class="window1">';
tbl += 'This topic requires a post count of at least ' + min_posts + ' to be viewed.';
tbl += '</td></tr></table>';
document.write(tbl);
}
//-->
</script>


Change the blue to the minimum number of posts required to see the topic.

The green is the users that can see the topic regardless of their post count. Separate each username with a |

The red is simply the ID of the topic that is being restricted.

This goes in the footer of the board that the post is in. {Smile}

Re: View Threads By Post Count? - Posted By Michael (wrighty) on 18th Jun 08 at 8:37pm
I would have used an array and had more than one thread! {Tongue Out}

BUT ... it's smex! {Cheesy}

Re: View Threads By Post Count? - Posted By rosebud (rosebud) on 18th Jun 08 at 8:49pm
I pictured this differently. Adding users to view the thread just makes it hard on the admin. Isn't there a way to link the thread where the members can just gain a certain post count and when they do the thread will show?

Re: View Threads By Post Count? - Posted By Marc (cr0w) on 18th Jun 08 at 9:45pm
 
I pictured this differently. Adding users to view the thread just makes it hard on the admin. Isn't there a way to link the thread where the members can just gain a certain post count and when they do the thread will show?


That's exactly how it does work; any member with a post count above the number you specify can automatically view the topic.

The list of users is meant for when you want certain users with a lower-than-required post count to view the topic. {Wink}

Re: View Threads By Post Count? - Posted By rosebud (rosebud) on 18th Jun 08 at 10:11pm
Oh! Okay. I get it now! I...think.... Thank-you!! *huggles*

Re: View Threads By Post Count? - Posted By Marc (cr0w) on 18th Jun 08 at 10:46pm
No worries. {Smile}