Friday, April 3, 2015

How to Remove "License Key Missing" Warning in ACP New Tutorial 2015

How to Remove "License Key Missing" Warning in ACP New Tutorial 2015, please check and follow...


Go to admin -> skin_cp -> cp_skin_global.php and find:

if( !$this->settings['ipb_reg_number'] )
{
                                $this->lang->words['license_missing_info']              = sprintf( $this->lang->words['license_missing_info'], $this->settings['base_url'] . 'app=core&module=tools&section=licensekey' );
                                $extra_class = 'force_license';
                                $license_html = <<<HTML
                                                                <div id='license_notice_force'>
                                                                                                <h4>{$this->lang->words['license_missing_header']}</h4>
                                                                                                <p>{$this->lang->words['license_missing_info']}</p>
                                                                </div>
HTML;
}
else
{
                                $licenseData    = $this->cache->getCache( 'licenseData' );
                                if( ( !$licenseData OR !$licenseData['key']['_expires'] OR $licenseData['key']['_expires'] < IPS_UNIX_TIME_NOW and $licenseData['key']['_expires'] != -1 ) AND !IPSCookie::get( 'ignore-license-notice' ) )
                                {
                                                                $extra_class = 'expired_license';
                                                                $license_html = <<<HTML
                                                                                                <div id='license_notice_expired'>
                                                                                                                                <div class='right'><a id='license-close' href='#'>Close</a></div>
                                                                                                                                <h4>{$this->lang->words['license_expired_header']}</h4>
                                                                                                                                <p>{$this->lang->words['license_expired_info']}</p>
                                                                                                </div>
HTML;
                                }
}

 and replace it with this:


/*
if( !$this->settings['ipb_reg_number'] )
{
                                $this->lang->words['license_missing_info']              = sprintf( $this->lang->words['license_missing_info'], $this->settings['base_url'] . 'app=core&module=tools&section=licensekey' );
                                $extra_class = 'force_license';
                                $license_html = <<<HTML
                                                                <div id='license_notice_force'>
                                                                                                <h4>{$this->lang->words['license_missing_header']}</h4>
                                                                                                <p>{$this->lang->words['license_missing_info']}</p>
                                                                </div>
HTML;
}
else
{
                                $licenseData    = $this->cache->getCache( 'licenseData' );
                                if( ( !$licenseData OR !$licenseData['key']['_expires'] OR $licenseData['key']['_expires'] < IPS_UNIX_TIME_NOW and $licenseData['key']['_expires'] != -1 ) AND !IPSCookie::get( 'ignore-license-notice' ) )
                                {
                                                                $extra_class = 'expired_license';
                                                                $license_html = <<<HTML
                                                                                                <div id='license_notice_expired'>
                                                                                                                                <div class='right'><a id='license-close' href='#'>Close</a></div>
                                                                                                                                <h4>{$this->lang->words['license_expired_header']}</h4>
                                                                                                                                <p>{$this->lang->words['license_expired_info']}</p>
                                                                                                </div>
HTML;
                                }
}
*/


 Save and go to admin -> applications -> core -> [b]extensions -> dashboardNotifications.php and find:


