Página 1 de 1
modificar esta plantilla (programacion)
Publicado: 13 Ago 2011, 02:59
por georwill04
hola abro este tema ya q me dijieron q iba aca ya que en la parte de estilos no..je
Quiero lograr que en esta parte como se ve abajo, cuando se registren tenga su avatar en ese recuadro asi como su rango...se pordra? desearia me confirmen sino cierro el tema

Re: modificar esta plantilla (programacion)
Publicado: 13 Ago 2011, 03:30
por memoadian
Para el avatar basta con poner estas lineas donde las necesitas. supongo que será en tu overall header
Código: Seleccionar todo
<!-- IF S_USER_LOGGED_IN -->
<!-- IF S_USERCOLOUR --><span style="color: #{S_USERCOLOUR}; font-weight: bold;"><!-- ENDIF -->{S_USERNAME}<!-- IF S_USERCOLOUR --></span><!-- ENDIF --><br /><br /><a href="{U_VIEW_PROFILE}"><!-- IF S_USERAVATAR -->{S_USERAVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="{L_USER_AVATAR}" /><!-- ENDIF --></a><br /><hr />
<!-- ENDIF -->
Re: modificar esta plantilla (programacion)
Publicado: 13 Ago 2011, 03:32
por georwill04
pero sabes bien como va?
Re: modificar esta plantilla (programacion)
Publicado: 13 Ago 2011, 03:36
por memoadian
¿como va que? es que se ve muy chiquita la imágen, y no logro distniguir nada. sería cosa de probar en el estilo que tienes.
¿puedes dejar un user de pruebas para ver como se ve logueado?
Re: modificar esta plantilla (programacion)
Publicado: 13 Ago 2011, 03:42
por georwill04
ok lo hago asi lo ves...pero ahora me voy a dormir ja mañana lo subo
Re: modificar esta plantilla (programacion)
Publicado: 13 Ago 2011, 12:06
por georwill04
prueba1 pass: 123456
Re: modificar esta plantilla (programacion)
Publicado: 13 Ago 2011, 14:00
por Juanla
La cuestión debería ser si no me equivoco así, abres tu overall_header.html y buscas:
Código: Seleccionar todo
<!-- IF S_USER_LOGGED_IN and not S_IS_BOT -->
<div class="mini-profile"><div class="mini-profile-inner">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td rowspan="2"><div class="member-icon"></div></td>
<td>
<a href="{U_PROFILE}" class="sn-mini-profile-username"><span style="color: #FFFFFF;">{S_USERNAME}</span></a> <a href="{U_LOGIN_LOGOUT}" class="sn-mini-profile-logout">{L_LOGOUT}</a>
</td>
</tr>
<tr>
<td style="padding-top: 4px;">
<!-- IF S_DISPLAY_PM --><img src="{T_THEME_PATH}/images/<!-- IF S_USER_NEW_PRIVMSG -->email_error<!-- ELSE -->email<!-- ENDIF -->.png" width="16" height="16" alt="" /><a href="{U_PRIVATEMSGS}" class="sn-mini-profile-link"><span style="color: #FFFFFF;">{PRIVATE_MESSAGE_INFO}</span></a><!-- ENDIF --> <!-- IF S_DISPLAY_SEARCH --> • <a href="{U_SEARCH_SELF}" class="sn-mini-profile-link"><span style="color: #FFFFFF;">{L_SEARCH_SELF}</span></a><!-- ENDIF -->
</td>
</tr>
</table>
</div></div>
<!-- ENDIF --><!-- /s-user-logged-in-->
Este parece ser el trozo de código que te muestra la información de usuario si estás conectado.
Si te he entendido bien quieres quitar el iconito que viene por defecto y poner el avatar del usuario, si es así el problema que vas a tener es que el avatar es más grande por defecto, y variable, por tanto tienes que redimensionarlos todos a un tamaño concreto igual que el del icono, cosa que se haría que se vieran mal.
Como alternativa sería modificar la caja de loguin completamente, hacerla más ancha y cuadrar ahí la imagen pero claro el problema en ese caso sería que tendrías que modificar la imagen de la caja y algunas cosas más.
Re: modificar esta plantilla (programacion)
Publicado: 13 Ago 2011, 15:02
por georwill04
o sea...mejor lo dejo asi verdad?listo
Re: modificar esta plantilla (programacion) Tema Solucionado
Publicado: 13 Ago 2011, 15:25
por memoadian
nop, ya vi como hacerlo mira.
abre
overall_header.html
busca
remplazar con:
Código: Seleccionar todo
<td rowspan="2"><!-- IF S_USERAVATAR -->{S_USERAVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" width="32" height="30" alt="{L_USER_AVATAR}" /><!-- ENDIF --></td>
con eso se verá el avatar, aunque si un poco deforme puedes dejar solo el alto asi:
Código: Seleccionar todo
<td rowspan="2"><!-- IF S_USERAVATAR -->{S_USERAVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" height="30" alt="{L_USER_AVATAR}" /><!-- ENDIF --></td>
para que no pierda la forma el avatar y solo se vea más pequeño.
Re: modificar esta plantilla (programacion)
Publicado: 13 Ago 2011, 16:01
por memoadian
Bueno me di cuenta que a mi me funciona por que tengo esas variables declaradas en functios XD
así que hice unas pruebas y logré el cometido de poner el avatar ahí, basado en el código de angelismo de este tema, pero devolvía el ancho y alto original asi que ahi va:
Abrir includes/functions.php

Buscar

Agregar después:
Código: Seleccionar todo
//-- mod: userbock -------------------------------------------------//
//-- add
$template->assign_var('SIDEBAR_AUTO_REFRESH', $time);
//-- end:userbock-------------------------------------------------//

Buscar
Código: Seleccionar todo
// The following assigns all _common_ variables that may be used at any point in a template.

Añadir antes
Código: Seleccionar todo
//-- mod: userbock--------------------------------------------------
//-- add
include_once($phpbb_root_path . 'includes/functions_userbock.' . $phpEx);
//This sets up the sidebar with the info it needs. :D
setup_sidebar_mods();
//Uncomment the following if you have installed the UCP extension for Silverbar
//setup_sidebar_ucp();
//-- fin mod: userbock --------------------------------------------------

Buscar

Añadir antes
Código: Seleccionar todo
//-- mod: userbock -------------------------------------------------//
//-- add
$user->add_lang('');
$redirectside = $user->page['page_dir'] ? '' : '&redirect=' . urlencode(str_replace('&', '&', build_url(array('_f_'))));
$template->assign_var('S_LOGIN_SIDE', append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login' . $redirectside));
//-- end:userbock -------------------------------------------------//
Crear el archivo functions_userbock y pegar el siguiente código
Código: Seleccionar todo
<?php
/**
*
*===================================================================
*
* BEGIN Silverbar MOD Functions File
*-------------------------------------------------------------------
* Script info:
* Version: ( 0.6.0 - Beta )
* Last release: ( 6/12/2008 ||| 5:46 PM [ GMT - 5 ] )
* Copyright: ( (c) 2008 - sTraTo )
* License: ( http://opensource.org/licenses/gpl-license.php ||| GNU Public License )
* Package: ( phpBB3 )
*
*===================================================================
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* Get user avatar
*
* @param string $avatar Users assigned avatar name
* @param int $avatar_type Type of avatar
* @param string $avatar_width Width of users avatar
* @param string $avatar_height Height of users avatar
* @param string $alt Optional language string for alt tag within image, can be a language key or text
*
* @return string Avatar image
*/
function get_my_user_avatar($avatar, $avatar_type, $alt = 'USER_AVATAR')
{
global $user, $config, $phpbb_root_path, $phpEx;
if (empty($avatar) || !$avatar_type)
{
return '';
}
$avatar_img = '';
switch ($avatar_type)
{
case AVATAR_UPLOAD:
$avatar_img = $phpbb_root_path . "download/file.$phpEx?avatar=";
break;
case AVATAR_GALLERY:
$avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
break;
}
$avatar_img .= $avatar;
$avatar_width = 30;
$avatar_height = '';
return '<img src="' . $avatar_img . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
}
/**
*
*END GET_MY_USER_AVATAR FUNCTION
*
*/
/**
* @private
*/
function setup_sidebar_mods()
{
global $user, $config, $phpbb_root_path, $phpEx;
global $db, $auth, $template;
//Unapproved Notification MOD and Reported Post Notification MODs thanks to Stitch626 and CoC
// Start Unapproved Notification Mod
// Unapproved Posts
$total_unapproved_posts = '';
$sql = 'SELECT COUNT(post_approved) AS total_unapproved_posts
FROM ' . POSTS_TABLE . "
WHERE post_approved = 0";
$result = $db->sql_query($sql);
$total_unapproved_posts = (int) $db->sql_fetchfield('total_unapproved_posts');
$db->sql_freeresult($result);
if ($total_unapproved_posts >= 0)
{
$total_unapproved_posts = $total_unapproved_posts;
}
// Unapproved Posts
// Unapproved Topics
$total_unapproved = '';
$sql = 'SELECT COUNT(topic_approved) AS total_unapproved
FROM ' . TOPICS_TABLE . "
WHERE topic_approved = 0";
$result = $db->sql_query($sql);
$total_unapproved = (int) $db->sql_fetchfield('total_unapproved');
$db->sql_freeresult($result);
if ($total_unapproved >= 0)
{
$total_unapproved = $total_unapproved;
}
// Unaproved Topics
if ($total_unapproved)
{
$total_unapproved_posts = !$total_unapproved_posts;
}
// End Unapproved Notification Mod
//<--Reported Post Alert Mod------------------------------->
$sql = 'SELECT topic_reported
FROM ' . TOPICS_TABLE . "
WHERE topic_reported = 1";
$result = $db->sql_query($sql);
$reported = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
//<--Reported Post Alert Mod-------------------------------->
$template->assign_vars(array(
'S_USERCOLOUR' => $user->data['user_colour'],
'S_USERAVATAR' => ( $user->data['user_avatar'] ) ? get_my_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type']) : '',
'U_MCP_UNAPPROVED_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=unapproved_topics', true, $user->session_id),
'S_UNAPPROVED_TOPIC' => (($total_unapproved) && $auth->acl_get('m_approve')) ? true : false,
'U_MCP_UNAPPROVED_POSTS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=unapproved_posts', true, $user->session_id),
'S_UNAPPROVED_POSTS' => (($total_unapproved_posts) && $auth->acl_get('m_approve')) ? true : false,
'S_NEW_REPORT' => (($reported['topic_reported']) && $auth->acl_get('m_report')) ? true : false,
'U_GOTO_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=reports', true, $user->session_id),
));
}
/*
*
*===================================================================
*
* END Silverbar MOD Functions File. Made by sTraTo
*===================================================================
*/
?>
y con las modificaciones que puse arriba del overall header quedaría así.

Re: modificar esta plantilla (programacion)
Publicado: 13 Ago 2011, 22:51
por Juanla
Buen aporte memoadian, deberías hacer un tutorial y postearlo ya que es un estilo muy usado y una característica bastante llamativa!
Re: modificar esta plantilla (programacion)
Publicado: 15 Ago 2011, 12:50
por georwill04