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.

Forum Module /

Discuss the Forum Module.

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

Implementing Point System


Reply


2 Posts   1434 Views

Avatar
zenmonkey

Community Member, 528 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, 61 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?