Jump to content

Search the Community

Showing results for tags 'web'.



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 179 results

  1. [CENTER][IMG]http://i.imgur.com/eqaTmUX.png[/IMG] [HR][/HR] [B]Website Homepage Forums Donation Page Vote Page Dynamic Donations Advanced Usergroup Permissions vBulletin Installs vBulletin Modifications[/B] [HR][/HR] [IMG]http://i.imgur.com/p9lb6tO.png[/IMG] [HR][/HR] [B]Website Homepage - $5 USD. Forums - $5 USD. Donation Page - $7 USD. Vote Page - $3 USD. Dynamic Donations - $8 USD. Advanced Usergroup Permissions - $5 USD. vBulletin Installs - $10 USD. vBulletin Modifications - $5 USD. Alright guys some details on my services, I major in Web Development obviously. I work with Javascript, C++, Pawno ,PHP mostly a little bit of everything. If and when you order something above, I will need to get access to your forums, as-well as your website's cPanel, It's manditory for me to use it as it'll give me access to everything I need. Skype: riley.devil Google Talk: bradleysixx69 MSN: bradleysixx69 Paypal: [email][email protected][/email][/B] Anyhow if you'd like to order something here is the current form you'd need to use. [QUOTE]Skype Name: Order / Service: Have you added me on skype yet?: Have you sent me a pm yet?:[/QUOTE] Past Customers: [url]www.unleashed-gaming.com[/url] / [url]www.mxgaming.net[/url] / more to be added! [HR][/HR] [IMG]http://i.imgur.com/jI42SpN.png[/IMG] [HR][/HR] As I am new with the services kind of thing, I don't have any current vouches and or supports, will be updated in the future![/CENTER]
  2. Hi, For a school project i am trying to develop at rsps community and game, located at projectsequestered I am having issues turning the client into a web client, I have tried multiple times with different tutorials and followed them correctly step by step. Jarring is simple, Yet once i jar the client it does not open. The .Bat file gives off no errors, So i am simply stuck. Many people are suggesting jarring through an IDE (Eclipse). Anyways it is due in 2 weeks and if there is anyone out there that can either send me a webclient that i can simply just put the cache link & server ip in then upload would be awesome. Would be happy to send some money your way for helping me out. - Thanks
  3. 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.
  4. Hello, Project Angel is requesting A Modeler, A web designer and also a coder. To apply, we would like you to have a decent understanding of these jobs whether it be self taught, or from courses online etc. All staff will be paid, prices can be arranged on Skype (Check bottom for Skype name) if you're interested in either of the jobs, money can be presented with in-game items/ranks or money can be done via Paypal (Can go more into detail when on Skype). Project Angel is a 317 server which has a VPS and is currently looking for players. If you think you can help us out, please follow this template: [LIST=1] [*]What role would you be interested in? [*]Do you have past Experience, if so how long? [*]Tell us about yourself: [*]anything else that may support your application: [/LIST] How to get in touch: SKYPE: Shastaa_ (trying looking for Daniel Hunter |) Neil.Avalos
  5. I'm looking for a website to develope for free (ipb) I will be playing the server also.
  6. Plz help we are willing to pay someone. If u can help us add my skype The_Brick3
  7. [SIZE=3]Apex718 is now looking for more People Who Qualify to join the team and are ready to Get Apex Going![/SIZE] --------------------------------------------- Web Developer [COLOR="#00FF00"](Open)[/COLOR] In-Game Developer [COLOR="#00FF00"](Open)[/COLOR] ---------------------------------------------- [COLOR="#FF0000"]Requirements:[/COLOR] Must Have Worked With 718+ RSPS. (More Than 6 Months Time) Must Have More Then Basic Java Knowledge. Must Be Able To Commit More than 10 Hours A week. ----------------------------------------------- IF ALL REQS ARE MET AND YOU ARE STILL INTERESTED PLEASE CONTACT ME ON SKYPE [MENTION=61829]purecoolbow[/MENTION]1
  8. I start to learn web designing. These days designing web sites in the note pad. Anyone can tell me about ant software to web designing.
  9. hi friends. i have a problem with making a web client. when i jar my client i cant open it direct i need it to paste it first in the old client folder so can any one help me out.
  10. [B]What is this useful for?[/B] *Server *Client *Launchers Q: For what? A: For a example you could load your news message from a dropbox .txt file, giving you the ability to change your in-game news just by using mobile phone when you're away from computer. [code] /** * Loads a .txt file from URL and * returns to the text inside it. * [MENTION=75098]Para[/MENTION]m url_adress > [url]www.adress.com/myText.txt[/url] * [MENTION=184045]return[/MENTION] S * @throws java.io.IOException */ public static String getMessageFromURL(String url_adress) throws IOException { URL url = null; try { url = new URL(url_adress); } catch (MalformedURLException e) { System.out.println("There was an error loading the file / reading it." + " " + Arrays.toString(e.getStackTrace())); } return IOUtils.toString(url); }[/code] You need apache commons-io 2.4 which can be downloaded here. [url]http://commons.apache.org/proper/commons-io/[/url]
  11. Hey all, figured since I was selling designs so often, I should just go ahead and create a thread that I can update every so often with current designs for sale. Any of the below designs can be modified to your liking. Please contact me on my skype [B]worldofclayton[/B] if you're interested. [quote name='Ascaria']Vouch for Hope. [IMG]http://www.runelocus.com/forums/images/smilies/smile.png[/IMG][/QUOTE] [quote name='Sir seppe']Vouch for hope![/QUOTE] [quote name='officiallulzs3c'] OT: vouch for hope, he knows what hes doing [IMG]http://www.runelocus.com/forums/images/smilies/tongue.png[/IMG][/QUOTE] [quote name='Titanium']Vouch for clayton [IMG]http://www.runelocus.com/forums/images/smilies/smile.png[/IMG] Best of luck with your selling bro [IMG]http://www.runelocus.com/forums/images/smilies/smile.png[/IMG][/QUOTE] Click each image once, then again on the next page to see a [B]full scaled[/B] image preview. [B]Below:[/B] Unfinished HTML version. [URL="http://i.share.pho.to/0a51c363_o.png"][IMG]http://i.share.pho.to/0a51c363_o.png[/IMG][/URL] [B]Below: [/B]A design that never really got done. This template is currently only in PSD form. If you'd like me to work on finishing it and constructing an HTML form to sell to you, I can do that. :D [URL="http://i.gyazo.com/c85ecd4901e6f3cc2ded6d331ba23c27.png"][IMG]http://i.gyazo.com/c85ecd4901e6f3cc2ded6d331ba23c27.png[/IMG][/URL] [B]Below:[/B] A theme made for a RSPS but never got officially used. You may buy a strictly HTML form of this from me or the full form (with login system, voting, and a custom shop area). [URL="http://i.share.pho.to/93c543d3_o.png"][IMG]http://i.share.pho.to/93c543d3_o.png[/IMG][/URL]
  12. [IMG]http://rspserver.com/images/motivote.png[/IMG] Download at [URL="http://www.runelocus.com/forums/showthread.php?102928-Ultimate-Vote-Script-Motivote-(SERVER-amp-WEBSITE)"]http://www.runelocus.com/forums/showthread.php?102928-Ultimate-Vote-Script-Motivote-(SERVER-amp-WEBSITE)[/URL] [SIZE=1]Note: This can be applied to any server, RL just forced me to use a thread prefix.[/SIZE] So I made [URL="http://www.runelocus.com/forums/showthread.php?102928-Ultimate-Vote-Script-Motivote-(SERVER-amp-WEBSITE)"]Motivote[/URL] pretty easy to install, right off the bat. The only real tricky part is going to be writing the code that gives the user the reward, but I've made that as simple as I can make it. [url]https://www.youtube.com/watch?v=GhOyPmwqw1s[/url] [LIST=1] [*]Create a MySQL database, user, and give the user as many privileges as you can. [*]Extract Motivote-(WHATEVER CURRENT VERSION IS)-web.rar and upload the contents into a directory on your website. I'd use /vote/. [*]Set permissions on config.php to 0777. If you don't, the script will tell you what to put in config.php by yourself. [*]Visit [url]http://yoursite.com/vote/[/url] and enter the installation information and just follow the steps. [*]MAKE SURE YOU SAVE YOUR [B]SERVER DATA CALLBACK KEY[/B] AND YOUR [B]ADMIN CONTROL PASSWORD[/B]! [/LIST] [IMG]http://i.imgur.com/pQSpAJP.png[/IMG] [I][COLOR="#FF0000"][B]Then, for the server installation, include Motivote-(current version).jar in your build path.[/B][/COLOR][/I] [SIZE=1]For PI, here's the method I added in PlayerHandler.java: [url=http://pastebin.com/T6Vvcvvd]Add to PlayerHandler.java - Pastebin.com[/url][/SIZE] Create RewardHandler.java: [CODE]import server.model.players.Client; import server.model.players.Player; import server.model.players.PlayerHandler; import com.rspserver.motivote.MotivoteHandler; import com.rspserver.motivote.Reward; public class RewardHandler extends MotivoteHandler<Reward> { [MENTION=15855]Over[/MENTION]ride public void onCompletion(Reward reward) { int itemID = -1; if (reward.rewardName().equalsIgnoreCase("gold")) { itemID = 995; } // SOME OF THIS CODE WILL BE DIFFERENT FOR YOUR SERVER, CHANGE IT ACCORDINGLY. everything to do with motivote will stay the same! if (PlayerHandler.isPlayerOn(reward.username())) { Player p = PlayerHandler.getPlayer(reward.username()); if (p != null && p.isActive == true) // check isActive to make sure player is active. some servers, like project insanity, need extra checks. { synchronized(p) { Client c = (Client)p; if (c.getItems().addItem(995, reward.amount())) { c.sendMessage("You've received your vote reward! Congratulations!"); reward.complete(); } else { c.sendMessage("Could not give you your reward item, try creating space."); } } } } } }[/CODE] Add where you initialize/start everything else: [CODE]new Motivote(new RewardHandler(), "http://yoursite.com/vote/", "server data callback key").start();[/CODE] [IMG]http://i.imgur.com/nB5EdTn.png[/IMG] Really, it's that easy. If you have any issues, just post a reply and I'll try and sort them out to the best of my ability. Thanks!
  13. Hello. [CENTER]A buddy and I have been interested in returning to the RSPS scene, and we're coming at it with full power to the thrusters, and we're looking for a team that will be dedicated to excelling.[/CENTER] [I][CENTER][B]A little background[/B][/CENTER][/I] [CENTER]Nick and I have setup multiple servers in the past, and we were very inexperienced, yet, we yielded a very decent player base. Our previous projects have been 317 based, so, we'd like to stay close(ish) to the revision, as we love the lower revisions. I myself, am currently a Web Developer who is experienced in PHP/CSS/HTML(obviously), and a bit of MySQL [B][CENTER][I]What we're looking for[/I][/CENTER][/B] At the moment, we're mainly looking for an individual or two, who are up-to-date with the RSPS whereabouts and with the different revisions (keep in mind, Nick & I literally haven't made/player servers since 2012), with the ability to make base-line level game code (we're aiming for simplicity with this current project). We're also looking for an additional individual who is decent with media (if not, I can cover the advertising promotions for the server once it is up). Lastly, we'd like to have 2-3 dedicated Staff members who will focus on relations with the server community, once the server is up. Basically, you'll hold the title as "Community Advisor" in which case you would relay concerns and requests from the player-base to the corresponding developers and staff. Along with this position, you will receive Moderator Level One. [/CENTER] [B][I][CENTER]What we can bring to the table[/CENTER][/I][/B] [CENTER]As stated above, I will be doing mostly everything require to create/manage and update the website/forums, along with making multiple different systems that will connect the game to the webpage (donation system, high scores, etc). Nick will be managing the Staff Team, with the exception of myself and the Game Developer. Nick has experience along with myself as a Staff Leader and recruiting/logistics of our previous Staff Teams we had within our latter RSPS projects. As for the up-cost of the server utilities, I will be covering it all. VPS/Dedi, Teamspeak & Website. [/CENTER] [B][I][CENTER]What we hope to create[/CENTER][/I][/B] [CENTER]We're mainly looking to make an older-revision(to be decided with Game Developer) server, that is very simplistic, original, and hold high values for our players, which in turn, will grow the player base tremendously. As for the game mode, we're mainly looking to focus around an original PK style server, without the unnecessary gimmicks of the latest servers. However, all of this is to be discussed with our future team, and what we'd like best. [B]ALL INQUIRES WILL BE ANSWERED![/B][/CENTER] [I][CENTER]Contact information[/CENTER][/I] [CENTER]Skype: blaze420noscope (don't mind this, simply the only account I have that isn't plagued with randoms)[/CENTER]
  14. can anyone help me with the line(s) i need to make a command open a webpage?
  15. I do not give permission for this to be released anywhere else but runelocus if you see this released anywhere else please report it asap [img]http://www.runelocus.com/forums/images/icons/icon14.png[/img] Demo RevolutionX: [url]http://insanityx.net/demo/flurry/revolutionx[/url] Demo PwnXile: [url]http://insanityx.net/demo/flurry/pwnxile[/url] download 2 in 1: [url]http://insanityx.net/demo/flurry/fldl.zip[/url]
  16. Fusion`

    Maxthon Web Browser

    Has anyone used this? It's amazing. Google Chrome has been being a little shit earlier with it's "Your profile could not be opened." Point is, I found a cooler browser. Here's the link for anyone who wants to give it a try. [url]http://www.maxthon.com/[/url]
  17. Looking to join a 718 or 317 Project, I don't feel like taking on a server by myself, and its hard to find good staff.. What i can offer for a Developer/Admin position.. Excellent knowledge in JAVA/C#/HTML/CSS.. 24/7 Webhost with IPS 3.4.7 or 4.0 BETA or vBulletin. Dual core 3GHZ CPU 5GB RAM DDR2-800mhz 160GB Storage Unlimited SQL Databases Plesk Panel and more... Any questions.. add my skype gb-rodney
  18. Hello. I need someone who has good knowledge of WordPress and is able to fix a bug for me. [url]http://almaplushotel.com/[/url] This site is in Russian and English using WPML. The slider isn't working on the Russian part. If anyone could fix this, it would be really helpful. The images don't show on the Russian part. We can discuss the price over Skype. Add my Skype @ Samar.Devious
  19. i already have a vps and another partner for coding the server all i need is a web dev. i can also make website/forums etc., but im busy atm and ill focus on the source. also if u can help me with funds for domain registration ull be co-owner] add my skype: ۩͇̿V͇̿I͇̿P͇̿۩ khen
  20. Hey guys. Recently I started on a RSPS alongside a few other members. We have a great team atm but we need a Web developer. A person who has full knowledge of html,php,css and other programming languages related to web development. I would like a person who can work with other member and contribute as much as possible. Please don't apply if you don't have enough knowledge. It'll be a waste of your and my time. If you are interested , please apply below with the following application format. [CODE] Name : Age : Skype : How much do you rate yourself in web development out of 10 : Tuts or guides you have contributed to Runelocus( links ) : Your previous work(s) : [/CODE]
  21. This is not my first time running a private server, so I need people with experience and that actually know what they're doing. Because quite frankly I am not good with client (interface, models, blah blah) or web development (php, mysql, auto vote, etc), but I know what I'm doing when it comes to the source files. You can also visit the webiste [url]http://projectpkrsps.com[/url] and download the client. I already have the server running on a VPS and a website with a webhost, I just haven't advertised at all seeing as I don't really want to release the server at this time. Add me on Skype: whiteboy.kobe , if you're interested (Serious inquires only)
  22. Hi guys , Well , I understand that XML useful for communicating data and exchange between different platforms .. I'm interesting in web development and it's technologies , can XML give special features for my job in web development that I can not get without ? I 've purchased beginning XML ,4ed (Wrox) , but it's 1000+ pages and it's know that XML is used in applications as well as for Web .. Do I need to read irrelevant materials like those or get to the part concerning with the Web ? and what is it ?
  23. Hey, I've been looking/trying to get back into RSPS these past few months and considered starting my own project however my knowledge on RuneScape as a whole has taken a hit these past few years as I haven't been apart of any projects or played in some time. I would like to join a team as a Web Developer where I have an extensive knowledge with PHP, MySQL and frameworks like Laravel and CodeIgniter. I've also run and managed multiple forums on different software including SMF, IP.Board, vBulletin and MyBB. You can view some of my projects I've done by viewing the threads I've created in the Web Development board of these Forums. Most of these are from 1 year+ ago but I can show some more recent work if requested. Depending on the time and effort required I may require some kind of pay. Being a part of a successful project and server is really what I want. Add me on Skype - BeachedOnDuty
  24. kibitz

    Web Banners

    Hey guys, i recently started making small and simply flash web banners and decided to start giving them out. Now i will do them for free, you can message me on here but i will not be doing them for free if you have like a low amount of posts, i want to see like 50+ posts or something, or some sign that you are not just here to leech but to actually contribute aswell. This is an extremely simple piece that i just made(Be patients, websites slow.) [url]http://www.swfcabin.com/open/1401646380[/url] I will not make super complex banners and will use 3-4 pictures with text and the banners will be branded with something like the one above(may not be exactly the same.) These banners can be used for your rsps and placed onto your website and will be delivered in .swf extension. Hope you enjoy, peace - Kibitz lolking
  25. Hello. I am looking for a Web Developer to fix up a site, and add a few things to it. also re do forum work, since i don't no anything about forums or site work. You will be paid for your work/time Skype is archangelsxo.
×