Jump to content
bbh_blocked_dnftl
Tiberium Technology® Forums

Welcome to Tiberium Technology® Forums

Welcome to Tiberium Technology® Forums, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of Tiberium Technology® Forums by signing in or creating an account.
  • Start new topics and reply to others
  • Subscribe to topics and forums to get email updates
  • Get your own profile page and make new friends
  • Send personal messages to other members.

  • entries
    7
  • comments
    0
  • views
    7800

From: Download: Bottom Bar (Beta 1) - Adding Visibility Feature For Members - Alternate Method #2


Should we install IP.Shoutbox?  

4 members have voted

  1. 1. Should we install IP.Shoutbox?

    • Yes
    • No
      0
    • Maybe...
      0

Here is a little tutorial on how to add a visibility feature for your members in their UserCP.

 

Step 1: Go to ACP -> Support Tab - SQL Toolbox and run the following SQL:

ALTER TABLE ibf_members ADD showbar TINYINT( 1 ) default 1

 

Step 2: Go to ACP -> Look & Feel -> Select Skin (You must use every skin you have)

Create a new template bit called: showBottomBarOff in group: skin_bottombar with the following content:

Also Note That: Once you have created the template bit in ONE skin, every skin has that template bit, you just then need to copy the following into every skin.

<div style="position: fixed;bottom: 0;right: 0;z-index: 9999;margin: 0 1%;background: #e3e2e2 url({style_images_url}/gradient_bg.png) repeat-x 50%;border: 1px solid #c3c3c3;border-bottom: none;">
<form action='{parse url="app=bottombar" base="public"}' method='post' enctype='multipart/form-data' id='postingform' onsubmit='return ValidateForm()' name='REPLIER'>
<input type='hidden' name='module' value='bbarsettings' />
<input type='hidden' name='section' value='settings' />
<input type='hidden' name='cmd' value='showbar' />
<input type='image' value='Show' src='{$this->settings['img_url']}/bottombar/bottombar.png' title='Click To Enable Bottom Bar' />
</form>
</div>

 

Step 3: Open up FTP and go to Forums Dir -> admin -> applications_addon -> other -> bottombar -> sources -> hooks.php

Inside that file, Find:

public function getHookOutput() 
{
	//-----------------------------------------
	// Member only
	//-----------------------------------------

	if ( ! $this->member->getProperty('member_id') )
	{
		return '';
	}

	//-----------------------------------------
	// Something to return
	//-----------------------------------------

	return $this->registry->output->getTemplate('bottombar')->showBottomBar();
}

 

Replace All Function Code With:

public function getHookOutput() 
{
               if ( $this->memberData['member_id'] )
               {
		if ( $this->memberData['showbar'] == 1 )
		{
			//-----------------------------------------
			// Member only
			//-----------------------------------------

			/*if ( ! $this->member->getProperty('member_id') )
			{
				return '';
			}*/

			//-----------------------------------------
			// Something to return
			//-----------------------------------------

			return $this->registry->output->getTemplate('bottombar')->showBottomBar();
		}
		else
		{
			//-----------------------------------------
			// Member only
			//-----------------------------------------

			/*if ( ! $this->member->getProperty('member_id') )
			{
				return '';
			}*/

			//-----------------------------------------
			// Something to return
			//-----------------------------------------

			return $this->registry->output->getTemplate('bottombar')->showBottomBarOff();
		}
               }
               else
               {

               	if ( $this->memberData['member_group_id'] == $this->settings['guest_group'] )
               	{
			//-----------------------------------------
			// Member only
			//-----------------------------------------

			/*if ( ! $this->member->getProperty('member_id') )
			{
				return '';
			}*/

			//-----------------------------------------
			// Something to return
			//-----------------------------------------

			return $this->registry->output->getTemplate('bottombar')->showBottomBar();
               	}
               	else
               	{
			return;
               	}
               }
}

 

Step 4: Go to ACP -> Look & Feel -> Select Skin -> skin_bottombar -> showBottomBar,

Replace whole template bit with (This is Based on the Default Template Bit.):

