Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 10-21-2017, 11:00 AM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 95,954
Dinocanid is on a distinguished road
Default

I forgot about the table builder! I would say phase it out, absolutely. I'm in the process of doing that now, and the results are so much better; especially if you use Bootstrap (or Foundation):

This is the method I use for custom tables, and I highly recommend it:
PHP Code:
public function index(){
        
//header("Location: /myadopts");
        
$mysidia Registry::get("mysidia");
        
$document $this->document;
        
$document->setTitle($this->lang->title);
        
//tab title
 
$document->add(new Comment("<title>Your Pantry</title>"));

        
$pagination $this->getField("pagination");
        
$stmt $this->getField("stmt")->get();
        if(
$stmt->rowCount() == 0){
            
$document->addLangvar($this->lang->empty);
            return;
        }
        
$shelfSpace $mysidia->db->select("users", array("shelfspace"), "username = '{$mysidia->user->username}'")->fetchColumn(); 
        
$adoptAmount $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}' AND health > '0'")->rowCount();
        if(
$adoptAmount >= 10){
        
$mysidia->db->update("users_status", array("fullpantry" => 'unlocked'), "username='{$mysidia->user->username}'");
        }
        
$document->add(new Comment("
            <div class='card'>
              <h2 class='card-header'><center>Pantry Stats</center></h2>
              <div class='card-body'>
                    <b>Shelf space:</b> 
{$adoptAmount}/{$shelfSpace} <a href='/expand' class='badge badge-secondary'>+</a>
              </div>
            </div>"
));
         
$document->add(new Comment("<table class='table table-bordered table-dark'>
  <thead>
    <tr>
      <th>Image</th>
      <th>Info</th>
      <th>Action</th>
    </tr>
  </thead>
  <tbody>"
FALSE));
        while(
$aid $stmt->fetchColumn()){
            
$adopt = new OwnedAdoptable($aid);
            
$gender_lookup $mysidia->db->select("owned_adoptables", array("gender"), "aid = '{$adopt->getAdoptID()}'")->fetchColumn(); 
            
$type $adopt->getType();
                   if (
$gender_lookup == "m") { $Gender "Male"; } 
                   if (
$gender_lookup == "f") { $Gender "Female"; }
                   
                   
$document->add(new Comment("<tr>
      <td><img src='
{$adopt->getImage()}'></td>
      <td><b><em>
{$adopt->getName()}</b></em><br></br> Level {$adopt->getCurrentLevel()}<br></br> {$Gender}</td>
      <td><a href='/myadopts/manage/
{$aid}' class='btn btn-primary' style='width:200px; height:auto;'>Manage</a></td>
    </tr>"
FALSE));
                   } 
        
        
$document->add(new Comment("</tbody></table>"));
    } 
It can even by applied to messages and stuff:


For #6, I've only ever tried it in the view file, so I don't know. I would try styling with "<style></style>" above the PHP tags first, since I don't know if "link rel" would work; you can try it though.
__________________
Reply With Quote
 

Thread Tools
Display Modes

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


All times are GMT -5. The time now is 05:19 AM.

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