Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: TechnoDragon on April 04, 2007, 02:46:02 PM

Title: Restrict Access Until Post
Post by: TechnoDragon on April 04, 2007, 02:46:02 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=551)

I had been trying to figure out a way to make it so that members of my forum would not have access to certain parts until they posted (mainly because they would make the initial posts to get access upon registration, but then would never post again)  So I came up with this.  This is actually a recode of the post count warning mod.

After install you will need to add the code below per the instructions to make this work right>

This will add the ability to enable/disable the post count restriction not just through admin, but allow you to also restrict ANY page you want if you add this code to the template file.  To do this add this code to the main source file for the section of the forum you want to restrict right after the brace ( { ) after the initial function call in the source directory file (example would be smf shop initial function call in the shop.php is function shop () { ) the code below goes right after that:

     global $sourcedir;
  // If it is sunday allow everyone on.
require_once($sourcedir.'/RestrictAccess.php');
if ($context['user']['is_logged']){
echo RestrictAccess(2);
}


The additional beauty of this code is it shows a warning box on every page your members go to remind them they need to make their posts, I have made the number of post perday changeable in admin as well as the ability to change the day of the week that you can have as your free-for-all day!
Title: Re: Restrict Access Until Post
Post by: lockelymarkets on April 10, 2007, 08:55:58 PM
Where do I find it in the admin panel after installation?
Title: Re: Restrict Access Until Post
Post by: TechnoDragon on April 11, 2007, 12:51:49 PM
Quote from: lockelymarkets on April 10, 2007, 08:55:58 PM
Where do I find it in the admin panel after installation?

It is under features and options
Title: Re: Restrict Access Until Post
Post by: drazprod on April 15, 2007, 09:25:33 PM
Sorry for my english.
Can you introduce the karma condition ?

Example:

if you have the karma <5, you don't have the permission and the restrict access.
Title: Re: Restrict Access Until Post
Post by: TechnoDragon on April 16, 2007, 09:12:56 AM
That wasn't the point of this mod...sorry.
Title: Re: Restrict Access Until Post
Post by: drazprod on April 16, 2007, 07:46:49 PM
ok, it's just an question.
Title: Re: Restrict Access Until Post
Post by: linette97 on April 26, 2007, 01:32:32 AM
This is exactly what I've been looking for.. I installed it and applied.. but it makes my forum all off ..everything is stretched out.. have to scroll way down to see the main part... ... I'm not using the default theme.. using Leviathan theme.. what can i do to fix this?? thanks in advance
Title: Re: Restrict Access Until Post
Post by: Joshsux on May 04, 2007, 12:50:39 AM
line, i'm not using it but it must be because the message is bigger than your template, the easiest way for me to explain here is go into the edit file "i don't have the mod here so i don't know what it would be" and find where it has the width and height for the message, you should be able to make it shorter, meaning it will be in your template better.

Another thing you could do is move it to another part of your theme editing the template.php file.
Title: Re: Restrict Access Until Post
Post by: Valodim on May 05, 2007, 09:47:43 AM
Quote from: TechnoDragon on April 04, 2007, 02:46:02 PM
I had been trying to figure out a way to make it so that members of my forum would not have access to certain parts until they posted (mainly because they would make the initial posts to get access upon registration, but then would never post again)

What's the matter with postgroup permissions? They do the job just fine...
Title: Re: Restrict Access Until Post
Post by: SpelingMistakes on June 26, 2007, 06:43:54 PM
Is it possible to look almost whole weak without notice and only one day with notice – Just to remember people not to forget to post?

Spel
Title: Re: Restrict Access Until Post
Post by: CommonCents on June 28, 2007, 07:48:15 PM
The "main source file" thats the index file correct?
Title: Re: Restrict Access Until Post
Post by: 0mExIcAn on August 01, 2007, 11:50:20 PM
Please help me!

I dont know how to put in the code...

I am new and I dont know where to put it...

This is the code I am supposed to put in right.

//Otherwise annoy them to post daily!
// If post count is less required let them know!!
$memberResult = loadMemberData($ID_MEMBER, false, 'profile');
list ($memID) = $memberResult;
$date = @getdate(forum_time(false));
$midnight = mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']) - ($modSettings['time_offset'] * 3600);
$query = db_query("
SELECT COUNT(ID_MSG) AS 'msgCount'
FROM {$db_prefix}messages
WHERE ID_MEMBER = '$memID' AND posterTime >= '$midnight'", __FILE__, __LINE__);
$result = mysql_fetch_assoc($query);
$posts_per_day = $result['msgCount'];
$restrictaccess = $modSettings['DayOfTheWeek'];
$dotw = date("w");
// If it is sunday allow everyone on.
if($dotw != $restrictaccess)
{
// If post count is less that 3 per day deny!!
if(($context['user']['is_logged']) && ($posts_per_day < $modSettings['MinReqPostCountRestrict']) && ($modSettings['restrictaccess'] == '1'))
{
echo '
<table align="center" style="width: 100%; padding: 20px; text-align: left; vertical-align: middle; margin: 2ex 1ex 2ex 1ex; border: 2px dashed ', $modSettings['PostCountWarningBorderColor'],'; background-color: ', $modSettings['PostCountWarningBackgroundColor'],';">
<tr>
<td width="64">
<img style="vertical-align: middle;" src="'.$settings['images_url'].'/pcWarn.gif" alt="Attention!" />
</td>
<td style="color: ', $modSettings['PostCountWarningTextColor'],';">
<strong>', $modSettings['PostCountRestrictMessageTitle'], '</strong><br />', $modSettings['PostCountRestrictMessage'], '
</td>
</tr>
</table>
';
} // End restrict low posts
} //end free-for-all
Title: Re: Restrict Access Until Post
Post by: 0mExIcAn on August 03, 2007, 01:02:03 AM
Nobody can help?

This site is huge!

And nobody cant help me?
Title: Re: Restrict Access Until Post
Post by: 0mExIcAn on August 04, 2007, 01:05:15 PM
Some one please reply!
Title: Re: Restrict Access Until Post
Post by: Guy Verschuere on August 08, 2007, 02:34:29 AM
Hey,

I've put the code in 'downloads.php'
The message shows up saying I don't have a post yet for that day, but stil I see the rest of the page and I am able to download.
What's going wrong?

edit: can I link this to some parts of the profile? ex If a member doesn't fillin it's location, that the warning shows?

Thanks
Guy
Title: Re: Restrict Access Until Post
Post by: leomai on August 12, 2007, 04:28:06 PM
would this work for 1.1.3?

i have try it this is what i got

Parse error: syntax error, unexpected ',' in .../index.template.php on line 207
Title: Re: Restrict Access Until Post
Post by: Guy Verschuere on August 14, 2007, 01:38:12 AM
it works in 1.1.3

The parse error is because you mistyped something.
Title: Re: Restrict Access Until Post
Post by: wmiles on October 09, 2007, 11:26:56 AM
Sorry i would like to know where to put the code in the first post. I have installed the mod and i can see the options in Admin Panel, but i cant see how i can restrict a board within the forum

Thanx in advance
Title: Re: Restrict Access Until Post
Post by: PandoraBizkit on October 10, 2007, 08:08:19 AM
Hi there,

I think I have the same issue with this mod.  It's installed but I can't find out how to restrict access to simply one board.  I don't want a post count on all the boards, only on one, I thought the info with the mod said that this was possible?

Thanks for any help that comes from this post.

PandoraBizkit.  :)
Title: Re: Restrict Access Until Post
Post by: PandoraBizkit on October 13, 2007, 01:32:56 PM
Well........I have to say that I'm really surprised there has been no replies to this.  I'm sure we are not the only people having issues with it and surely it's better to iron out the kinks?

The main thing I have always reccommended SMF to people for is the support that is always readily available.  Sadly, not so on this thread.
Title: Re: Restrict Access Until Post
Post by: PandoraBizkit on November 05, 2007, 08:56:49 AM
Still nothing, is that simply because nobody knows the answer then?  :o
Title: Re: Restrict Access Until Post
Post by: spiky1471 on December 01, 2007, 06:35:40 PM
someone make this work with 1.1.4 ?
Title: Re: Restrict Access Until Post
Post by: AndyII on December 17, 2007, 12:54:06 PM
would be great if this mod would allow for a specific board (s), and also chosen membergroups, say just the "newbies"
anyone know what happened to the author?, seems he could fix this  (ad it) rather quickly :)
Title: Re: Restrict Access Until Post
Post by: googleminigames.com on February 03, 2008, 03:25:15 AM
will this ever work for smf 1.1.4


:(
Title: Re: Restrict Access Until Post
Post by: john34516 on March 22, 2008, 03:49:08 PM
work for smf 1.1.4?
Title: Re: Restrict Access Until Post
Post by: F4r4Zm0In on May 20, 2008, 10:28:30 AM
I have got this while installing this mod:

Install Actions
Installations actions for "Restrict Access Until Post":
The package you are trying to download or install is either corrupt or not compatible with this version of SMF.

It seems that it is not compatible with my version of smf which is 1.1.5, am i right?
Title: Re: Restrict Access Until Post
Post by: limo2005 on May 26, 2008, 06:55:51 PM
Quote from: F4r4Zm0In on May 20, 2008, 10:28:30 AM

It seems that it is not compatible with my version of smf which is 1.1.5, am i right?

Yep! 

I am also using 1.1.5 and I would love to have this on my forum!  Ideally, I would like to restrict access to a "SPOILERS" section as it seems that a certain number of members from all groups just visit that section and never post!  I would like to encourage more activity and this mod would help me to get at least one post before showing the latest "Spoiler"

:-\
Title: Re: Restrict Access Until Post
Post by: ooze_orb on June 20, 2008, 09:55:32 AM
QuoteIt seems that it is not compatible with my version of smf which is 1.1.5, am i right?

I am also looking for this...

Is there a 1.1.5 version ????

greetz ooze
Title: Re: Restrict Access Until Post
Post by: jvo on December 09, 2008, 03:32:25 PM
Quote from: ooze_orb on June 20, 2008, 09:55:32 AM
QuoteIt seems that it is not compatible with my version of smf which is 1.1.5, am i right?

I am also looking for this...

Is there a 1.1.5 version ????

greetz ooze
1.1.7 now even... would be nice to use this one, but i dont feel like trying it on a big 450k posts live board....anyone did and succeed?
Title: Re: Restrict Access Until Post
Post by: LizN on February 09, 2009, 11:25:52 PM
Any updates? I'm using 1.1.8 and would find this mod very handy for my forum.
Title: Re: Restrict Access Until Post
Post by: Blinker on February 27, 2009, 11:27:14 PM
Quote from: LizN on February 09, 2009, 11:25:52 PM
Any updates? I'm using 1.1.8 and would find this mod very handy for my forum.

Me too! Does anyone know of a similar mod?
Title: Re: Restrict Access Until Post
Post by: R.Bourne on May 19, 2009, 02:32:13 PM
Modified version to work with all SMF versions up to and including 1.1.8

Enjoy!

WARNING: Even if you don't get an error message during install, you probably have to follow the exact instructions for 1.1.2 on MOD page specially if you have too many other MODs, such as Google Bot and etc, and other themes. I had to spend less than 5 min to get it to work no trouble with over 56 MODs here. Go ahead with installation but double check all the files to make sure they are all updated.

NOTE: When it comes to other themes, you may also need to redesign the warning message for the user to fit nicely on your forum.
Title: Re: Restrict Access Until Post
Post by: strale_91 on August 04, 2009, 11:01:46 PM
this installation is for 1.1.8+...... work's for me....
Title: Re: Restrict Access Until Post
Post by: chrishicks on August 05, 2009, 12:28:31 AM
Anyone care to help me work this out so I can have this apply to private messages?
Title: Re: Restrict Access Until Post
Post by: Scarecrow7170 on January 17, 2010, 02:57:57 PM
Any updates??  I am using 1.1.11 & need something like this. so obviously outdated.
Title: Re: Restrict Access Until Post
Post by: program5 on March 15, 2010, 05:12:40 PM
I do appreciate all the help that mod authors give.
But outdated and unsupported mods are really a headache.
And yes I need this for 1.1.11 :)
Title: Re: Restrict Access Until Post
Post by: hcfwesker on August 18, 2010, 04:11:50 PM
Quote from: strale_91 on August 04, 2009, 11:01:46 PM
this installation is for 1.1.8+...... work's for me....

Thanx so much for the update.

How exactly would I apply this to the chat.  I don't see anything as explained in the REAMD Me text.
Title: Re: Restrict Access Until Post
Post by: Apllicmz on December 29, 2010, 11:25:13 PM
when update dont forget Portugues

<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
        <operation>
            <search position="end"><![CDATA[]]></search>
            <add><![CDATA[
//Begin Page Restriction Text by candidosa2
$txt['PostCountRestrictMessageTitle'] = 'Acesso restrito - T&iacute;tulo';
$txt['PostCountRestrictMessage'] = 'Acesso restrito - Mensagem';
$txt['MinReqPostCountRestrict'] = 'M&iacute;nimo exigido para contagem no poste (0 = disabled)';
$txt['restrictaccess'] = 'Activar acesso restrito';
$txt['DayOfTheWeek'] = 'Qual e o dia de semana que esta livre?';
$txt['dow0'] = 'Domingo';
$txt['dow1'] = 'Segunda-feira';
$txt['dow2'] = 'Ter&ccedil;a-feira';
$txt['dow3'] = 'Quarta-feira';
$txt['dow4'] = 'Quinta-feira';
$txt['dow5'] = 'Sexta-feira';
$txt['dow6'] = 'S&aacute;bado';
$txt['PostCountWarningBorderColor'] = 'Aviso na contagem de poste - Cor em limite';
$txt['PostCountWarningBackgroundColor'] = 'Aviso na contagem de poste - Cor do fundo';
$txt['PostCountWarningTextColor'] = 'Aviso na contagem de poste - Cor do texto';
//End Page Restriction Text support smfpt
]]></add>
        </operation>
    </file>
    <file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
        <operation>
            <search position="end"><![CDATA[]]></search>
            <add><![CDATA[
//Begin Page Restriction Text by candidosa2
$txt['PostCountRestrictMessageTitle'] = 'Acesso restrito - T&iacute;tulo';
$txt['PostCountRestrictMessage'] = 'Acesso restrito - Mensagem';
$txt['MinReqPostCountRestrict'] = 'M&iacute;nimo exigido para contagem no poste (0 = disabled)';
$txt['restrictaccess'] = 'Activar acesso restrito';
$txt['DayOfTheWeek'] = 'Qual e o dia de semana que esta livre?';
$txt['dow0'] = 'Domingo';
$txt['dow1'] = 'Segunda-feira';
$txt['dow2'] = 'Ter&ccedil;a-feira';
$txt['dow3'] = 'Quarta-feira';
$txt['dow4'] = 'Quinta-feira';
$txt['dow5'] = 'Sexta-feira';
$txt['dow6'] = 'S&aacute;bado';
$txt['PostCountWarningBorderColor'] = 'Aviso na contagem de poste - Cor em limite';
$txt['PostCountWarningBackgroundColor'] = 'Aviso na contagem de poste - Cor do fundo';
$txt['PostCountWarningTextColor'] = 'Aviso na contagem de poste - Cor do texto';
//End Page Restriction Text support smfpt
]]></add>
        </operation>
    </file>
Title: Re: Restrict Access Until Post
Post by: StevenTing on July 21, 2011, 11:24:56 AM
Sorry to bring up a super old thread.  Found this mod and I like it.  But any possibility of having it updated for Version 2?
Title: Re: Restrict Access Until Post
Post by: ssbb_fm on October 02, 2012, 08:45:08 PM
Bumping.

I'm really needing this mod in 2.0
Can anyone help?
I want to have my members keep active.
Title: Re: Restrict Access Until Post
Post by: TrickyRicky on December 03, 2013, 05:20:04 PM
Hello all i know this mod is real old but iv been searching and cant find any thing like it is there another mod like this or can it easy be updated.