<if test="$this->memberData['member_id']">
<!--  BEGIN MEMBER BAR  -->
<div style="position: fixed;bottom: 0;right: 0;z-index: 9999;margin: 0 1%;background: #e3e2e2 url({style_images_url}/gradient_bg.png) repeat-x 50%;border: 1px solid #c3c3c3;border-bottom: none;">
<form action='{parse url="app=bottombar" base="public"}' method='post' enctype='multipart/form-data' id='postingform' onsubmit='return ValidateForm()' name='REPLIER'>
<input type='hidden' name='module' value='bbarsettings' />
<input type='hidden' name='section' value='settings' />
<input type='hidden' name='cmd' value='hidebar' />
<input type='image' value='Hide' src='{$this->settings['img_url']}/bottombar/bottombar.png' title='Click To Enable Bottom Bar' />
</form>
</div>
<php>
       $version        = IPSLib::fetchVersionNumber();
       $this->registry->class_localization->loadLanguageFile( array( 'public_lang' ), 'bottombar' );
</php>
<link rel="stylesheet" type="text/css"  href="{$this->settings['public_dir']}style_css/{$this->registry->getClass('output')->skin['_csscacheid']}/bottombar.css" />
<div id="footpanel">
   <ul id="mainpanel">
       <li><a href="{parse url="" base="public"}" class="home">{$this->lang->words['bb_tab_home']} <small>{$this->lang->words['bb_tab_gohome']}</small></a></li>
       <li><a href="{parse url="showuser={$this->memberData['member_id']}" base="public" seotitle="{$this->memberData['members_seo_name']}" template="showuser"}" class="profile">{$this->lang->words['bb_tab_vp']} <small>{$this->lang->words['bb_tab_vp']}</small></a></li>
       <li><a href="{parse url="app=core&module=usercp" base="public"}" class="editprofile">{$this->lang->words['bb_tab_ep']} <small>{$this->lang->words['bb_tab_ep']}</small></a></li>
       <if test="$this->memberData['has_blog'] AND IPSLib::appIsInstalled( 'blog' )">
               <li><a href="{parse url="app=blog&module=display&section=blog&mid={$this->memberData['member_id']}" base="public"}" class="blog">{$this->lang->words['bb_tab_yb']} <small>{$this->lang->words['bb_tab_yb']}</small></a></li>
       </if>
       <if test="$this->memberData['has_gallery'] AND IPSLib::appIsInstalled( 'gallery' )">
               <li><a href="{parse url="app=gallery&module=user&section=user&user={$this->memberData['member_id']}" base="public"}" class="gallery">{$this->lang->words['bb_tab_yg']} <small>{$this->lang->words['bb_tab_yg']}</small></a></li>
       </if>

       <if test="$version['long'] >= 31000">
               <li id="alertpanel">
                       <a href="#" class="alerts" id='alert-link' title='Alerts'>{$this->lang->words['bb_tab_alerts']}</a>
                       <div class="subpanel" style='display:none;'>
                                       <h3><span> – </span>Notifications</h3>
                                       <ul>
                                               <li class="view"><a href="#">View All</a></li>
                                               <li>
                                                       <a href="#" class="delete">X</a>
                                                       <p><!--Content--></p>
                                               </li>
                                               <li>
                                                       <a href="#" class="delete">X</a>
                                                       <p><!--Content--></p>
                                               </li>
                                       </ul>
                               </div>
               </li>
           </if>

       <li id="favoritepanel">
               <a href="#" class="favorites" id='favorites-link' title='{$this->lang->words['bb_tab_favs']}'>{$this->lang->words['bb_tab_favs']}</a>
               <div class="subpanel" style='display:none;'>
                               <h3><span> – </span>{$this->lang->words['bb_bookmarks']}</h3>
                               <ul id='favorites-bb'>
                                       <li class="view"><a href="#" id='add-favorite-link'>{parse replacement="approve"} {$this->lang->words['bb_addpage']}</a></li>
                               </ul>
                       </div>
       </li>
       <li id="friendpanel">
               <a href="#" class="friends" id='friends-link' title='{$this->lang->words['bb_tab_friends']}'>{$this->lang->words['bb_tab_friends']}</a>
               <div class="subpanel" style='display:none;'>
                               <h3><span> – </span>{$this->lang->words['bb_tab_friends']}</h3>
                               <if test="is_array($this->memberData['_cache']['friends']) AND count($this->memberData['_cache']['friends'])">
                                       <php>
                                               $friends        = array();
                                               $mIds                = array_keys( $this->memberData['_cache']['friends'] );
                                               $friends        = IPSMember::load( $mIds );
                                               $onlineF        = array();
                                               $offlineF        = array();
                                               if( is_array($friends) AND count($friends) )
                                               {
                                                       foreach( $friends as $k => $v )
                                                       {
                                                               $member = IPSMember::buildDisplayData( $v );

                                                               if( $member['_online'] )
                                                               {
                                                                       $onlineF[]        = $member;
                                                               }
                                                               else
                                                               {
                                                                       $offlineF[]        = $member;
                                                               }
                                                       }
                                               }

                                               $this->friends        = array_merge( $onlineF, $offlineF );
                                       </php>
                               <ul>
                                   <li class='view'><a href='{parse url="app=members&module=profile&section=friends&do=list" base="public"}'>{$this->lang->words['bb_friendlist']}</a></li>
                                   <foreach loop="$this->friends as $member">
                                           <li class='friend'>
                                                   <div class="online-indicator">
                                                           <img src='{$this->settings['img_url']}/bottombar/<if test="$member['_online']">online.png<else />offline.png</if>' alt='<if test="$member['_online']">online<else />offline</if>' title='<if test="$member['_online']">{$this->lang->words['bb_useronline']}<else />{$this->lang->words['bb_useroffline']}</if>' />
                                                   </div>
                                                   <a href="{parse url="showuser={$member['member_id']}" base="public" seotitle="{$member['members_seo_name']}" template="showuser"}"><img src='{$member['pp_mini_photo']}' alt="{$member['members_display_name']}{$this->lang->words['users_photo']}" width='{$member['pp_mini_width']}' height='{$member['pp_mini_height']}' class='photo' /> {$member['members_display_name']}</a>
                                           </li>
                                   </foreach>
                               </ul>
                               <else />
                                       <p class='center'><a href='{parse url="app=members" base="public"}'><em>{$this->lang->words['bb_ff']}</em></a></p>
                               </if>
                       </div>
       </li>
       <li id="pmpanel">
               <a href="#" class="pms" id='pm-link' title='{$this->memberData['msg_count_new']}{$this->lang->words['pc_suffix']}'>{$this->lang->words['bb_tab_inbox']} (<strong>{$this->memberData['msg_count_new']} {$this->lang->words['bb_pc_new']}</strong>)</a>
               <div class="subpanel" style='display:none;'>
                               <h3><span> – </span>{$this->lang->words['bb_tab_pct']}</h3>
                               <ul id='private-message-list-bb'>
                                       <li class="view"><a href="{parse url="app=members&module=messaging" base="public"}">{$this->lang->words['bb_viewall']}</a></li>
                               </ul>
                       </div>
       </li>
   </ul>
