Need Help Thingy

Forum
Last Post
Threads / Messages

KittHaven

Member
Member
Joined
May 21, 2013
Messages
478
Points
28
Age
25
Location
Devon, UK
Mysidian Dollar
8,292
OK, I decided that I am pretty much filling up the forum with random posts so, unless I am not allowed to do this, I have decided to make this ONE post have all my pleas for help on it XD I have gotten most of the major stuff done now.. just a few small bits left to do. (And a few big bits, but they can wait for the moment..)

Anyway, the small things I need help with as I write this are:

  Spoiler: All the completed stuff have been moved into here :P 
  Spoiler: Completed! (Look below for what solutions were used) 
  • Is it possible to resize adoptable images on the myadopts page? (CSS file or something? >.<) This is so that people can have more than two adoptables on their Adoptables page without it going over the wrapper and extending it too much (thanks to IntoRain, and Kyttias, I already have the myadopts page formatted as I want it and can specify how many to have in a row)

  Spoiler: Completed! (Look below for what solutions were used) 
  • When you go to your profile, you are able to friend yourself XD Is there something I can add in to prevent that? XD

  Spoiler: Completed! (Look below for what solutions were used) 
  • NEW!! There are slashes in the bios of people when they send PM's (only just noticed):
      Spoiler: Image 
    screenshot_zps77ba482e.png

  • Whenever you go to the message center and try to visit the outbox, it won't let you in unless something is already in it. The page appears blank. And as soon as you add something to it, you can go and view it. Preferably I would like a little message to be there and say that there is currently nothing in your Outbox (instead of the blank page, as it makes it look like the site is broken XD)

  • NEW!! 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.. >.<

The big things I need help with:

  Spoiler: Completed! (The link to the public thread is inside these spoiler tags! Just open and click to go there) 

