Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Community Board > Mysidia Adoptables Official Announcement

Notices

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 11-22-2012, 10:47 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 492,426
Hall of Famer is on a distinguished road
Default Mysidia Adoptables v1.3.2[Security Release]

Well guess the development for Mys v1.3.2 has been taking longer than expected, I almost put it off for like half a year. The good news is that the new version is finally ready to be released. Happy Turkeys day everyone, and now allow me to introduce the changes and new features in Mys v1.3.2:

1. Improvement of Object Oriented Design: If Mys v1.3.1 was our first step towards OOP, Mys v1.3.2 sure pushed this forward quite a bit. In this version several core mysidia classes are created, they will prove quite useful for us in not so distant future. Mys v1.3.2 introduces 50+ new classes, and old classes are revised to improve performance. The ACP brings up the concept of controller, which you will see a lot in Mys v1.3.3.

2. New AdminCP Layout and functionality: Well this isnt the grand ACP overhaul project I was talking about for Mys v1.4.0, but its a rather important step to achieve the goal. I already posted the new ACP layout in a blog entry, I like the way it looks thanks to Nyxi's awesome work. The ACP menu items expand/collapse using javascript, something you may find intriguing once you get used to how it works.

3. Adoptables Shop System: It is now possible to buy adoptables from various shops in the marketplace! The shop works in a similar way as itemshop, in which admins can specify whether the shop is open and how much tax to charge. The adoption center now only shows pets not purchasable from adoptables shop. This was supposed to be the main new feature for Mys v1.3.2, though it didnt take me much time to complete.

4. Protected Custom Pages:
If you have paid attention to a recent blog I posted, you'd figure out that the content management system has received a major improvement. In additional to the usage of CKEditor, admins can even specify protected pages with the following conditions: promocode, item, time and usergroup. The four aint mutually exclusive, so it is up for you to build an highly protected page for authorized users only.

5. MyBB Forum Integration Basics: It's been quite a long time since we first supported MyBB forum integration. In Mys v1.3.1 there was a problem that forum stats could not rebuild, which led to messed up forum stats. This has been fixed in Mys v1.3.2, and at this point all basics of MyBB bridge are completed. Future updates will probably bring up advanced features such as user sync and forum posts/activity in user profile tab.

6. Old glitches fixed in new release: umm this happens in every release, doesnt it? One major issue was the font size glitch with pagination, this has been resolved in Mys v1.3.2. The promocode now supports both public and private promocodes equally well. Adoptables hard deletion is also working as it should be. Anyway Mys v1.3.1 fixed most glitches in the original release, so there probably aint many noticeable ones this time.

Installation Guide:
1. Use ftp to Upload the entire folder Mysidia Adoptables v1.3.2 to your preferred directory, and change the name to whatever you like.
2. Change the CMD of folder "picuploads" to 777, together with its subfolders, this is required to enable user uploading images.
3. Rename the file config_adopts to config.php, otherwise the script will tell you config.php does not exist.
4. Access the installer script at "http://yoursitename.com/install/index.php", follow the instructions and proceed.
5. Congrats, you've successfully installed Mys v1.3.2. There is no need to manually encrypt your password in Mys v1.3.2, so cheers!

Note: The value pepper code can be generated from a website called: http://strongpasswordgenerator.com/, it can be of any length and may contain symbols. Make sure to delete the file install/index.php after running this script, or your site is potentially at danger if this file is accessed by someone else.

Upgrade Mini-Guide:
An upgrader from mys v1.3.1 is available, but the megaupgrader from Mys v1.2.x will have to wait till probably in my winter break. To upgrade, simply upload all script files to your folder and overwrite the existing ones. The config file is named config_adopts.php by default, so your old config file should be safe. Now run the upgrade.php script to complete this task, shouldnt take more than 10 secs. Note you need to manually remove the file lang.php from your /inc directory before proceeding, and the upgrade.php file too after you have completed this process.

Do not use the upgrader if you have a site with heavily modified script! Unlike Mys v1.3.1, Mys v1.3.2's changes are way too dramatic. If you have modified any script files before, or added your own piece of code, your site will surely not function at all. Even old Mods/Addons for Mys v1.3.1 do not work on this version, for this reason I will update my 'Gender Ratio' Mod a few hours later to be compatible with this version. Of course if you are intermediate or advanced programmer, you should be fine making changes on your own to get it to work somehow.


