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
  #1  
Old 05-05-2014, 07:07 PM
TLT96's Avatar
TLT96 TLT96 is offline
Member
 
Join Date: May 2014
Posts: 3
Gender: Male
Credits: 2,016
TLT96 is on a distinguished road
Default Two links or more + images in 1 row

Well, i want to edit a lot of mysidia, i have some changes but i get stuck in this part....

I want to put two links with images in one row... Here the code (I tried but i cant...)

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("First""Second""Third""Fourth");

        while(
$aid $stmt->fetchColumn()){
            
$adopt = new OwnedAdoptable($aid);
            
$cells = new LinkedList;
            
$STATS=new Link("myadopts/stats/{$aid}", new Image("templates/icons/stats.gif"));
            
$FEEDEAR=new Link("levelup/click/{$aid}", new Image("templates/icons/add.gif"));
            
$cells->add($STATS);
            
$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());
    } 
I have two variables called: STATS and FEEDEAR, they have links with images (Using codes from mysidia), but i cant put in just 1 row (I know how to put sepparated in two rows) but i want to show two images with links in the same row....

Php/Html knowledge = 2/10
Reply With Quote
  #2  
Old 05-05-2014, 07:20 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 49,930
Hwona is on a distinguished road
Default Re

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?
__________________

Last edited by Hwona; 05-05-2014 at 07:23 PM.
Reply With Quote
  #3  
Old 05-05-2014, 07:31 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,586
IntoRain is on a distinguished road
Default

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));
__________________


asp.net stole my soul.

Last edited by IntoRain; 05-13-2014 at 02:12 PM.
Reply With Quote
  #4  
Old 05-05-2014, 09:17 PM
TLT96's Avatar
TLT96 TLT96 is offline
Member
 
Join Date: May 2014
Posts: 3
Gender: Male
Credits: 2,016
TLT96 is on a distinguished road
Default

Quote:
Originally Posted by Wallie987 View Post
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 View Post
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....)
__________________
Reply With Quote
Reply

Tags
farm, monster, myadoptsview, mysidia, table


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
Changing the links under Member's Links. LucasA33 Questions and Supports 1 12-24-2013 08:04 PM
:Links Bar: AlkseeyaKC Questions and Supports 9 06-23-2011 04:20 PM
Flash Links Tip PTGigi Tutorials and Tips 2 01-31-2011 02:03 PM
links zhiichiro Questions and Supports 10 06-15-2009 04:10 PM
Links SJC Questions and Supports 2 04-17-2009 06:46 PM


All times are GMT -5. The time now is 10:57 PM.

Currently Active Users: 930 (0 members and 930 guests)
Threads: 4,080, Posts: 32,024, 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 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636