Jump to content

Search the Community

Showing results for tags 'advanced'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RuneLocus
    • News & Announcements
    • Information Booth
    • Website Support
    • Introductions
    • Chat
    • Forum Games
  • RuneScape Development
    • RSPS General
    • RuneScape Private Server (RS2)
    • RuneScape Private Server (503+)
    • RuneScape Private Server (EoC 742+)
  • Other
    • Digital Art
    • Gaming
    • Webdevelopment
    • Computers
  • Marketplace
    • RuneScape Market
    • RSPS Market
    • Others Market
    • Freelance Middleman Services
  • Super Secret Club's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 34 results

  1. Hello Runelocus users. I once wrote this tutorial which is based on my application itself. You should not proceed if you do not have a basic knowledge of PHP and an expert knowledge of HTML, this tutorial wil learn some advanced stuff that is simply not meant for starters. In this tutorial i will asume you know HTML and CSS perfectly, also PHP should not be new for you, if so this tutorial will fit you perfectly! This tutorial will be much copy paste work, by the end you should have a working structure though i do recommend reading every single word in this tutorial to understand what is going on exactly. As you will see by the end of this tutorial your structure will have many files in opposition of plain PHP writing, but it has a nice structure and a smart application system to process any kind of action. After that it's all about creating the pages by implementing a controller and a view where our controller would interact with the modal(s). This work method will reduce allot of work time spent in the future, because in opposition of working with plain PHP files mixed with html and stuff you will be able to seperate those layers which results in clearer code simply put you will know what to edit and where to edit it. Annother great advantage is that you can re-use any previous written code from your modal or view layers. For example a single login system (PHP sided) on multiple pages, or even a single login form (HTML/CSS) on multiple pages. As you will advance your skills working with this method you will also start to notice allot of other great advantages in many other open-source vendors you can use, even your client sided code will be completly programmable. I now introduce you to this great tutorial which will be editted upon time when some code is out-of-date or anywhat. Enjoy and read much to understand little! [b]What is MVC ?[/b] In terms it speaks of a Modal (class where we handle all of the logic related to a page) a View (template ex:HTML/CSS and some resources) and a Controller (PHP file where we process all of the page's actions and let the modal take care of it.) I'm also going to introduce people to using a one index controller for their web application, and using a templating engine like twig for faster and understandable twig code template rendering. Some would recommend using a class for your controllers (which you can perfectly do by the end of this tutorial 'trust me') but i see the benefit of just including the controller (Plain PHP file no class) inside the front controller and depending on what controller is accesed you can simply write what the controller has to do and let the modal take care of it. Which the modal than may or may not interact with our database classes or even entity classes if we'd like to store data inside an object. Using a class for your controllers is perfectly fine but quite unnecessary because the controller just needs to do one thing. (Interact with it's modal and generate the right view) [size=6][b]The setup:[/b][/size] Before we begin we will need all of the following resources: - An editor for both PHP / HTML and CSS code is recommended (May show you errors before you even debug) i use PHPDesigner which u can find here: [url=http://www.mpsoftware.dk/phpdesigner.php]phpDesigner 8 - PHP Editor & PHP IDE with built-in HTML5, JavaScript, CSS3 editor! | MPSOFTWARE[/url] - Twig library to implent in our source later: [URL]https://github.com/twigphp/Twig/tags[/URL] download the latest version and extract[b] /Twig(version)/lib/Twig[/b] somewhere save for later use. - Autoloading class which is included in doctrine common files: [URL]https://github.com/doctrine/common[/URL] download and extract[b] /common_master/lib/Doctrine[/b] somewhere save. - Last but not least a session manager to stop session hijackers: [url=http://mafiasource.be/downloads/sessionManager.txt]http://mafiasource.be/sessionManager.txt[/url] The one i use feel free to add your own proxies and stuff. [size=6][b]Starting off:[/b][/size] in public_html we will now create our application tree for example: [code]/app - Here we keep our application cache, configurations and standard base templates. /src - Here we can find our source code where our Models, Views and Controllers will be present maybe even Language packets. /vendor - An easy way to keep all of our 3rd library files for example doctrine and facebook api (We will not place Twig in there) /web - The directory where our front-controller is present (index.php) and we have 2 sub directories: one for web/lib and one for web/public. /web/lib - Here we wil upload our extracted Twig map. /web/public - Where every resource that has to be accessible from the web application is present. (ex: ajax, images, css, bootstrap, js) .htaccess robots.txt sitemap.xml[/code] [size=6][b]Step 1:[/b][/size] Creating the .htacces file to link all browser users to the same page on every request. (our front controller in /web/index.php ) This step is very important, we don't want our users the browse every single page itself why don't we create one single page to proccess all of our actions? So mmediatly in public_html you create a new file (if not already exsist) and name it .htaccess write following code: [code] DirectoryIndex /web/index.php Options -Indexes <IfModule mod_rewrite.c> RewriteEngine On #RewriteCond %{REQUEST_URI} /sitemap.xml #These are lines that have to be manualy accessible for SEO optimalisation / Remove comment if not working local #RewriteRule .* - [S=99999999999999] #These are lines that have to be manualy accessible for SEO optimalisation / Remove comment if not working local #RewriteCond %{REQUEST_URI} /robots.txt #These are lines that have to be manualy accessible for SEO optimalisation / Remove comment if not working local #RewriteRule .* - [S=99999999999999] #These are lines that have to be manualy accessible for SEO optimalisation / Remove comment if not working local RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ RewriteRule ^(.*) - [E=BASE:%1] RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteRule ^web\index\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L] RewriteRule .? %{ENV:BASE}/web/index.php [L] </IfModule> <IfModule !mod_rewrite.c> <IfModule mod_alias.c> RedirectMatch 302 ^/$ /web/index.php/ </IfModule> </IfModule>[/code] This code literaly says when the reqquest uri is /sitemap.xml ignore next 99999999999999 lines of code than it checks if the request uri is /robots.txt, and yes you already guessed it. If none of these matches so any other possible URI, it will direct the user to /web/index.php. [size=6][b]Step 2:[/b][/size] Creating the front controller /web/index.php. In our front-controller we will setup: - strict error reporting for debuging. - We will make classes that can be autoloaded in our whole application source using the autoloading vendors. - Setup the session manager - Setup a routing system for router -> controller. Before we can start writing the index controller we need to make sure we can use the session manager, the autoloading class and the twig engine, to do so please upload the previously saved Doctrine map to [b]/public_html/vendor[/b] you now have: public_html/vendor/Doctrine. Now for the session Manager you can upload it directly to [b]/public_html/vendor[/b] make sure to save it as a PHP extension and not a TXT (like i uploaded). At last upload the previously saved Twig map to [b]/public_html/web/lib[/b] Index.php front controller: [code]<?PHP /** * Front controller - all requests GET / POST are processed here * @author Michael Carrein **/ //Error reporting ini_set('display_errors',1); ini_set('display_startup_errors',1); error_reporting(-1); //Use statements use Doctrine\Common\ClassLoader; use app\config\Routing; /** Session manager **/ require_once __DIR__.'/../vendor/sessionManager.php'; SessionManager::sessionStart('Website name', 0, '/', $_SERVER['HTTP_HOST'], false); // Does the same as session_start(); but in a more secure way. **/ /** Routing & controllers **/ require_once __DIR__.'/../app/config/routing.php'; $route = new Routing(); if($route->getController() != FALSE) //If we get a valid controller it will execute following code { define("DOC_ROOT", $_SERVER['DOCUMENT_ROOT']); /** Autoloading with doctrine so we never have to include or require again (Just use statements)**/ require_once DOC_ROOT . '/vendor/Doctrine/Common/ClassLoader.php'; $classLoader = new ClassLoader('src' , DOC_ROOT); $classLoader->register(); /** Twig engine **/ require_once __DIR__.'/lib/Twig/Autoloader.php'; Twig_Autoloader::register(); $loader = new Twig_Loader_Filesystem(DOC_ROOT); //Load Twig templates from root $twig = new Twig_Environment($loader, array( 'cache' => FALSE //DOC_ROOT . '/app/cache/TwigCompilation/', //Cache or no cache ? )); $_SESSION['DOC_ROOT'] = DOC_ROOT; /** Get requested controller **/ if(file_exists(__DIR__.'/../src/Controllers/'.$route->getController())) { if($route->getController() != "notfound.php" && $route->getController() != "languageSelect.php") // Pages where we don't save the previous route for redirects (ex. notfound with button -> go back, or language select where we handle the reqest and redirect the user to the same page he was on. If you have allot of these pages, pleasy simplyfy this process) { $route->setPrevRoute(); //Save previous route } include __DIR__.'/../src/Controllers/'.$route->getController(); } }[/code] And again, the user will always be browsing on this page no mather what. This index file is the only file we will be using require or include functions (PHP) because this is our front-controller and our autoloading class will only be triggered once there's an exsisting route. In the rest of the application we can use the use statements to autoload a class instead of require / include every time. (Because when a user reaches another part of the application (Ex. a controller) he requested an exsisting route) Autoloading has less impact on server load especialy on large web application with lots of logic because any PHP file just use's what it needs while it doesn't have to include or require anything or everything physicaly, classes are "autoloaded" this allows us to dynamicaly obtain what we need in parts of our application and nothing more nothing less. Remember: you can only autoload classes and no plain PHP files. Important to notice is that every class that needs to be able to be autoloaded is going to get a namespace. This namespace is the directory the class is in. and don't mis it's \ instead of / for both namespace and use statements to jump directories. And this is however a bunch to remember for autoloading, but after all it's pretty easy to setup while you don't need to mind what it is realy doing for you. If you have read the code you saw some incompleted code which is routing and controllers. (we'll handle that later on this tutorial) Now for this setup to work we need to add one more .htaccess file in our web directory. So this goes in [b]/public_html/web[/b] as .htaccess [code]Options +FollowSymLinks Options -Indexes IndexIgnore */* # Turn on the RewriteEngine RewriteEngine On # Rules RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . index.php [/code] Explenation: We have pointed our public_html .htaccess file to always go to web/index.php but now in our web directory we need to confirm that whatever we do server sided we browse on index.php We have a server side and a client side to our web application, client side is everything that the eye sees, simply the website itself. Server side on the other hand are logic and inputing and retrieving data. [size=6][b]Step 3:[/b][/size] Creating the routing class and seting up the routes and controllers. You might ask yourself what the * are routes? As we don't direct our user to every single page anymore we need some kind of routing system te determine wheter a users is loggin in or reading the news or registering ... Routes are the URI's requested in our browser as we can create every route ourselfs we can create beautifull SEO applications too. Example of a route (bold): [URL]http://v3.mafiasource.be[/URL][b]/game/summary/info[/b] Now before we can setup the routes and controllers we need a routing class i have written quite a good routing class for you already: [code]<?PHP namespace app\config; use src\Data\seoDAO; /** * Routing class **/ class Routing { private $route; private $routeName; private $controller; public $routeMap = array(); public $prevRoute; public function __construct() //If class is requested this function is called immediatly { include __DIR__.'/routes/routes.php'; //Where we define our routes see Step 4 of this tutorial. And yes we use include because an array is not a class and can not be autoloaed. $this->routeMap = $applicationRoutes; //Put our defined routes in the routeMap /** * At the for loop you define from which directory the routes start. * Caution: as we root our web app in public_html/web/ we use $i = 1; **/ $requestURI = explode('/', $_SERVER['REQUEST_URI']); $routes = array(); for($i = 1; $i < count($requestURI); $i++) { $val = $requestURI[$i]; array_push($routes,$val); } $endRoute = ""; foreach($routes AS $value) { $endRoute .= '/'.$value; } $controller = false; //Now check wheter a user requested a route defined in routes.php (Step 4) foreach($this->routeMap AS $key => $value) { if(preg_match('{^'.$value['route'].'$}', $endRoute)) { $controller = $value['controller']; $routeName = $key; } } //Now check if the route exsist depending on what controller you retrieve. if($controller != false) { //Setup page parameters $this->route = $endRoute; $this->controller = $controller; $this->routeName = $routeName; } else { //Generate not found page $this->route = '/notfound'; $this->controller = 'notfound.php'; } } //Get previous route for redirects $route->getPrevRoute(); public function getPrevRoute() { if(isset($_SESSION['PREV_ROUTE'])) { return $_SESSION['PREV_ROUTE']; } else { return $_SESSION['PREV_ROUTE'] = $_SERVER['REQUEST_URI']; } } //Set prev route happens on every request already public function setPrevRoute() { $_SESSION['PREV_ROUTE'] = $_SERVER['REQUEST_URI']; } public function headTo($routeName) { /** * Replaces the header('Location: '); function now you can use $route->headTo("ROUTENAME (see Step 4)"); * **/ foreach($this->routeMap AS $key => $value) { if($key == $routeName) { header("Location: " . $value['route']); exit(0); } } } public function getRouteByRouteName($routeName) { foreach($this->routeMap AS $key => $value) { if($key == $routeName) { return $value['route']; } } } public function getRoute() { return $this->route; } public function getRouteName() { return $this->routeName; } public function getController() { return $this->controller; } } [/code] And as you can see in index.php (front controller) you see this belongs in [b]/public_html/app/config[/b] as: routing.php Now we need to keep in mind that we have aleady setup a routing and if the route doesn't exsist we throw a not found page, so in step 4 we will create the routes and in step 5 we will create our not found page. [size=6][b]Step 4:[/b][/size] Defining the routes in a PHP array file. For SEO optimalisation many search engines state that you have "beautiful" urls, those urls don't contain any special characters like &,? which is common used in form submit. With our own routing we can setup the routes the way we want it i will give some great examples allong the way. This array goes into [b]/public_html/app/config/routes[/b] as routes.php: [code]<?PHP /** * Define all possible routes * * [MENTION=33150]rou[/MENTION]teName = The name you want to give the route for ex. $route->headTo( [MENTION=33150]rou[/MENTION]teName"); * [MENTION=33150]rou[/MENTION]tePath = The requested URI * [MENTION=87372]Controller[/MENTION] = The controller to execute when Route matches. (remember in our index.php front controller we have defined the controller map to be at /public_html/src/Controllers there is where we handle our controllers.) * * A little example with / (root) * Routes with random PHP vals can be found by preg_match(); which routing already does, here we just need to use the regex. (check example 1 and 2 below) **/ $applicationRoutes = array( /** * [MENTION=33150]rou[/MENTION]teName **/ 'home' => array( /** * [MENTION=33150]rou[/MENTION]tePath **/ 'route' => '/', /** * [MENTION=87372]Controller[/MENTION] **/ 'controller' => 'index.php' ), 'index' => array( 'route' => '/index', 'controller' => 'index.php' ), 'not_found' => array( 'route' => '/notfound', 'controller' => 'notfound.php' )//, //Example 1: Working with page numbers //'news_page' //=> //array( // 'route' => '/news/page/[1-9][0-9]*', // 'controller' => 'news.php' //), //Example 2: working with news titels //'news_article' //=> //array( // 'route' => '/news/article/[A-Za-z0-9-]{3,200}', // 'controller' => 'news_article.php' //) ); [/code] Now it's up to you to define all routes needed for your web application and link them with the correct controllers. [size=6][b]Step 5:[/b][/size] Creating the not found page with 2 sub steps. (Now it's actualy all about creating the pages) Gratz you have succesfully finished your setup to start working realy fast and realy productive in the future! [size=5]Sub step 1:[/size] Creating the controller Now once we create the controller we can handle every possible action for that page. Depending on what action you do you might get another page.. This is where the view comes in handy. Our not_found controller which should be in [b]/public_html/src/Controllers[/b] as notfound.php (Like defined in the routes) [code]<?PHP /* * This code are examples of how logic should be processed in the controller using layers which get autoloader by our Doctrine autoloading class using the use statements. use src\Business\UserService; $user = new UserService(); $userProfile = $user->getUserProfile(); $loggedIn = false; if($userProfile) $loggedIn = true; */ //We don't want to render our PHP variables inside the template so we simply convert them to Twig variables (which is actualy a simple array with data) with folowing line of code: $twigVars = array('docRoot' => "http://".$_SERVER['HTTP_HOST']."",'routing' => $route); //Render notfound template and include all variables needed to render the template so for us the $twigVars echo $twig->render('/src/Views/notfound.twig',$twigVars); [/code] Yes, our controller can be as simple as that because we just need to render a template which says that the page was not found. [size=5]Sub step 2:[/size] Creating the not_found view. (The html page the user sees) Now in our view we will be learning nothing more than HTML and a little bit of Twig (for advanced twig options please refer to their website) Simply create [b]notfound.twig[/b] in [b]/public_html/src/Views[/b] with following code: [code]{% extends "/app/Resources/Views/base.twig" %} {% block content %} {# Example of how if else block works in twig {% if loggedIn == true %} {% include "/app/Resources/Views/base_ingame_static_nav.twig" %} {% else %} {% include "/app/Resources/Views/base_outgame_static_nav.twig" %} {% endif %} #} <section id="top" class="notFound"> <div class="not-found-page"> <div class="container"> <div class="row not-found-kol"> <div class="col-md-4"> <img class="img-rounded img-responsive" alt="Company Logo" src="/web/public/images/logo.png"/> </div> <div class="col-md-8"> <!-- <div class="not-found"> <div class='alert alert-warning'> <h4><span class="glyphicon glyphicon-ban-circle"></span>Page doens't exsist!</h4> </div> </div> --> <iframe src="http://notfound-static.fwebservices.be/404/index.html?&key=c3246892335c83e0a507e07c4f824a45" width="100%" height="650" frameborder="0"></iframe> </div> </div> </div> </div> </section> {% endblock content %} {% block footer %}{% endblock footer %} [/code] Note: as you can see my HTML mockup is already styled and has used some bootstrap classes. It's totaly up to you to code your HTML the way you want it. Now the realy IMPORTANT part here is notice the first line of code ? The not found template actualy extends another template, so in simple terms my not_found content actualy gets included in my base HTML mockup. [size=6][b]Step 6:[/b][/size] Creating the base template as required by step 5.2. Now head over to the [b]/public_html/app/Resources/Views[/b] directory (Create if needed DUH!) and create the file: [b]base.twig[/b] Note: The code bellow is code of my web application as i said before HTML and CSS is all up to you. [code]{% spaceless %} <!DOCTYPE html> <html lang="en"> <!-- SEO WORD ENKEL TOEGEPAST OP DE OUTGAME PAGINA'S! --> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" /> <base href="{{ docRoot }}"/> <title>{{ PAGE_TITLE }}</title> <meta property="og:title" content="{{ PAGE_TITLE }}" /> <!-- FB --> <meta property="og:type" content="game" /> <!-- FB --> <meta property="og:image" content="{{ docRoot }}{{ PAGE_IMAGE }}" /> <!-- FB --> <meta property="og:url" content="{{ PAGE_URL }}" /> <!-- FB --> <meta property="og:description" content="{{ PAGE_DESCRIPTION }}" /> <meta property="og:site_name" content="Mafiasource" /> <meta property="DC.title" content="{{ PAGE_TITLE }}" /> <meta property="DC.subject" content="{{ PAGE_SUBJECT }}" /> <meta property="DC.description" content="{{ PAGE_DESCRIPTION }}" /> <meta property="DC.format" content="text/html" /> <meta property="DC.publisher" content="{{ AUTHOR }}" /> <meta property="DC.language" content="nl-BE" /> <meta name="description" content="{{ PAGE_DESCRIPTION }}" /> <meta name="keywords" content="{{ PAGE_KEYWORDS }}" /> <meta name="google-site-verification" content="1pdpzSKdcZBpNYkkzZ0z3Sqxb9FXcZz4eJmolTUHFU8" /> <meta name="geo.region" content="nl-BE" /> <meta name="geo.placename" content="Deerlijk,Belgium" /> <meta name="geo.position" content="50.8683762,3.2712771" /> <meta name="ICBM" content="50.8683762,3.2712771" /> <link rel="publisher" href="https://plus.google.com/u/0/117401061808919535014"/> <link rel="icon" href="{{ docRoot }}/web/public/images/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="{{ docRoot }}/web/public/images/favicon.ico" type="image/x-icon" /> <link rel="apple-touch-icon" href="{{ docRoot }}/web/public/images/favicon.ico" /> <link href="{{ docRoot }}/web/public/bootstrap/css/bootstrap.min.css" rel="stylesheet" /> <link href="{{ docRoot }}/web/public/css/homepage.css" rel="stylesheet" /> <link href='http://fonts.googleapis.com/css?family=Pathway+Gothic+One' rel='stylesheet' type='text/css' /> <!-- Twig stylesheets --> {% block stylesheets %} {% endblock stylesheets %} </head> <body> <!-- Header --> {% block header %} <header id="top" class="header"> <div class="container"> {% block message %}{% endblock message %} </div> </header> {% endblock header %} <!-- /Header --> <!-- Navigation --> {% block navigation %} <aside id="nav"> <nav class="navbar navbar-new" role="navigation"> <div class="container"> </div> </nav> </aside> {% endblock navigation %} <!-- /Navigation --> {% block content %} {% endblock content %} {% block footer %} <!-- Footer --> <footer> <div class="container"> <div class="row"> <div class="col-md-6 col-md-offset-3 text-center"> <em>Copyright © 2014 Mafiasource.be</em> </div> </div> </div> </footer> <!-- /Footer --> {% endblock footer %} <!-- Bootstrap core JavaScript --> <script src="{{ docRoot }}/web/public/js/default/bootstrap.jquery.min.js"></script> <!-- Google Analytics --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-49957889-1', 'mafiasource.be'); ga('send', 'pageview'); </script> <!-- End Google Analytics --> <!-- Twig javascripts --> {% block javascripts %} {% endblock %} </body> </html> {% endspaceless %} [/code] Now important to know is that in our not found view we extended this above view. But in our base view we will see something like: block content notice that we also used block content in our not_found view but there we inserted the content we needed. not_found view inherits from base view while not_found view inserts content in the base view. Also you see that in our not_found view we used the block footer too, but it's empty. This means the footer will not be visible on the page not_found. However if you do add content in the footer block in your not_found view it wil simply replace the base footer. And this is a great way of templating your HTML / CSS with twig cause you can actualy build HTML programaticly. [code]{% %} Are logic statements ex: if else construction, a loop but can also form a block as explained above. {{ }} Are variables to be printed out (Variables you have defined in the controller with $twigVars(). {# #} Makes comments possible Also make sure to check out Twigs documentation, you wil get a much better understanding of it all. [/code] In the above base.twig code you see i require some twig varables (ex: {{ PAGE_TITLE }} ) to be printed, if you have followed this tutorial from the beginning you would know how to fix it. Note that Twig has everything needed to replace PHP for templating! If you realy get stuck with outputing data you are doing it wrong. Also important is that when you have created the base template it should never be changed again unless you want to change your whole layout. You can simply build your blocks with standard content like a header and a navigation and a footer but all you ever have to change is the content of the page and the SEO tags of the page. That's why i work with the {{ }} print out's in my header tag. Depending on what page i might get another title, description, keywords, image, og,dc tags ... [size=6][b]Final step:[/b][/size] How to handle logic and seting up a database connection, a great view of what you can do. Remember this ? [code]/* use src\Business\UserService; $user = new UserService(); $userProfile = $user->getUserProfile(); $loggedIn = false; if($userProfile) $loggedIn = true; */ [/code] That was an example of a controller interacting with it's modal. Just create the Modal in it's right directory: [b]/public_html/src/Business[/b] as UserService.php Now our controller "Uses" this class. In this class we can handle all our users logic wheter someone is logging in or out, or writing a post or even changing their password. Note: we have not yet written any HTML form to interact with users so don't start dreaming. Now Me Myself and I like to get my business and data seperate. For that i create another folder in src/ named Data. Every business class wil have it's own Data class if the class need's to interact with a database. En example of UserService.php could be: [code]<?PHP namespace src\Business; use src\Data\UserDAO; class UserService { private $data; public function __construct() { $this->data = new UserDAO(); //Get class where data is handled opens connection. } public function __destruct() { $this->data = null; //Close connection on destruct. } public static function errorMessage($msg) { $message = "<div id='alert' class='alert fade in alert-danger'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button><span class='glyphicon glyphicon-exclamation-sign'></span> ".$msg."</div>"; return $message; } public static function successMessage($msg) { $message = "<div id='alert' class='alert fade in alert-success'><button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button><span class='glyphicon glyphicon-ok-circle'></span> ".$msg."</div>"; return $message; } } [/code] As you can see our Business layer for UserService also uses the UserDAO data class. In that class there will be all functions to edit, insert, select,... anything related to our database. Also i have made 2 functions in the UserService already which is showing a error message or success message to the user. For simplicity reasons i have included HTML inside the functions, but note: HTML should never be written except in the view layer. Now for the data class in [b]/public_html/src/Data[/b] as UserDAO.php for example: [code]<?PHP namespace src\Data; use src\Data\config\DBConfig; //User Data class class UserDAO extends DBConfig { private $dbh = ''; public function __construct() { parent::__construct(); $connection = new DBConfig(); $this->dbh = $connection->con; } public function __destruct() { $this->dbh = null; } } [/code] You might think everything is done now but we still have one more class to make which is connecting to our database. After that we can start creating functions in the DAO class with PDO in mind (Better way to handle MySQL) You can look it all up on google. So our DBConfig.php file goes into [b]/public_html/src/Data/config[/b] with following code: [code]<?PHP namespace src\Data\config; use PDO; class DBConfig { protected $dbConstring = "mysql:host=DatabaseHost;dbname=DatabaseName"; protected $dbUser = "DatabaseUser"; protected $dbPass = "DatabasePass"; public $con = null; public $error; public function __construct() { $this->connect(); } public function __destruct() { $this->disConnect(); } public function connect() { //Only connect when connection is null to prevent multiple connections and lag. if($this->con == null) { try { $this->con = new PDO($this->dbConstring,$this->dbUser,$this->dbPass); $this->con->setAttribute(PDO::ERRMODE_SILENT,PDO::ERRMODE_EXCEPTION); } catch(\PDOException $e) { $this->error = $e->getMessage(); die('An error occured while connecting to the database. Please try again later.'); } } } public function disConnect() { $this->con = null; } } [/code] Congratulations you have have a working MVC pattern. I have still not explained how to query though so here's the thing i'm going to check if a username exsist in my database. The following code goes in the UserService class as a function: [code] public function checkUsernameExsists($username) { return $this->data->checkUsernameExsists($username); } [/code] As you can see it returns a function from the data class which does not exsist yet. Up to us to create the function and the query. The next code goes into UserDAO class as a function,[b] It is very important to query anything through this method by using PDO and prepared statements to avoid any sql injection![/b] (Always bind ALL USER INPUT)): [code] public function checkUsernameExsists($username) { $statement = $this->dbh->prepare("SELECT `id` FROM `users` WHERE `username` = :username "); $statement->execute(array(':username' => $username)); //Remember to handle all user input this way to prevent SQL injection! if($statement->fetchColumn() > 0) { return TRUE; } else { return FALSE; } } [/code] And this is how we query in our application. So te get back to our not_found controller we can actualy interact with our modal layer, where our modal layer can interact with the database itself with a seperate class. If we now edit our not_found controller like so: [code]<?PHP use src\Business\UserService; $user = new UserService(); $username = "MiCa"; $bool = $user->checkUsernameExsists($username); //We can't use any PHP variables inside our (Twig) view, so all variabes needed to print data will be included inside a single array: $twigVars = array('docRoot' => "http://".$_SERVER['HTTP_HOST']."",'routing' => $route, 'usernameExsists' => $bool); //Render notfound template and include all variables needed to render the template so for us the $twigVars echo $twig->render('/src/Views/notfound.twig',$twigVars); [/code] The only variables we can now use in our Twig rendered page are: 'docRoot' => "http://".$_SERVER['HTTP_HOST']."",'routing' => $route,'usernmeExsists' => $bool (as listed above) If we echo them in our notfound.twig page like so: [code]{% extends "/app/Resources/Views/base.twig" %} {% block content %} <section id="top" class="notFound"> <div class="not-found-page"> <div class="container"> {{ docRoot }}<br /> {{ routing.getRoute }}<br /> {% if UsernameExsists %} True {% else %} False {% endif %} </div> </div> </section> {% endblock content %} {% block footer %}{% endblock footer %} [/code] Now if we browse to our websiteurl.ex/notfound We will get the right results first line echoes the website url, the second echoes the current route and the last line echoes true or false. However if you output {{ routing }} it would give you an twig error as you cannot convert a class into a string. Also good to know is that {{ var|raw }} can output HTML data too. So for example our success or error message to the user if we print it we use |raw next to our variable. However if we now just browse to websiteurl.ex or websiteurl.ex/index we will get a PHP error including index.php from Controllers as it does not exsist yet. But we did setup a route for it already, that's why it give's us the error. You could now try browse any other possible url you didn't setup yet, it would direct you to not found page. Up to you to code the controller and style the view template (Step 5.1 & Step 5.2). Goodluck! [b]Update 1: Looping with Twig instead of PHP[/b] Another great code for twig is: [code]{% for charType in charTypes %} {% if registerForm.charType == charType.getId %} <option value="{{ charType.getId }}" title="{{ charType.getDescription }}" selected="selected">{{ charType.getName }}</option> {% else %} <option value="{{ charType.getId }}" title="{{ charType.getDescription }}">{{ charType.getName }}</option> {% endif %} {% endfor %} [/code] This is an example of printing an array of data, for example in PHP we would use the for loop and the echo / print function. And yes, this is how we loop in twig so in twig vars: [code]$twigVars['charTypes'] = array(); // And fill it with all data nedded to print on your view side. [/code] As simple as that, i think i have included the most important twig statements now. [b]Update 1.1: Binding any function to a twig filter to use in our view.[/b] Here's a great way of binding any PHP or own made function into a twig filter, the possibilities are endless as long as you always return any value in the function. First of all create a new file in [b]app/config/[/b] with name[b] twig.filters.php[/b] and paste the following code: [code]<?PHP /** Nodige functies toevoegen **/ function isstr($str) { if(!is_numeric($str)) { return TRUE; } else { return FALSE; } } /** Filters initialiseren **/ $twig->addFilter('var_dump', new Twig_Filter_Function('var_dump')); $twig->addFilter('isstr', new Twig_Filter_Function('isstr')); $twig->addFilter('ucfirst', new Twig_Filter_Function('ucfirst')); [/code] Now we have our file that binds our filters but we still have to require the file in our front controller (Initialize twig first, than bind filters.), it should look something like this: [code]... /** Load Twig **/ require_once __DIR__.'/lib/Twig/Autoloader.php'; Twig_Autoloader::register(); $loader = new Twig_Loader_Filesystem(DOC_ROOT); //Twig templates kunnen laden vanaf de root applicatie (PHP) $twig = new Twig_Environment($loader, array( 'cache' => FALSE, 'debug' => true, 'autoescape' => false //DOC_ROOT . '/app/cache/TwigCompilation/', //Cache uit tijen DEVELOPMENT MODE )); require_once __DIR__.'/../app/config/twig.filters.php'; ... [/code] These are a small example of how to bind your functions into twig filters, in our view side we can use them like so: [code]{# inside a statement: #} {% if key|isstr %} {# Do something #} {% endif %} {# Or a simple print/echo: #} {{ key|isstr }} [/code] Another great way to expand your view functions and filters, before adding a function please make sure it doesn't already exsist therefore you can visit Twig's official website for any info and documentation: [URL]http://twig.sensiolabs.org/[/URL] [b]Update 2: Starting to work very safe, not just database sided where we made sure any ser input is binded in prepared statements.[/b] Now we also have to make sure we protect ourselves from several other kinds of attacks where mostly the client side is used as a hacking method either by hijacking sessions or manipulating our view contents. Our sessions are already protected from hijacking inside the session manager (again feel free to change any settings inside the session manager) but still our view content needs protection too especialy when working with forms to submit any user input. Also if we would store any user input for exmple to our database we will have to xss escape the user's value first, this way we can prevent View printing manipulation where the attacker can execute anything to his own liking. First of all add this line on top of the front-controller script as a use satetement: [code]use app\config\Security;[/code] And these 2 lines of code just under the session initialisation of your front-conroller: [code]require_once __DIR__.'/../app/config/security.php'; $security = new Security();[/code] And yes, add these 2 functions in the routing class for action messages: [code] public function createActionMessage($msg) { $_SESSION['message'] = $msg; } public function setActionMessage() { $message = ""; if(isset($_SESSION['message'])) $message = $_SESSION['message']; unset($_SESSION['message']); return $message; } [/code] A Security class to initialize in your front-controller and use anywhere in your application. With this class you can prevent CSRF and XSS examples will follow bellow, create it in it's rightfull directory as shown above. [code]<?PHP /** Security class om XSS en CSRF tegen te gaan **/ namespace app\config; class Security { /** * CSRF * */ protected $token; public function __construct() { if(!isset($_SESSION['security_token'])) { $_SESSION['security_token'] = self::createToken(); } $this->token = $_SESSION['security_token']; } private function createToken() { $string = md5(uniqid(rand(), true)); $hash = hash('sha256', $string); return $hash; } public function getToken() { return $this->token; } public function generateNewToken() { $_SESSION['security_token'] = self::createToken(); $this->token = $_SESSION['security_token']; } /* * Use this function on any form submit to check the inputed hidden token (on any form submit) with the user's session token * */ public function checkToken($input) { $validToken = $_SESSION['security_token']; if($validToken === $input) { return TRUE; } else { return FALSE; } } /** * XSS * */ public function xssEscape($input) { $output = htmlspecialchars(strip_tags($input)); return $output; } /** * Captcha use to increment the captcha count on any action. * */ public function setCaptcha($count = false) { if(!isset($_SESSION['captcha_security'])) $_SESSION['captcha_security'] = 0;//Initialiseren if($count) $_SESSION['captcha_security'] += $count; $_SESSION['captcha_security'] += 1; } public function resetCaptcha() { $_SESSION['captcha_security'] = 0; } /* * Checks if the user has to validate a captcha or not * */ public function checkCaptcha() { if(isset($_SESSION['captcha_security']) && $_SESSION['captcha_security'] > 4) //Change the number if the captcha has to be shown after more actions. { return TRUE; } else { return FALSE; } } } [/code] So how do we use this ? In realy any form on your website you would need to protect yourself from these other kind of attacks. So basicaly our view content starting from the form should look something like this: [code]{# ... Any other mockup and maybe ofcource the extending #} <form action="{{ routing.getRouteByRouteName('maffia_home') }}" method="post" id="some-form" class="form-horizontal"> <fieldset> <div class="form-group"> <label class="col-sm-4 control-label" for="name">{{ langs.HOME_USER_INPUT }}</label> <div class="col-sm-8"> <input type="text" placeholder="{{ langs.HOME_USER_INPUT_PLACEHOLDER }}" class="form-control" name="user_input" id="user_input" /> </div> </div> {% if captcha_security == true %} <div class="form-group"> <label class="col-sm-4 control-label" for="captcha">{{ langs.CAPTCHA_CODE_LABEL }}</label> <div class="col-sm-8"> {{ langs.CAPTCHA_CODE|raw }} <br /><br /> <input type="text" placeholder="{{ langs.CAPTCHA_CODE_PLACEHOLDER }}" class="form-control" name="captcha" id="captcha" /> </div> </div> {% endif %} <div class="col-sm-offset-4 col-sm-8"> <input type="hidden" name="security_token" value="{{ security_token }}" /> <button type="submit" name="submit" id="submit" class="btn btn-success">{{ langs.HOME_SUBMIT }}</button> </div> </fieldset> </form> [/code] - As you can see this is a simple example of a form that we have inserted in our view. - Our action tag is our homepage note how simple it is with the routing class to obtain our path for that route and include it in our action tag. So in simple terms, need to change a route ? No problem, change it once in routes.php array an programm your structure smart-coded and not hard-coded so you don't have to change a bunch of files for one simple route. As you need to notice you can really apply a lot of these techniques to make your web application more reliable for future use. - Than we have a user input field that we handle in our controller below. - Also our hidden security token to prevent CSRF attacks, and last our button to submit the action. Now for example in our controller we would have something like this: [code]use src\Business\UserService; $user = new UserService(); $langs = new Lang(); //You would need to create that yourself. & $route also included in twig tags is already initialized in our front-controller remember? no need to re-add it. if(isset($_POST['submit'])) { $userInput = $security->xssEscape($_POST['user_input']); //Make sure the users input is safe, if not make it safe.(If we would store it for our view) if($security->checkToken($_POST['security_token'])) { //No CSRF Attack process inputs and who knows what else, make sure to handle as much logic you can inside your modal layer and maybe eventualy redirect the user to another or the same page. if($user->submitUserAction($userInput)) //You would also need to create that yourself. { $route->createActionMessage($user::succesMessage("No errors, our form is submitted")); //And a action message to be displayed after the user gets headed. $route->headTo("mafia_home"); //As i wil mention below this is important the heading part. (the session PREV_ROUTE wil not be saved on any form submit for security reasons too. There's no way to go to a previous route that submits a form) exit(0)://After heading always exit, exit does not execute any other code in the script: ex twig rendering. (which can slow down the heading process) } else { $route->createActionMessage($user::errorMessage("Oops, form was not submitted due to errors")); //And a action message to be displayed after the user gets headed. $route->headTo("mafia_home"); //As i wil mention below this is important the heading part. (the session PREV_ROUTE wil not be saved on any form submit for security reasons too. There's no way to go to a previous route that submits a form) exit(0)://After heading always exit, exit does not execute any other code in the script: ex twig rendering. (which can slow down the heading process) } } } /** Just always do that when you have a form on that controller, it generates a action message to be shown to the user and gets deactivated automaticly when seen. **/ $message = $route->setActionMessage(); $twigVars = array('langs' => $langs, 'security_token' => $security->getToken(), 'message' => $message, 'routing' => $route); echo $twig->render('/src/Views/index.twig',$twigVars); [/code] And this is our controller, it has some incompleted code view sided to be initialised in the controller as you've guesed the langs variable. Also everything should work fine except for the submitUserAction function that doesn't exsist yet. It is important to head the user to the same or another url after any action either valid or invalid, this is to avoid spam submitting forms. And with the exit tag we make sure the script stops immediatly after heading the user, this to avoid saving the previous route also for security reasons. And of course you can find yourself a way to simplify this process, like handling the action messages and heading also in the modal however you like. NOTE!: guys, this is realy important you should start to notice allot by now, working with this stucture gives you great benefits and less vulnerabilities. If you however forget to apply these security measures your application can be vulnerable for today's web hacking technologies. [size=6][b]Download:[/b][/size] No time but advanced enough ? Download the whole package here: Here is a complete package in zip format starting from the start-off to step 6. (Username search and other final step's and updates not included) I have made this in about 15 minutes following this tutorial till it was a working pattern both localy and online, you can [url=http://mafiasource.be/downloads/Package.zip]download it here[/url]. If the structure is not working on your server you most likely have an out-dated PHP version. Update your PHP version to the most recent and stable version. Thank you for reading this tutorial! Remember that you now have to power to contain your whole code: - If you know whats wrong you now know how to fix it and where to fix it. - No more messy one script editting since it can bug up the rest of your application. - Logic handling with classes and objects. (Java alike) - You can now use the same functions code everywhere you want instead of copy pasting / where eventualy you get bugs too because of editting one and forgetting the other... (Class functions ex: UserService.php) Is there something wrong with this tutorial or do you need help? Please message me. My next tutorial will be using objects instead of plain variables, it will teach you to insert data in an object and retrieve it as an object. It will be based on this tutorial and we wil be making a working user login / register / logout. Regards, MiCa Excuse me for any misspelling.
  2. How would I go about and do that? I'm pretty experienced with Java, so I don't need any "basic" tutorials. I want it to be 718+. Keep in mind, I have never owned a RSPS server and this is basically my first time even touching this subject. Thanks for any help.
  3. [B]Hello, everyone. [/B] For the first I would like to say that this is a side project and I will be working for Enso normally. I basically started this project because I would like to contribrute rsps more, everyone is using project insanity so why not create a Project Instanity that is decent, and for everyone's use. [B]Project details[/B] Project's framework: Project Instanity re-worked Project's revision: 317 Project's revision (loading): 474-479 at the moment. (will maybe change to 484-498). Networking: MINA -- not anymore, Using Netty atm [B] Updates[/B] Proper Entity combat. (30.6.2014) [B]Media[/B] [img]http://puu.sh/9Qb9O/238c5c3e5b.jpg[/img]
  4. Mod remove please, i wrote title wrong by accident and couldn't change back.
  5. [CENTER][IMG]http://i60.tinypic.com/v80k1s.png[/IMG] [b][SIZE=2]RuneKingdom has now been in private development for over a year now. Thanks to the original Hyperion development team, they've made this project possible. When the project was first started, we didn't think we would ever come this far. We were mostly just using it as a learning experience, then realizing how much time we've spent on it and literally built it up from just a completely clean base, we decided to take a leap and put it up to the next step. [COLOR="#FF0000"][SIZE=4]This is not a remake![/COLOR][/b][/size] [url=http://www.****************/members/photon/]Photon[/url] - Main project developer Corey - Main project developer (not developing anymore) [url=http://www.****************/members/spear/]Spear[/url] - Side project developer Josh - Side project developer [url=http://www.****************/members/galkon/]Galkon[/url] - Original client developer [url=http://www.****************/members/graham/]Graham[/url] - Original Hyperion developer Blake - Original Hyperion developer And everyone else who contributed to the original Hyperion project! [B][SIZE=4][COLOR="#FF8C00"]**Features**[/COLOR][/SIZE][/B] [LEFT] [IMG]http://img2.wikia.nocookie.net/__cb20130227091657/2007scape/images/thumb/5/51/Attack-icon.png/20px-Attack-icon.png[/IMG][B][COLOR="DarkOrange"]Melee System[/COLOR][/B] -[COLOR="Lime"]A near perfect melee maxhit and special max hit tested via RuneHQ[/COLOR] -[COLOR="Lime"]Poisoned weapons and poisioning to opponent.[/COLOR] -[COLOR="Lime"]Correct special melee effects (Wretched Strength, Void melee increase)[/COLOR] -[COLOR="Lime"]Proper item requirements.[/COLOR] [IMG]http://img2.wikia.nocookie.net/__cb20130228040727/2007scape/images/thumb/7/72/Ranged-icon.png/21px-Ranged-icon.png[/IMG][B][COLOR="DarkOrange"]Ranging System[/COLOR][/B] [COLOR="Lime"]-Correct bolt specials(Dragon's breath, Leech life etc.) -Correct ammo to bows and crossbows. -Proper range timers (Need to test for perfection) -Correct range bonuses -Proper ranging max hit [/COLOR] [IMG]http://img4.wikia.nocookie.net/__cb20130228041537/2007scape/images/thumb/7/77/Magic-icon.png/21px-Magic-icon.png[/IMG][B][COLOR="DarkOrange"]Magic System[/COLOR][/B] -[COLOR="Lime"]Correct casting and freezing timers[/COLOR] -[COLOR="Lime"]Nearly all modern spell's working.[/COLOR] -[COLOR="Lime"]All ancient spell's working[/COLOR] -[COLOR="Lime"]All lunar spell's working[/COLOR] -[COLOR="Lime"]Autocasting for selected staffs[/COLOR] [B][COLOR="DarkOrange"][SIZE="3"]**Skilling System[/SIZE][/COLOR][/B] [IMG]http://i51.tinypic.com/20uq4i9.png[/IMG][B][COLOR="Gold"]Slayer[/COLOR][/B] [img]http://img3.wikia.nocookie.net/__cb20130228042653/2007scape/images/thumb/f/f3/Thieving-icon.png/21px-Thieving-icon.png[/img][b][color="lime"]Thieving[/color][/b] [img]http://img3.wikia.nocookie.net/__cb20130228042812/2007scape/images/thumb/f/f0/Farming-icon.png/21px-Farming-icon.png[/img][b][color="Gold"]Farming[/color][/b] [IMG]http://i56.tinypic.com/20kf18m.png[/IMG][B][COLOR="Lime"]Herblore[/COLOR][/B] [IMG]http://img3.wikia.nocookie.net/__cb20130228041634/2007scape/images/thumb/0/0f/Woodcutting-icon.png/17px-Woodcutting-icon.png[/IMG][B][COLOR="Lime"]Woodcutting[/COLOR][/B] [img]http://img1.wikia.nocookie.net/__cb20130228042713/2007scape/images/thumb/7/77/Fletching-icon.png/21px-Fletching-icon.png[/img][b][color="lime"]Fletching[/color][/b] [IMG]http://i52.tinypic.com/2dadj54.png[/IMG][B][COLOR="Lime"]Firemaking[/COLOR][/B] [IMG]http://img1.wikia.nocookie.net/__cb20130228040753/2007scape/images/f/f7/Cooking-icon.png[/IMG][B][COLOR="Orange"]Cooking[/COLOR][/B] [IMG]http://i53.tinypic.com/1z1y3wl.png[/IMG][B][COLOR="Lime"]Fishing[/COLOR][/B] [IMG]http://i55.tinypic.com/16a5vee.png[/IMG][B][COLOR="Gold"]Runecrafting[/COLOR][/B] [IMG]http://img2.wikia.nocookie.net/__cb20130227091636/2007scape/images/thumb/8/84/Agility-icon.png/17px-Agility-icon.png[/IMG][B][COLOR="Red"]Agility[/COLOR][/B] [IMG]http://i53.tinypic.com/10x63rt.png[/IMG][B][COLOR="Lime"]Mining[/COLOR][/B] [img]http://img2.wikia.nocookie.net/__cb20130227091813/2007scape/images/d/df/Smithing-icon.png[/img][b][color="lime"]Smithing[/color][/b] [img]http://img2.wikia.nocookie.net/__cb20130228041613/2007scape/images/thumb/4/48/Crafting-icon.png/21px-Crafting-icon.png[/img][b][color="Gold"]Crafting[/color][/b] [IMG]http://images1.wikia.nocookie.net/__cb20100607202123/runescape/images/5/5c/Minigame_icon.png[/IMG] [COLOR="DarkOrange"][B]Minigames[/B][/COLOR] [COLOR=Lime]-Duel Arena[/COLOR] [COLOR=Lime]-Barrows[/COLOR] [COLOR=Gold]-Tzhaar Caves[/COLOR] [COLOR=Gold]-Mage Training Arena[/COLOR] [COLOR=Gold]-Pest Control[/COLOR] [COLOR="Red"]-Barbarian Assault[/COLOR] [IMG]http://images.wikia.com/runescape/images/archive/e/e1/20100205121459%21Music_icon.png[/IMG] [COLOR="DarkOrange"][B]Music/Sounds[/B][/COLOR] [COLOR=Lime]-Music plays in most regions[/COLOR] [COLOR=Lime]-Weapon sounds[/COLOR] [COLOR=Lime]-NPC sounds[/COLOR] [COLOR=Lime]-Custom sounds/music (used for custom quests & mini-games)[/COLOR] [IMG]http://i.imgur.com/QR4Lh.png[/IMG] [COLOR="DarkOrange"][B]Miscellaneous[/B][/COLOR] [COLOR="Lime"]-Random Events[/COLOR] [COLOR="Lime"]-Bankpin system[/COLOR] [COLOR="Gold"]-Skilling Guilds[/COLOR] [COLOR="Gold"]-Pickable items[/COLOR] [COLOR="Lime"]-Transportation (boats, gnome glider, gnome trees, etc)[/COLOR] [COLOR="Gold"]-Treasure Trails[/COLOR] [COLOR="Lime"]-Poison on items[/COLOR] [COLOR="Lime"]-Enchanting[/COLOR] [COLOR="Lime"]-Run Draining (with restore based on Agility level)[/COLOR] [COLOR="Lime"]-Global Door/Ladder system[/COLOR] [COLOR="Lime"]-Global skill/dungeon areas[/COLOR] [COLOR="Lime"]-Client Launcher[/COLOR] [COLOR="Lime"]-Fullscreen Client support[/COLOR] [COLOR="Lime"]-Realistic lighting and shadows[/COLOR] [COLOR="Lime"]-Fully working Clan Chat (ranks, ban system, etc)[/COLOR] [b]And tons of other stuff![/b] [/left] [/SPOILER] [B][SIZE=4][COLOR="#FF8C00"]Fullscreen Support [img]http://i948.photobucket.com/albums/ad328/Miasmic_Ltd/runekingdom.png[/img] Other pictures [img]http://i948.photobucket.com/albums/ad328/Miasmic_Ltd/runekingdom1.png[/img] [img]http://i948.photobucket.com/albums/ad328/Miasmic_Ltd/runekingdom2.png[/img] [img]http://i948.photobucket.com/albums/ad328/Miasmic_Ltd/runekingdom3.png[/img] [img]http://i948.photobucket.com/albums/ad328/Miasmic_Ltd/runekingdom4.png[/img] [img]http://i948.photobucket.com/albums/ad328/Miasmic_Ltd/runekingdom5.png[/img] [img]http://i948.photobucket.com/albums/ad328/Miasmic_Ltd/runekingdom6.png[/img] [img]http://i948.photobucket.com/albums/ad328/Miasmic_Ltd/runekingdom7.png[/img] [img]http://i948.photobucket.com/albums/ad328/Miasmic_Ltd/runekingdom8.png[/img] [img]http://i948.photobucket.com/albums/ad328/Miasmic_Ltd/runekingdom9.png[/img] [img]http://i948.photobucket.com/albums/ad328/Miasmic_Ltd/runekingdom10.png[/img] [img]http://i948.photobucket.com/albums/ad328/Miasmic_Ltd/runekingdom11.png[/img] [img]http://i948.photobucket.com/albums/ad328/Miasmic_Ltd/runekingdom12.png[/img] [img]http://i948.photobucket.com/albums/ad328/Miasmic_Ltd/runekingdom13.png[/img] Please show your support by thanking the thread! If you have any questions, feel free to post below. If you want to make any support signatures, I'll be more than happy to post them on the thread along with giving you credit. [/COLOR][/SIZE][/B] [/CENTER][/size]
  6. Hello, After research on all rsps we found the weak spots and the things that needs to be improved to become a great rsps. we also build up a decent player base who would join. We have been looking the past few months for people who can code. Why? we need people we can hire to create, maintain a rsps server. this in exchange for payment. we are not sure if we will be able to offer you a contract but that's for later on. (all interesting people received a message) The question right now is; do you think you have the capacity creating a professional rsps, hosted by professional and real employees? of course you won't be the only coder. we are looking for more people. If you are interested we can range a Skype call to explain more and maybe an agreement. if you think you are one of these people but we didn't send you a prig message, then please post below or pm. kind regards,
  7. [center][u][b]Varrador - Get ready[/b][/u] What is Varrador? Hi there guys. Welcome to Varrador's Official Runelocus project thread. This thread is going to contain exclusive updates on my new and first project 'Varrador'. Yeah okay, its a 508 but WHO CARES!. 508's are just perfect if they are coded correctly and by someone who knows what they are doing. Varrador is hopefully going to be one of the most advanced 508's projects going at this time. Varrador is going to be an all round server, Just like Runescape. There will be 100% Pk/Wilidy with a fantastic custom coded combat system giving the best combat possible, All skills will be working to the highest they can be, they might not be perfect but they will be close. 80% of the Runescape Minigames back in the day and just so much more. This is going to be a Giant project for me and hopefully I can pull this of and work on other servers if i enjoy doing this. I also do note that I am not very confident with Runescape features. I'm just a Java developer and wanted to start something different. [b]Currently in Varrador[/b] - Most of the Correct NPC spawn's - Perfect weapon specials | AGS, SGS, ZGS, Whip ect ect... - Fight Pits - Clan Wars - Castle Wars (Very bugy at the moment) - Duel Arena - Correct Bosses in correct places - Correct level up Interface - Full HD/LD Compatible With a choice of Fixed or Full screen [b]Skills[/b] - 100% Fishing - Every fish is catch-able - 40% Cooking - Need to work on Burning and correct Interfaces - 85% Agility - Gnome Agility Course/Barbarian Course and Wilderness course - 95% Thieving - Pickpocketing - All stalls around the world work - 70% Fletching - Correct Interfaces - All logs work - Need to work on getting '5' '10' and 'x' to work - 30% Runecrafting - Just a temp base will work more later date - 60% Firemaking - Need to work on ashes - 90% Woodcutting - Need to work on Stumps and better timers [b]What to add next [/b] I will add these in chunks this means when the below is completed I will move them to the Whats added and add new updates :)[/center] - Herblore - Summoning - Mining - Smithing - Grand Exchange - Dialogue - Quests - Essential Commands - Need to make server more stable (Easy as Pie - Probably next update) [b]Media[/b] [URL=https://imageshack.com/i/nbfj6up][IMG]http://imagizer.imageshack.us/v2/xq90/839/fj6u.png[/IMG][/URL] [URL=https://imageshack.com/i/157i1up][IMG]http://imagizer.imageshack.us/v2/xq90/41/7i1u.png[/IMG][/URL] [URL=https://imageshack.com/i/mz9scrp][IMG]http://imagizer.imageshack.us/v2/xq90/827/9scr.png[/IMG][/URL] [URL=https://imageshack.com/i/jwexrup][IMG]http://imagizer.imageshack.us/v2/xq90/716/exru.png[/IMG][/URL] [b]More media as more updates come :)[/b] Thanks for reading my Project thread on Varrador and hopefully you can now see just how good 508's can be. Comments are apperciated and please let me know on what to add next!. [/center]
  8. Needing A advanced coder that can code a 718/742. Will be paying 1 coder 50% of donations. Plus a $50 bonus when the server goes online. A lot of work has been done, but still a lot to do. Must be able to code at least 5-6 hours a day or so. You can contact me on Skype at live:iamguthark
  9. jakescapev1

    Advanced coders

    Are there any advanced/trusted coders out there that will do coding services for me if i pay them? Revision: 718 Skype: Jake.starr6 I'm not looking for like pay by hour but like, "pay you 20 dollars to do this" sort of thing. Also client sided things.
  10. [center][IMG]http://elunity.com/images/elunity.png[/img] [url=http://elunity.com]Elunity[/url] [url=http://elunity.com/play]Play Elunity![/url] [url=http://elunity.com/forums]Elunity - Index[/url] [url=http://elunity.com/scores]High Scores[/url] [url=http://elunity.com/play/recover.php]Recover account[/url] [url=http://elunity.com/play/create.php]Create new account[/url] [url=http://elunity.com/wiki]Elunity Wiki[/url] Elunity is not like your average servers you see around here it is very unique. The server is 24/7, has a very experienced team and has custom which no other server has. The server has grate load of bosses so the PvM’s are spoiled for choice and PvP’s are just as spoiled with all the spec weapons in-game. Elunity allows players to use the yell (::yell) cannel without having to donate, all you need is over one hour online time, this is to stop any advertisers. [color=green]Quests:[/color] We have 7 quests already done, not including holiday quests! We currently have our Halloween quest out! [IMG]http://img580.imageshack.us/img580/4117/7s3p.png[/img] [color=green]Elunity Home:[/color] Here at Elunity we decided to change thing up rather than having home/starting place at edge like every other server; we decided to have our home based in Port Phasmatys. We also based out teleports such as god wars and mini-games. [color=green]Main commands:[/color] For all the following command you will need to write two colon’s (:: ) then followed by the name of the command without any space. [color=red]The commands are:[/color] Dz (Donator zone) Home (Port Phasmatys) Hbank (homebank) Mine (To mine rune essence) Pk (Mage bank) Team (Staff team) Yell (self-explanatory) People (tells you how many people at pits) Modhelp (lets mods know you need help and they will come and see you) Jad (fight cave) Players (who is on, and how many) [color=green]Skills:[/color] Once again Elunity decided they were going to do thing different from other severs rather than having levels going up to 99, we had them going up to 126 with a max xp of 250m and a max combat level of 160, but is wildness it will change to max level going up to 110 and max combat level of 140 (this changes back once you leave the wildness). [color=green]PvP:[/color] The main place on Elunity for player killing is hill giants. The main weapons been Dragon Claws Dark bow, Night bow (costom), Seren Godsword (costom), Dragon Cross bow, Vesta long sword and also has all regular godswords, along with "E" Godswords donaters. When you have killed a player you will get 2 pk points which allows you to later spend the pk points on a certain rewards from the Pk shop. There are also recorded stats for your kills, you will have the ability to wear the Player killing skill capes. 200 kills for Un-trimmed cape, 400 kills & .6 ratio for (t) cape, and 600 kills & .8 ratio for (m) cape. [color=green]Pvm:[/color] Elunity has wide range of bosses for to go PvM, some of them are; Sea Troll Queen, Jad, Dagganoth Kings, Mithril Dragon, King Black Dragon, Kalphite Queen. But the best bosses are Bandos, Armadyl, Zammy, Saradomin and Corporeal Beast. These monsters drop the most valuable items on Elunity. [color=green]Donators:[/color] You get a 15% increase on all experience you gain, ability to go to donatorzone ,donator shop, spirit shields, ability to go to the corporeal beast and tormented demons, Vengance, Donator godswords, and much more! [color=green]Backup:[/color] Backups are always being generated and saved! [IMG]http://img34.imageshack.us/img34/1877/tlz9.png[/img] [color=green]Pictures:[/color] [URL=http://s1180.photobucket.com/user/jimmy786/media/Bosses_zps3d2b7544.png.html][IMG]http://i1180.photobucket.com/albums/x405/jimmy786/Bosses_zps3d2b7544.png[/img][/URL] [URL=http://s1180.photobucket.com/user/jimmy786/media/wuww_zps86786faa.png.html][IMG]http://i1180.photobucket.com/albums/x405/jimmy786/wuww_zps86786faa.png[/img][/URL] [URL=http://s1180.photobucket.com/user/jimmy786/media/pkshop_zps608ea7be.png.html][IMG]http://i1180.photobucket.com/albums/x405/jimmy786/pkshop_zps608ea7be.png[/img][/URL] [URL=http://s1180.photobucket.com/user/jimmy786/media/allpkcapes_zpsd4f62214.png.html][IMG]http://i1180.photobucket.com/albums/x405/jimmy786/allpkcapes_zpsd4f62214.png[/img][/URL] [URL=http://s1180.photobucket.com/user/jimmy786/media/75379939f3b4e7d348e9aaf75ffdba89_zps68f65c1f.png.html][IMG]http://i1180.photobucket.com/albums/x405/jimmy786/75379939f3b4e7d348e9aaf75ffdba89_zps68f65c1f.png[/img][/URL] [COLOR="#00FF00"] Unique Highscores, and some other features. Including one price timed subscription that includes all benefits of a subscriber. Donation system automatically added status when paid, and removed when time runs out.[/COLOR] [IMG]http://imageshack.us/a/img593/2827/d3mv.png[/img] [IMG]http://imageshack.us/a/img268/4493/e96p.png[/img] [IMG]http://imageshack.us/a/img132/9792/c4h.png[/img] [COLOR="#00FF00"]Flawless Recovery system with email notifications.[/COLOR] [IMG]http://imageshack.us/a/img706/14/yy4f.png[/img] [COLOR="#00FF00"]Ce toolkit, still to come (in development still)[/COLOR] [IMG]http://imageshack.us/a/img809/1287/2kxn.png[/img] [IMG]http://imageshack.us/a/img837/9526/bkbg.png[/img] [IMG]http://imageshack.us/a/img132/1552/jbga.png[/img] [COLOR="#FF0000"]Thank you, The Elunity Team![/COLOR][/center]
  11. [url=http://elunity.com]Elunity[/url] [url=http://elunity.com/play]Play Elunity![/url] [url=http://elunity.com/play/sub.php]Subscriptions[/url] [url=http://elunity.com/forums]Elunity - Index[/url] [url=http://elunity.com/scores]High Scores[/url] [url=http://elunity.com/play/recover.php]Recover account[/url] [url=http://elunity.com/play/create.php]Create new account[/url] [url=http://elunity.com/wiki]Elunity Wiki[/url] [url=http://elunity.listen2myradio.com]Listen2myradio.com - Listen to the Elunity radio station!![/url] Elunity is not like your average servers you see around here it is very unique. The server is 24/7, has a very experienced team and has custom which no other server has. The server has grate load of bosses so the PvM’s are spoiled for choice and PvP’s are just as spoiled with all the spec weapons in-game. Elunity allows players to use the yell (::yell) cannel without having to donate, all you need is over one hour online time, this is to stop any advertisers. [color=green]Elunity Home:[/color] Here at Elunity we decided to change thing up rather than having home/starting place at edge like every other server; we decided to have our home based in Port Phasmatys. We also based out teleports such as god wars and mini-games. [color=green]Main commands:[/color] For all the following command you will need to write two colon’s (:: ) then followed by the name of the command without any space. [color=red]The commands are:[/color] Dz (Donator zone) Home (Port Phasmatys) Hbank (homebank) Mine (To mine rune essence) Pk (Mage bank) Team (Staff team) Yell (self-explanatory) People (tells you how many people at pits) Modhelp (lets mods know you need help and they will come and see you) Jad (fight cave) Players (who is on, and how many) [color=green]Skills:[/color] Once again Elunity decided they were going to do thing different from other severs rather than having levels going up to 99, we had them going up to 126 with a max xp of 250m and a max combat level of 160, but is wildness it will change to max level going up to 110 and max combat level of 140 (this changes back once you leave the wildness). [color=green]PvP:[/color] The main place on Elunity for player killing is hill giants. The main weapons been Dragon Claws Dark bow, Night bow (costom), Seren Godsword (costom), Dragon Cross bow, Vesta long sword and also has all regular godswords, along with "E" Godswords donaters. When you have killed a player you will get 2 pk points which allows you to later spend the pk points on a certain rewards from the Pk shop. There are also recorded stats for your kills, you will have the ability to wear the Player killing skill capes. 200 kills for Un-trimmed cape, 400 kills & .6 ratio for (t) cape, and 600 kills & .8 ratio for (m) cape. [color=green]Pvm:[/color] Elunity has wide range of bosses for to go PvM, some of them are; Sea Troll Queen, Jad, Dagganoth Kings, Mithril Dragon, King Black Dragon, Kalphite Queen. But the best bosses are Bandos, Armadyl, Zammy, Saradomin and Corporeal Beast. These monsters drop the most valuable items on Elunity. [color=green]Donators:[/color] You get a 15% increase on all experience you gain, ability to go to donatorzone ,donator shop, spirit shields, ability to go to the corporeal beast and tormented demons, Vengance, Donator godswords, and much more! [color=green]Pictures:[/color] [URL=http://s1180.photobucket.com/user/jimmy786/media/Bosses_zps3d2b7544.png.html][IMG]http://i1180.photobucket.com/albums/x405/jimmy786/Bosses_zps3d2b7544.png[/img][/URL] [URL=http://s1180.photobucket.com/user/jimmy786/media/wuww_zps86786faa.png.html][IMG]http://i1180.photobucket.com/albums/x405/jimmy786/wuww_zps86786faa.png[/img][/URL] [URL=http://s1180.photobucket.com/user/jimmy786/media/pkshop_zps608ea7be.png.html][IMG]http://i1180.photobucket.com/albums/x405/jimmy786/pkshop_zps608ea7be.png[/img][/URL] [URL=http://s1180.photobucket.com/user/jimmy786/media/allpkcapes_zpsd4f62214.png.html][IMG]http://i1180.photobucket.com/albums/x405/jimmy786/allpkcapes_zpsd4f62214.png[/img][/URL] [URL=http://s1180.photobucket.com/user/jimmy786/media/75379939f3b4e7d348e9aaf75ffdba89_zps68f65c1f.png.html][IMG]http://i1180.photobucket.com/albums/x405/jimmy786/75379939f3b4e7d348e9aaf75ffdba89_zps68f65c1f.png[/img][/URL] [COLOR="#00FF00"] Unique Highscores, and some other features. Including one price timed subscription that includes all benefits of a subscriber. Donation system automatically added status when paid, and removed when time runs out.[/COLOR] [IMG]http://imageshack.us/a/img593/2827/d3mv.png[/img] [IMG]http://imageshack.us/a/img268/4493/e96p.png[/img] [IMG]http://imageshack.us/a/img132/9792/c4h.png[/img] [COLOR="#00FF00"]Flawless Recovery system with email notifications.[/COLOR] [IMG]http://imageshack.us/a/img706/14/yy4f.png[/img] [COLOR="#00FF00"]Ce toolkit, still to come (in development still)[/COLOR] [IMG]http://imageshack.us/a/img809/1287/2kxn.png[/img] [IMG]http://imageshack.us/a/img837/9526/bkbg.png[/img] [IMG]http://imageshack.us/a/img132/1552/jbga.png[/img] [COLOR="#FF0000"]Thank you, The Elunity Team![/COLOR]
  12. I Am looking for an advanced coder with alot of free time to be the dev for a rsps if your good you could become the permemant dev for the server. This is what i need doing 718 source downloaded and setup You to host the Rsps if possible if not i will host on my cpu I would like A spawn server were you can spawn bandos etc and goliaths but overpowered items like claws ags need to be voted for (vote for op weapons) also goliaths need to be voted for and any armour after bandos bandos is not to be voted for or dh. Then donors can have primal vesta chaotic weapons etc so spawning needs to work. Pk needs to be good and the home is edge with all 3 altars and someone to change your stats like mandrith in bank or a command to change stats and skilling isnt on my mind atm once the pking and spawning is done the home area needs to be done. Then i need a webclient and maybe a downloadable client made for the server that will be put on a forum. This is the idea for my server and if anyone could do this once the server takes off they would recieve a percentage of the profit from the server. Also the website needs a donate button etc if all this was done perfectly you would recieve a higher percentage of profits and if your a good dev i will keep you as a permament dev i will host the server once everything is done it just needs handing over to me to host and as i said you will be greatly rewarded thanks you need alot of free time 4-6+hours aday thanks guys and say below if your interested as i think this is a good idea for a server only problem is i have no java coding experience and if needed i would hire a second dev to help you out and relive the strain thanks! btw the percentage would range from 30-50+ percent depending on the job you do and most medium sized servers earn from 4k-6k a month you do the maths a good investment ;d and once its set up not alot of maintaining to do so something thats will take a long time but once done not much maintaining to do and you get a big cut of the profit
  13. I Am looking for an advanced coder with alot of free time to be the dev for a rsps if your good you could become the permemant dev for the server. This is what i need doing 718 source downloaded and setup You to host the Rsps if possible if not i will host on my cpu I would like A spawn server were you can spawn bandos etc and goliaths but overpowered items like claws ags need to be voted for (vote for op weapons) also goliaths need to be voted for and any armour after bandos bandos is not to be voted for or dh. Then donors can have primal vesta chaotic weapons etc so spawning needs to work. Pk needs to be good and the home is edge with all 3 altars and someone to change your stats like mandrith in bank or a command to change stats and skilling isnt on my mind atm once the pking and spawning is done the home area needs to be done. Then i need a webclient and maybe a downloadable client made for the server that will be put on a forum. This is the idea for my server and if anyone could do this once the server takes off they would recieve a percentage of the profit from the server. Also the website needs a donate button etc if all this was done perfectly you would recieve a higher percentage of profits and if your a good dev i will keep you as a permament dev i will host the server once everything is done it just needs handing over to me to host and as i said you will be greatly rewarded thanks you need alot of free time 4-6+hours aday thanks guys and say below if your interested as i think this is a good idea for a server only problem is i have no java coding experience and if needed i would hire a second dev to help you out and relive the strain thanks!
  14. I am looking for a coder who knows how to code 718-742 and would like to run a server with me. I am use to 317's not 718's but i would like to make the change. I will host all the files unless you want to. Email me at [email][email protected][/email] or add me on Skype- Ryan.Slife021 (homecoming)
  15. I suggest we add an advanced Tutorial, Downloads, etc.. sections where mods, RSPS vets and maybe even contributors can talk in a private forum and nominate topics to be moved there. It is something like where RS fansites move really good guides to another section so players know that the topics there is really helpful and thus giving reputation to the poster of the topic (Real life reputation where someone is actually respectable...) and gaining information from a more pro. player/user.
  16. How can i change logging in coordinates? How can i add and remove objects? How do i make Outside of banks safe PvP and dangerous PvP? Please respond Thankyou Or try to leave me any help that will / websites that will help me come to a conclusion Skype: Rspssupport
  17. [CENTER]Hello RuneLocus :3 .. So I have been wondering, could it be possible for Runelocus to have a more advanced callback? You could make it optional on the runelocus page where you can edit your page's settings. With advanced I mean, that you can make people enter a username, which sends the username in a callback to a specific link provided by the server owner. A good example of such callbacks are mostly in Minecraft voting pages. [img]http://img209.imageshack.us/img209/5638/625b1fb30d1b4bccb255873.png[/img] If it's not possible, no problemo, but if it is, please consider it. Thank you very much and my apologies if this has been suggested before. Regards, Mercenary.[/CENTER]
  18. Today, I had nothing to do, so I am currently working on a toplist. I made in 10 hours: - Login - Sign Up with email verification - Add Server - server list - manage panel interface - website design - and more! So basicly, this toplist will be in real-time, easy to manage, easier voting system, etc. Advanced OOP PHP used in the systems. Here is a video that shows the functionality so far I made today: [url]http://www.youtube.com/watch?v=6jZdvmo2fAA[/url] I will be adding pictures soon. Reply and tell me what you think about it.
  19. To start off I'd like to say I hate the new 'vpns' Ip changers and etc... Mainly because they cheat my vote system and get rich, and they often get ipbanned for it. Main problem is they just come back after I ipban them, so is there a way I can MAC ban them? I mean its really needed for 562 so if anyone can help that would be great! If you don't know what MAC ban is it's basically a way to ban someone by their computer id not the network ip.
  20. any got Advanced Barbarian Outpost course anims?
  21. any got 100% Advanced Barbarian Outpost course or know a tut
  22. I am currently using [AJAX]Advanced forum statistics and all was working fine. I installed a new theme, but the statistics doesn't appear, so I guess I have to change their location on the forums. The problem is that I don't know where to change it, there's no option to do it. P.S. It's for vBulletin.
  23. this would work wonders, working many years with vB this is you're new best friend :) Compatible with 4.1.9 [url]http://www.vbulletin.org/forum/showthread.php?t=236117&highlight=advanced+registration[/url] Basically you add a random question to the registration form like 2+2=? and they must answer it to move on 100% bot proof! Just another helpful tip for Iki, need anymore just ask :) EDIT : you can also disable the invitation system that is included in that mod. Edit 2 : also, a nice database cleanup would help the website speed alot, maybe mass deleting all users who havent logged in for a year, or all users with 0 posts.
  24. So I can across this problem that had me stumped for two whole days, (it even took my teacher two whole days to figure it out), on one of my tests. I will offer anyone who finishes it first and shows me their work a chance to be in my signature, with whatever they want to be said in it (Since I have no cash currently, and this should be easy for someone who is in college for this sort of thing or something). [img]http://i39.tinypic.com/ad2iza.jpg[/img] [I][SIZE=4]CD is what is call an altitude, and is an altitude of triangle BCE. What is the length of DE?[/SIZE][/I] Edit: [B]Hints:[/B] You will use trig ratios to solve this problem. You will not have a whole number, so you will get something like 00.00000 (if you do get an answer like this, just give me the first 3 digits after the decimal). Also, I am not implying that this is correct but Trey is making good guesses so far as to how to solve the problem, so you could probably work with atleast [I]some[/I] of this :) [quote name='Trey']The key to this problem is figuring out that EDC and ECB are similar triangles. We know that angle ECD is 90 - DCB. We also know that CED + EDC + DCE = 180, since DCE is 90, CED + EDC = 90. Substituting, we get CED + 90 - DCB = 90, CED = DCB. Thus, they are similar triangles. Thus, their sides have a consistent ratio of (32/44). So, since CD * (32/44) = ED, 32 * (32/44) = 256/11 = ED. I'm assuming you can work from their knowing the ratio.[/QUOTE]
×