National Flags on Board 2.1.0 RC2

Post Reply

Topic author
bennybernaer
Active Member
Posts: 7
Joined: 6. November 2012 14:17
phpBB.de User: /
phpBB.com User: bennybernaer

National Flags on Board 2.1.0 RC2

Post by bennybernaer »

Your Portal Version: 2.1.0 RC2
Your phpBB Type: other phpBB Distribution
MODs installed: No
Your knowledge: Beginner

What have you done before the problem was there?


What have you already tryed to solve the problem?


Description and Message
How to get the national flags extension instead of on the forum index on the portal?
Who can give me this explain step by step?
Thanks!

www.proanamia.nl

Topic author
bennybernaer
Active Member
Posts: 7
Joined: 6. November 2012 14:17
phpBB.de User: /
phpBB.com User: bennybernaer

Re: National Flags on Board 2.1.0 RC2

Post by bennybernaer »

I would like the flags block down to move to the portal. I added the following changes, but unfortunately does not work. What am I doing wrong and how to get it working properly?

ext\board3\portal\styles\prosilver\template\portal\modules
[c]flags_center.htm[/c]

Code: Select all

{$C_BLOCK_H_L}{$TITLE}{$C_BLOCK_H_R}
<div class="panel bg1 portal-no-margin" id="flags">
   <ul class="topiclist bg1">
      <li class="header">
         <dl>
            <dt><div class="list-inner"><!-- IF U_FLAGS --><a href="{U_FLAGS}"><!-- ENDIF -->{L_NATIONAL_FLAGS}<!-- IF U_FLAGS --></a><!-- ENDIF --></div></dt>
         </dl>
      </li>
   </ul>
   <ul class="flags">
   <!-- BEGIN flag -->
      <li class="bg1">
         <a href="{flag.U_FLAG}">{flag.FLAG}</a><br />{flag.L_FLAG_USERS}
      </li>
   <!-- END flag -->
   </ul>
</div>
{$C_BLOCK_F_L}{$C_BLOCK_F_R}

[c]flags.php[/c]

Code: Select all

<?php
/**
*
* @package Board3 Portal v2 - National flags
* @copyright (c) Board3 Group ( www.board3.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

namespace board3\portal\modules;

/**
* @package National flags
*/
class portal_flags extends module_base
{
   /**
   * Allowed columns: Just sum up your options (Exp: left + right = 10)
   * top      1
   * left      2
   * center   4
   * right      8
   * bottom   16
   */
   public $columns = 21;

   /**
   * Default modulename
   */
   public $name = 'PORTAL_FLAGS';

   /**
   * Default module-image:
   * file must be in "{T_THEME_PATH}/images/portal/"
   */
   public $image_src = 'portal_custom.png';

   /**
   * module-language file
   * file must be in "language/{$user->lang}/mods/portal/"
   */
   public $language = 'portal_flags_module';
   
   /**
   * custom acp template
   * file must be in "adm/style/portal/"
   * public $custom_acp_tpl = 'acp_portal_';
   */
   
   /** @var \phpbb\config\config */
   protected $config;

   /** @var \phpbb\template */
   protected $template;

   /** @var string PHP file extension */
   protected $php_ext;

   /** @var string phpBB root path */
   protected $phpbb_root_path;


   /**
   * Construct object
   *
   * @param \phpbb\config\config $config phpBB config
   * @param \phpbb\request\request $request phpBB request
   * @param \phpbb\template $template phpBB template
   * @param \phpbb\user $user phpBB user
   * @param string $phpbb_root_path phpBB root path
   * @param string $phpEx php file extension
   */
   public function __construct($config, $phpEx, $phpbb_root_path)
   {
      $this->config = $config;
      $this->template = $template;
      $this->phpbb_root_path = $phpbb_root_path;
      $this->php_ext = $phpEx;
   }
   /**
   * {@inheritdoc}
   */
   public function get_template_center($module_id)
   {
      $portal_config = obtain_portal_config();

//Begin: National_Flag
if (!empty($config['allow_flags']))
{
   if (!function_exists('top_flags'))
   {
      include($phpbb_root_path . 'ext/rmcgirr83/nationalflags/functions_nationalflags.php.' . $phpEx);
   }
   top_flags();
}
//End: National_Flag
return 'flags_center.html';
}   
public function get_template_acp($module_id)
   {
      return array(
         'title'   => 'PORTAL_FLAGS',
         'vars'   => array(
         'legend1'                            => 'ACP_FLAG_SETTINGS',
         )
      );
   }
   
   /**
   * {@inheritdoc}
   */
    public function install($module_id)
    {
        return true;
    }

   /**
   * {@inheritdoc}
   */

    public function uninstall($module_id)
    {
       return true;
    }
                     
}
[c]portal_flags_module.php[/c]

Code: Select all

<?php
/**
*
* [Dutch] translated by Dutch Translators (https://github.com/dutch-translators)
* @package Board3 Portal v2.1 - national flags
* @copyright (c) 2013 Board3 Group ( www.board3.de )
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
   exit;
}
if (empty($lang) || !is_array($lang))
{
   $lang = array();
}
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
$lang = array_merge($lang, array(
   'PORTAL_FLAGS'  => 'National flags',
));
User avatar

Kirk
Dev
Posts: 1956
Joined: 27. July 2010 18:02
phpBB.de User: Kirk
Contact:

Re: National Flags on Board 2.1.0 RC2

Post by Kirk »

Gruß Udo

Theriddler
Active Member
Posts: 11
Joined: 25. August 2011 14:24

Re: National Flags on Board 2.1.0 RC2

Post by Theriddler »

Hi Benny

I've just finished a module for national flags for board 3 portal.

You can download it here: https://www.phpbbservice.nl/forum/viewt ... 168#p76168
Post Reply

Return to “Modification Requests”