Webmastersite.net
Register Log In

Paul, simple customization

Title Paul, simple customization
Description Member Link Credit field
Message Text (BTW, I love my the WSN software more and more! Thanks.)


I've added a new numeric member field called MEMBERCREDITS.

Two simple things I'd like to automate with this field.

1. Set it to X when the user registers.

2. Have it decrement by 1 on each link submission.



I figure there will be some new code in member.php addlink(), but it depends on predefined member field globals and I'm not sure how to correctly make the modifications for this custom field.


function addlink()
{
global $plurallinks, $db, $newid;
// incriment counter
$this->$plurallinks = $db->rowitem($db->select($plurallinks, 'memberstable', $newid .'='. $this->id, '', '')); // I have absolutely no idea how this can be needed, but it is
$this->$plurallinks += 1;
$this->update($plurallinks);
return true;
}



Do I need to add another global $plurallinkcredits and a similar object member? If so, where?

Can I get away with just changing the DB value and not the member value, so I don't have to add it? I guess the first arg to the db->select is the field name?

And how would I setup a default value?

Thanks so much!
Rating
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5
0/5 based on 0 votes.
Ownership Thermit
Views 680 views. Averaging 0 views per day.
Similar Topics
Submission Date Dec 14, 2004 - 7:30 PM