View Single Post
  #2  
Old 12-24-2014, 02:29 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 22,453
IntoRain is on a distinguished road
Default

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")); 
      } 
  } 
__________________


asp.net stole my soul.

Last edited by IntoRain; 12-24-2014 at 02:32 PM.
Reply With Quote