4en3rgY Romania
 ICON-URI LA LEGENDA 2z8bv910
Welcome To 4EN3RGY Romania
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. If you already have an account, login here - otherwise create an account for free today!

4en3rgY Romania


Nu sunteti conectat. Conectați-vă sau înregistrați-vă

ICON-URI LA LEGENDA

Vezi subiectul anterior Vezi subiectul urmator In jos  Mesaj [Pagina 1 din 1]

1 ICON-URI LA LEGENDA Empty ICON-URI LA LEGENDA Mier 22 Aug 2012, 16:06

randunEL.

randunEL.Membru

[size=150]ATENTIE!!! FACETI BACK-UP IN CAZUL IN CARE NU MERGE CEVA SI VA VA DA O EROARE SA PUTETI SA REFACETI FORUMUL ... EU L-AM TESTAT SI MERGE....PENTRU INCEPATORI MAI BINE SALVATI-VA FISIERELE INAINTE DE A INCEPE MODIFICARILE.[/size]


Descriere: Acest tutorial va poate ajuta sa va puneti icon-uri la legenda.
Autor: nedka
Tradus in limba romana de: eXcuSe Me ;x

Download : CLICK !

Fisiere de editat:


Cod:
index.php,
    viewonline.php,
    adm/style/acp_groups.html,
    includes/cache.php,
    includes/functions_content.php,
    includes/functions_display.php,
    includes/functions_user.php,
    includes/acp/acp_board.php,
    includes/acp/acp_groups.php,
    includes/ucp/ucp_groups.php,
    language/en/common.php,
    language/en/acp/common.php,
    styles/prosilver/template/ucp_groups_manage.html,
    styles/subsilver2/template/ucp_groups_manage.html


Fisiere de urcat:


Cod:
root/images/group_icons/
Urcati in Images.



Inserati in SQL:


Cod:
INSERT INTO phpbb_config (config_name, config_value) VALUES ('group_icons_path', 'images/group_icons');
ALTER TABLE phpbb_users ADD user_icon varchar(255) DEFAULT '' NOT NULL;
ALTER TABLE phpbb_groups ADD group_icon varchar(255) DEFAULT '' NOT NULL;


Deschideti index.php si cautati:


Cod:
$sql = 'SELECT group_id, group_name, group_colour, group_type


Dupa group_name, adaugati group_icon,

Cautati:

Cod:
$sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type


Dupa g.group_name, adaugati g.group_icon,

Cautati:

Cod:
$group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];


Dupa adaugati:

Cod:
$group_icon = (!empty($row['group_icon'])) ? '<img style="vertical-align: middle;" src="' . $phpbb_root_path . $config['group_icons_path'] . '/' . $row['group_icon'] . '" alt="' . $group_name . '" title="' . $group_name . '" /> ' : '';


Cautati:


Cod:
$legend[] = '<span' . $colour_text . '>' . $group_name . '</span>';

Dupa $legend[] = adaugati $group_icon.


Cautati:


Cod:
$legend[] = '<a' . $colour_text . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . $group_name . '</a>';


Dupa $legend[] = adaugati $group_icon.


Deschideti viewonline.php si cautati:

Cod:
// Grab group details for legend display
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
{
  $sql = 'SELECT group_id, group_name, group_colour, group_type
      FROM ' . GROUPS_TABLE . '
      WHERE group_legend = 1
      ORDER BY group_name ASC';
}
else
{
  $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type
      FROM ' . GROUPS_TABLE . ' g
      LEFT JOIN ' . USER_GROUP_TABLE . ' ug
        ON (
            g.group_id = ug.group_id
            AND ug.user_id = ' . $user->data['user_id'] . '
            AND ug.user_pending = 0
        )
      WHERE g.group_legend = 1
        AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')
      ORDER BY g.group_name ASC';
}
$result = $db->sql_query($sql);

$legend = '';
while ($row = $db->sql_fetchrow($result))
{
  if ($row['group_name'] == 'BOTS')
  {
      $legend .= (($legend != '') ? ', ' : '') . '<span style="color:#' . $row['group_colour'] . '">' . $user->lang['G_BOTS'] . '</span>';
  }
  else
  {
      $legend .= (($legend != '') ? ', ' : '') . '<a style="color:#' . $row['group_colour'] . '" href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
  }
}
$db->sql_freeresult($result);


