Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

More control over what users can do with their accounts

edited January 2006 in Vanilla 1.0 Help
Hi. I'm curently working on a redesign of a website for a local public radio show. This is a voluntary effort, and one that I believe in. Now, for some time, we've been wanting to experiment a bit with our forum. Now that we're redesigning the entire site, we thought this is the perfect opportunity to try out new things with the forum. One of the ideas is that we want the entire discussion forum to concentrate entirely on discussions. We believe that, to achieve that, we'll need a forum that eliminates all unnecessary information that cultivates user internet personas and egos. This includes avatars and signatures. So Vanilla seems to me like it's a perfect solution for us, except for that detail, that one doesn't have that level of control where we can tell our users that there is simply no pictures in their profiles and no icon on their posts. (We are also excluding signatures, as they tend to become annoying cults to a user's ego.) We believe that providing our visitors with a forum like this will generate more discussion by people better-equipped and with better intentions of actually engaging in intelligent discussion. So I was wondering if someone had made an extension or otherwise hacked the code to allow this kind of control. (I've only substantially worked with Perl, so I'm out of my league regarding PHP.) Also, if you're interested in this as well, please post it here to show that people other I are interested in this, the more demand we show, the better chance someone will be inclined to write this code.

Comments

  • While you could do it with an extension, i'm gonna go out on a limb here and say that it's probably easier to do it using themes in 0.9.3 - you can just cut the code straight out of the display which does just as good a job. It depends what sort of hurry you're in really. I wouldnt advise launching 0.9.3 on a live site before it's ready.
    I believe it should be possible in 0.9.2 with extensions/code hacking, but there i'm afraid i cant help you. Unless ofcourse you can cut the css info which will stop them displaying? That'd certainly work for avatars (icons), but i'm not sure about the profile pic.
  • MarkMark Vanilla Staff
    If you wanted to do a quick hack, you could open up the form that allows your users to specify an icon and a picture and cut those fields out of the form. They're not required fields, so the form won't complain about not seeing them when submitted.

    The same thing goes for the "custom information" inputs.

    To do this, go into the controls/account.php file and change the Render method on the IdentityForm class (lines 209 to 301) to look like this:

    function Render() { if ($this->IsPostBack) { if ($this->Context->Session->UserID != $this->User->UserID && !$this->Context->Session->User->AdminUsers) { $this->Context->WarningCollector->Add($this->Context->GetDefinition("PermissionError")); $this->Context->Writer->Add("<div class=\"AccountForm\"> ".$this->Get_Warnings()." </div>"); } else { $this->PostBackParams->Set("PostBackAction", "ProcessIdentity"); $this->PostBackParams->Set("u", $this->User->UserID); $this->PostBackParams->Set("LabelValuePairCount", (count($this->User->Attributes) > 0? count($this->User->Attributes):1)); $Required = $this->Context->GetDefinition("Required"); $this->Context->Writer->Add("<div class=\"AccountForm\"> <h1>".$this->Context->GetDefinition("ChangePersonalInfo")."</h1> <div class=\"Form AccountPersonal\"> ".$this->Get_Warnings()." ".$this->Get_PostBackForm("frmAccountPersonal")." <h2>".$this->Context->GetDefinition("DefineYourAccountProfile")."</h2>"); if (agALLOW_NAME_CHANGE == "1") { $this->Context->Writer->Add("<dl> <dt>".$this->Context->GetDefinition("YourUsername")."</dt> <dd><input type=\"text\" name=\"Name\" value=\"".$this->User->Name."\" maxlength=\"20\" class=\"SmallInput\" id=\"txtUsername\" /> ".$Required."</dd> </dl> <div class=\"InputNote\">".$this->Context->GetDefinition("YourUsernameNotes")."</div>"); } $this->Context->Writer->Add("<dl> <dt>".$this->Context->GetDefinition("YourFirstName")."</dt> <dd><input type=\"text\" name=\"FirstName\" value=\"".$this->User->FirstName."\" maxlength=\"50\" class=\"SmallInput\" id=\"txtFirstName\" /> ".$Required."</dd> </dl> <div class=\"InputNote\">".$this->Context->GetDefinition("YourFirstNameNotes")."</div> <dl> <dt>".$this->Context->GetDefinition("YourLastName")."</dt> <dd><input type=\"text\" name=\"LastName\" value=\"".$this->User->LastName."\" maxlength=\"50\" class=\"SmallInput\" id=\"txtLastName\" /> ".$Required."</dd> </dl> <div class=\"InputNote\"> ".$this->Context->GetDefinition("YourLastNameNotes")." <div class=\"CheckBox\">".GetDynamicCheckBox("ShowName", 1, $this->User->ShowName, "", $this->Context->GetDefinition("MakeRealNameVisible"))."</div> </div> <dl> <dt>".$this->Context->GetDefinition("YourEmailAddress")."</dt> <dd><input type=\"text\" name=\"Email\" value=\"".$this->User->Email."\" maxlength=\"200\" class=\"SmallInput\" id=\"txtEmail\" /> ".$Required."</dd> </dl> <div class=\"InputNote\"> ".$this->Context->GetDefinition("YourEmailAddressNotes")." <div class=\"CheckBox\">".GetDynamicCheckBox("UtilizeEmail", 1, $this->User->UtilizeEmail, "", $this->Context->GetDefinition("CheckForVisibleEmail"))."</div> </div> <div class=\"FormLink\"><a href=\"javascript:AddLabelValuePair();\">".$this->Context->GetDefinition("AddLabelValuePair")."</a></div> <div class=\"FormButtons\"> <input type=\"submit\" name=\"btnSave\" value=\"".$this->Context->GetDefinition("Save")."\" class=\"Button SubmitButton\" /> <a href=\"./account.php?u=".$this->User->UserID."\" class=\"CancelButton\">".$this->Context->GetDefinition("Cancel")."</a> </div> </form> </div> </div>"); } } } }

    It is a hack, but it's quick solution that gives you exactly what you need.
  • Thank you so much! Please excuse my late response, as I've been working on other stuff these days and literally just remembered this discussion. Mark, I will be applying this in the next couple of days. I'll keep you posted as to how it all works out. Thank you both again!
This discussion has been closed.