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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Forum Module /

Discuss the Forum Module.

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

Implementing Point System


Go to End


2 Posts   1918 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?