(Link for shop AND inventory creation) = http://www.mysidiaadoptables.com/forum/showthread.php?p=31764

  • The inventory page to be like my shop page (Kyttias said they'd look)

  • The adopt shops to be like my item shops.

  • I kind of want my pound to appear differently... but I am not sure exactly how I wish it to appear. (I will probably update this when I have more of an idea)

  • I kind of want the tab on the profile that shows your adoptables to be like the myadopts page... so it'll show the same things, and be lay out similarly with a function for me to resize them. Might look a bit neater than the adoptables just being thrown in as they are now XD (I want this still in the tabbed sections if possible, to avoid any serious recodes just yet, so if you need a screenie of what it currently looks like, ask me :) )

Thank you for reading~

~Parayna

(and I will probably add stuff in new comments when I need help and then also update the main post with the problem and solution for those who come and read after)
 
Last edited:
ovo/ Hi again.

I've got this in my css and it seemed to have helped a lot:
HTML:
#form table img, #adopttable img, #top10 img, #rand5 img { width: 250px; }

If you find any other elements that are too large there are ways to inspect the HTML of a page by right-clicking and hitting 'Inspect Element' from the mouse menu in both Firefox and Chrome. Try to look at what container they're sitting inside, and go from there when making your css.

I know next to nothing about the Outbox/Inbox/Message stuff because I'm the only member of my site. Definitely ask IntoRain on this one.

I'll be leaving Monday down to my gf's parents place and I'll be able to work on the inventory for you, definitely. And then sometime after that, can probably help with the adopt shop. I don't actually have an adopt shop set up yet for myself (dunno if I'll use one, in the end), but I'll definitely give it a shot.

I'd kind of like my pound page to be different, too. But maybe too different, aha... I can still probably help once you have a better idea.
 
Hi XD OK, thanks. I'll try that! And yeah, I sometimes do the F12 thing but I get bored because I can't find it straight away (need to stop doing that ¬.¬) And it's fine, take your time, obviously XD I just thought of having one post instead of many... :p

EDIT: Actually, not sure if that'll help me. (The thingy for the CSS) I tried and it doesn't work *^* Thanks though XD (It might just be because I have differen specifications? I dunno XD I may do the F12 thing in a moment :p
 
Ah, right. You took yours out of the table. But areas like on the stats page, where its still in the table, that code would make the images smaller, etc.

Anyway, back when you did this in the other thread?
PHP:
$cell->add(new Comment("<a href='/myadopts/manage/{$aid}'><img src='{$adopt->getImage()}'></a>"));

Try just adding an inline style or width there on the image element directly, just like you would if it were html.
 
Alright, I'll try that thanks!

EDIT: Well, it worked. To an extent. It does resize the larger images, only it also resizes the smaller images XD Which means the eggs now look big and blurry.. and also, peeking around the internet they recommend you be careful as certain browser sizes don't like it.. (small ones for example). This is about as far as my knowledge goes *^*

Could we do a if statement and if it's $eggImage = yes or something, don't resize? (I know that isn't a valid statement XD But to get my point across of kind of the thing I want?)

This is the line so far:

PHP:
                $cell->add(new Comment("<a href='/myadopts/manage/{$aid}'><img src='{$adopt->getImage()}' width= '200px'></a>"));

And as I said, I only know html to a short extent... the internet helps me a lot XD But I'm glad I even managed to do that XD And that I knew where to put the width command, so so far I'm happy :p

EDIT again: And would you also be able to do it with the baby image? (All species on my site will have 3 stages, regardless of species)
 
Last edited:
My site's similar -- and basically? I take the largest image and save everything it's size with a lot of extra space around it. That's my easiest solution, though it requires resaving everything. I planned ahead in this.

However, theoretically it should be possible to get the adoptable's level and resize accordingly:
PHP:
 $lvl = $adopt->getCurrentLevel();
 # if level 0 (egg) resize to 50px
 if ($lvl == 0) { $cell->add(new Comment("<a href='/myadopts/manage/{$aid}'><img src='{$adopt->getImage()}' width= '50px'></a>")); }
 # if level 1 (baby) resize to 100px
 if ($lvl == 1) { $cell->add(new Comment("<a href='/myadopts/manage/{$aid}'><img src='{$adopt->getImage()}' width= '100px'></a>")); }
 # if level is 2 or greater (adult) resize to 200px
 if ($lvl >= 2) { $cell->add(new Comment("<a href='/myadopts/manage/{$aid}'><img src='{$adopt->getImage()}' width= '200px'></a>")); }

Although if the egg images do not need resizing, just remove the width attribute from theirs entirely. ovo

(I think most browsers only take issue if you resize with percents, rather than exact pixel widths? There's also "sort of" a difference between style="width: 200px", width="200", and width="200px" but mostly just not.)
 
Last edited:
Thank you! It worked! I even managed to edit the align:

PHP:
                $aCell->setAlign(new Align("center", "bottom"));

To make it look like they were on the same level :p

  Spoiler: For anyone interested in the dimensions I used, for whatever reason XD 
PHP:
				$lvl = $adopt->getCurrentLevel();
				# if level 0 (egg) resize to 50px
				if ($lvl == 0) { $cell->add(new Comment("<a href='/myadopts/manage/{$aid}'><img src='{$adopt->getImage()}' width= '90px'></a>")); }
				# if level 1 (baby) resize to 100px
				if ($lvl == 1) { $cell->add(new Comment("<a href='/myadopts/manage/{$aid}'><img src='{$adopt->getImage()}' width= '130px'></a>")); }
				# if level is 2 or greater (adult) resize to 200px
				if ($lvl >= 2) { $cell->add(new Comment("<a href='/myadopts/manage/{$aid}'><img src='{$adopt->getImage()}' width= '200px'></a>")); }

Thanks~
 
Last edited:
I have another problem D: Your method before to get rid of slashes worked, but now I see that there are slashes in the bios of people when they send PM's (only just noticed)

And also when you go to your profile, you are able to friend yourself. Is there something I can add in to prevent that? XD
 
Last edited:
...why is there a bio when a message is being sent? That's a weird feature. o_O

It's probably pulling it up elsewhere and will need the stripslashes wherever that's going on, too...

It's in class_privatemessage.php, function getPostBar, around line 77. Change
PHP:
$postHeader->add(new TCell("<b>Member Since: </b><br>{$sender->membersince}<br> <b>Bio:</b><br>{$sender->profile->getBio()}<br> "));
to
PHP:
$str_bio = stripslashes($sender->profile->getBio());
$postHeader->add(new TCell("<b>Member Since: </b><br>{$sender->membersince}<br> <b>Bio:</b><br>{$str_bio}<br> "));

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:
 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.
 
Last edited:
Thank you :3 The message bio thing worked. And yeah, it is a bit weird XD

I tried the friending yourself solution, and it DOES hide it... only when I made another account to test it it was hidden for them as well. So it has hid it, only it seems as if it is for every account as well ^_^''
 
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:
 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:
	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:
$member = new Member($mysidia->input->get("user"));

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

PHP:
 
Last edited:
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.)
 
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)
 
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:
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.
 
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
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,122
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top