Forum Integration Guide:

First of all, make sure you have both fresh installation of Mysidia Adoptables and MyBB forum. Open the file /inc/config_forums.php, enter each empty field for the database info of your MyBB forum. Then Change the variable mybbenabled from 0 to 1. The very last step is to disable registration on the forum. It is all said and done, new users will have accounts created from both the adoptables site and the forum from now on. In Mys v1.3.2 they also log into site and forum accounts simultaneously! The forum stats is automatically updated whenever a new registration is completed, so there is no need for admins to update forum stats in ACP from now on.

Download Links(both .rar and .zip are provided):

Rapidshare links:

Rar version:
https://rapidshare.com/files/2866623...s%20v1.3.2.rar

Zip version:
https://rapidshare.com/files/1617330...s%20v1.3.2.zip

Mediafire Links:

Rar version:
http://www.mediafire.com/?xk38s8mocccvnw4

Zip version:
http://www.mediafire.com/?9zpf0xvaxs2d76h

The fact is that, well, Mys v1.3.2 is a dramatic change from Mys v1.3.1. It comes with a few new features, but these features alone should not have taken more than 2 months for me. The real challenge was with the improvement of script quality. I am trying to establish an organized coding style and structure for this script. Some programmers refer to this as framework, though at this point this script still does not really have a complete framework yet.

Starting from Mys v1.3.2 we are making a huge step in the transition from procedural PHP to object oriented PHP. The new code will probably give a headache to some of you, especially if you are so used to traditional php programming. This cannot be helped, its the way of future. The only thing I am sure is that once the transition is complete, development of Mysidia adoptables script will be moving forward in a different level. Much faster and much less redundant work.

I thank you everyone who stick to us and this project for this long without a stable release being made. The next version should not take more than one and a half month though, the transition from Mys v1.3.1 to v1.3.2 really was one of the hardest since we had to find a direction where this script should go.

Hall of Famer
November 22, 2012
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
  #2  
Old 11-23-2012, 11:12 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 133,654
Abronsyth is on a distinguished road
Default

Yes! Yes! Yes! Downloading this right away! Finally decided that, since I love drawing them so much, I'm going to go ahead and make a Pine Marten site :D Can't wait to get working on my site!

You have no idea how grateful and happy I am for this script!

EDIT:
Okay, just finished installing the script and all went well...but when I tried to access my site, I got this:
Fatal error: Can't inherit abstract function Creator::create() (previously declared abstract in UserCreator) in /home/u526740665/public_html/classes/abstract/abstract_usercreator.php on line 3
__________________
My Mods Site (1.3.4, 2020 Mods)

Last edited by Abronsyth; 11-23-2012 at 02:38 PM. Reason: correction
  #3  
Old 11-23-2012, 04:20 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 492,426
Hall of Famer is on a distinguished road
Default

umm weird, never happened to me before, are you trying to upgrade from an old site? Can you show me the two script files abstract_usercreator.php and class_membercreator.php? It looks to me that the script is trying to inherit the same method twice.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
  #4  
Old 11-23-2012, 05:36 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 133,654
Abronsyth is on a distinguished road
Default

Okay, here's the abstract_usercreator.php:
PHP Code:
<?php

abstract class UserCreator implements Creator{
  
// The abstract factory class UserCreator
  
  
abstract public function create();
  abstract public function 
massproduce();
  
  public static function 
logincheck(){
     global 
$mysidia;
    
     
//Check for cookie
     
if(!$mysidia->cookies->getcookies("mysuid") or !$mysidia->cookies->getcookies("myssession")) return FALSE;
     else{
        
$uid secure($mysidia->cookies->getcookies("mysuid"));
        
$session secure($mysidia->cookies->getcookies("myssession"));

        
//Run login operation
        
$luser $mysidia->db->select("users", array("uid""session"), "uid = '{$uid}'")->fetchObject();
        
$luid=$luser->uid;
        
$lsess=$luser->session;
        
        if(
$uid == $luid and $session == $lsess) return TRUE;
        else{
            if(isset(
$_COOKIE['mysuid'])) setcookie("mysuid"$uidtime() - 10);
            if(isset(
$_COOKIE['myssession'])) setcookie("myssession"$sessiontime() - 10);
            return 
FALSE;
        }
     }
     
// End of login check
  
}
  
