Jump to content


- - - - -

(V88)Points Required To Enter Forum


  • Please log in to reply
15 replies to this topic

#1 Vince

Vince

    Lead Developer

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,973 posts
  • Location:California, USA / Israel
  • Real Name:Vince
  • IPB Version:v3.1.x
Contributor

Posted 13 April 2008 - 09:40 AM

File Name: (V88)Points Required To Enter Forum
File Submitter: Vadim88
File Submitted: 13 Apr 2008
File Updated: 17 Apr 2008
File Category: IP.Board v2.3.x Mods

File Name: (V88)Points Required To Enter Forum

File Description: - Allows you to put a restriction on who have a certain amount of points needed to enter a certain forum.
- Control via ACP - Manage Forums - Add/Edit Forum - Min. number points required to enter the forum

Author: Vadim Gavrilov

File Version: 1.0

Requirements: Universal Mod Installer

Files Affected:

* ./lofiversion/index.php
* ./skin_acp/IPB2_Standard/acp_skin_html/cp_skin_forums.php
* ./sources/action_admin/forums.php
* ./sources/action_public/forums.php
* ./sources/action_public/search.php
* ./sources/action_public/topics.php
* ./sources/action_public/misc/attach.php
* ./sources/action_public/misc/forward_page.php
* ./sources/action_public/misc/print_page.php
* ./sources/classes/post/class_post.php
* ./sources/lib/func_usercp.php

Click here to download this file
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image


Zend Certified Engineer.
Zend Framework Certified Engineer.
-- Email: vadimg88@gmail.com
-- Phone: +972-52-3808258
-- Skype: vadim.gabriel
-- Website: http://www.vadimg.com

formerly known as vadimg88

#2 emoney

emoney

    I'll do graffiti if you sing to me in french

  • Modders
  • PipPipPipPipPipPipPipPip
  • 1,269 posts
  • Real Name:Eric
  • IPB Version:v3.1.x
Contributor

Posted 17 April 2008 - 01:08 AM

Is this supposed to add the point_required to the Members table or the Forums table?  I installed it normally but got IPS driver errors, so I added the field to Forums and it was ok.  Or did I way off?  I any case its working fine now.

If I wanted to add a user group or multiple usergroups who could bypass the minimum point rules, how would I add that to the code?  This is what I came up with, whats wrong with it?

if( ! $this->ipsclass->member['g_access_cp'] && ( $this->ipsclass->member['points'] < $this->forum['points_required'] ) && $this->ipsclass->member['mgroup'] ==95 )	
		{
			$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'points_required', 'EXTRA' => $this->forum['points_required'] ) );

Edited by emoney, 17 April 2008 - 04:58 AM.


#3 Vince

Vince

    Lead Developer

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,973 posts
  • Location:California, USA / Israel
  • Real Name:Vince
  • IPB Version:v3.1.x
Contributor

Posted 17 April 2008 - 06:03 AM

Yes it should add points_required to the forums table, i think it does, i will check this out.

Yea something like this:
$groups = array(1,2,3,4);
if($this->ipsclass->member['points'] < $this->forum['points_required'] ) && ! in_array($this->ipsclass->member['mgroup'], $groups) )	
		{
			$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'points_required', 'EXTRA' => $this->forum['points_required'] ) );

Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image


Zend Certified Engineer.
Zend Framework Certified Engineer.
-- Email: vadimg88@gmail.com
-- Phone: +972-52-3808258
-- Skype: vadim.gabriel
-- Website: http://www.vadimg.com

formerly known as vadimg88

#4 emoney

emoney

    I'll do graffiti if you sing to me in french

  • Modders
  • PipPipPipPipPipPipPipPip
  • 1,269 posts
  • Real Name:Eric
  • IPB Version:v3.1.x
Contributor

Posted 17 April 2008 - 12:49 PM

