View Full Version : How to Restyle Myadopts Page?
AlexC
04-02-2013, 08:09 AM
So for a while I've redone the myadopts page on my site on a different style, which I prefer and find easier and quicker, but since the code change, I'm having trouble changing it - every time I try, the page goes blank and won't load.
I wanted it to look like this;
| image | trade status | rename - freeze - pound | click |
| name + species (gender) | # clicks / level # | stats - get codes - change trade status | |
imagine that is a table, with four cells and one row. I'm not entirely sure how to put things on top of other stuff in the new coding, let alone how to add other stuff.
Hall of Famer
04-03-2013, 10:14 AM
umm if you have to play with the table, it may get a bit tricky. Here is the code used to generate myadopts index table:
$adoptTable = new TableBuilder("adopttable", 650);
$adoptTable->setAlign(new Align("center", "middle"));
$adoptTable->buildHeaders("Gender", "Name/Type", "Image", "Clicks", "Level");
while($aid = $stmt->fetchColumn()){
$adopt = new OwnedAdoptable($aid);
$gender = new TCell($adopt->getGender("gui"));
$nametype = new TCell("<em>{$adopt->getName()}</em> the {$adopt->getType()}");
$image = new TCell(new Link("myadopts/manage/{$aid}", $adopt->getImage("gui")));
$clicks = new TCell($adopt->getTotalClicks());
$level = new TCell($adopt->getCurrentLevel());
$adoptTable->buildRow(array($gender, $nametype, $image, $clicks, $level));
}
To change the header, simply edit the words inside the line $adoptTable->buildHeader(). To edit the actual contents, you will have to define each table cell with $cellName = new TCell("Contents inside"). Then add all table cells to the table row as shown in the last line $adoptTable->buildRow(). It is very convenient to use.
Note you can still just write a string of HTML code and use the below code to append it to your document:
$html = "<table>Contents inside</table>";
$document->addLangvar($html);
It is not recommended though, since the GUI system is really good to use and moreover, it works well with the new URL system especially if you use relative url. Remember relative urls will not work with the script since we are having SEO friendly URL right now, unless you apply some complex trick to it.
AlexC
04-03-2013, 08:15 PM
Wait, how do I do another row though?
Hall of Famer
04-04-2013, 10:34 AM
All you have to do is to build an additional row above the standard table rows and below the table header. Use this syntax:
$adoptTable->buildRow(array("Column 1", "Column 2", "Column 3", "Column 4"));
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.