if( ! $this->settings['ipb_reg_number'] )
  {
   $entries[] = array( $this->lang->words['lc_title_nokey'], sprintf( $this->lang->words['lc_msg_nokey'], "{$this->settings['base_url']}module=tools&section=licensekey" ) );
  }
  else
  {
   /* Is the Spam Service Working?
   if ( $this->settings['spam_service_enabled'] )
   {
                $GOT_SPAM_ERROR = false;
                /* Are we entitled to it?
                $licenseData = $this->cache->getCache( 'licenseData' );
                if ( is_array( $licenseData['ipbMain'] ) && count( $licenseData['ipbMain'] ) )
                {
                 foreach ( $licenseData['ipbMain'] as $data )
                 {
                  if ( $data['name'] == 'Spam Monitoring Service' && $data['status'] != 'Ok' )
                  {
                   $disableLink = $this->settings['base_url'] . "app=core&module=settings&section=settings&do=findsetting&key=spamservice";
                   if ( is_numeric( $data['_expires'] ) && time() > $data['_expires'] )
                   {
                                $entries[] = array( $this->lang->words['spam_service_error'], sprintf( $this->lang->words['spam_service_expired'], $disableLink ) );
                   }
                   else
                   {
                                $entries[] = array( $this->lang->words['spam_service_error'], sprintf( $this->lang->words['spam_service_unavailable'], $disableLink ) );
                   }
                   $GOT_SPAM_ERROR = true;
                   break;
                  }
                 }
                }
                if ( ! $GOT_SPAM_ERROR )
                {
                 /* Get last 5 logs, and if all 5 are errors, show message
                 $_errors = 0;
                 $_entries = 0;
                 $_lastError = '';
                 $this->DB->build( array( 'select' => 'log_code, log_msg', 'from' => 'spam_service_log', 'order' => 'id DESC', 'limit' => 5 ) );
                 $this->DB->execute();
                 while( $_r = $this->DB->fetch() )
                 {
                  $_entries++;
                  if( $_r['log_code'] === '0' )
                  {
                   $_errors++;
                   if( !$_lastError )
                   {
                                $_lastError = $_r['log_msg'];
                   }
                  }
                 }
                 if( $_entries > 0 && $_errors == $_entries )
                 {
                  $entries[] = array( $this->lang->words['spam_service_error'], sprintf( $this->lang->words['spam_service_error_msg'], $_lastError ) );
                 }
                }
   }
   /* If it's disabled, are we entitiled to it?
   else
   {
                $licenseData = $this->cache->getCache( 'licenseData' );
                if ( is_array( $licenseData['ipbMain'] ) && count( $licenseData['ipbMain'] ) )
                {
                 foreach ( $licenseData['ipbMain'] as $data )
                 {
                  if ( $data['name'] == 'Spam Monitoring Service' && $data['status'] == 'Ok' )
                  {
                   $entries[] = array( $this->lang->words['spam_service_disabled'], $this->lang->words['spam_service_disabled_msg'] );
                   break;
                  }
                 }
                }
   }
  }
 and replace with this:


/* if( ! $this->settings['ipb_reg_number'] )
  {
   $entries[] = array( $this->lang->words['lc_title_nokey'], sprintf( $this->lang->words['lc_msg_nokey'], "{$this->settings['base_url']}module=tools&section=licensekey" ) );
  }
  else
  {
   /* Is the Spam Service Working?
   if ( $this->settings['spam_service_enabled'] )
   {
                $GOT_SPAM_ERROR = false;
                /* Are we entitled to it?
                $licenseData = $this->cache->getCache( 'licenseData' );
                if ( is_array( $licenseData['ipbMain'] ) && count( $licenseData['ipbMain'] ) )
                {
                 foreach ( $licenseData['ipbMain'] as $data )
                 {
                  if ( $data['name'] == 'Spam Monitoring Service' && $data['status'] != 'Ok' )
                  {
                   $disableLink = $this->settings['base_url'] . "app=core&module=settings&section=settings&do=findsetting&key=spamservice";
                   if ( is_numeric( $data['_expires'] ) && time() > $data['_expires'] )
                   {
                                $entries[] = array( $this->lang->words['spam_service_error'], sprintf( $this->lang->words['spam_service_expired'], $disableLink ) );
                   }
                   else
                   {
                                $entries[] = array( $this->lang->words['spam_service_error'], sprintf( $this->lang->words['spam_service_unavailable'], $disableLink ) );
                   }
                   $GOT_SPAM_ERROR = true;
                   break;
                  }
                 }
                }
                if ( ! $GOT_SPAM_ERROR )
                {
                 /* Get last 5 logs, and if all 5 are errors, show message
                 $_errors = 0;
                 $_entries = 0;
                 $_lastError = '';
                 $this->DB->build( array( 'select' => 'log_code, log_msg', 'from' => 'spam_service_log', 'order' => 'id DESC', 'limit' => 5 ) );
                 $this->DB->execute();
                 while( $_r = $this->DB->fetch() )
                 {
                  $_entries++;
                  if( $_r['log_code'] === '0' )
                  {
                   $_errors++;
                   if( !$_lastError )
                   {
                                $_lastError = $_r['log_msg'];
                   }
                  }
                 }
                 if( $_entries > 0 && $_errors == $_entries )
                 {
                  $entries[] = array( $this->lang->words['spam_service_error'], sprintf( $this->lang->words['spam_service_error_msg'], $_lastError ) );
                 }
                }
   }
   /* If it's disabled, are we entitiled to it?
   else
   {
                $licenseData = $this->cache->getCache( 'licenseData' );
                if ( is_array( $licenseData['ipbMain'] ) && count( $licenseData['ipbMain'] ) )
                {
                 foreach ( $licenseData['ipbMain'] as $data )
                 {
                  if ( $data['name'] == 'Spam Monitoring Service' && $data['status'] == 'Ok' )
                  {
                   $entries[] = array( $this->lang->words['spam_service_disabled'], $this->lang->words['spam_service_disabled_msg'] );
                   break;
                  }
                 }
                }
   }
  }
  */


 Save and you're done.

In general, this works for 3.2.x, 3.3.x and 3.4.x.

it's there How to Remove "License Key Missing" Warning in ACP New Tutorial 2015, Greetings

[ Tutorial ] How to change the default mobile skin in 3.4.x

How to change the default mobile skin in 3.4.x. If you have installed a new mobile skin on IP.Board and want to make it the default version, as well as updating User agents you also must change the skin key in Admin CP. That option is actually hidden and you have to edit a little to get it to show up.

This is the simplest way I know to change the default forum skin on IP.Board. The skin key is hidden and there's no option to change it from the Admin CP.



FTP into your forum and navigate to admin/applications/core/skin_cp and download the file cp_skin_templates.php

Open this file in an editor (I use Notepad++) and scroll down to line 1401

if ( $skinSet['set_key'] != 'mobile' && $skinSet['set_key'] != 'default' )


change this to

if ( $skinSet['set_key'] != 'nmobile' && $skinSet['set_key'] != 'default' )


Save and close the file and transfer is back via ftp to where you downloaded it from.

In AdminCP select Look & Feel/Manage skins and templates and edit settings for IP.Board Mobile, there should now be a drop down box which says Skin key - mobile, change this to mobile_123 or anything that isn't "mobile" and save the settings. Now go to your new mobile skin and edit settings, in the drop down for Skin Key change this to mobile and save your settings. 

Monday, September 30, 2013

How To Create Your Own Helpers On xenForo

How To Create Your Own Helpers On xenForo. Helpers provide extra functions that you can use inside the XenForo templates.

Currently there are many Helpers, following some them:

  1. avatar -> Helper to fetch the URL of a user's avatar.
  2. username -> Produces a <a href="members/username.123" class="username">Username</a> snippet.
  3. usertitle -> Helper to get the user title for the specified user.
  4. richusername -> Outputs the necessary HTML for a rich username (includes the display style markup class).
  5. ismemberof -> Check if the user is member of a group.
  6. wordtrim -> Word trims and HTML escapes the given string.
  7. autolink -> Auto-links URLs in plain text. This text should generally already be HTML escaped, because it can't be done after the linking.

You can call a helper in the template this way:

{xen:helper NAME_OF_THE_HELPER, 'argument1', 'argument2'}


Step 1 - Begin

As usual let's starting by creating the folder for our add-on, and including a listener (because we need one). This is the final structure:

  • forumroot
  • library
  • SimpleHelper -> Our new folder!
  • Listener.php -> Our new file!
  • XenForo
Ok, once created, open the file Listener.php and add the following code:

<?php//Our class nameclass SimpleHelper_Listener{
    
/**
    * Listen to the "init_dependencies" code event.
    *
    * @param XenForo_Dependencies_Abstract $dependencies
    * @param array $data
    */
    
public static function init(XenForo_Dependencies_Abstract $dependencies, array $data)
    {
        
//Get the static variable $helperCallbacks and add a new item in the array.
        
XenForo_Template_Helper_Core::$helperCallbacks += array(
            
'echo' => array('SimpleHelper_Helpers''helperEcho')
        );
    }
}
?>