  protected function 
getusergroup($userinfo){
     global 
$mysidia;
     
$whereclause = (is_numeric($userinfo))?"uid ='{$userinfo}'":"username ='{$userinfo}'";
     
$usergroup $mysidia->db->select("users", array("usergroup"), $whereclause)->fetchColumn();
     if(empty(
$usergroup)) throw new Exception('Invalid Usergroup, cannot instantiate user object');
     return 
$usergroup;
  }
  
  protected function 
getgroupcategory(){
     global 
$mysidia;
     
$category $mysidia->db->select("groups", array("category"), "uid ='{$uid}'")->fetchColumn();
     if(empty(
$category)) throw new Exception('Invalid Usergroup Category, cannot instantiate user object');
     return 
$category;     
  }
  
  protected function 
getidentity(){
     
$spiderip = array();
     if(
in_array($_SERVER['REMOTE_ADDR'], $spiderip)) $identity "Spider";
     else 
$identity "Guest";
     return 
$identity;
  }
  
}
?>
And here's the class_membercreator.php:
PHP Code:
<?php

class MemberCreator extends UserCreator{
  
// The abstract factory class UserCreator
  
protected $userinfo;
  protected 
$usergroup;
  protected 
$user;
   
  public function 
__construct($userinfo){
     if(empty(
$userinfo)) throw new Exception('User id or Username does not exist...');
     
$this->userinfo $userinfo;
     
$this->usergroup $this->getgroupid();
  }

  public function 
getgroupid(){
     global 
$mysidia;
     
$whereclause $whereclause = (is_numeric($this->userinfo))?"uid ='{$this->userinfo}'":"username ='{$this->userinfo}'";
     
$gid $mysidia->db->select("users", array("usergroup"), $whereclause)->fetchColumn();
     return 
$gid;
  }

  public function 
getgroupcategory(){
     
// This feature will be fully implemented in Mys v1.3.3 or v1.3.4.
     
if($this->usergroup == or $this->usergroup == 2) return "Admin";
     elseif(
$this->usergroup == or $this->usergroup == 6) return "Mod";
     elseif(
$this->usergroup == 3) return "Registered";
     elseif(
$this->usergroup == 5) return "Banned";
     else throw new 
Exception('Cannot recognize usergroup category for this user, he/she may be a guest, a bot, or else...');
  }

  public function 
create(){
     
$category $this->getgroupcategory();
     switch(
$category){
        case 
"Admin":
           
$this->user $this->create_admin();
           break;
        case 
"Mod":
           
$this->user $this->create_mod();
           break;
        case 
"Banned":
           
$this->user $this->create_banned();
           break;           
        default:
           
$this->user $this->create_member();                   
     }
     return 
$this->user;     
  }
  
  public function 
massproduce(){
     return 
FALSE;
  }
    
  private function 
create_admin(){
     return new 
Admin($this->userinfo);
  }
  
  private function 
create_mod(){
     return new 
Mod($this->userinfo);
  }
  
  private function 
create_member(){
     return new 
Member($this->userinfo);
  }
  