Inlocuiti cu:



Cod:
// Grab group details for legend display
if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
{
  $sql = 'SELECT group_id, group_name, group_icon, group_colour, group_type
      FROM ' . GROUPS_TABLE . '
      WHERE group_legend = 1
      ORDER BY group_name ASC';
}
else
{
  $sql = 'SELECT g.group_id, g.group_name, g.group_icon, g.group_colour, g.group_type
      FROM ' . GROUPS_TABLE . ' g
      LEFT JOIN ' . USER_GROUP_TABLE . ' ug
        ON (
            g.group_id = ug.group_id
            AND ug.user_id = ' . $user->data['user_id'] . '
            AND ug.user_pending = 0
        )
      WHERE g.group_legend = 1
        AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')
      ORDER BY g.group_name ASC';
}
$result = $db->sql_query($sql);

$legend = array();
while ($row = $db->sql_fetchrow($result))
{
  $colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : '';
  $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
  $group_icon = (!empty($row['group_icon'])) ? '<img style="vertical-align: middle;" src="' . $phpbb_root_path . $config['group_icons_path'] . '/' . $row['group_icon'] . '" alt="' . $group_name . '" title="' . $group_name . '" /> ' : '';

  if ($row['group_name'] == 'BOTS' || ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')))
  {
      $legend[] = $group_icon . '<span' . $colour_text . '>' . $group_name . '</span>';
  }
  else
  {
      $legend[] = $group_icon . '<a' . $colour_text . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . $group_name . '</a>';
  }
}
$db->sql_freeresult($result);

$legend = implode(', ', $legend);


Deschideti adm/style/acp_groups.html si cautati:


Cod:
<!-- IF S_EDIT -->


Dupa adaugati:


Cod:
<script type="text/javascript">
// <![CDATA[
  function update_group_icon(newicon)
  {
      document.getElementById('icon_group').src = (newicon) ? "{GROUP_ICONS_PATH}/" + encodeURI(newicon) : "./images/spacer.gif";
  }
// ]]></script>


Cautati:


Cod:
<dl>
      <dt><label for="group_rank">{L_GROUP_RANK}:</label></dt>
      <dd><select name="group_rank" id="group_rank">{S_RANK_OPTIONS}</select></dd>
  </dl>


Inainte adaugati:


Cod:
<dl>
      <dt><label for="group_icon">{L_GROUP_ICON}:</label></dt>
      <dd><select name="group_icon" id="group_icon" onchange="update_group_icon(this.options[selectedIndex].value);">{S_FILENAME_LIST}</select> <img style="vertical-align: middle;" src="{GROUP_ICON}" id="icon_group" alt="" title="" /></dd>
  </dl>



Deschideti includes/cache.php si cautati:


Cod:
/**
  * Obtain ranks
  */
  function obtain_ranks()


Inainte adaugam:

Cod:
/**
  * Obtain group icons
  */
  function obtain_group_icons()
  {
      if (($group_icons = $this->get('_group_icons')) === false)
      {
        global $db, $user;

        $sql = 'SELECT g.group_id, g.group_name, g.group_icon, g.group_type, u.user_id
            FROM ' . GROUPS_TABLE . ' g
            LEFT JOIN ' . USERS_TABLE . ' u
              ON (g.group_id = u.group_id)';
        $result = $db->sql_query($sql);

        $group_icons = array();
        while ($row = $db->sql_fetchrow($result))
        {
                if (!empty($row['group_icon'])){
                    $group_icons[$row['user_id']] = array(
                        'empty'    => false,
                        'name'    => $row['group_name'],
                        'icon'    => $row['group_icon']
                    );
                }else{
                    $group_icons[$row['user_id']] = array(
                        'empty'    => true
                        );
                }
        }
        $db->sql_freeresult($result);

        $this->put('_group_icons', $group_icons);
      }

      return $group_icons;
  }



Deschideti includes/functions_content.php si cautati:


Cod:
function get_username_string($mode, $user_id, $username, $username_colour = '', $guest_username = false, $custom_profile_url = false)
{
  static $_profile_cache;

  // We cache some common variables we need within this function
  if (empty($_profile_cache))
  {
      global $phpbb_root_path, $phpEx;

      $_profile_cache['base_url'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u={USER_ID}');
      $_profile_cache['tpl_noprofile'] = '{USERNAME}';
      $_profile_cache['tpl_noprofile_colour'] = '<span style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</span>';
      $_profile_cache['tpl_profile'] = '<a href="{PROFILE_URL}">{USERNAME}</a>';
      $_profile_cache['tpl_profile_colour'] = '<a href="{PROFILE_URL}" style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</a>';
  }

  global $user, $auth;



Stergeti ; de la $auth; iar dupa adaugam , $config, $group_icons, $phpbb_root_path,


Cautati:

Cod:
// Build correct username colour
        $username_colour = ($username_colour) ? '#' . $username_colour : '';

Inainte adaugam:

Cod:
// Get the group icon if available
  if (empty($group_icons))
  {
      global $cache;
      $group_icons = $cache->obtain_group_icons();
  }

  // Display the group icon with group name as legend
  if (isset($group_icons[$user_id]))
  {
      if(!$group_icons[$user_id]['empty']){
        $group_name = (!empty($user->lang['G_' . $group_icons[$user_id]['name']])) ? $user->lang['G_' . $group_icons[$user_id]['name']] : $group_icons[$user_id]['name'];
        $group_icon = $group_icons[$user_id]['icon'];
        $group_info = '<img style="vertical-align: middle;" src="' . $phpbb_root_path . $config['group_icons_path'] . '/' . $group_icon . '" title="' . $group_name . '" /> ';//'" alt="' . $group_name .
      }else    $group_info='';
               
  }else{
      global $cache;
      $cache->destroy('_group_icons');
      $group_icons = $cache->obtain_group_icons();
      $group_info='';
  }


Cautati:


Cod:
return str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_noprofile'] : $_profile_cache['tpl_noprofile_colour']);


Inainte de str_replace adaugati $group_info.


Cautati:


Cod:
return str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_profile'] : $_profile_cache['tpl_profile_colour']);


Inainte de str_replace adaugati $group_info.


Deschideti includes/functions_display.php si cautati:

Cod:
'SELECT'  => 'm.*, u.user_colour, g.group_colour, g.group_type',


Dupa g.group_type', adaugati g.group_icon,


Cautati:


Cod:
$group_name = (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']);


Dupa adaugati:

Cod:
$group_icon = (!empty($row['group_icon'])) ? '<img style="vertical-align: middle;" src="' . $phpbb_root_path . $config['group_icons_path'] . '/' . $row['group_icon'] . '" alt="' . $group_name . '" title="' . $group_name . '" /> ' : '';


Cautati:

Cod:
$forum_moderators[$f_id][] = '<span' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . '>' . $group_name . '</span>';


Dupa $forum_moderators[$f_id][] = adaugam $group_icon.


Cautati:

Cod:
$forum_moderators[$f_id][] = '<a' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . $group_name . '</a>';


Dupa $forum_moderators[$f_id][] = adaugati $group_icon.


Deschideti includes/functions_user.php si cautati:


Cod:
'group_rank'        => 'int',


Inainte adaugati:


Cod:
'group_icon'        => 'string',


Cautati:

Cod:
$user_attribute_ary = array(


Inlocuiti cu:

Cod:
$user_attribute_ary = array('group_icon',


Deschideti includes/acp/acp_board.php si cautati:

Cod:
'ranks_path'        => array('lang' => 'RANKS_PATH',      'validate' => 'rpath',  'type' => 'text:20:255', 'explain' => true),


Dupa adaugati:

Cod:
'group_icons_path'      => array('lang' => 'GROUP_ICONS_PATH',  'validate' => 'rpath',  'type' => 'text:20:255', 'explain' => true),


Deschideti includes/acp/acp_groups.php si cautati:

Cod:
'rank'            => request_var('group_rank', 0),


Inainte adaugati:

Cod:
'icon'            => request_var('group_icon', ''),


Cautati:

Cod:
if ((isset($submit_ary['avatar']) && $submit_ary['avatar'] && (!isset($group_row['group_avatar']))) || $delete)
              {
                  if (isset($group_row['group_avatar']) && $group_row['group_avatar'])
                  {
                    avatar_delete('group', $group_row, true);
                  }
              }


Dupa adaugati:


Cod:
if (isset($submit_ary['icon']) && $submit_ary['icon'] != $group_row['group_icon'])
{
$cache->destroy('_group_icons');
}



Cautati:


Cod:
$test_variables = array(



Dupa adaugati:

Cod:
[code]'icon'        => 'string',[/code]


Cautati:

Cod:
$group_rank = $submit_ary['rank'];


Inainte adaugati:

Cod:
$group_icon = $submit_ary['icon'];


Cautati:

Cod:
$group_rank = 0;


Inainte adaugati:

Cod:
$group_icon = '';


Cautati:

Cod:
$group_rank = $group_row['group_rank'];


Inainte adaugati:

Cod:
$group_icon = $group_row['group_icon'];


Cautati:


Cod:
$sql = 'SELECT *
              FROM ' . RANKS_TABLE . '
              WHERE rank_special = 1
              ORDER BY rank_title';
            $result = $db->sql_query($sql);


Inainte adaugati:

Cod:
if (strlen($img) > 255)
                    {
                        continue;
                    }

                    $filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>';
                  }
              }
            }

            $filename_list = '<option value=""' . (($edit_img == '') ? ' selected="selected"' : '') . '>' . $user->lang['SELECT_GROUP_ICON'] . '</option>' . $filename_list;
            unset($existing_imgs, $imglist);


Cautati:

Cod:
'S_RANK_OPTIONS'      => $rank_options,


Inainte adaugati:

Cod:
'GROUP_ICONS_PATH'  => $phpbb_root_path . $config['group_icons_path'],
              'GROUP_ICON'      => ($edit_img) ? $phpbb_root_path . $config['group_icons_path'] . '/' . $edit_img : $phpbb_admin_path . 'images/spacer.gif',
              'S_FILENAME_LIST'  => $filename_list,



Deschideti includes/ucp/ucp_groups.php si cautati:

Cod:
'rank'        => request_var('group_rank', 0),


Inainte adaugati:


Cod:
'icon'        => request_var('group_icon', ''),


Cautati:


Cod:
if ((isset($submit_ary['avatar']) && $submit_ary['avatar'] && (!isset($group_row['group_avatar']))) || $delete)
                    {
                        if (isset($group_row['group_avatar']) && $group_row['group_avatar'])
                        {
                          avatar_delete('group', $group_row, true);
                        }
                    }

Dupa adaugati:


Cod:
if (isset($submit_ary['icon']) && $submit_ary['icon'] != $group_row['group_icon'])
                    {
                        $cache->destroy('_group_icons');
                    }


Cautati:

Cod:
$test_variables = array(


Dupa adaugam:

Cod:
'icon'        => 'string',


Cautati:

Cod:
$group_rank = $submit_ary['rank'];


Inainte adaugam:

Cod:
$group_icon = $submit_ary['icon'];


Cautati:


Cod:
$group_rank = 0;


Inainte adaugati:


Cod:
$group_icon = '';


Cautati:

Cod:
$group_rank = $group_row['group_rank'];



Inainte adaugati:

Cod:
$group_icon = $group_row['group_icon'];


Cautati:

Cod:
$sql = 'SELECT *
                    FROM ' . RANKS_TABLE . '
                    WHERE rank_special = 1
                    ORDER BY rank_title';
                  $result = $db->sql_query($sql);


Inainte adaugati:


Cod:
// Select a group icon
                  include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);

                  $icons = $existing_imgs = array();

                  $sql = 'SELECT *
                    FROM ' . GROUPS_TABLE . '
                    ORDER BY group_icon';
                  $result = $db->sql_query($sql);

                  while ($row = $db->sql_fetchrow($result))
                  {
                    $existing_imgs[] = $row['group_icon'];

                    if ($action == 'edit' && $group_id == $row['group_id'])
                    {
                        $icons = $row;
                    }
                  }
                  $db->sql_freeresult($result);

                  $imglist = filelist($phpbb_root_path . $config['group_icons_path'], '');
                  $edit_img = $filename_list = '';

                  foreach ($imglist as $path => $img_ary)
                  {
                    sort($img_ary);

                    foreach ($img_ary as $img)
                    {
                        $img = $path . $img;

                        // Do use the same icon for groups
                        if (!in_array($img, $existing_imgs) || $img == $group_icon)
                        {
                          if ($icons && $img == $icons['group_icon'])
                          {
                              $selected = ' selected="selected"';
                              $edit_img = $img;
                          }
                          else
                          {
                              $selected = '';
                          }

                          if (strlen($img) > 255)
                          {
                              continue;
                          }

                          $filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>';
                        }
                    }
                  }

                  $filename_list = '<option value=""' . (($edit_img == '') ? ' selected="selected"' : '') . '>' . $user->lang['SELECT_GROUP_ICON'] . '</option>' . $filename_list;
                  unset($existing_imgs, $imglist);


Cautati:


Cod:
'S_RANK_OPTIONS'      => $rank_options,


Inainte adaugati:

Cod:
'GROUP_ICONS_PATH'  => $phpbb_root_path . $config['group_icons_path'],
                    'GROUP_ICON'      => ($edit_img) ? $phpbb_root_path . $config['group_icons_path'] . '/' . $edit_img : $phpbb_root_path . 'images/spacer.gif',
                    'S_FILENAME_LIST'  => $filename_list,



Deschideti language/en/common.php si cautati:

Cod:
?>


Inainte adaugati:

Cod:
// Group Icon
$lang = array_merge($lang, array(
  'GROUP_ICON'      => 'Group icon',
  'SELECT_GROUP_ICON'  => 'Select a group icon',
));


Deschideti language/en/acp/common.php si cautati:

Cod:
?>


Inainte adaugati:

Cod:
// Group Icons
$lang = array_merge($lang, array(
  'GROUP_ICONS_PATH'        => 'Group icons storage path',
  'GROUP_ICONS_PATH_EXPLAIN'  => 'Path under your phpBB root directory, e.g. <samp>images/group_icons</samp>.',
));


Deschideti styles/prosilver/template/ucp_groups_manage.html si cautati:

Cod:
<!-- INCLUDE ucp_header.html -->


Dupa adaugati:

Cod:
<script type="text/javascript">
// <![CDATA[
  function update_group_icon(newicon)
  {
      document.getElementById('icon_group').src = (newicon) ? "{GROUP_ICONS_PATH}/" + encodeURI(newicon) : "./images/spacer.gif";
  }
// ]]></script>


Cautati:

Cod:
<dl>
      <dt><label for="group_rank">{L_GROUP_RANK}:</label></dt>
      <dd><select name="group_rank" id="group_rank">{S_RANK_OPTIONS}</select></dd>
  </dl>


Inainte adaugati:

Cod:
<dl>
      <dt><label for="group_icon">{L_GROUP_ICON}:</label></dt>
      <dd><select name="group_icon" id="group_icon" onchange="update_group_icon(this.options[selectedIndex].value);">{S_FILENAME_LIST}</select> <img style="vertical-align: middle;" src="{GROUP_ICON}" id="icon_group" alt="" title="" /></dd>
  </dl>


Deschideti styles/subsilver2/template/ucp_groups_manage.html si cautati:

Cod:
<!-- INCLUDE ucp_header.html -->


Dupa adaugati:

Cod:
<script type="text/javascript">
// <![CDATA[
  function update_group_icon(newicon)
  {
      document.getElementById('icon_group').src = (newicon) ? "{GROUP_ICONS_PATH}/" + encodeURI(newicon) : "./images/spacer.gif";
  }
// ]]></script>


Cautati:

Cod:
<tr>
      <td class="row1" width="35%"><label for="group_rank">{L_GROUP_RANK}:</label></td>
      <td class="row2"><select name="group_rank" id="group_rank">{S_RANK_OPTIONS}</select></td>
  </tr>


Inainte adaugati:

Cod:
<tr>
      <td class="row1" width="35%"><label for="group_icon">{L_GROUP_ICON}:</label></td>
      <td class="row2"><select name="group_icon" id="group_icon" onchange="update_group_icon(this.options[selectedIndex].value);">{S_FILENAME_LIST}</select> <img style="vertical-align: middle;" src="{GROUP_ICON}" id="icon_group" alt="" title="" /></td>
  </tr>


[size=150]Sterge-ti cache !
Refresh Template ( Sabloane ) !
[/size]

Vezi subiectul anterior Vezi subiectul urmator Sus  Mesaj [Pagina 1 din 1]

Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum

 

Copyright @ 2010-2024 by 4en3rgY ~> All rights reserved.