What it does?
This function listen to the Code Event Listener init_dependecies. This code event is called when the dependency manager loads its default data. Is fired on virtually every page and is the first thing you can plug into.
The following code get the static $helperCallbacks which has the list of helpers, and merge a new one, the our simple helper.
 
XenForo_Template_Helper_Core::$helperCallbacks += array(
        
'echo' => array('SimpleHelper_Helpers''helperEcho')
);



Notice that the SimpleHelper_Helpers do not exists. We'll creating this class in the next step.

We now need to do two things: create a new add-on and create a new event listener in the AdminCP.



Create the add-on



To create a new add-on, 
  • go to AdminCP
  • Development 
  • Create Add-on and fill with the info:
----------------------------------------------------
  1. Add-on ID: SimpleHelper
  2. Title: Simple Helper
  3. Version String: 1.0.0
  4. Version ID: 1

Then save it.


Create the Event Listener


Go to
AdminCP -> Development -> Code Event Listeners and create a new listener using our function.
  • Listen to Event: init_dependecies
  • Execute Callback Class: SimpleHelper_Listener
  • Execute Callback method: init
  • Description: Add a new custom helper
  • Add-on: Simple helper

Save it!


Step 2 - Core


Now that are all setup, let's create the function that will handle the call to the helper
echo.
Create one more file:

  • forumroot
  • --library
  • ---SimpleHelper
  • -----Helpers.php -> Our new file!
  • -----Listener.php
  • ---XenForo


