4en3rgY Romania
[Tutorial] Iconuri 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ă

[Tutorial] Iconuri la legenda

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

1[Tutorial] Iconuri la legenda Empty [Tutorial] Iconuri la legenda Vin 03 Feb 2012, 17:15

KiddOx <3.

KiddOx <3.Membru

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

Download: [Trebuie sa fiti inscris si conectat pentru a vedea acest link]
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'])) ? '[Trebuie sa fiti înscris şi conectat pentru a vedea această imagine] ' : '';




Cautati:



Cod:
$legend[] = '' . $group_name . '';




Dupa $legend[] = adaugati $group_icon.

Cautati:



Cod:
$legend[] = '' . $group_name . '';




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 != '') ? ', ' : '') . '' . $user->lang['G_BOTS'] . '';
}
else
{
$legend .= (($legend != '') ? ', ' : '') . '[Trebuie sa fiti inscris si conectat pentru a vedea acest link]';
}
}
$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'])) ? '[Trebuie sa fiti înscris şi conectat pentru a vedea această imagine] ' : '';

if ($row['group_name'] == 'BOTS' || ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')))
{
$legend[] = $group_icon . '' . $group_name . '';
}
else
{
$legend[] = $group_icon . '' . $group_name . '';
}
}
$db->sql_freeresult($result);

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




Deschideti adm/style/acp_groups.html si cautati:



Cod:





Dupa adaugati:



Cod:

// function update_group_icon(newicon)
{
document.getElementById('icon_group').src = (newicon) ? "{GROUP_ICONS_PATH}/" + encodeURI(newicon) : "./images/spacer.gif";
}
// ]]>





Cautati:



Cod:







Inainte adaugati:



Cod:


[Trebuie sa fiti înscris şi conectat pentru a vedea această imagine]





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'] = 'Vizitator';
$_profile_cache['tpl_noprofile_colour'] = 'Vizitator';
$_profile_cache['tpl_profile'] = '[Trebuie sa fiti inscris si conectat pentru a vedea acest link]';
$_profile_cache['tpl_profile_colour'] = '[Trebuie sa fiti inscris si conectat pentru a vedea acest link]';
}

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 = '[Trebuie sa fiti înscris şi conectat pentru a vedea această imagine] ';//'" 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}', 'Vizitator'), 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}', 'Vizitator'), 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'])) ? '[Trebuie sa fiti înscris şi conectat pentru a vedea această imagine] ' : '';




Cautati:



Cod:
$forum_moderators[$f_id][] = '' . $group_name . '';




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

Cautati:



Cod:
$forum_moderators[$f_id][] = '' . $group_name . '';




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:
'icon' => 'string',




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 .= '';
}
}
}

$filename_list = '' . $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 .= '';
}
}
}

$filename_list = '' . $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. images/group_icons.',
));




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



Cod:





Dupa adaugati:



Cod:

// function update_group_icon(newicon)
{
document.getElementById('icon_group').src = (newicon) ? "{GROUP_ICONS_PATH}/" + encodeURI(newicon) : "./images/spacer.gif";
}
// ]]>





Cautati:



Cod:







Inainte adaugati:



Cod:


[Trebuie sa fiti înscris şi conectat pentru a vedea această imagine]





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



Cod:





Dupa adaugati:



Cod:

// function update_group_icon(newicon)
{
document.getElementById('icon_group').src = (newicon) ? "{GROUP_ICONS_PATH}/" + encodeURI(newicon) : "./images/spacer.gif";
}
// ]]>





Cautati:



Cod:








Inainte adaugati:



Cod:


[Trebuie sa fiti înscris şi conectat pentru a vedea această imagine]





Sterge-ti cache !
Refresh Template ( Sabloane ) !

V-am prezentat un imens tutorial sper sa va fie de folos.
Si astept parerile voastre.

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.