Quote:
Originally Posted by Wallie987
Um, by any chance, are you trying to display an adoptable's stats on its click page? Sorry, I can't understand you very well, because if that's the case, someone just finished helping me with that. :3
Edit: Sorry, mistook the code for another! Wait, are the links in there?
|
Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports
Showing stats on click page
Dont worry :D
Quote:
Originally Posted by IntoRain
In the same row or in the same cell?
Cells is a linked list of TCells that form a row. Each TCell is a single cell in that row.
To put them in the same row but different cells, you need to create a TCell for each thing you want to add, like
$cells->add(new TCell($STATS));
$cells->add(new TCell($FEEDEAR));
etc... (you have four columns it seems from the header, so you can only add four Tcells)
To put them in the same cell, I believe there is no other way other than putting it all inside a Comment and then the comment inside the TCell, like
$comment = new Comment("{$variableHere} blablabla <img src='link.png'> blablabla");//comments can have html
$cells->add(new TCell($comment));
|
Thx you soo much :D
I dont need those variables, i didnt know about that, y just write the code like i learn (Simple html) and obviously work :D
PHP Code:
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", 650);
$adoptTable->setAlign(new Align("center", "middle"));
$adoptTable->buildHeaders("Acciones", "Monster", "Exp", "Nivel");
while($aid = $stmt->fetchColumn()){
$adopt = new OwnedAdoptable($aid);
$cells = new LinkedList;
$comment = new Comment("<a href='levelup/click/{$aid}'><img src='templates/icons/add.gif'></a>
<a href='myadopts/manage/{$aid}'><img src='templates/icons/stats.gif'></a>
<a href='myadopts/stats/{$aid}'><img src='templates/icons/bbcodes.gif'></a>");
$cells->add(new TCell($comment));
$cells->add(new TCell(new Link("myadopts/manage/{$aid}", $adopt->getImage("gui"))));
$cells->add(new TCell($adopt->getTotalClicks()));
$cells->add(new TCell($adopt->getNivel()));
$adoptTable->buildRow($cells);
}
$document->add($adoptTable);
$document->addLangvar($pagination->showPage());
}
Thx :D
So.... we end with this thread... Thx :D
How i can thank you? :D
PD: Sorry for my english.... (Im getting better but slower....)