Jump to content
  • Sign in to follow this  

    [IPS 4] "Help GFL" Application


    Roy
    • Start Date: 09/08/2018
      Completion Date: No value
      Expected Completion Date: 12/01/2018

    This is an idea I posted long ago. Idea contents can be found here and the project's name is likely to change:

     

    Quote

    Hello,

     

    I just wanted to throw out this idea to all team members to see what they thought about this. I discussed this with @Darkling yesterday along with a couple other ideas and he liked it.

     

    At the moment, I feel it's somewhat a mess to apply for a position. Whether the position would be Developer, Media, or just regular Server Admin or Member (I have a different plan for members, though). For example, to apply for Developer and Media, you have to hover under the "GFL" tab. For Server Admin, you have to go to the server's individual sub-forum and make an application manually. And finally, for member you have to hover over "Servers" which is in a different category than the other applications making it more confusing in my opinion. Though, this can be fixed if we organized the nav-bar.

     

    What I would like to do is code an IPS 4 application that merges all the applications into one page and form. The name of the page at the moment would be "Help GFL", but I think this is likely to change and would like suggestions. This form would act like the current form used with the donations application. Here's the link to the donation application. This form uses "steps". Meaning, you configure the first step and then click continue and fill out the second step, etc.

     

    First Step

    On the first step, there would be one select box which would consist of the following:

     

    Title - What Do you want to help with?

    1. Being a part of a team.
    2. Other.

     

    We can likely add more options to this. After the first step is completed, the next step would bring up the following depending on the options.

     

    Second Step

    On the second step, a list of options will be displayed depending on what you selected on the first step.

     

    Option 1

    Title - Which team would you like to be a part of?

    1. Server Admin.
    2. Media.
    3. Developer.

     

    Option 2

    This option (Other) would be used for people who want to help out in GFL that doesn't include being a part of a team. For example, if somebody wants to help advertise GFL, they use this option and fill it out. It would only consist of one big text box asking what they want to help with. There are no further steps if this option is selected.

     

    Third Step

    The third step will depend on which options you selected for Option 1 from the last step.

     

    Option 1

    A nice and organized list of all game servers in GFL will pop up. The user will be able to select one server they want to apply for. This option will require a fourth step.

     

    Option 2/4

    Additional forms required for the team application will be displayed. This is the last step of the application.

     

    Fourth Step

    As of right now, the Server Admin option is the only option that will require a fourth step. Generic and server-specific forms will be displayed on this step. This is the last step.

     

    Submission

    After the last step is completed, the form will be submitted to it's appropriate location depending on the configured options. We will more than likely create an IPS 4 database that consist of "categories" for each section needed. Each game server will have its own category under the the game's category. I will ensure this is organized but we will likely be creating our own database code unless if we can implement this into the official IPS 4 database application.

     

    Flexibility

    If we code this application, I would like it to have as much flexibility as it can. This means we'd be able to add any form we'd like along with as many steps as we'd like while doing the least amount of manual work as possible. This could do A LOT for us if developed correctly.

     

    That's it! Like I said, I'm up for suggestions. I believe this could organize a lot of the current applications.

     

    Thanks!

     

    This project would need to be integrated with the IPS 4 API.

     

    Thanks.

    Edited by Roy


    Leader - Roy
    Progress - 0%
    • Like 2
    Sign in to follow this  


    User Feedback

    Recommended Comments

    Here's another helpful post on the idea thread with me doing some stuff with the IPS 4 API to make a "demo" version:

     

    Quote

    Hello,

     

    While I was messing around with the IPS 4 API, I decided to make a "demo" version of what this project would be. Keep in mind I made this within 30 minutes or so and everything is manually coded in. If I were to make an actual application, everything would be automated and look better than it does right now. With that said, I would make major style changes as well to make the form look better.

     

    I am using IPS 4's "wizard" module to do this.

     

    http://g.gflclan.com/2216b9bc012cb8.mp4

     

    Step 1

    2218ead5cb5cde.png

     

    Step 2

    2219fa6561af28.png

     

    Step 3

    2220086e893a11.png

     

    Step 4

    2221715dd0b5f5.png

     

    Step 5 (Final)

    2222b6ed91b150.png

     

    Watch the MP4 video listed above to see more options. I also used my donation system's page for this since it was a small demo. The wizard module in IPS 4 is buggy and I have to work on improving it. I already made a custom function to fix a bug with the wizard module (see below for code).

     

    As for the text areas, when I decide to make this application, I will be using the editors. The reason I didn't use it in the demo is because they're more advanced than I thought and will require more work from my end (e.g. creating a separate extension to handle any attachment uploads). I also want to make it so if there are no further steps required, it automatically submits it when you move to the next step. However, this will require altering how the wizard module works which more than likely will be tricky.

     

    Here's the full code for this demo from the donation page:

     

    
    <?php
    
    
    namespace IPS\rds\modules\front\donations;
    
    /* To prevent PHP errors (extending class does not exist) revealing path */
    if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
    {
    	header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
    	exit;
    }
    
    /**
     * donate
     */
    class _donate extends \IPS\Dispatcher\Controller
    {
    	protected $internalURL;
    	/**
    	 * Execute
    	 *
    	 * @return	void
    	 */
    	public function execute()
    	{
    		
    		parent::execute();
    	}
    	
    	public function _step1($data)
    	{
    		// Reset the form one step one because ya know, IPS 4 doesn't do it this and it fucks EVERYTHING up.
    		$this->resetWizard();
    		
    		$form = new \IPS\Helpers\Form("step1", "Continue");
    		$form->class = "ipsForm_vertical";
    		
    		// Lolzzzzzzzzzzzzz
    		$form->addTab("tab1");
    		
    		$help = new \IPS\Helpers\Form\Select("help", "0", TRUE, Array
    		(
    			'options' => Array
    			(
    				'0' => "Being a part of a team.",
    				'1' => "Other"
    			)
    		));
    		$help->label = "Type";
    		$help->description = "What type of help would you like to do?";
    		
    		$form->add($help);
    		
    		if ($values = $form->values())
    		{
    			return $values;
    		}
    		
    		return $form;
    	}
    	
    	public function _step2($data)
    	{
    		$form = new \IPS\Helpers\Form("step2", "Continue");
    		$form->class = "ipsForm_vertical";
    		
    		$form->addTab("tab1");
    		
    		if ($data['help'] == 0)
    		{
    			// Team box.
    			$team = new \IPS\Helpers\Form\Select("team", "0", TRUE, Array
    			(
    				'options' => Array
    				(
    					'0' => "Server Admin",
    					'1' => "Media",
    					'2' => "Developer"
    				)
    			));
    			$team->label = "Team";
    			$team->description = "Which team would you like to be a part of?";
    			
    			$form->add($team);
    		}
    		else
    		{
    			// Add text area.
    			$other = new \IPS\Helpers\Form\TextArea("other", "", TRUE, Array
    			(
    				'placeholder' => "Write what you'd like to help us with. Please be as specific as possible.",
    				'rows' => 15
    			));
    			$other->label = "Help";
    			$other->description = "What would you like to help us with?";
    			
    			$form->add($other);
    		}
    		
    		if ($values = $form->values())
    		{
    			return $values;
    		}
    		
    		return $form;
    		
    	}
    	
    	public function _step3($data)
    	{
    		$form = new \IPS\Helpers\Form("step3", "Continue");
    		$form->class = "ipsForm_vertical";
    		
    		$form->addTab("tab1");
    		
    		if (isset($data['other']))
    		{
    			$form->addMessage("No additional options. Please hit continue.");
    			
    			// Have to add this, otherwise it won't move onto the next step.
    			$form->hiddenValues['tmp'] = "Alrightyyy";
    		}
    		else
    		{
    			// Server Admin.
    			if ($data['team'] == 0)
    			{
    				$server = new \IPS\Helpers\Form\Select("server", "0", TRUE, Array
    				(
    					'options' => Array
    					(
    						'0' => "CS:GO Arena",
    						'1' => "CS:GO Zombie Escape",
    						'2' => "GMod CWRP",
    						'3' => "FoF #1"
    					)
    				));
    				$server->label = "Server";
    				$server->description = "What game server would you like to apply for?";
    				
    				$form->add($server);
    			}
    			// Media team.
    			elseif ($data['team'] == 1)
    			{
    				// Part.
    				$part = new \IPS\Helpers\Form\Select("part", "0", TRUE, Array
    				(
    					'options' => Array
    					(
    						'0' => "GFX",
    						'1' => "Advertising",
    						'2' => "Video Editing"
    					)
    				));
    				$part->label = "Part";
    				$part->description = "What part of the media team would you focus on?";
    				
    				$form->add($part);
    				
    				// Skills.
    				$skills = new \IPS\Helpers\Form\TextArea("skills", "", TRUE, Array
    				(
    					'placeholder' => "Describe your skills for the part you chose."
    				));
    				$skills->label = "Skills";
    				$skills->description = "What skills do you have in the part you selected?";
    				
    				$form->add($skills);
    			}		
    			// Developer team.
    			elseif ($data['team'] == 2)
    			{
    				// Part.
    				$languages = new \IPS\Helpers\Form\TextArea("languages", "", TRUE, Array
    				(
    					'placeholder' => "What coding languages do you know?",
    					'rows' => 15
    				));
    				$languages->label = "Languages";
    				$languages->description = "What coding languages do you have experience in?";
    				
    				$form->add($languages);
    			}
    		}
    		
    		if ($values = $form->values())
    		{
    			return $values;
    		}
    		
    		return $form;
    	}
    	
    	public function _step4($data)
    	{
    		$form = new \IPS\Helpers\Form("step4", "Finish");
    		$form->class = "ipsForm_vertical";
    		
    		$form->addTab("tab1");
    		
    		if (isset($data['other']))
    		{
    			$form->addMessage("No further actions necessary. Please hit finish.");
    			
    			// Have to add this, otherwise it won't move onto the next step.
    			$form->hiddenValues['tmp'] = "Alrightyyy";
    		}
    		else
    		{
    			if ($data['team'] == 1 || $data['team'] == 2)
    			{
    				$form->addMessage("No further actions necessary. Please hit finish.");
    				
    				// Have to add this, otherwise it won't move onto the next step.
    				$form->hiddenValues['tmp'] = "Alrightyyy";
    			}
    			
    			if (isset($data['server']))
    			{
    				$why = new \IPS\Helpers\Form\TextArea("why", "", TRUE);
    				$why->label = "Why Accept You?";
    				$why->description = "Why should we accept your game server application? Be as specific as possible.";
    				
    				$form->add($why);
    			}
    		}
    		
    		if ($values = $form->values())
    		{
    			return $values;
    		}
    		
    		return $form;
    	}
    	
    	public function _step5($data)
    	{
    		return \IPS\Output::i()->output = "Your application has been submitted!!!<br /><br />" . print_r($data, true);
    	}
    	
    	// Custom function made by roy da boy.
    	protected function resetWizard()
    	{
    		unset($_SESSION['wizard-' . md5($this->internalURL) . '-step']);
    		unset($_SESSION['wizard-' . md5($this->internalURL) . '-data']);
    	}
    
    	/**
    	 * ...
    	 *
    	 * @return	void
    	 */
    	protected function manage()
    	{
    		$this->internalURL = \IPS\Http\Url::internal("app=rds&module=donations&controller=donate");
    		
    		$wizard = new \IPS\Helpers\Wizard(Array
    		(
    			'rds_step1' => Array($this, '_step1'),
    			'rds_step2' => Array($this, '_step2'),
    			'rds_step3' => Array($this, '_step3'),
    			'rds_step4' => Array($this, '_step4'),
    			'rds_step5' => Array($this, '_step5')
    		), $this->internalURL, TRUE, NULL, TRUE);
    		
    		\IPS\Output::i()->output = $wizard;
    	}
    	
    	// Create new methods with the same name as the 'do' parameter which should execute it
    }

     

    If you have suggestions, please post them!

     

    Thanks!

     

    Thanks.

    • Like 1

    Share this comment


    Link to comment
    Share on other sites

×
×
  • Create New...