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 07-16-2014, 09:14 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,190
Hwona is on a distinguished road
Default Does Anyone Know How to Create Working Pages In Class and Public HTML Folders?

Hello, does anyone know how to add new pages and get them to work like the ones already in the script? I can't seem to create a class file that works with on in public html... it pops up as a blank page.
__________________
Reply With Quote
  #2  
Old 07-16-2014, 09:53 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,265
IntoRain is on a distinguished road
Default

1.3.3? This is the pattern for a page:

PHP Code:
<?php

//substitute (PageName) with your page, for example if it's yoursite.com/quests you will name it QuestsController
class (PageName)Controller extends AppController{

    public function 
__construct(){//check other files to check their constructor function, for permissions if you need
        
parent::__construct("member");    
    }
    
//this will be your /quests page's content
    
public function index(){
        
$mysidia Registry::get("mysidia");
        
$document $mysidia->frame->getDocument();
        
$document->setTitle("title");//gotta have a title!
        
    
}

/*any other public function you add that has a title like in index(), will work as a page.
 If you add a public function like:

public function reward(){
$mysidia = Registry::get("mysidia");
        $document = $mysidia->frame->getDocument();
        $document->setTitle("title");//gotta have a title!
}

the page will be yoursite.com/quests/reward
*/
    
}
?>
This stays in the public_html folder pretty much. Create a file in class folder when you want to create a new object or something
__________________


asp.net stole my soul.

Last edited by IntoRain; 07-16-2014 at 10:02 PM.
Reply With Quote
  #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: 48,190
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
  #4  
Old 07-16-2014, 11:15 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,265
IntoRain is on a distinguished road
Default

Blank page usually means syntax error. I can't test your code (my host is down :c ) so you will have to delete everything and slowly add lines until you find the one causing the blank page ^^'

edit:

$name = new TCell($group->getGroupName));

For example I see a missing ( here already
__________________


asp.net stole my soul.

Last edited by IntoRain; 07-16-2014 at 11:23 PM.
Reply With Quote
  #5  
Old 07-17-2014, 01:21 PM
Infernette Infernette is offline
CODE CODE CODE CODE CODE
 
Join Date: Jan 2013
Location: Where I live? I live home.
Posts: 164
Gender: Female
Credits: 23,624
Infernette is on a distinguished road
Default

http://phpcodechecker.com/ this is usually good at catching syntax errors. :)
__________________
No, I have no idea what I'm doing. But it works. Barely.
Reply With Quote
  #6  
Old 07-17-2014, 01:49 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,190
Hwona is on a distinguished road
Default

Thanks! :D
Edit: I changed the code up a bit, but now I'm getting this:
Fatal error: Call to a member function rowCount() on a non-object in /home/wallie12/public_html/classes/abstract/abstract_guicontainer.php on line 392
__________________

Last edited by Hwona; 07-17-2014 at 02:04 PM.
Reply With Quote
Reply

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 09:48 AM.

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