[Development] Premium Panel

Results 1 to 19 of 19
  1. #1
    Member BrightChoco is offline
    MemberRank
    Dec 2010 Join Date
    28Posts

    config [Development] Premium Panel

    Premium Panel

    Over the next week or so I will be working on a Premium Panel. This project was inspired by some of the servers I am taking part in. The project will be open source, and released upon stages of completion. By skimming through the source of the project, you will find the following programming languages throughout it: HTML, CSS, PHP, JavaScript, JQuery (JavaScript Library), SQL (MSSQL).

    Overall Progress:

    100%

    • Base Template - Completed.
    • Base Engine (Class) - Completed.
    • Base User (Class) - Completed.
    • Login Process - Completed.
    • Donation Process (paypal) - Completed.
    • Item Mall - Completed.


    Screen Shots:

    Spoiler:

    Coming Shortly...


    Snippets:

    Spoiler:

    Base Engine (Class):
    Code:
    <?php
    
    ############################################
    ## Class Engine                           ##
    ############################################
    
    class Engine
    {
    	private $connected = false;
    	// Sets variable connected.
    	private $link;
    	// Sets variable link.
    	
    	public function ParseConfigs()
    	// Parses configuration settings.
    	{
    		$configPath = INCLUDES . "inc.config.php";
    		
    		switch (file_exists($configPath))
    		{
    			case(false):
    				die("Cannot locate the configuration file.");
    				break;
    				
    			default:
    				require_once $configPath;
    				break;
    		}
    		
    		$this->config = $config;
    		define("WWW", $this->config['site']['host_name']);
    	}
    	
    	public function Connect()
    	// Connects to the MSSQL server.
    	{
    		$this->link = @mssql_connect($this->config['mssql']['server'], $this->config['mssql']['username'], $this->config['mssql']['password']);
    	
    		$this->connected = true;
    	}
    	
    	public function Select($number = '')
    	// Selects a MSSQL database.
    	{
    		$select = @mssql_select_db($this->config['mssql']['database'][$number]);
    	
    		switch ($select)
    		{
    			case(false):
    				die("Cannot select database " . $number . ".");
    				break;
    		}
    	}
    	
    	public function isConnected()
    	// Checks if connection is true.
    	{
    		if ($this->connected == true)
    		{
    			return true;
    		}
    		
    		return false;
    	}
    	
    	public function doQuery($str = '', $number = '')
    	// Queries database.
    	{
    		$select = $this->Select($number);
    		$result = @mssql_query($str, $this->link);
    		
    		return $result;
    	}
    	
    	public function doHash($str = '')
    	// Hashes a string.
    	{
    		return md5($this->config['site']['hash_code'] . $str);
    	}
    	
    	public function Filter($str = '')
    	// Filters string.
    	{
    		return stripslashes(trim(htmlentities($str)));
    	}
    }
    
    ?>


    Preliminary Overview:

    The Premium Panel will be handling: donations, buying items, and gifting items. It will be a secure panel, properly coded using classes and parameters to easily organize functions and ease customization by the client (server owner).

    During the project, I would like to encourage suggestions and feedback to help improve and maximize the quality of this panel. That being said, feel free to comment at any point in time to share your ideas and suggestions.

    Basic Features (revised version 1.0)

    • Custom FlyFF Template
    • Login
    • Automated Paypal Donation (IPN)
    • Item Mall (Buy, Gift, etc.)
    • Logging


    Credits (revised version 1.0):

    Last edited by BrightChoco; 19-01-11 at 07:16 PM.


  2. #2
    Sorcerer Supreme Hexadecimal is offline
    Member +Rank
    Dec 2010 Join Date
    424Posts

    Re: [Development] Premium Panel

    Looks nice. Well done.

    -BGxApixen

  3. #3
    Sorcerer Supreme Johnny is offline
    Member +Rank
    Jun 2010 Join Date
    U.S.ALocation
    477Posts

    Re: [Development] Premium Panel

    since its a panel you should add things like change password? maybe forgot password thing. i think the forgot password would be harder but change password or maybe reset char when they get bugged so players can reset there player to say flaris or something? good luck looks like this id going to be one of the good releases XD

  4. #4
    Elite Member Matrixo is offline
    Member +Rank
    Aug 2008 Join Date
    181Posts

    Re: [Development] Premium Panel

    Good job man. Don't miss this project.

  5. #5
    Sorcerer Supreme Hexadecimal is offline
    Member +Rank
    Dec 2010 Join Date
    424Posts

    Re: [Development] Premium Panel

    Quote Originally Posted by johnnyfla1 View Post
    since its a panel you should add things like change password? maybe forgot password thing. i think the forgot password would be harder but change password or maybe reset char when they get bugged so players can reset there player to say flaris or something? good luck looks like this id going to be one of the good releases XD
    Read the post.

    It's an Item Mall.

  6. #6
    Member Sephern is offline
    MemberRank
    Jan 2009 Join Date
    59Posts

    Re: [Development] Premium Panel

    Quote Originally Posted by BrightChoco View Post
    Premium Panel

    Over the next week or so I will be working on a Premium Panel. This project was inspired by some of the servers I am taking part in. The project will be open source, and released upon stages of completion. By skimming through the source of the project, you will find the following programming languages throughout it: HTML, CSS, PHP, JavaScript, JQuery (JavaScript Library), SQL (MSSQL).

    Overall Progress:

    10%

    • Base Template - Completed.
    • Base Engine (Class) - Completed.


    Screen Shots:

    Spoiler:

    Coming Shortly...


    Snippets:

    Spoiler:

    Base Engine (Class):
    Code:
    <?php
    
    ############################################
    ## Class Engine                           ##
    ############################################
    
    class Engine
    {
    	private $connected = false;
    	// Sets variable connected.
    	private $link;
    	// Sets variable link.
    	
    	public function ParseConfigs()
    	// Parses configuration settings.
    	{
    		$configPath = INCLUDES . "inc.config.php";
    		
    		switch (file_exists($configPath))
    		{
    			case(false):
    				die("Cannot locate the configuration file.");
    				break;
    				
    			default:
    				require_once $configPath;
    				break;
    		}
    		
    		$this->config = $config;
    		define("WWW", $this->config['site']['host_name']);
    	}
    	
    	public function Connect()
    	// Connects to the MSSQL server.
    	{
    		$this->link = @mssql_connect($this->config['mssql']['server'], $this->config['mssql']['username'], $this->config['mssql']['password']);
    	
    		$this->connected = true;
    	}
    	
    	public function Select($number = '')
    	// Selects a MSSQL database.
    	{
    		$select = @mssql_select_db($this->config['mssql']['database'][$number]);
    	
    		switch ($select)
    		{
    			case(false):
    				die("Cannot select database " . $number . ".");
    				break;
    		}
    	}
    	
    	public function isConnected()
    	// Checks if connection is true.
    	{
    		if ($this->connected == true)
    		{
    			return true;
    		}
    		
    		return false;
    	}
    	
    	public function doQuery($str = '', $number = '')
    	// Queries database.
    	{
    		$select = $this->Select($number);
    		$result = @mssql_query($str, $this->link);
    		
    		return $result;
    	}
    	
    	public function doHash($str = '')
    	// Hashes a string.
    	{
    		return md5($this->config['site']['hash_code'] . $str);
    	}
    	
    	public function Filter($str = '')
    	// Filters string.
    	{
    		return stripslashes(trim(htmlentities($str)));
    	}
    }
    
    ?>


    Preliminary Overview:

    The Premium Panel will be handling: donations, buying items, and gifting items. It will be a secure panel, properly coded using classes and parameters to easily organize functions and ease customization by the client (server owner).

    During the project, I would like to encourage suggestions and feedback to help improve and maximize the quality of this panel. That being said, feel free to comment at any point in time to share your ideas and suggestions.

    Basic Features (revised version 1.0)

    • Custom FlyFF Template
    • Login
    • Automated Paypal Donation (IPN)
    • Item Mall (Buy, Gift, etc.)
    • Logging


    Credits (revised version 1.0):

    Just a heads up, but you'll benefit from switching your database over to MySQL. Unless you're using sub-queries, its got better performance and generally works better with PHP. Considering that the database is almost always the bottleneck in web applications, this is something you might want to improve upon.

    You seem to have a 'god' class with Engine. What this basically means is that you're putting all your code logic, or a lot of your code logic, all within 1 class. This is kinda contrary to what Object Orientation is about. You should make lots of little classes for different things. For example, you should have a config class, a logging class etc. Using a design pattern like MVC will benefit you in doing these things (and a lot of MVC frameworks have config, logging, database and caching, amongst other things, already written for you if you choose to use one).

    I've got some config and logging classes lying around on my other PC from working on my framework. I'll post them up later if they'll be of benefit to you.

    I use windows ini file format for my configuration, because its easy for anybody who isn't good with code to edit. If you use a PHP config file, then they only need to miss one quote, semi colon or dollar sign and the whole script clusterfucks. By using a more standardised and recognisable config format like ini you can stop that problem, since people are generally familiar with that format. The functions pretty quick too, since it's written as a C extension. Your ini file should have a php extension and have a null statement at the top though, cos it solves problems of people CHMOD'ing wrong and dropping their config details all over the 'net. I'll drop an example up in a bit.

    You should definitely add support for opcode caching too. Look into APC and xCache. They'll speed up your PHP a hell of a lot. You can serialize your config options and store them in the opcode cache as well, since this is quicker than even including a file and it reduces stat() calls.

  7. #7
    0xC0FFEE spikensbror is offline
    Grand MasterRank
    Dec 2006 Join Date
    SwedenLocation
    1,855Posts

    Re: [Development] Premium Panel

    I got to agree with Sephern, putting all logic and object linking in a "god" class is never a good idea.
    I guess people tend to think Classes = Pro, I know I did before, but I, and they failed/fail to realize that classes are made to represent objects, and not "engines" or whatever you may have.

    I suggest you only make what's necessary into objects, the rest can be done in a procedural matter.

  8. #8
    Member Sephern is offline
    MemberRank
    Jan 2009 Join Date
    59Posts

    Re: [Development] Premium Panel

    Quote Originally Posted by spikensbror View Post
    I got to agree with Sephern, putting all logic and object linking in a "god" class is never a good idea.
    I guess people tend to think Classes = Pro, I know I did before, but I, and they failed/fail to realize that classes are made to represent objects, and not "engines" or whatever you may have.

    I suggest you only make what's necessary into objects, the rest can be done in a procedural matter.
    Hm, I'd disagree. You should either choose OO or Procedural and stick to it. But of you're going to do it you should do it properly. The problem is having too much in one class, especially if its not related.

    Engine classes are fine, but there should be 1 class per engine. And engines are for specific purposes. For example, in my framework I have a database engine class. This handles which database-specific class to instantiate, and manages the instances to ensure there's no duplicates and such.

  9. #9
    Sorcerer Supreme TheJacob is offline
    Member +Rank
    Jun 2010 Join Date
    Toronto, CanadaLocation
    322Posts

    Re: [Development] Premium Panel

    Nice development.

    EDIT: I agree above.
    Last edited by TheJacob; 05-01-11 at 06:22 PM.

  10. #10
    Member BrightChoco is offline
    MemberRank
    Dec 2010 Join Date
    28Posts

    Re: [Development] Premium Panel

    I have only released one snippet? It's not a "god" class, I have various classes for various functionality. So don't be so quick off your feet to assume so.

    Sephern just because you can use MSSQL and MySQL at the same time in PHP doesn't mean that I will. I have other plans, and specific ones which require MSSQL, therefore I am using it.

    More snippets will be released shortly to clear up the spoof about this being a "god" class and non Object Oriented coding.

    Does anyone have any specific Item Mall suggestions? I am thinking just a basic Buy, Gift, and if you have suggestions for features I am open to them.
    Last edited by BrightChoco; 05-01-11 at 09:17 PM.

  11. #11
    Elite Member R3fl3x is offline
    Member +Rank
    Sep 2008 Join Date
    116Posts

    Re: [Development] Premium Panel

    Quote Originally Posted by BrightChoco View Post
    I have only released one snippet? It's not a "god" class, I have various classes for various functionality. So don't be so quick off your feet to assume so.

    Sephern just because you can use MSSQL and MySQL at the same time in PHP doesn't mean that I will. I have other plans, and specific ones which require MSSQL, therefore I am using it.

    More snippets will be released shortly to clear up the spoof about this being a "god" class and non Object Oriented coding.

    Does anyone have any specific Item Mall suggestions? I am thinking just a basic Buy, Gift, and if you have suggestions for features I am open to them.
    Suggestions from my side:
    - Add a possibility to set a item on a status like "There are XXXX on sale! After they are sold you can't buy them anymore!"
    - Add a good discount function to make it able to sell an item for a specific amount of cash over a specified period.

  12. #12
    Member BrightChoco is offline
    MemberRank
    Dec 2010 Join Date
    28Posts

    Re: [Development] Premium Panel

    I like both of those ideas, I will add them in and credit appropriately. I really like the discount function, I'll work it out somehow -tries to remember grade 9 Math-.

  13. #13
    0xC0FFEE spikensbror is offline
    Grand MasterRank
    Dec 2006 Join Date
    SwedenLocation
    1,855Posts

    Re: [Development] Premium Panel

    If you are going to use MSSQL because of the procedures, you can do that in MySQL too.

    Discount formula example:
    Code:
    $price = $original_price - (($original_price / 100) * $discount_percentage);
    Might want some kind of rounding function for that as well, but it's a raw formula so.
    Last edited by spikensbror; 05-01-11 at 11:45 PM.

  14. #14
    Member BrightChoco is offline
    MemberRank
    Dec 2010 Join Date
    28Posts

    Re: [Development] Premium Panel

    Quote Originally Posted by spikensbror View Post
    If you are going to use MSSQL because of the procedures, you can do that in MySQL too.

    Discount formula example:
    Code:
    $price = $original_price - (($original_price / 100) * $discount_percentage);
    Might want some kind of rounding function for that as well, but it's a raw formula so.
    I know how how to do the formula; I was kidding about the "-goes back to grade 9 Math-". I am using MSSQL for other reasons, you'll find out when the full source is leaked.

    Your code above doesn't work properly, and it doesn't handle all situations, e.x. it doesn't take into account numbers such as "6.9183". I'll be using something like this below.

    Code:
    $price = $original_price - (round($original_price * $discount_percent));
    Last edited by BrightChoco; 06-01-11 at 01:20 AM.

  15. #15
    Member Sephern is offline
    MemberRank
    Jan 2009 Join Date
    59Posts

    Re: [Development] Premium Panel

    Quote Originally Posted by BrightChoco View Post
    I have only released one snippet? It's not a "god" class, I have various classes for various functionality. So don't be so quick off your feet to assume so.

    Sephern just because you can use MSSQL and MySQL at the same time in PHP doesn't mean that I will. I have other plans, and specific ones which require MSSQL, therefore I am using it.

    More snippets will be released shortly to clear up the spoof about this being a "god" class and non Object Oriented coding.

    Does anyone have any specific Item Mall suggestions? I am thinking just a basic Buy, Gift, and if you have suggestions for features I am open to them.
    You've released one snippet, but the one snippet you have released is a 'god' class. You have several different functions in there, none of them necessarily related to each other.
    Why have a parse_config function in a class which also connects to a database, does queries, generates hashes, and filters output?
    A class should do one specific job. For example, have a config class which deals with parsing config files, and returning config values. A database class which handles connection to a database, querying and such. A security class maybe, which has output sanitization and hashing. Logically structuring your code into different blocks, which all do a specific thing is the whole purpose of Object Orientation.

    As for your usage of MsSQL, I appreciate that you'll probably at some point be communicating with the game database. However, in a situation where web servers are being run separately from the game servers (which should be most of the time), MySQL will probably be the superior option for this development, for the following reasons.
    1) It has better PHP support. PHP has better extensions for handling connections to MySQL (particularly the most excellent PDO Library). This leads to faster, more efficient and generally cleaner code.

    2) MsSQL is locked down to Microsoft. This means that when you want to scale, you have to pay out. Lets say at the moment you're quite a small server who run your web box on the same server as your game. When it comes to the point where you want to split off and get a web box, you have to get Windows hosting, with MsSQL. When you go to get a VPS or Dedicated server, you have the same issue. You'll have to pay for a windows server license and a MsSQL license. Plus windows generally isn't as good as a Server Operating System in comparison to Linux.

    3) MySQL is marginally quicker, and more memory efficient.

    I'm not necessarily saying that you definitely should make it with MySQL. All I'm saying is that its something you should consider and not dismiss straight away. Adding support for multiple database engines, for example, probably won't take that long if you've designed your application with Object Orientation.

    Also, we're giving you constructive criticism to help your project become better. It's all part of the learning process, we're not insulting you personally, just putting a few things you should look out for -.-

    Edit: Oh, and the code snippets I was talking about before.

    PHP Code:
    <?php

    #Cache Class
    #Created by Sephern
    #Allows parsing and easy retrieval of Config values

        
    class Config {
        
            protected static 
    $is_loaded false;
            protected static 
    $config_options = array();
        
            public static function 
    getVal($category$key) {
                if (
    self::$is_loaded === false
                {
                    
    $config parse_ini_file("config.ini.php"true);
                    
    self::$is_loaded true;
                    
    self::$config_options $config;
                    return 
    $config[$category][$key];
                }
                return 
    self::$config_options[$category][$key];
                
            }
        }
        
    ?>
    That's obviously a class for parsing config files. I'll probably add some support for caching later on, which is definitely something you should do if you plan to use this and implement caching in yours. At the moment it does one stat call per request D:
    Caching it should be quite simple. Make a function which tries to make a call to APC. If it succeeds, then check if a cached value exists, and if it does then update the static variable to reflect the values from the cache, set that the static variable has been filled and return the value. If there is no cache record, get the ini file and cache it :)


    PHP Code:
    <?php

    #Logging Abstraction Layer
    #Created by Sephern
    #Allows the user to log intuitive messages from anywhere in their application

    class Log {
        const 
    LOG_ERROR 5;
        const 
    LOG_WARN 4;
        const 
    LOG_NOTICE 3;
        const 
    LOG_INFO 2;
        const 
    LOG_DEBUG 1;
        
        protected static 
    $engine false;
        protected static 
    $maxlevel false;
        
        public function 
    __construct($engine false) {
            
    #Constructor to determine the logging engine
            
    if ($engine === false)
                
    $engine strtolower(Config::getVal("log","engine"));
            require_once (
    "log.".$engine.".php");
            
    $loadlib "Log".$engine."Wrapper";
            
    $instance = new $loadlib();
            
    self::$engine $instance;
            
    self::$maxlevel Config::getVal("log","loglevel");
        }
        
        private static function 
    _getInstance() {
            
    #Create an instance of child logging engine class
            
    if (!self::$engine)
            {
                
    $log = new Log();            
            }
            return 
    self::$engine;
        }
        
        private static function 
    _write($loglevel$message$file$line) {
            
    #Write to the log
            
    $log self::_getInstance();
            if (
    $loglevel <= self::$maxlevel)
            {
                if (!
    $file || !$line)
                {
                    
    $location debug_backtrace();
                    
    $file $location[1]['file'];
                    
    $line $location[1]['line'];
                }
                
    $log->write($loglevel$message$file$line);
            }
        }
        
        public static function 
    error($message$file=false$line=false) {
            
    #public method for errors
            
    self::_write(self::LOG_ERROR$message$file$line);
        }
        
        public static function 
    warn($message$file=false$line=false) {
            
    #public method for warnings
            
    self::_write(self::LOG_WARN$message$file$line);
        }
        
        public static function 
    notice($message$file=false$line=false) {
            
    #public method for notices
            
    self::_write(self::LOG_NOTICE$message$file$line);
        }
        
        public static function 
    info($message$file=false$line=false) {
            
    #public method for information messages
            
    self::_write(self::LOG_INFO$message$file$line);
        }
        
        public static function 
    debug($message$file=false$line=false) {
            
    #public method for debugging messages
            
    self::_write(self::LOG_DEBUG$message$file$line);
        }
        
    }
    ?>
    Abstraction code for logging. This basically allows you to have multiple different 'engines' for logging, as specified in the config file. Evidently, if you do your configs differently from mine (and choose to only have one logging engine) yours will be different.
    The advantage of this is that as it abstracts, you can change the code really easily. Simply by writing a new 'engine' and changing the config file, you can have it save errors in a database, email a site admin, and do a ton of other stuff. When you have the logging engine called by the error handler, it can be really quite powerful. Especially since you don't have to go through all the code and change it, and you can switch back to different file logging methods with the change of 1 config line.

    PHP Code:
    <?php

    #Log File Engine
    #Created by Sephern
    #Class for logging to a file - written for logging abstraction layer

    class LogFileWrapper {

        private 
    $fhandle;

        public function 
    __construct() {
            
    #Determine whether the logfile exists, and create/open for editing
            
    $logdir Config::getVal("log""logdir");
            if (
    $logdir[0] != "/")
                
    $logdir "/".$logdir;
            
            
    $logdir $_SERVER['DOCUMENT_ROOT'].Config::getVal("general","path").$logdir."/log-".date("d.m.y").".log";
            
    $this->fhandle fopen($logdir'at');
        }

        public function 
    write($loglevel$message$file$line) {
            
    #Write to the logfile
            
    switch($loglevel)
            {
            case 
    Log::LOG_ERROR:
                
    $level "ERROR";
                break;
            case 
    Log::LOG_WARN:
                
    $level "WARNING";
                break;
            case 
    Log::LOG_NOTICE:
                
    $level "NOTICE";
                break;
            case 
    Log::LOG_INFO:
                
    $level "INFORMATION";
                break;
            case 
    Log::LOG_DEBUG:
                
    $level "DEBUG";
                break;
            }
            
            
    $time_format strval(Config::getVal("log","timestamp_format"));
            
    $timestamp date($time_formattime());
            
    $fullmessage "[".$level."] - ".$timestamp." - ".$message." in ".$file." on line ".$line."\n\n";
            
    fwrite($this->fhandle$fullmessage);
            return 
    true;
        }
        
        public function 
    __destruct() {
            
    #Close the handle on class ending to prevent file lockups
            
    fclose($this->fhandle);
        }
    }

    ?>
    Theres an example of an engine. Its a pretty basic one that writes to files.

    The logging mechanism uses Log4j, which is pretty much industry standard. It specifies 5 levels of error that you can log within your application.

    PHP Code:
    ;<?php die("Direct File Access Forbidden"); ?>

    ;Framework Configuration Script
    ;Windows Ini Format
    ;Comments declared with semi-colons
    ;Trees are enclosed in square brackets
    ;Settings stored in key value pairs

    [general]
    path = /Framework ;any folder or path outside of the document root, with leading slash

    [database]
    host = localhost ;your db host, IP or DNS
    port = 3306 ;the port your database runs on
    username = root ;your database username
    password = ****** ;your database password
    schema = testdb ;your schema/database name
    engine = MySQL ;your database engine [MySQL, MsSQL]
    returntype = ROW ;default return type of queries. [ROW, ARRAY, VALUE, RAW] 
    table_prefix = ;table prefix for your db tables

    [log]
    engine = File ;logging engine, currently only File
    logdir = /Logs ;goes from the document root, and a leading slash should be used (but will be silently added if there isn't one)
    fileprefix = 
    ; 0 = no logging
    ; 1 = log errors
    ; 2 = log warnings
    ; 3 = log notices
    ; 4 = log info
    ; 5 = log debug
    ; all escalate
    loglevel = 5
    timestamp_format = d/m/Y G:i:s

    [errors]
    showinfo = true ;Show error information in error pages displayed to user. Should be set to false in production environment (True/False)

    [cache]
    engine = memcached
    host = localhost
    port = 11211
    ttl = 600 ;time for cache records to survive by default in seconds
    Finally, a sample config.php.

    All of these are called as static, so all you need to do is include/require them in your project (so probably just adding them to your autoloader).

    PHP Code:
    Config::getVal("database""host"); 
    would return the database host in the config. Its pretty simple. The first argument passed to it is the section of the config (the bits in square brackets), and the second part is the key. The function returns the value.

    Logging takes 1 parameter which is compulsory, and 2 optional ones. Obviously, the parameter you have to send is the message.
    PHP Code:
    Log::debug("This is a log message"); 
    You can also optionally send a file name, and a line number
    PHP Code:
    log::error("Shit! Something went wrong""anotherfile.php"12); 
    Hopefully those little snippets should help you out when it comes to coding the same segments of your application ;)
    Last edited by Sephern; 06-01-11 at 09:14 PM.

  16. #16
    Member BrightChoco is offline
    MemberRank
    Dec 2010 Join Date
    28Posts

    Re: [Development] Premium Panel

    No sorry it will not help my current project seeing as you have no idea how I am coding this. Good effort though, maybe you should use those for what ever you made them for.

  17. #17
    Member Sephern is offline
    MemberRank
    Jan 2009 Join Date
    59Posts

    Re: [Development] Premium Panel

    Quote Originally Posted by BrightChoco View Post
    Premium Panel

    Over the next week or so I will be working on a Premium Panel. This project was inspired by some of the servers I am taking part in. The project will be open source, and released upon stages of completion. By skimming through the source of the project, you will find the following programming languages throughout it: HTML, CSS, PHP, JavaScript, JQuery (JavaScript Library), SQL (MSSQL).

    Overall Progress:

    10%

    • Base Template - Completed.
    • Base Engine (Class) - Completed.


    Screen Shots:

    Spoiler:

    Coming Shortly...


    Snippets:

    Spoiler:

    Base Engine (Class):
    Code:
    <?php
    
    ############################################
    ## Class Engine                           ##
    ############################################
    
    class Engine
    {
    	private $connected = false;
    	// Sets variable connected.
    	private $link;
    	// Sets variable link.
    	
    	public function ParseConfigs()
    	// Parses configuration settings.
    	{
    		$configPath = INCLUDES . "inc.config.php";
    		
    		switch (file_exists($configPath))
    		{
    			case(false):
    				die("Cannot locate the configuration file.");
    				break;
    				
    			default:
    				require_once $configPath;
    				break;
    		}
    		
    		$this->config = $config;
    		define("WWW", $this->config['site']['host_name']);
    	}
    	
    	public function Connect()
    	// Connects to the MSSQL server.
    	{
    		$this->link = @mssql_connect($this->config['mssql']['server'], $this->config['mssql']['username'], $this->config['mssql']['password']);
    	
    		$this->connected = true;
    	}
    	
    	public function Select($number = '')
    	// Selects a MSSQL database.
    	{
    		$select = @mssql_select_db($this->config['mssql']['database'][$number]);
    	
    		switch ($select)
    		{
    			case(false):
    				die("Cannot select database " . $number . ".");
    				break;
    		}
    	}
    	
    	public function isConnected()
    	// Checks if connection is true.
    	{
    		if ($this->connected == true)
    		{
    			return true;
    		}
    		
    		return false;
    	}
    	
    	public function doQuery($str = '', $number = '')
    	// Queries database.
    	{
    		$select = $this->Select($number);
    		$result = @mssql_query($str, $this->link);
    		
    		return $result;
    	}
    	
    	public function doHash($str = '')
    	// Hashes a string.
    	{
    		return md5($this->config['site']['hash_code'] . $str);
    	}
    	
    	public function Filter($str = '')
    	// Filters string.
    	{
    		return stripslashes(trim(htmlentities($str)));
    	}
    }
    
    ?>


    Preliminary Overview:

    The Premium Panel will be handling: donations, buying items, and gifting items. It will be a secure panel, properly coded using classes and parameters to easily organize functions and ease customization by the client (server owner).

    During the project, I would like to encourage suggestions and feedback to help improve and maximize the quality of this panel. That being said, feel free to comment at any point in time to share your ideas and suggestions.

    Basic Features (revised version 1.0)

    • Custom FlyFF Template
    • Login
    • Automated Paypal Donation (IPN)
    • Item Mall (Buy, Gift, etc.)
    • Logging


    Credits (revised version 1.0):

    The fact that the project is open source suggests that its around for people to contribute to it. Why do you launch an 'open source' project, then don't listen to any actual genuine help given to you?

    Also, the fact that its object orientated PHP, and that you've stated you're implementing features such as Logging, its bound to help in some capacity since its a logging class. There's only so far you can deviate from that without doing something catastrophically different.

  18. #18
    Member BrightChoco is offline
    MemberRank
    Dec 2010 Join Date
    28Posts

    Re: [Development] Premium Panel

    UPDATED THREAD

    I have updated my progress, I will post some screen shots shortly. The engine is completed, as well as the template, etc.

  19. #19
    We are Maverick! Dell Honne is offline
    Grand MasterRank
    Feb 2009 Join Date
    ON, CanadaLocation
    3,254Posts

    Re: [Development] Premium Panel

    Closed on request.



Advertisement