I think that syntax was a bit off, but this worked:

			$groups = array(4,37,10,119,148);
			if ( $this->ipsclass->member['points'] < $this->forum['points_required'] && ! in_array($this->ipsclass->member['mgroup'], $groups) )	  
		{
			$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'points_required', 'EXTRA' => $this->forum['points_required'] ) );
		}
And if its supposed to add points_required to Forums there is definitely an error in the xml.  here is what all of your recent "XX Required to.."mods have basically:

		<alters_group>
		<alter>
			<alter_type>add</alter_type>
			<table>members</table>
			<field_name>post_required</field_name>
			<field_type>smallint(5)</field_type>
			<field_default>0</field_default>
		</alter>


#5 Vince

Vince

    Lead Developer

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,973 posts
  • Location:California, USA / Israel
  • Real Name:Vince
  • IPB Version:v3.1.x
Contributor

Posted 17 April 2008 - 02:40 PM

Just downloaded the points required and i had this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<mod_data>
	<mod_info>
		<title>(V88)Points Required To Enter Forum</title>
		<version>1.0.0</version>
		<author>vadim88</author>
		<website>http://www.invisionmodding.com/forums/</website>
		<ipbver>2.2</ipbver>
	</mod_info>
	<alters_group>
		<alter>
			<alter_type>add</alter_type>
			<table>members</table>
			<field_name>points_required</field_name>
			<field_type>smallint(5)</field_type>
			<field_default>0</field_default>
		</alter>
	</alters_group>
	<languages_group>
	<language>
			<key>points_required</key>
			<text><![CDATA[Sorry, you must have a total of <#EXTRA#> points or above to enter this forum.]]></text>
			<file>lang_error</file>
		</language>
	</languages_group>
</mod_data>

Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image


Zend Certified Engineer.
Zend Framework Certified Engineer.
-- Email: vadimg88@gmail.com
-- Phone: +972-52-3808258
-- Skype: vadim.gabriel
-- Website: http://www.vadimg.com

formerly known as vadimg88

#6 emoney

emoney

    I'll do graffiti if you sing to me in french

  • Modders
  • PipPipPipPipPipPipPipPip
  • 1,269 posts
  • Real Name:Eric
  • IPB Version:v3.1.x
Contributor

Posted 17 April 2008 - 02:55 PM

Ok, am I just reading that wrong?  You said it has to add points_required to the forums table, but in your alters group it has:

<table>members</table>

shouldn't it be <table>forums</table> ?

Edited by emoney, 17 April 2008 - 02:55 PM.


#7 Vince

Vince

    Lead Developer

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,973 posts
  • Location:California, USA / Israel
  • Real Name:Vince
  • IPB Version:v3.1.x
Contributor

Posted 17 April 2008 - 06:38 PM

Oh darn...yes it should...thanks for that...sometimes my eyes are blurry.....

*of to fix...*
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image


Zend Certified Engineer.
Zend Framework Certified Engineer.
-- Email: vadimg88@gmail.com
-- Phone: +972-52-3808258
-- Skype: vadim.gabriel
-- Website: http://www.vadimg.com

formerly known as vadimg88

#8 Vince

Vince

    Lead Developer

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,973 posts
  • Location:California, USA / Israel
  • Real Name:Vince
  • IPB Version:v3.1.x
Contributor

Posted 17 April 2008 - 06:44 PM

Fixed. ;)
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image


Zend Certified Engineer.
Zend Framework Certified Engineer.
-- Email: vadimg88@gmail.com
-- Phone: +972-52-3808258
-- Skype: vadim.gabriel
-- Website: http://www.vadimg.com

formerly known as vadimg88

#9 emoney

emoney

    I'll do graffiti if you sing to me in french

  • Modders
  • PipPipPipPipPipPipPipPip
  • 1,269 posts
  • Real Name:Eric
  • IPB Version:v3.1.x
Contributor

Posted 17 April 2008 - 07:12 PM

;) Glad I wasn't going crazy!  also, you may want to check your other mods in this variety, all the recent "Required to" mods you made.  I think at least a couple had the wrong table.

