Need help with pet rarities with images..o.o

Forum
Last Post
Threads / Messages

Pear

Woah man.
Member
Joined
Dec 14, 2013
Messages
169
Points
16
Age
27
Location
The Underworld
Mysidian Dollar
40,823
Need help with pet grouping & pet rarities with images..o.o

How would one go about making pet groups? I really like how eldemore's is set up.
euABWqc.png

Users are able to make their own groups and organize their pets. I really would love to make this, but I have no idea what I'd have to do. ^^;

There is a pet group sort mod for Mys 1.3.1, so is anyone able to update it to 1.3.4? Here's another thread regarding it for 1.3.4, but the OP did not post their update on if they got it to work..haha. cx I would not mind if it were to look like this instead of Eldemore's looks. x3

____
This part has been solved (Although I haven't had time to try it out haha)
Yo. I have been trying to do this mod, but it just is not working out for me. |D /because I'm a coding n00b/ I'm following all the instructions to the best of my ability, including starting from this post. I just don't understand anything. :cfrown:

I was wondering if there was a way where I could just put the rarity images by the pet's gender kind of like this? And be able to have 7 different rarity types, for the different pets rarities.
LbQqVbA.png


And maybe a place in the AdminCP where I could do the pet's rarity from there. (Kind of like this post. Unless this method would work? I have it installed already..haha)

I am not really sure where I should post this, so if it needs to be moved I'm fine with it. :eye:
 
Last edited:
For the rarity part, try this,


I'm assuming you want this in your My Adopts page?

First go to myadoptsview.php in your view folder, and you need to add a rarity column to the table. So add the "Rarity" title next to gender. This is located in the public function index section right at the top of the file. I also changed my table width to 900 so don't copy that part unless you want to.

PHP:
$adoptTable = new TableBuilder("adopttable", 900);
		$adoptTable->setAlign(new Align("center", "middle"));
		$adoptTable->buildHeaders("Gender", "Rarity", "Name/Type", "Image", "Points", "Level");

Then under the gender cell, add your rarity cell like so:
PHP:
$cells->add(new TCell($adopt->getGender("gui")));
		    $cells->add(new TCell("<img src='/picuploads/{$adopt->getRarity()}.png' />"));

Here's the whole index part if you want to just copy and paste. This is the public function index section only, not the whole file, so only replace that part.

PHP:
	public function index(){
	    $mysidia = Registry::get("mysidia");
		$document = $this->document;
	    $document->setTitle($this->lang->title);
 
        $pagination = $this->getField("pagination");
		$stmt = $this->getField("stmt")->get();
		if($stmt->rowCount() == 0){
		    $document->addLangvar($this->lang->empty);
		    return;
		}
		
	    $adoptTable = new TableBuilder("adopttable", 900);
		$adoptTable->setAlign(new Align("center", "middle"));
		$adoptTable->buildHeaders("Gender", "Rarity", "Name/Type", "Image", "Points", "Level");
		
		while($aid = $stmt->fetchColumn()){
		    $adopt = new OwnedAdoptable($aid);
			$cells = new LinkedList;
		    $cells->add(new TCell($adopt->getGender("gui")));
		    $cells->add(new TCell("<img src='/picuploads/{$adopt->getRarity()}.png' />"));
			$cells->add(new TCell("<b>{$adopt->getName()}</b><br />{$adopt->getType()}"));
			$cells->add(new TCell(new Link("myadopts/manage/{$aid}", $adopt->getImage("gui"))));
			$cells->add(new TCell($adopt->getTotalClicks()));
			$cells->add(new TCell($adopt->getCurrentLevel()));
			$adoptTable->buildRow($cells);
		}
		$document->add($adoptTable);
		$document->addLangvar($pagination->showPage());
	}


As for your second question, I'm afraid pet groups are a bit more complicated/take longer to code and I'm not sure if anyone here has done that yet.
 
Last edited:
@tahbikat - Thank you so much QwQ <3 You're a life saver! Yeah, I figured that the pet grouping would be a bit more complicated. ^-^ <3
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,280
Messages
33,129
Members
1,603
Latest member
Monako
BETA

Latest Threads

Latest Posts

Top