Restrict Access Until Post

Started by TechnoDragon, April 04, 2007, 02:46:02 PM

Previous topic - Next topic

TechnoDragon

Link to Mod

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!
Don't tell me to get into shape...I have a shape...It is round!


lockelymarkets

Where do I find it in the admin panel after installation?

TechnoDragon

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
Don't tell me to get into shape...I have a shape...It is round!


drazprod

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.

TechnoDragon

That wasn't the point of this mod...sorry.
Don't tell me to get into shape...I have a shape...It is round!


drazprod


linette97

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
Watch Documentaries Online!


Yesterday is history,
Tomorrow is a mystery,
Today is a gift,
That's why it's called the Present.

Joshsux

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.
If you can't hear it before you see it, then it ain't a harley

Valodim

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...

SpelingMistakes

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
There is a huge difference between living and being alive!

CommonCents

The "main source file" thats the index file correct?

0mExIcAn

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

0mExIcAn

Nobody can help?

This site is huge!

And nobody cant help me?

0mExIcAn


Guy Verschuere

#14
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

leomai

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

Guy Verschuere

it works in 1.1.3

The parse error is because you mistyped something.

wmiles

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

PandoraBizkit

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.  :)
Just live it!

PandoraBizkit

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.
Just live it!

PandoraBizkit

Still nothing, is that simply because nobody knows the answer then?  :o
Just live it!

spiky1471

someone make this work with 1.1.4 ?

AndyII

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 :)

googleminigames.com

will this ever work for smf 1.1.4


:(

john34516


F4r4Zm0In

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?
---------------------
Not Just Another Forum
---------------------

limo2005

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"

:-\
I dunno!

ooze_orb

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

jvo

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?

LizN

Any updates? I'm using 1.1.8 and would find this mod very handy for my forum.

Blinker

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?

R.Bourne

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.

strale_91

this installation is for 1.1.8+...... work's for me....

chrishicks

Anyone care to help me work this out so I can have this apply to private messages?

Scarecrow7170

Any updates??  I am using 1.1.11 & need something like this. so obviously outdated.

program5

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 :)

hcfwesker

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.

Apllicmz

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>



StevenTing

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?

ssbb_fm

Bumping.

I'm really needing this mod in 2.0
Can anyone help?
I want to have my members keep active.

TrickyRicky

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.

Advertisement: