Jump to content

.InyaProduction

Former Staff
  • Posts

    511
  • Joined

  • Last visited

  • Days Won

    10
  • Feedback

    0%

Posts posted by .InyaProduction

  1. What apple bug? oO

    Yeah well i will correct that asap :D

     

    http://embeddedgurus.com/barr-code/2014/03/apples-gotofail-ssl-security-bug-was-easily-preventable/

     

    Missing braces around blocks can easily lead to false branching.

     

    I think your project needs some clear (rough) aim so interested developers can think about what could benefit this project.

    There are already plenty of specialized libraries for e.g. database abstraction.

    There are also many sites providing useful classes and helpers (with questionable code quality, maybe).

     

    What I'm actually missing is an easy Bootstrap widget system for PHP - there are some for several frameworks but not for plain PHP.

    Well that bootstrap thing is the next thing i was planning to do. I did something similar earlier but just for forms. Ill append the source code at the bottom. In the dreamPHP it will be a lot more clean, with templates and so on.

    <?php
    	/**
    	 * @name: form
    	 * @package: modules
    	 * @version: 1.0
    	 * @author: DreamChain
    	 * @last-modified: 13/11/2014
    	 * @last-modifier: DreamChain
    	 * @description:
    	 *             form handler
    	 *
    	 * @license:
    	 *         This CMS is developed and owned by DreamChain (.InyaProduction)
    	 *         Dont use this CMS without my permission!
    	 *
    	 * @copyright:
    	 *           ©2014 DreamChain and Pollux2
    	 *
    	 * @sources:
    	 *         Admin Panel built with Bootstrap v2.3.2 (http://getbootstrap.com/2.3.2/)
    	 */
    	class form_manager{
    		public function initForm($method, $action, $mfd = false){
    			return new form($method, $action, $mfd);
    		}
    	}
    	class form{
    
    		protected $_form = array();
    
    		public function __construct($method, $action, $mfd = false){
    			$this->_form = array(
    				'method'		=> $method,
    				'action'		=> $action,
    				'mfd'			=> $mfd, //multipart/formdata
    				'child'			=> array(),
    			);
    		}
    
    		public function setMultipartFormData($bool){
    			$this->_form['mfd'] = $bool;
    		}
    
    		public function addField($name, $type, $options = array()){
    			$this->_form['child'][] = array(
    				'name'			=> $name,
    				'type'			=> $type,
    				'options'		=> $options
    			);
    		}
    
    		protected function _generateChild($element){
    			$html = "";
    			if(isset($element['options']['label'])){
    				$html .= '<label for="'.$element['name'].'">'.$element['options']['label'].'</label>';
    			}
    			switch($element['type']){
    				case "text":
    				case "hidden":
    				case "password":
    				default:
    					$html .= '<input type="'.$element['type'].'" ';
    					$html .= 'name="'.$element['name'].'" ';
    					$html .= 'id="'.$element['name'].'" ';
    					$html .= 'class="form-control';
    					if(isset($element['options']['class'])){
    						$html .= ' '.$element['options']['class'];
    					}
    					$html .= '" ';
    					if(isset($element['options']['placeholder'])){
    						$html .= 'placeholder="'.$element['options']['placeholder'].'" ';
    					}
    					if(isset($element['options']['value'])){
    						$html .= 'value="'.$element['options']['value'].'" ';
    					}
    					$html .= "/>";
    					break;
    				case "textarea":
    					$html .= '<textarea ';
    					$html .= 'name="'.$element['name'].'" ';
    					$html .= 'id="'.$element['name'].'" ';
    					$html .= 'class="form-control';
    					if(isset($element['options']['class'])){
    						$html .= ' '.$element['options']['class'];
    					}
    					$html .= '" ';
    					if(isset($element['options']['size'])){
    						$html .= 'size="'.$element['options']['size'].'" ';
    					}
    					$html .= ">";
    					//content
    					if(isset($element['options']['value'])){
    						$html .= 'value="'.$element['options']['value'].'" ';
    					}
    					$html .= '</textarea>';
    					break;
    				case "select":
    					$html .= '<select ';
    					$html .= 'name="'.$element['name'].'" ';
    					$html .= 'id="'.$element['name'].'" ';
    					$html .= 'class="form-control';
    					if(isset($element['options']['class'])){
    						 $html .= ' '.$element['options']['class'];
    					}
    					$html .= '" ';
    					$html .= ">";
    					if(isset($element['options']['options'])){
    						foreach($element['options']['options'] as $value => $name){
    							$html .= '<option value="'.$value.'">';
    							$html .= $name;
    							$html .= '</option>';
    						}
    					}
    					$html .= '</select>';
    					break;
    				case "submit":
    				case "reset":
    					$html .= '<button type="'.$element['type'].'" class="btn ';
    					if(isset($element['options']['secondary']) && $element['options']['secondary']){
    						$html .= 'btn-default">';
    					} else {
    						$html .= 'btn-primary">';
    					}
    					$html .= $element['name'];
    					$html .= '</button>';
    					break;
    				case "break":
    					$html .= '<br />';
    					break;
    				case "headline":
    					$html .= '<h2>'.$element['name'].'</h2>';
    					break;
    			}
    			return $html;
    		}
    
    		public function outputForm(){
    			$html = "";
    			$html .= '<form action="'.$this->_form['action'].'" method="'.$this->_form['method'].'" '.(($this->_form['mfd'] == true) ? 'enctype="multipart/form-data"' : '').'>';
    			$html .= '<div class="form-group">';
    			foreach($this->_form['child'] as $element){
    				$html .= $this->_generateChild($element);
    			}
    			$html .= '</div>';
    			return $html;
    		}
    
    	}
    
  2. Hey guys,

     

    im currently working on a small PHP library called DreamPHP and I'm searching for some contributors. I just started and well its just a beginning till now. For the first thing this library collection support I've made a Gravatar library. More will follow in the next days and i hope to find someone who has fun developing this with me.

     

    The library is completely free and open source.

    If you want to contribute please feel free to contact me and for some informations head over here:

    DreamPHP

    This is the hidden content, please

     

    Also make suggestions, what you want to see. It can be metin2 related stuff aswell as everything else. 

     

    Some ideas i got in my head is:

     

    Bootstrap support (loading, generating forms and tables etc)

    MySQL, MySQLi, PDO librarys

    and some other stuff you can ask me for that

     

    Greetings, Inya

     

    PS: I don't want opinions about frameworks like smarty or anything (which can be used beside this lib anyways and may be integrated). Im just searching for contributors

    • Metin2 Dev 1
    • Love 1
  3. Yup, Wordpress scripts are shit from coding standards point of view. How to not mix php & html ?

    Just don't put logic where you display things. For example the framework I use, has a nice templating engine called Blade:

    Ex: https://github.com/ionutxp/blogging-platform/blob/master/themes/default/home.blade.php

    All the logic i've made it's in https://github.com/ionutxp/blogging-platform/tree/master/srcdir :D

    Also it's crazy to force the player to have a 8 chars account name and 9102391 char passwords.

    Anyway, After I'll release Metin2CMS , world will be a better place.

    Never said to put the logic to html. But if you work without any template system you have to used mixed html & php for the output. For me template systems are just a workaround for missing coding knowledge. Smarty is written in php so it cant be faster than php itself. So why use it?

  4. It's not just deprecated, it also will be removed in the next major PHP update, that's it. And people who script like '<div class="cusngireun"><?PHP echo $array['name']; ?></div>' are just terrible or lazy scripter.

    Ehh not really thats the normal way to do it. Or you wanna tell me the coders of Wordpress and Magento are terrible scripters? What way is better?

    echo '<div class="test">'.$array['name'].'</div>';

    You mean that way? If you want to fire an echo every time you make a new line go ahead. Even in the phpdocs its used that way

    Also i like the removal of mysql from php. The kids wont be able to use hen anymore and cant even setup a Website without using old php versiond

  5. It's not just scripted with an old PHP version, it's also using rare mysql_* functions, got a few sql vulnerables and got scripted with mixed HTML + PHP, that's kinda shit.

    Sry but ive never heard so much shit in one sentence...

    You cant script "with an old version" PHP Script wont be compiled so you just have to change the Plugin version at your apache/nginx and you are fine updating the php version (as long as you dont have any changed php functions used)

    Also please tell me how to make a php website without mixed php and html. Php is interpreted by the Server html by the client. So theres no other way than using both

    Also what you mean with rare mysql functions? Dispite the fact mysql is deprecated and slower than mysqli theres nothing wrong using it. As long as you do it right (doesnt mean i would still use it)

  6. hey, is a complex on insert neu Character?

    On Python and c++ ?

    It took me about 12 hours now for following:

    Character Create

    Armor Models

    Weapon Models

    All Animations (with kissing etc)

    Skillset (skills still kick me with skill_hack log (anybody know how to solve that?))

    Horse stuff

    Ui Updates for Wolfman

    • Love 2
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.