Imagine ~ Excel above the rest (Mutli Theme, Page Editor, Mutli DB)+

Status
Not open for further replies.

AaidenX

Member
Jun 30, 2012
261
29
Eh, you dont need to check for rank etc and logged in or not. You can use Middlewares and another function which I dont remember. I dont use Laravel anymore.

Plus, it doesn't even do Laravel style sht... you havent even done namespaces my friend..

Sent from my SM-N9005 using Tapatalk
 

LeChris

https://habbo.codes/
Sep 30, 2013
2,786
1,395
Care to be more specific on the topic of the 'multi-database panel'?
I planned on each database having it's own set of queries to run for the different functions, the databases included as of now are Phoenix, Butterfly, and Azure. I'm also still learning the different bits and pieces of Laravel, and if you never noticed it says at the bottom that the ending code will most likely be different as I go through multiple revisions of my code daily..
 

Sinq

New Member
Aug 1, 2015
5
0
Hope to see this go on, don't let people push you around with what you're using. If it works and is solid, it's a good CMS.
 

LeChris

https://habbo.codes/
Sep 30, 2013
2,786
1,395
iAdmin will serve the administrative side of retros while ImagineMS will serve a more advanced CMS for retros.
 

LeChris

https://habbo.codes/
Sep 30, 2013
2,786
1,395
2 different projects going on in this thread.
----------
ImagineMS - Will serve as an actual CMS that serves yes as a CMS - incorporating a plugin system and what not.

iAdmin - Will just serve as an administrative suite that allows you to manage the users, news, and other bits and pieces that are used in management.
 

Khalil

IDK
Dec 6, 2011
1,642
786
2 different projects going on in this thread.
----------
ImagineMS - Will serve as an actual CMS that serves yes as a CMS - incorporating a plugin system and what not.

iAdmin - Will just serve as an administrative suite that allows you to manage the users, news, and other bits and pieces that are used in management.
You're doing it wrong. Your "ImagineMS", is just a web system that provides users with a UI to interract about the place. However, what actually does the job of a CMS is the administrative panel, that's where all the management functionalities reside in.
 

LeChris

https://habbo.codes/
Sep 30, 2013
2,786
1,395
onNPCul25LE1.png

I begun work on the installation system for ImagineMS. What you see above is a screenshot where on one browser I'm installing Imagine and on the other it tells me that an installation is in progress, and doesn't allow me any options. The installation system has a session now - so once the initial installation system has begun only the user with that session is able to continue it (unless install.session is deleted).
PHP:
<?php
namespace Models;
class Install
{

  public static function is_installed()
  {
    if (is_readable('./install.lock'))
    {
      return true;
    }
    else
    {
      Install::is_installing();
    }
  }

  public static function is_installing()
  {
    if (is_readable('./install.session'))
    {
      if (Session::has('install_progress') == true)
      {
        Install::continue_install();
      }
      else
      {
      Error::notify('Install', '2');
    }
  }
    else
    {
      Install::new_install();
    }
  }

  public static function new_install()
  {
    Install::create_lock('session');
    Session::set('install_progress', 'welcome');
    Install::continue_install();
  }

  public static function continue_install()
  {
    $progress = Session::get('install_progress');
    $location = 'install/'.$progress.'';
    Page::get($location);
    echo '<div class="footer">Powered by <b>ImagineMS</b> by <b>Leader</b></div>';
  }

  public static function create_lock($what)
  {
    switch ($what)
    {
      case "session":
        fopen("./install.session", "w");
      break;
      case "install":
        fopen("./install.lock", "w");
      break;
    }
  }

}
?>
PHP:
<?php
namespace Install;
class Receiver
{
  public static function handle()
  {
    if (isset($_POST["continue"]))
    {
      $progress = \Models\Session::get('install_progress');
      switch ($progress)
      {
        case "welcome":
          \Models\Session::set('install_progress', 'database');
        break;

        case "database":
          \Models\Session::set('install_progress', 'general');
        break;

        case "general":
          \Models\Session::set('install_progress', 'user');
        break;

        case "user":
          \Models\Session::set('install_progress', 'finish');
        break;
      }
      \Models\Install::continue_install();
    }
  }

}
?>
PHP:
<?php
namespace Install;
class Initial
{
  public static function check($key)
  {
    switch ($key)
    {
      case "PHP_VER":
        echo Initial::PHP_VER();
      break;
    }
  }

  public static function PHP_VER()
  {
    if (version_compare(PHP_VERSION, '5.3.0') >= 0)
    {
      echo '
            <div class="label-good">PHP Version is atleast 5.3.0</div>
            <br>
            <form class="pure-form pure-form-aligned" method="post" name="continue">
              <button type="submit" name="continue" class="pure-button pure-button-primary">Continue</button>
            </form>
            ';
    }
    else
    {
      echo '<div class="label-bad">PHP Version is below 5.3.0</div>';
      $continue = '0';
    }
  }

}
?>
PHP:
<?php
namespace Controllers;
class System
{
  public $db;