#10 Vince

Vince

    Lead Developer

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,973 posts
  • Location:California, USA / Israel
  • Real Name:Vince
  • IPB Version:v3.1.x
Contributor

Posted 17 April 2008 - 07:19 PM

Thanks will do.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image


Zend Certified Engineer.
Zend Framework Certified Engineer.
-- Email: vadimg88@gmail.com
-- Phone: +972-52-3808258
-- Skype: vadim.gabriel
-- Website: http://www.vadimg.com

formerly known as vadimg88

#11 emoney

emoney

    I'll do graffiti if you sing to me in french

  • Modders
  • PipPipPipPipPipPipPipPip
  • 1,269 posts
  • Real Name:Eric
  • IPB Version:v3.1.x
Contributor

Posted 17 April 2008 - 10:33 PM

I just now realized that guests can't view any forum regardless of the minimum set.  "They get the You need <EXTRA> more points to view this forum/" Is that supposed to be happening and if not, what could be the problem?  I of course need at least part of my board open for guests.

edit: unless there is a better solution I'll just add the guest group number to the groups permitted line and then remove the guest permissions for any forum I set restrictions on.  Let me know if there is a better solution. ;)

Edited by emoney, 17 April 2008 - 11:43 PM.


#12 JoshoD

JoshoD

    Advanced Member

  • Members
  • PipPipPipPip
  • 62 posts
  • Real Name:Josh
  • IPB Version:v2.3.x

Posted 14 August 2008 - 10:52 AM

When you enter the forum, do you have to PAY the amount, or do you just NEED the amount...

#13 Vince

Vince

    Lead Developer

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,973 posts
  • Location:California, USA / Israel
  • Real Name:Vince
  • IPB Version:v3.1.x
Contributor

Posted 18 August 2008 - 07:38 AM

He will just need the amount set to enter, the points will not deduct from his account.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image


Zend Certified Engineer.
Zend Framework Certified Engineer.
-- Email: vadimg88@gmail.com
-- Phone: +972-52-3808258
-- Skype: vadim.gabriel
-- Website: http://www.vadimg.com

formerly known as vadimg88

#14 JoshoD

JoshoD

    Advanced Member

  • Members
  • PipPipPipPip
  • 62 posts
  • Real Name:Josh
  • IPB Version:v2.3.x

Posted 19 August 2008 - 03:03 AM

Is there a way to make it so it will deduct the amount from his account only the first time he enters it?

#15 Vince

Vince

    Lead Developer

  • Modders
  • PipPipPipPipPipPipPipPipPipPip
  • 3,973 posts
  • Location:California, USA / Israel
  • Real Name:Vince
  • IPB Version:v3.1.x
Contributor

Posted 19 August 2008 - 07:02 AM

Not right now, No. But i am hoping to extend this for IPB 3.
Vince Gabriel, Lead Developer.
Posted ImagePosted ImagePosted Image


Zend Certified Engineer.
Zend Framework Certified Engineer.
-- Email: vadimg88@gmail.com
-- Phone: +972-52-3808258
-- Skype: vadim.gabriel
-- Website: http://www.vadimg.com

formerly known as vadimg88

#16 Turkulerdiyari

Turkulerdiyari

    Novice

  • Banned
  • PipPip
  • 6 posts
  • IPB Version:v2.3.x

Posted 08 September 2008 - 08:25 PM

View Postemoney, on Apr 18 2008, 12:33 AM, said:

I just now realized that guests can't view any forum regardless of the minimum set.  "They get the You need <EXTRA> more points to view this forum/" Is that supposed to be happening and if not, what could be the problem?  I of course need at least part of my board open for guests.


Same problem here..anybody help please?

Edited by Turkulerdiyari, 08 September 2008 - 08:25 PM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users