Mysidia Adoptables Support Forum  

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

Notices

Reply
 
Thread Tools Display Modes
  #11  
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,453
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
  #12  
Old 12-23-2014, 03:01 AM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 127,478
Kyttias is on a distinguished road
Default

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.)
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
  #13  
Old 12-23-2014, 06:02 AM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 27,839
parayna is on a distinguished road
Default

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)
Reply With Quote
  #14  
Old 12-31-2014, 10:40 PM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 27,839
parayna is on a distinguished road
Default

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\

Last edited by parayna; 12-31-2014 at 11:53 PM.
Reply With Quote
  #15  
Old 12-31-2014, 11:44 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 127,478
Kyttias is on a distinguished road
Default

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.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
  #16  
Old 12-31-2014, 11:53 PM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 27,839
parayna is on a distinguished road
Default

Oh, alright! I will! Thanks :)
Reply With Quote
  #17  
Old 01-08-2015, 01:26 AM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 27,839
parayna is on a distinguished road
Default

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
Reply With Quote
Reply


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 01:00 AM.

Currently Active Users: 2216 (0 members and 2216 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