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)
-   -   Need Help Thingy (http://www.mysidiaadoptables.com/forum/showthread.php?t=4740)

IntoRain 12-22-2014 05:01 PM

Quote:

Originally Posted by Kyttias (Post 31755)
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



Kyttias 12-23-2014 03:01 AM

Mmm, is there real harm in actually letting people friend themselves? I think it just looks silly to have the option available to on your own page, aha...

Anyway, Parayna, I've made the shop I helped you work on into an official mod, and you'll be happy to hear the second post of which also includes a matching Inventory. You'll have to switch the css back over to yours, however, if you liked the light blue one I made for you. (Also, I found having inline-table did no real harm, so it's what's now in the css.)

parayna 12-23-2014 06:02 AM

Alright! Thank you both :) (No, there isn't any real harm in it.. I just don't really want it XD Plus everyone thought it was a bug, and to save me getting loads of potential emails or PM's from other people also thinking so, I thought I had better just remove it XD)

parayna 12-31-2014 10:40 PM

Hello again XD Long time no see! Anyway, I have gotten more people signing up and I have discovered (luckily before everyone else XD) that if someone signs up with an apostrophe in their username, it adds a slash into the Member's list and throws an error when trying to access their page.. >.<

It pops up with this:

Invalid ID Specified

Sorry, but we could not find a user in the system with the username you have specified. Please make sure you have the username right. The user's account may also have been deleted by the system admin...

With this in the URL box: /profile/view/Realilty\

The user's name is Realilty's Madness but the slash it pops up with messes it up :/

Do you know how to fix it? :/ This is the full link if you need it: http://ycadopts.byethost4.com/profile/view/Realilty\

Kyttias 12-31-2014 11:44 PM

I'd file an official bug report about this one and contact Hall of Famer directly in a week or two if nothing comes of it. I think this is important enough for the whole community to know about.

parayna 12-31-2014 11:53 PM

Oh, alright! I will! Thanks :)

parayna 01-08-2015 01:26 AM

Does anyone know how to set two different adoptables with the same species name? So say I want one called Original and one called Banana Splatter and I then breed them together to try and get hybrids, it isn't very fun if I have to have the hybrids named something different as you would be able to see if you have a hybrid or not... I have tried to set the names the same but it just shows one on the drop down lists in the admin CP. (Well, it shows both but the links lead to the same type of pet)

I want to avoid using the alt images if possible as I only want them available through breeding..

Thank you


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

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