  private function 
create_banned(){
     return new 
Banned($this->userinfo);
  }
}
?>
(Sometimes I feel like it's just my job to find as many errors as possible...most of them being my fault for some reason XD)
__________________
My Mods Site (1.3.4, 2020 Mods)
  #5  
Old 11-23-2012, 06:29 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 492,426
Hall of Famer is on a distinguished road
Default

Well its perfectly fine, lol. An compile-time error like this should have been detected and fixed by me way before the official release if I can find it. Mvm...

I dont see anything wrong with the script, lets give this a try though. For the UserCreator class, find the first line::

PHP Code:
abstract class UserCreator implements Creator
remove the implements Creator parts so it becomes:

PHP Code:
abstract class UserCreator
See if it works. If not, post your class_visitorcreator.php too and I'd like to do a thorough search on what may be causing the error.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
  #6  
Old 11-24-2012, 08:59 AM
schepers12's Avatar
schepers12 schepers12 is offline
Member
 
Join Date: Sep 2012
Location: netherlands
Posts: 30
Gender: Male
Credits: 9,106
schepers12 is on a distinguished road
Default

is htere also coming a tutorial coming for imlementing own scripts? (i.e. modifications), as i heard somewhere on this board that there are some changes in the variables~ (and i don't know what to change right now in my modifications)
__________________
~
  #7  
Old 11-24-2012, 09:06 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 492,426
Hall of Famer is on a distinguished road
Default

Well yeah, I will post a short tutorial on how to do this. In fact, its pretty simple.

And btw, do you encounter the 'cannot inherit abstract method' error Iris was getting? It never occurred on my server, but an error of this magnitude should be noticeable to me long before the script was completed. Weird.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
  #8  
Old 11-24-2012, 09:39 AM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 133,654
Abronsyth is on a distinguished road
Default

Okay, edited as you said to, and got this error:
Fatal error: Call to undefined method DateTime::getTimestamp() in /home/u526740665/public_html/classes/class_visitor.php on line 15

And here's my class_visitor.php:
PHP Code:
<?php

class Visitor extends User{
  public 
$isloggedin;
  public 
$error;
  
  public function 
__construct($uid){
      
// Fetch the basic member properties for users
      
      
$this->uid 0;
      
$this->ip $_SERVER['REMOTE_ADDR'];
      
$this->usergroup Usergroup::fetchgroup('Visitor');
      
      
$time = new DateTime();
      
$this->lastactivity $time->getTimestamp();
      
$this->isloggedin UserCreator::logincheck();      
  }
  
  public function 
__call($method$param){
      
// This magic method triggers when visitors attempt to visit pages inaccessible to guests
      
      
$this->error "The functionality is unavailable for guests, please log in or register.";
      return 
FALSE;
  }
  
  public function 
__get($param){
      
// This magic method triggers when visitors attempt to visit pages inaccessible to guests
      
      
$param 0;
      return 
$param;
  }
  
  public function 
register(){
      
// Will be added in future
      
global $mysidia;
      
$date = new DateTime;
      
$salt codegen(15);
      
$password passencr($mysidia->input->post("username"), $mysidia->input->post("pass1"), $salt);
      
// Insert the very first row of data for user registration
      
$mysidia->db->insert("users", array("uid" => NULL"username" => $mysidia->input->post("username"), "salt" => $salt"password" => $password"session" => NULL"email" => $mysidia->input->post("email"), "ip" => $_SERVER['REMOTE_ADDR'], 
                                     
"usergroup" => 3"birthday" => $mysidia->input->post("birthday"), "membersince" => $date->format('Y-m-d'), "money" => $mysidia->settings->startmoney"friends" => NULL));
      
$uid $mysidia->db->select("users", array("uid"), "username = '{$mysidia->input->post("username")}'")->fetchColumn();
      
      
// Now update the session
      
$myssession md5($uid.$mysidia->session->getid());
      
$mysidia->db->update("users", array("session" => $myssession), "uid = '{$uid}'");    

      
// Insert user data to the other tables
      
$mysidia->db->insert("users_contacts", array("uid" => $uid"username" => $mysidia->input->post("username"), "website" => NULL"facebook" => NULL"twitter" => NULL
                                               
"aim" => NULL"yahoo" => NULL"msn" => NULL"skype" => NULL));
    
      
$mysidia->db->insert("users_options", array("uid" => $uid"username" => $mysidia->input->post("username"), "newmessagenotify" => 1"pmstatus" => 0
                                              
"vmstatus" => 0"tradestatus" => 0"theme" => $mysidia->settings->theme));

      
$mysidia->db->insert("users_profile", array("uid" => $uid"username" => $mysidia->input->post("username"), "avatar" => $mysidia->input->post("avatar"), "bio" => $mysidia->input->post("bio"), "color" => $mysidia->input->post("color"), 
                                              
"about" => NULL"favpet" => 0"gender" => $mysidia->input->post("gender"), "nickname" => $mysidia->input->post("nickname")));                                              
    
      
$mysidia->db->insert("users_status", array("uid" => $uid"username" => $mysidia->input->post("username"), "canlevel" => 'yes'"canvm" => 'yes'"canfriend" => 'yes'
                                             
"cantrade" => 'yes'"canbreed" => 'yes'"canpound" => 'yes'"canshop" => 'yes'));
    
      
$mysidia->page->settitle($mysidia->lang->success_title);
      
$mysidia->page->addcontent($mysidia->lang->success.$mysidia->input->post("username").$mysidia->lang->success2);      
  }
  
  public function 
login($username){
      global 
$mysidia;
      if(
$this->ip != $mysidia->session->clientip) throw new Exception('Your IP has changed since last session, please log in again.');
      else{         
         
$mysidia->cookies->setcookies($username);
         
$mysidia->db->update("users", array("session" => $mysidia->cookies->getcookies("myssession")), "username = '{$username}'");         
         include(
"inc/config_forums.php");
         if(
$mybbenabled == 1){
            include_once(
"functions/functions_forums.php");   
            
mybblogin();
         }
         return 
TRUE;
      }     
  }
  
  public function 
getloginform(){
      
$loginform "<form name='form1' method='post' action='login.php'>
                    <p>Username: <input name='username' type='text' id='username'></p>
                    <p>Password: <input name='password' type='password' id='password'></p>
                    <p><input type='submit' name='Submit' value='Submit'></p>
                    <p>Don't have an account?<br>
                    <a href='register.php'>Register Free</a>  </p>
                    <a href='forgotpass.php'>Forgot your password?  Click Here</a>
                    </form>"
;
      return 
$loginform;    
  }
  
  public function 
logout(){
      global 
$mysidia;
      
$mysidia->page->settitle("Already logged out");
      
$mysidia->page->addcontent("It appears that you are already logged out from this site..."TRUE);
      return 
FALSE;
  }
  
  public function 
resetpass($username$email){
      global 
$mysidia;
      
$newpw codegen(12);
      
$newsalt codegen(15,0);
      
$newpass passencr($username$newpw$newsalt);

      
//Update the database with the new password...
      
$mysidia->db->update("users", array("password" => $newpass"salt" => $newsalt), "username='{$username}' and email='{$email}'");

      
//Delete the entry from the password reset table
      
$mysidia->db->delete("passwordresets""code='{$mysidia->input->post("code")}'");
      return 
$newpw;      
  }
}
?>
__________________
My Mods Site (1.3.4, 2020 Mods)
  #9  
Old 11-24-2012, 10:26 AM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 492,426
Hall of Famer is on a distinguished road
Default

Well are you running PHP 5.2? This looks like a problem that should not have existed in the first place, your PHP version does not support advanced DateTime Object manipulation. Or it may have been misconfigured?

I can look up the files and use alternative approaches for you at this point so that you can bypass the DateTime functions missing error. But keep in mind that DateTime is a common class in PHP 5.3.x development, if you are indeed running PHP 5.2.x then its probably time to upgrade or switch host. I try to compromise for those using PHP 5.2.x for Mys v1.3.x releases, but in Mys v1.4.0 and onwards supports for older versions of PHP will be dropped.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
  #10  
Old 11-24-2012, 10:36 AM
schepers12's Avatar
schepers12 schepers12 is offline
Member
 
Join Date: Sep 2012
Location: netherlands
Posts: 30
Gender: Male
Credits: 9,106
schepers12 is on a distinguished road
Default

i currently am a little too lazy to test it out, so don't expect me upgrading my site soon or reporting bugs..~ ^^;
__________________
~
Closed Thread


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
Mysidia Adoptables v1.3.3[Security Release] Hall of Famer Mysidia Adoptables Official Announcement 122 05-18-2013 05:02 PM
Mysidia Adoptables v1.3.0[Security Release] Hall of Famer Mysidia Adoptables Official Announcement 180 04-01-2012 11:16 PM
Mysidia Adoptables v1.2.0[Security Release] Hall of Famer Mysidia Adoptables Official Announcement 21 03-22-2011 05:13 PM
Mysidia Adoptables v1.1.4[Security Release] Hall of Famer Mysidia Adoptables Official Announcement 15 01-28-2011 12:48 PM
Mysidia Adoptables v1.1.3[Security Release] Hall of Famer Mysidia Adoptables Official Announcement 27 01-26-2011 03:59 PM


All times are GMT -5. The time now is 03:29 PM.

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