</div>
<script type='text/javascript' src='{$this->settings['public_dir']}js/bottombar.js'></script>
<script type='text/javascript'>
var bbzfavs        = "{$this->lang->words['bb_zfavs']}";
</script>
<!--  END MEMBER BAR  -->
<else />
<!-- BEGIN GUEST BAR -->
<php>
       $version        = IPSLib::fetchVersionNumber();
       $this->registry->class_localization->loadLanguageFile( array( 'public_lang' ), 'bottombar' );
</php>
<link rel="stylesheet" type="text/css"  href="{$this->settings['public_dir']}style_css/{$this->registry->getClass('output')->skin['_csscacheid']}/bottombar.css" />
<div id="footpanel">
   <ul id="mainpanel">
       <li><a href="{parse url="" base="public"}" class="home">{$this->lang->words['bb_tab_home']} <small>{$this->lang->words['bb_tab_gohome']}</small></a></li>
<if test="$this->memberData['member_id']">
<!-- BEGIN MEMBER STUFF -->
       <li><a href="{parse url="showuser={$this->memberData['member_id']}" base="public" seotitle="{$this->memberData['members_seo_name']}" template="showuser"}" class="profile">{$this->lang->words['bb_tab_vp']} <small>{$this->lang->words['bb_tab_vp']}</small></a></li>
       <li><a href="{parse url="app=core&module=usercp" base="public"}" class="editprofile">{$this->lang->words['bb_tab_ep']} <small>{$this->lang->words['bb_tab_ep']}</small></a></li>
<!--  END MEMBER STUFF  -->
</if>
       <if test="$this->memberData['has_blog'] AND IPSLib::appIsInstalled( 'blog' )">
               <li><a href="{parse url="app=blog&module=display&section=blog&mid={$this->memberData['member_id']}" base="public"}" class="blog">{$this->lang->words['bb_tab_yb']} <small>{$this->lang->words['bb_tab_yb']}</small></a></li>
       </if>
       <if test="$this->memberData['has_gallery'] AND IPSLib::appIsInstalled( 'gallery' )">
               <li><a href="{parse url="app=gallery&module=user&section=user&user={$this->memberData['member_id']}" base="public"}" class="gallery">{$this->lang->words['bb_tab_yg']} <small>{$this->lang->words['bb_tab_yg']}</small></a></li>
       </if>

