Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #10  
Old 12-22-2014, 05:01 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 22,455
IntoRain is on a distinguished road
Default

Quote:
Originally Posted by Kyttias View Post
As for the friending yourself thing... perhaps we can make a check so that if you are the user that the page belongs to, to not display the trade, message, or friend options. In class_userprofile.php, near the bottom of the page near the bottom of the contactinfo function, you can surround stuff with

PHP Code:
 if (!$mysidia->user == $mysidia->input->get("user")){ ... } 
which reads 'if not the user whose page this is, you can display this' implying that that if you are the user whose page this is, the stuff inside it will therefore not display.
Just a tip relating to this: Hiding the options/links from the users isn't enough to avoid having users visiting those links. Specially with frameworks like mysidia that are public, so people might have some knowledge about which links work. Even if you hide the profile stuff, they still can friend themselves by going through /friends/request/their_id

To really prevent it, in friends.php, request() function, do the following:

PHP Code:
    public function request(){
        
$mysidia Registry::get("mysidia");
        if(!
$mysidia->input->get("id")) throw new InvalidIDException("friend_id");
        
$friend = new Friend(new Member($mysidia->input->get("id")), $this->friendlist);
        
    
//addthis
    
$input $mysidia->input->get("id");    
    if(
$input instanceof String$input $input->getValue();
    
$user_id is_numeric($input) ? $mysidia->user->uid $mysidia->user->username;

    if(
$user_id == $input)
        throw new 
InvalidIDException("<br>Invalid Action! You can't add yourself to your friendlist.");
        
        if(!
$friend->isfriend){      
            if(
$friend->sendrequest()) $this->setField("friend", new String($friend->username));
            else throw new 
DuplicateIDException("<br>Invalid Action! This is a duplicate friend request between you and {$friend->username}.");
        }
        else throw new 
InvalidIDException("<br>Invalid Action! The user {$friend->username} is already on your friendlist.");
    } 
That way, accessing the link directly will throw an error if you try to add yourself to your friendslist.

And to hide it, try:

PHP Code:
$member = new Member($mysidia->input->get("user"));

if(
$mysidia->user->uid != $member->uid){
//put what you want to show here

__________________


asp.net stole my soul.

Last edited by IntoRain; 12-22-2014 at 05:27 PM.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cool little pager thingy? LilPixie Questions and Supports 4 02-09-2009 05:47 PM


All times are GMT -5. The time now is 06:51 PM.

Currently Active Users: 2078 (0 members and 2078 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636