Jump to content


Welcome to IPS!

Feel free to browse our community to get a feel for how our community software operates. Post in the pre-sales forum with any questions you have before purchasing or use the Test Posting forum to post a few messages yourself! You can also get a free demo to try the IPS Community Suite yourself.

Already an active IPS client?

Login with the same email address and password you use for the client area to access client-only areas.





Photo - - - - -

From: Download: Bottom Bar (Beta 2) - Adding the Bottom Bar UserCP Form to the Settings Tab

Posted by Nuclear General, in Bottom Bar Tutorials 19 March 2010 · 20 views

Go to FTP, open /admin/applications/core/extenstions/usercpForms.php,
Find:
		if ( $this->memberData['g_attach_max'] != -1 )
		{
			$array[] = array(
							'url'    => 'area=attachments',
							'title'  => ipsRegistry::instance()->getClass('class_localization')->words['m_attach'],
							'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'attachments' ? 1 : 0,
							'area'   => 'attachments'
							);
		}

Add BELOW:
                if ( IPSLib::appIsInstalled('bottombar') )
                {
                        $array[] = array( 'url'    => 'area=bottombar',
                                                          'area'   => 'bottombar',
                                                          'title'  => 'Bottom Bar Configuration',
                                                          'active' => $this->request['tab'] == 'core' && $this->request['area'] == 'bottombar' ? 1 : 0 );
                }

Find:
			case 'notes':
				return $this->showFormNotes();
			break;

Add BELOW:
			case 'bottombar':
				return $this->showFormBottomBar();
			break;

Find:
			case 'notes':
				return $this->saveFormNotes();
			break;

Add BELOW:
			case 'bottombar':
				return $this->saveFormBottomBar();
			break;

Find:
	/**
	 * UserCP Save Form: Password
	 *
	 * @access	public
	 * @param	array	Array of member / core_sys_login information (if we're editing)
	 * @return	mixed	Array of errors / boolean true
	 */
	public function saveFormPassword( $member=array() )
	{

Add ABOVE:
	/**
	 * UserCP Save Form: Bottom Bar
	 *
	 * @access	public
	 * @author	Brandon Farber
	 * @return	boolean		Successful
	 */
        public function saveFormBottomBar( $current_area )
        {
                $_hide        = $this->request['hide_bottombar'] ? 1 : 0;

                IPSMember::packMemberCache( $this->memberData['member_id'], array( 'hide_bottombar' => $_hide ), $this->memberData['_cache'] );
        }

Find:
	/**
	 * UserCP Form Check
	 *
	 * @access	public
	 * @author	Matt Mecham
	 * @param	string		Current area as defined by 'get_links'
	 * @return	string		Processed HTML
	 */
	public function saveForm( $current_area )
	{

Add ABOVE:
	/**
	 * Show the Bottom Bar form
	 *
	 * @access	public
	 * @author	Brandon Farber
	 * @return	string		Processed HTML
	 */
        public function showFormBottomBar()
        {
                return $this->registry->output->getTemplate('bottombar')->usercpSettings();
        }

Good Luck!

Donald :)

Source: Download: Bottom Bar (Beta 2)