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
  #3  
Old 07-16-2014, 10:37 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 67,625
Hwona is on a distinguished road
Default

Thanks, but I get a blank page when I try to edit the content of the myadopts file to this:
PHP Code:
<?php

class AdoptGroupController extends AppController{

    const 
PARAM "aid";
    const 
PARAM2 "confirm";
    private 
$view;
    private 
$subController;
    private 
$group;
    private 
$image;

    public function 
__construct(){
        
parent::__construct("member");
        
$mysidia Registry::get("mysidia");
        if(
$this->action != "index"){
            
$this->group = new AdoptableGroup($mysidia->input->get("gid"));    
            if(
$this->group->getGroupOwner() != $mysidia->user->username) throw new NoPermissionException("You do not have permission to manage the groups of other users.");    
        }
    }
  
    
    public function 
index(){
        
$mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();
        
$document->setTitle($mysidia->lang->title);
 
        
$adoptgroups $mysidia->db->select("adoptgroups", array("gid"), "owner = '{$mysidia->user->username}'")->rowCount();    
        
$pagination = new Pagination($adoptgroups20"groups");
        
$pagination->setPage($mysidia->input->get("page"));
        
$stmt $mysidia->db->select("adoptgroups", array("gid"), "owner = '{$mysidia->user->username}' ORDER BY gid LIMIT {$pagination->getLimit()},{$pagination->getRowsperPage()}");
        if(
$stmt->rowCount() == 0){
            
$document->addLangvar($mysidia->lang->empty);
            return;
        }
        
        
$groupTable = new TableBuilder("grouptable"650);
        
$groupTable->setAlign(new Align("center""middle"));
        
$groupTable->buildHeaders("Name""Rename""Delete");
        
        while(
$gid $stmt->fetchColumn()){
            
$group = new AdoptGroup($gid);
            
$name = new TCell($group->getGroupName));
            
$rename = new TCell(new Link("adoptgroup/rename/{$gid}""Rename"));
            
$delete = new TCell(new Link("adoptgroup/delete/{$gid}""Delete"));
            
$adoptTable->buildRow(array($name$rename$delete));
        }
        
$document->add($groupTable);
        
$document->addLangvar($pagination->showPage());
    }
?>
Here's the class file for it(database has been updated):
PHP Code:
<?php

class AdoptGroup extends Model{

    protected 
$gid;
    protected 
$gname;
    protected 
$gowner;
    
  
    public function 
__construct($gid$gowner ""){      
        
$mysidia Registry::get("mysidia");
        
$whereClause "gid ='{$gid}'";
        if(!empty(
$gowner)) $whereClause .= " and gowner = '{$gowner}'";
        
$row $mysidia->db->select("adoptgroups", array(), $whereClause)->fetchObject();
        if(!
is_object($row)) throw new AdoptGroupNotfoundException("This group does not exist or does not belong to the owner specified...");
        
        
parent::__construct($row->type);
        foreach(
$row as $key => $val){
            
$this->$key $val;              
        }      
    }

    public function 
getGroupID(){
        return 
$this->gid;
    }
    
    public function 
getGroupName(){
    
        return 
$this->gname;}
   
    public function 
getGroupOwner(){
    
        return 
$this->gowner;
    }
    
    protected function 
save($field$value){
        
$mysidia Registry::get("mysidia");
        
$mysidia->db->update("adoptgroups", array($field => $value), "gid='{$this->gid}'");
    }
}

?>
I'm trying to create a pet grouping system, but I don't know what I'm doing wrong...
__________________
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Public Trade that is not shown? Glow Questions and Supports 3 12-24-2014 07:33 PM
View Public Trade Offers not working. Pear Questions and Supports 16 03-10-2014 06:29 PM
Pages on myadopts not working? Infernette Questions and Supports 1 07-27-2013 12:30 PM
Ad HTML not working AlkseeyaKC Questions and Supports 2 07-01-2011 07:13 AM
How do I create new html webpages through a php script? kamrinjacobs Webmasters Area 2 03-05-2010 12:01 PM


All times are GMT -5. The time now is 03:42 AM.

Currently Active Users: 3534 (0 members and 3534 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