<if test="$this->memberData['member_id']">
<!-- BEGIN MEMBER STUFF -->
       <if test="$version['long'] >= 31000">
               <li id="alertpanel">
                       <a href="#" class="alerts" id='alert-link' title='Alerts'>{$this->lang->words['bb_tab_alerts']}</a>
                       <div class="subpanel" style='display:none;'>
                                       <h3><span> – </span>Notifications</h3>
                                       <ul>
                                               <li class="view"><a href="#">View All</a></li>
                                               <li>
                                                       <a href="#" class="delete">X</a>
                                                       <p><!--Content--></p>
                                               </li>
                                               <li>
                                                       <a href="#" class="delete">X</a>
                                                       <p><!--Content--></p>
                                               </li>
                                       </ul>
                               </div>
               </li>
           </if>

       <li id="favoritepanel">
               <a href="#" class="favorites" id='favorites-link' title='{$this->lang->words['bb_tab_favs']}'>{$this->lang->words['bb_tab_favs']}</a>
               <div class="subpanel" style='display:none;'>
                               <h3><span> – </span>{$this->lang->words['bb_bookmarks']}</h3>
                               <ul id='favorites-bb'>
                                       <li class="view"><a href="#" id='add-favorite-link'>{parse replacement="approve"} {$this->lang->words['bb_addpage']}</a></li>
                               </ul>
                       </div>
       </li>
       <li id="friendpanel">
               <a href="#" class="friends" id='friends-link' title='{$this->lang->words['bb_tab_friends']}'>{$this->lang->words['bb_tab_friends']}</a>
               <div class="subpanel" style='display:none;'>
                               <h3><span> – </span>{$this->lang->words['bb_tab_friends']}</h3>
                               <if test="is_array($this->memberData['_cache']['friends']) AND count($this->memberData['_cache']['friends'])">
                                       <php>
                                               $friends        = array();
                                               $mIds                = array_keys( $this->memberData['_cache']['friends'] );
                                               $friends        = IPSMember::load( $mIds );
                                               $onlineF        = array();
                                               $offlineF        = array();
                                               if( is_array($friends) AND count($friends) )
                                               {
                                                       foreach( $friends as $k => $v )
                                                       {
                                                               $member = IPSMember::buildDisplayData( $v );

                                                               if( $member['_online'] )
                                                               {
                                                                       $onlineF[]        = $member;
                                                               }
                                                               else
                                                               {
                                                                       $offlineF[]        = $member;
                                                               }
                                                       }
                                               }

                                               $this->friends        = array_merge( $onlineF, $offlineF );
                                       </php>
                               <ul>
                                   <li class='view'><a href='{parse url="app=members&module=profile&section=friends&do=list" base="public"}'>{$this->lang->words['bb_friendlist']}</a></li>
                                   <foreach loop="$this->friends as $member">
                                           <li class='friend'>
                                                   <div class="online-indicator">
                                                           <img src='{$this->settings['img_url']}/bottombar/<if test="$member['_online']">online.png<else />offline.png</if>' alt='<if test="$member['_online']">online<else />offline</if>' title='<if test="$member['_online']">{$this->lang->words['bb_useronline']}<else />{$this->lang->words['bb_useroffline']}</if>' />
                                                   </div>
                                                   <a href="{parse url="showuser={$member['member_id']}" base="public" seotitle="{$member['members_seo_name']}" template="showuser"}"><img src='{$member['pp_mini_photo']}' alt="{$member['members_display_name']}{$this->lang->words['users_photo']}" width='{$member['pp_mini_width']}' height='{$member['pp_mini_height']}' class='photo' /> {$member['members_display_name']}</a>
                                           </li>
                                   </foreach>
                               </ul>
                               <else />
                                       <p class='center'><a href='{parse url="app=members" base="public"}'><em>{$this->lang->words['bb_ff']}</em></a></p>
                               </if>
                       </div>
       </li>
       <li id="pmpanel">
               <a href="#" class="pms" id='pm-link' title='{$this->memberData['msg_count_new']}{$this->lang->words['pc_suffix']}'>{$this->lang->words['bb_tab_inbox']} (<strong>{$this->memberData['msg_count_new']} {$this->lang->words['bb_pc_new']}</strong>)</a>
               <div class="subpanel" style='display:none;'>
                               <h3><span> – </span>{$this->lang->words['bb_tab_pct']}</h3>
                               <ul id='private-message-list-bb'>
                                       <li class="view"><a href="{parse url="app=members&module=messaging" base="public"}">{$this->lang->words['bb_viewall']}</a></li>
                               </ul>
                       </div>
       </li>
