View Single Post
  #15  
Old 11-03-2017, 12:36 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 65,649
Dinocanid is on a distinguished road
Default

Quote:
Originally Posted by gwynmil View Post
Was busy for a week, now back to messing around. Gonna try to learn and add some more mods myself, so poor Dino won't be piled with a million random small tasks to do later. x)

Added original owner and birthday (Kyttias' mod). They work fine on griffs' Stats pages, but I can't get them to show up on the temporary profiles (levelupview) amongst the other stats.
{$birthday} - shows nothing
{$this->birthday} - shows nothing
{$adopt->getBirthday()} - causes error
I don't yet understand the difference between all these methods. When is it appropriate to use each one?

Also, birth dates seem to be delayed by a few hours. I stayed up til the early hours and made some griffs; they had the previous day. Made another this afternoon and it's the correct date. Is the game using an American time system or something?

Finally, when errors are turned on, holy balls. Every page of the site has this mess at the top, before things load normally. I guess it can be safely ignored again, but it would be quite nice to fix it, so I can see what causes errors elsewhere.
The offending line: if($this->thematicBreak) $this->renderThematicBreak();
edit: removed that line and errors are mostly gone, whew.
For the birthday variable, there is a difference between those three:
  • {$birthday}: $birthday must be defined within that function. For example
    PHP Code:
    $birthday $mysidia->db->select("owned_adoptables", array("birthday"), "aid = '{$adopt->getAdoptID()}'")->fetchColumn();
    $document->add(new Comment("Birthday: {$birthday}")); 
  • {$this->birthday}: In levelupview.php, you wouldn't use $this, you have to use $adopt. So it would be {$adopt->birthday}
  • {$adopt->getBirthday()}: For this, you must set it up in class_ownedadoptable.php like this:
    PHP Code:
    public $birthday//add with the other listed variables

    public function getBirthday(){
            return 
    $this->birthday;
        } 

For the actual dates, I think the server time is set to UTC by default (or EST, not entirely sure) You can change the timezone by sticking this at the top of any script you want though (within the php tags!):
PHP Code:
date_default_timezone_set('TIMEZONE'); 
Here's a page on it: link

Now for the errors. This might sound wrong but uh...you can just turn them back off lol. While it is nice to fix them if you can, they actually don't affect the site in any way and can safely be ignored without causing any problems (just like strict standards), plus it saves a lot of headaches. I don't think anyone has found a proper fix for them, since everyone just disables them. I've been working on my site for 3 years, and I just have them turned off without any issues.

(I posted after your edit, but might as well keep this here ^^;)
__________________
Reply With Quote