Open the new file (SimpleHelper/Helpers.php) and put the following code:

 
<?php//Our class helper (we can put any helpers in here we want)class SimpleHelper_Helpers{
    public static function 
helperEcho ($string)
    {
        
//We only return the argument, dont do nothing.
        
return $string;
    }
}
?>



Remember this piece of code in the Listener.php:
 
'echo' => array('SimpleHelper_Helpers''helperEcho')


So, we just have created a class SimpleHelper_Helpers and a function helperEcho.

But as you can see, this helper does nothing! It just take an argument (the first one) and then return as it is.



Step 3 - Testing


Let's test this.


Open the template
forum_view and put this at the top:

{xen:helper echo, 'This is a custon helper! It does nothing!'}



Save.

Go to your forum list, refresh the page and you'll see something like this:



Ok, it works, but how we can make this helper a little more.....helpish?


Step 4 - More functionality



Let's change what this helper do. Open the file
SimpleHelper/Helpers.php and change ourhelperEcho to the following code:

public static function helperEcho ($string$color)
{
    return 
"<font color=$color>$string</font>";
}



Open the forum_list and change the call to this helper to:

{xen:helper echo, 'This is a custon helper! It does nothing!', 'red'}


Refresh the forum list in your forum and see what happens. It will turn all the text red.

So that's it. You can create your own helpers this way. And for sure, you can do a lot more then just echo a string in the red color.

Sunday, September 29, 2013

Skin Metro Premium On IP. Board

Skin Metro Premium On IP. Board. Skin metro is very well known in the IP. Board, Skin elegant, beautifully responsive and can enhance your website or forum well. Skin Metro also includes one premiun skin, this can add to the appeal of your website a more professional and modern. To preview and the info please see my tutorial given below correctly and appropriately.

Preview Demo :

Skin Metro Premium On IP. Board

Attachment

It that Skin Metro Premium On IP. Board, hopefully useful and helpful for you!

 

Skin Xgame On IP. Board

Skin Xgame On IP. Board. Skin Xgame are very responsive and elegant applied on your website, for those who have a website berdominan games, and other applications it is suitable to use this skin. To preview and demo tutorial please see the details that I will give below.


Preview Demo :




Attachment

It that Skin Xgame On IP. Board, hopefully useful and helpful for you!