  public function __construct()
  {
  }

  public static function begin()
  {
    System::health();
  }

  public static function health()
  {
    if (\Models\Install::is_installed() == true)
    {
      \Models\Page::get($_GET["url"]);
    }
  }

}
?>
PHP:
<?php
namespace Models;
class Error
{

  public static function notify($class, $protocol)
  {

    switch ($class)
    {
      case "Page":
        switch ($protocol)
        {
          case "1": Error::stop('errors/pages/page-not-found.php'); break;
        }
      case "Permissions":
        switch ($protocol)
        {
          case "1": Error::stop('errors/permissions/no-session.php'); break;
          case "2": Error::stop('errors/permissions/rank-to-low.php'); break;
        }
      break;

      case "Install":
        switch ($protocol)
        {
          case "1": Error::stop('errors/install/already-made.php'); break;
          case "2": Error::stop('errors/install/in-progress.php'); break;
        }
      break;

      case "Session":
        switch ($protocol)
        {
          case "1": Error::stop('errors/session/no-value'); break;
        }

    }

  }

  public static function stop($file)
  {
    die (include('./public/pages/'.$file.''));
  }

}
?>
PHP:
<?php
namespace Models;
class Session
{
  public static function has($what)
  {
    if (isset ($_SESSION[$what]))
    {
      return true;
    }
    else
    {
      return false;
    }
  }

  public static function get($what)
  {
    return $_SESSION[$what];
  }

  public static function set($key, $data)
  {
    $_SESSION[$key] = $data;
  }

  public static function remove($what)
  {
    unset($_SESSION[$what]);
  }

  public static function clean()
  {
    unset ($_SESSION);
    return 'Session cleaned.';
  }
}
?>
Just a bit of my code right now, Imagine is using a MVC framework and Illuminate's database.
Current Protocol List
-----------------

Permissions
1 = No level
2 = Too Low Of Rank

Pages
1 = Page Not Found

Install
1 = Install already made.
2 = Installation in progress

(May not be current)

PHP:
<?php
namespace Models;
class Install
{

  public static function check()
  {
    if (Install::session_exists() == false)
    {
      if (Install::made() == false)
      {
        Install::start();
      }
    }
    else
    {
      $location = Install::session_location('where');
      Install::run_last($location);

    }
  }

  public static function made()
  {
    if (is_readable('./install.lock'))
    {
      return true;
    }
    else
    {
      return false;
    }
  }

  public static function start()
  {
    if (Install::session_running() == true)
    {
      if (Install::session_exists() == false)
      {
      Error::notify('Install', '2');
      }
      else
      {
        $where = Install::session_location('where');
        echo $location = Install::navigate($where);
        //Page::get('install/'.$location.'');
      }
    }
    else
    {
      Install::session_new();
      Install::create_lock_part();
      $where = Install::session_location('where');
      echo $location = Install::navigate($where);
      //Page::get('install/'.$location.'');
    }
  }

  public static function session_new()
  {
    if (Install::made() == false)
    {
      $_SESSION["install_loc"] = 0;
    }
    else
    {
      return false;
    }
  }

  public static function session_exists()
  {
    if (isset ($_SESSION["install_loc"]))
    {
      return true;
    }
    else
    {
      return false;
    }
  }

    public static function session_location($key)
    {
      switch ($key)
      {
        case "where":
          if (isset($_SESSION["install_loc"]))
          {
            return Install::navigate($_SESSION["install_loc"]);
          }
          else
          {
            $_SESSION["install_loc"] = 0;
            return Install::navigate($_SESSION["install_loc"]);
          }
        break;
        case "push":
          $_SESSION["install_loc"] = $_SESSION["install_loc"]++;
        break;
      }
    }

    public static function navigate($location)
    {
      switch ($location)
      {
        case "0": return 'welcome'; break;
        case "1": return 'mysql'; break;
        case "2": return 'general'; break;
      }
    }

    public static function run_last($where)
    {
      echo $where;
      //Page::get('install/'.$where.'');
    }

    public static function session_running()
    {
      if (is_readable('./install.session'))
      {
        return true;
      }
      else
      {
        return false;
      }
    }

    public static function create_lock()
    {
      fopen("./install.lock", "w");
    }

    public static function create_lock_part()
    {
      fopen("./install.session", "w");
    }

}
?>
 
Imagine installation system works completely now, and there are 3 database types by default "Phoenix", "Butterfly", "Azure". Working on my theme manager today, and going to get a nice start on the new templatng system. If anyone has decent themes (Official Habbo designs covered), send them to me and you'll get mentioned on release thread.
 
Documentation

 
Alright, I am now merging my Page Model over to using Blade Templating. Pretty much I've taken my favorite Laravel components (Illuminate, and Blade) and just used them to form the backbone for Imagine.
 
If anyone thought this was half decent, here's the alpha version of it.

 
Hey, this project has not died. Anyways, the Plugin Manager as well as the other important model (Pages) is fully finished, and now running fine and just doing some updates to the admin panel. I may consider release after I do a quick touchups on iAdmin to ensure a security environment, but Imagine is looking and running great for once!
1.png

