Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Editing Contact Options (http://www.mysidiaadoptables.com/forum/showthread.php?t=4745)

Abronsyth 12-24-2014 01:20 PM

Editing Contact Options
 
I know I'm asking a lot of questions XD Just trying to fix some things before that I never bothered with.

So in the user's account they have the option to share their facebook and messaging accounts. I would like to remove this as I don't want users to be able to share such personal information on their public profiles.

Then I'd like to add in a Deviantart and Forum account section.

I've looked through accountview.php and lang_account, and while I found the contact section in view, I couldn't find a way to remove specific feilds.

Would someone be able to point me in the right direction?

IntoRain 12-24-2014 02:29 PM

Well, you will have to modify the database first to add in the deviantart and forum account option. Go to your database and add two columns, one for deviantart and the other for the forum

Assuming you called those columns "deviantart" and "forumaccount":

Go to your class_member.php and search for the formatcontacts() function. Then change this line:

PHP Code:

$sites = array("website""facebook""twitter""deviantart""forumaccount"); 

Now go to account.php and change these lines:

PHP Code:

    public function contacts(){
        
$mysidia Registry::get("mysidia");        
        if(
$mysidia->input->post("submit")){
            
$newmsgnotify = ($mysidia->input->post("newmsgnotify") == 1)?1:0;
            
$mysidia->db->update("users_options", array("newmessagenotify" => $newmsgnotify), "username='{$mysidia->user->username}'");

//change this line, add in the ones you want to update, delete the ones you removed from the ArrayList below
            
$mysidia->db->update("users_contacts", array("website" => $mysidia->input->post("website"), "twitter" => $mysidia->input->post("twitter"), "skype" => $mysidia->input->post("skype"), "deviantart" => $mysidia->input->post("deviantart"), "forumaccount" => $mysidia->input->post("forumaccount")), "username = '{$mysidia->user->username}'");
            return;
        }
        
        
$contactList = new ArrayList;    
//remove the lines you dont want, add in the new ones. These have to match the mysidia->db->update commented above
        
$contactList->add(new String("website"));
        
$contactList->add(new String("deviantart"));
        
$contactList->add(new String("forumaccount"));
        
$contactList->add(new String("twitter"));    
        
$contactList->add(new String("skype"));    
        
$this->setField("contactList"$contactList);
    } 

By now, your users are able to edit their deviantart account and can't edit facebook account anymore (in the /account/contacts link).
To change the display in the user's profile (/profile/view/User link), go to class_userprofile.php, contactinfo() function and edit the lines like:

PHP Code:

  private function contactinfo($contacts){
      
$mysidia Registry::get("mysidia");    
      
$document $mysidia->frame->getDocument();    
      
$member = new Member($mysidia->input->get("user"));
      
      if(
$mysidia->user->uid == $member->uid){
      
$document->add(new Image("templates/icons/web.gif""web"));
      
$document->add(new Comment($contacts->website));

      
$document->add(new Image("templates/icons/twitter.gif""twitter"));
      
$document->add(new Comment($contacts->twitter));    
  
      
$document->add(new Image("templates/icons/skype.gif""skype"));
      
$document->add(new Comment($contacts->skype));

//for example I removed the facebook, msn, etc. lines and added these ones:
      
$document->add(new Image("_deviantart_image.gif""deviantart"));
      
$document->add(new Comment($contacts->deviantart));

      
$document->add(new Image("_image_.gif""forumaccount"));
      
$document->add(new Comment($contacts->forumaccount));

      
$document->add(new Image("templates/icons/title.gif""Write a PM"));
      
$document->add(new Link("messages/newpm/{$mysidia->input->get("user")}""Send {$mysidia->input->get("user")} a Private Message"TRUE));
      
$document->add(new Image("templates/icons/fr.gif""Send a Friend Request"));
      
$document->add(new Link("friends/request/{$member->uid}""Send {$mysidia->input->get("user")} a Friend Request"TRUE));
      
$document->add(new Image("templates/icons/trade.gif""Make a Trade Offer"));
      
$document->add(new Link("trade/offer/user/{$member->uid}""Make {$mysidia->input->get("user")} a Trade Offer")); 
      } 
  } 


Abronsyth 12-24-2014 03:19 PM

Aaah awesome!

Thank you very, very much!

Kind of surprised I managed to add the columns XD

IntoRain 12-24-2014 07:06 PM

Quote:

Originally Posted by Abronsyth (Post 31782)
Aaah awesome!

Thank you very, very much!

Kind of surprised I managed to add the columns XD

I'm glad it worked out! ^^


All times are GMT -5. The time now is 01:58 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.