Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Forum Module /

Discuss the Forum Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Implementing Point System


Go to End


2 Posts   2451 Views

Avatar
zenmonkey

Community Member, 545 Posts

15 November 2009 at 9:30am

I'm trying to implement a point system into the form module, so that users would gain or spend points when posting to certain forums. I've added a 'Points' field to the extraStatistics function. However adding a Default value has no effect, nor does changing the value in the Edit Member Popup.

Did I add this field tot the wrong function?

Here is the code

function extraStatics() {
		$fields = array(
			'db' => array(
				'ForumRank' => 'Varchar',
				'Occupation' => 'Varchar',
				'Company' => 'Varchar',
				'City' => 'Varchar',
				'Country' => 'Varchar',
				'Nickname' => 'Varchar',
				'FirstNamePublic' => 'Boolean',
				'SurnamePublic' => 'Boolean',
				'OccupationPublic' => 'Boolean',
				'CompanyPublic' => 'Boolean',
				'CityPublic' => 'Boolean',
				'CountryPublic' => 'Boolean',
				'EmailPublic' => 'Boolean',
				'LastViewed' => 'SSDatetime',
				'Signature' => 'Text',
				'Points' => 'Int'
			),
			'has_one' => array(
				'Avatar' => 'Image'
			),
			'belongs_many_many' => array(
				'ModeratedForums' => 'Forum'
			),
			'defaults' => array(
				'ForumRank' => _t('ForumRole.COMMEMBER','Community Member'),
				'Points' => '5'
			),
			'searchable_fields' => array(
				'Nickname' => true
			),
			'indexes' => array(
				'Nickname' => true,
			),
		);
		
		return $fields;
	}

Avatar
johnmblack

Community Member, 62 Posts

27 October 2011 at 9:35am

We are also looking for something like this. Has anyone had any success? Are there any existing mods out there already?