2.png
3.png
4.png
5.png
6.png
7.png
8.png
9.png

Both systems use PDO, and Blade templating and have little issues as of now. In fact, iAdmin is being used for the Humane Society's management platform as of now (My local section, not national).
 
Also:
Imagine uses it's own system for logins, and "identities" which are essentially the same as characters or your PhoenixEMU users. This means one account can have multiple characters to switch and choose from
 
:)
 

Jaden

not so active
Aug 24, 2014
886
263
Congratulations, you can do what I myself and most developers mentally cannot do--- use frameworks. ._.
Count your blessings...

This is starting to get interesting-- Can we take a peak at your PDO class (assuming its a wrapper, you can have a thumbs up right now).

:up:
 

LeChris

https://habbo.codes/
Sep 30, 2013
2,786
1,395
Congratulations, you can do what I myself and most developers mentally cannot do--- use frameworks. ._.
Count your blessings...

This is starting to get interesting-- Can we take a peak at your PDO class (assuming its a wrapper, you can have a thumbs up right now).

:up:
I'm loosely using a framework, I just took my 2 most favorite components from Laravel and used them via Composer Packager :)

PHP:
<?php
class Database
{

    private static $factory;
    private $db;

    public static function boot()
    {
        if (!self::$factory)
        self::$factory = new Database();
        return self::$factory;
    }

    public function connect()
    {
        if (!$this->db)
        {
           $capsule = new \Illuminate\Database\Capsule\Manager();
           include('./app/configuration.php');
           $capsule->addConnection([
             'driver'    => 'mysql',
             'host'      => $host,
             'database'  => $name,
             'username'  => $user,
             'password'  => $pass,
             'charset'   => 'utf8',
             'collation' => 'utf8_unicode_ci',
             'prefix'    => '',
           ]);
           $capsule->setAsGlobal();
           $capsule->bootEloquent();
           $this->db = $capsule->getConnection();
        }
    return $this->db;
    }

}
?>
Than for a DB connection, I'll just use $db = Database::boot()->connect() which is a lot more efficient than some of the ways I did connections in the past
For a DB query
$db->table('imagine_config')->where('key', 'img_name')->pluck('data');
 
Last edited:

AaidenX

Member
Jun 30, 2012
261
29
@Leader looking good, but you should follow the PSR standards. It isn't a must but recommended.
 

DevAaron

Member
Nov 22, 2014
36
1
Great, something new tbh that you really never see around here! Would make it easier, to manage your retros for some people.
 

LeChris

https://habbo.codes/
Sep 30, 2013
2,786
1,395
Hey guys,
Imagine's administrative panel has received some updates with the page manager, and plugins! I'm currently thinking of changing the plugin system to possibly using Json however for now, the PDO usage will suffice. You can now create pages, and I'm working on possibly adding a drag and drop type interface such as how Wordpress handles managing page content.

Plugin Distribution Tree
DBLFEm0.png

Current Progress on Page creator
7eg7CgH.png
g0BqNCp.png


Also:
I'm most likely going to change Imagine's full system into a REST API, and use AngularJS for the front-end to speed things up a bit, and make it flow better. However, that'll be within revision 2, which won't be a for a long time (after first initial release)
 
HwoIpli.png

 
Hey, this project is just receiving some fixes however it could be up to 2 weeks without any updates as I tore my shoulder ligament, and fractured some bones in a fourwheeler accident - anyways my doctor wants me to rest and keep my arm in a sling so any coding is off until it heals. :)
 
Oct 11, 2014
1,071
256
Hey guys,
Imagine's administrative panel has received some updates with the page manager, and plugins! I'm currently thinking of changing the plugin system to possibly using Json however for now, the PDO usage will suffice. You can now create pages, and I'm working on possibly adding a drag and drop type interface such as how Wordpress handles managing page content.

Plugin Distribution Tree
DBLFEm0.png

Current Progress on Page creator
7eg7CgH.png
g0BqNCp.png


Also:
I'm most likely going to change Imagine's full system into a REST API, and use AngularJS for the front-end to speed things up a bit, and make it flow better. However, that'll be within revision 2, which won't be a for a long time (after first initial release)
 
HwoIpli.png

 
Hey, this project is just receiving some fixes however it could be up to 2 weeks without any updates as I tore my shoulder ligament, and fractured some bones in a fourwheeler accident - anyways my doctor wants me to rest and keep my arm in a sling so any coding is off until it heals. :)
Alright, Get well soon mate. can't wait to see this finished
 

LeChris

https://habbo.codes/
Sep 30, 2013
2,786
1,395
Hey, so I might of lied about taking some vacation and went against my doctor's orders. Anyways here's some updates as of today
Code:
-Added modifiable events
-Redone structure relative to class type (System, Settings)
-Redone how classes are used, their now used as traits essentially
-Started merging parts of Imagine to JSON data to reduce database usage
 
Status
Not open for further replies.

Users who are viewing this thread

Top