<!--  END MEMBER STUFF  -->
</if>
   </ul>
</div>
<script type='text/javascript' src='{$this->settings['public_dir']}js/bottombar.js'></script>
<script type='text/javascript'>
var bbzfavs        = "{$this->lang->words['bb_zfavs']}";
</script>
<!--  END GUEST BAR  -->
</if>

 

Step 5: Open up FTP and go to Forums Dir -> public -> style_images -> YOUR_SKIN_DIR,

Save this Image into YOUR_SKIN_DIR -> bottombar http://forums.tiberiumstudios.net/public/style_images/master/bottombar/bottombar.png (This image comes with the mod by default and is located in admin -> applications_addon -> other -> bottombar -> skin_cp -> appIcon.png)

 

Step 6: Open up FTP and go to Forums Dir -> admin -> applications_addon -> other -> bottombar -> modules_public,

Create a new folder called: bbarsettings, then create three(3) files called: defaultSection.php, settings.php and a BLANK index.html file

 

Step 7: Copy the following content into defaultSection.php and save:

<?php

if ( ! defined( 'IN_IPB' ) )
{
       print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
       exit();
}

$DEFAULT_SECTION = 'settings';

 

Step 8: Copy the following in to settings.php

<?php

if ( ! defined( 'IN_IPB' ) )
{
       print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
       exit();
}

class public_bottombar_bbarsettings_settings extends ipsCommand
{
       /**
        * Main class entry point
        *
        * @access        public
        * @param        object                ipsRegistry reference
        * @return        void                [Outputs to screen]
        */
       public function doExecute( ipsRegistry $registry )
       {
               //-----------------------------------------
               // What to do?
               //-----------------------------------------

               switch($this->request['cmd'])
               {

               //-----------------------------------------
                       case 'showbar':
                               $this->showBar();
                               break;
                       case 'hidebar':
                               $this->hideBar();
                               break;
               }
       }

       /**
        * Show The Bottom Bar
        *
        * @access        public
        * @author        Matt Mecham
        * @return        string                Processed HTML
        */
       public function showBar()
       {
               if( $this->request['referer'] )
               {
                       $http_referrer        = $this->request['referer'];
               }
               else if ( !my_getenv('HTTP_REFERER') OR stripos( my_getenv('HTTP_REFERER'), $this->settings['board_url'] ) === false )
               {
                       $http_referrer = ( strtolower($_SERVER['HTTPS']) == 'on' ? "https://" : "http://" ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
               }
               else
               {
                       $http_referrer = my_getenv('HTTP_REFERER');
               }
               $showbar = 1;
               $this->DB->update( 'members',  array('showbar'  => $showbar ), "member_id=".$this->memberData['member_id']);
               $this->registry->output->redirectScreen( 'Bottom Bar Visibility Toggled (Showing)', $http_referrer  );
       }

       /**
        * Hide The Bottom Bar
        *
        * @access        public
        * @author        Matt Mecham
        * @return        string                Processed HTML
        */
       public function hideBar()
       {
               if( $this->request['referer'] )
               {
                       $http_referrer        = $this->request['referer'];
               }
               else if ( !my_getenv('HTTP_REFERER') OR stripos( my_getenv('HTTP_REFERER'), $this->settings['board_url'] ) === false )
               {
                       $http_referrer = ( strtolower($_SERVER['HTTPS']) == 'on' ? "https://" : "http://" ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
               }
               else
               {
                       $http_referrer = my_getenv('HTTP_REFERER');
               }
               $showbar = 0;
               $this->DB->update( 'members',  array('showbar'  => $showbar ), "member_id=".$this->memberData['member_id']);
               $this->registry->output->redirectScreen( 'Bottom Bar Visibility Toggled (Hiding)', $http_referrer  );
       }
}

 

Step 9: Go to Your UserCP and test the function to see if it is working. If so, you're done with the tutorial and have successfully installed a Member Visibility feature for Bottom Bar Beta 1.

 

http://videos.tiberiumstudios.net/bottom-bar-visibility/bottom-bar-visibility-method-2.htm (Video dimensions: 1600x900 HD)

 

Good Luck!

Donald

 

Source: Download: Bottom Bar (Beta 1)

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Guidelines, & Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.