02-01-2021, 07:11 PM
(Última modificación: 06-04-2024, 12:52 PM por Chctrpgo.
Razón: Arreglar captura
)
6

[img]Registrate o inicia tu sesión para ver este contenido[/img]
Hola, os dejo el mod actualizado para la versión 1.3, el tutorial vale para cualquier tema, probado en la versión default de Risus y la V6.
Crean esta consulta en la BD
Código: ( Seleccionar Todo )
ALTER TABLE `u_perfil` ADD `user_avatar` VARCHAR( 500 ) NOT NULL AFTER `user_firma` ,ADD `user_pavat` int(1) NOT NULL DEFAULT '1' AFTER `user_avatar` ,ADD `user_act` varchar(2) NOT NULL DEFAULT 'no' AFTER `user_pavat`inc/class/c.admin.php
Buscar:
Código: ( Seleccionar Todo )
'godp' => $_POST['global-darpuntos'],Agregar debajo:
Código: ( Seleccionar Todo )
'goda' => $_POST['global-avatargif'],Buscar otra vez:
Código: ( Seleccionar Todo )
'godp' => $_POST['global-darpuntos'],Agregar debajo:
Código: ( Seleccionar Todo )
'goda' => $_POST['global-avatargif'],Buscar:
Código: ( Seleccionar Todo )
function setUserFirma($user_id)
{
global $tsCore;
if (db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE `u_perfil` SET user_firma = \'' . $tsCore->setSecure($_POST['firma']) .
'\' WHERE user_id = \'' . (int)$user_id . '\''))
return true;
}Agregar debajo:
Código: ( Seleccionar Todo )
function setUserAvatar($user_id = NULL)
{
global $tsCore;
if (db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE `u_perfil` SET user_avatar = \'' . $tsCore->setSecure($_POST['avatar']) .
'\' WHERE user_id = \'' . (int)$user_id . '\''))
return true;
}
function setUserAct($user_id = NULL)
{
global $tsCore;
if (db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE `u_perfil` SET user_act = \'' . $tsCore->setSecure($_POST['act']) .
'\' WHERE user_id = \'' . (int)$user_id . '\''))
return true;
}inc/class/c.cuenta.php
Buscar:
Código: ( Seleccionar Todo )
'firma' => $tsCore->setSecure($tsCore->parseBadWords($_POST['firma']), true),Agregar debajo:
Código: ( Seleccionar Todo )
'avatar' => $tsCore->setSecure($tsCore->parseBadWords($_POST['avatar']), true),
'pavat' => ($_POST['pavat'] == 'n') ? 0 : 1,Buscar:
Código: ( Seleccionar Todo )
p.p_configsAgregar al lado:
Código: ( Seleccionar Todo )
, p.user_avatar, p.user_act, p.user_pavatBuscar:
Código: ( Seleccionar Todo )
user_firmaAgregar al lado:
Código: ( Seleccionar Todo )
, user_avatar, user_act, user_pavatinc/class/c.posts.php
Buscar:
Código: ( Seleccionar Todo )
p.user_firmaAgregar al lado:
Código: ( Seleccionar Todo )
, p.user_avatar, p.user_act, p.user_pavatinc/php/admin.php
Buscar:
Código: ( Seleccionar Todo )
case 8:
if(!empty($_POST['save'])){
$update = $tsAdmin->setUserFirma($user_id);
if($update == 'OK') $tsCore->redirectTo($tsCore->settings['url'].'/admin/users?act=show&uid='.$user_id.'&save=true');
else $smarty->assign("tsError",$update);
}
$smarty->assign("tsUserF",$tsAdmin->getUserData());
break;Agregar debajo:
Código: ( Seleccionar Todo )
case 9:
if(!empty($_POST['save'])){
$update = $tsAdmin->setUserAvatar($user_id);
if($update == 'OK') $tsCore->redirectTo($tsCore->settings['url'].'/admin/users?act=show&uid='.$user_id.'&save=true');
else $smarty->assign("tsError",$update);
}
$smarty->assign("tsUserF",$tsAdmin->getUserData());
break;
case 10:
if(!empty($_POST['save'])){
$update = $tsAdmin->setUserAct($user_id);
if($update == 'OK') $tsCore->redirectTo($tsCore->settings['url'].'/admin/users?act=show&uid='.$user_id.'&save=true');
else $smarty->assign("tsError",$update);
}
$smarty->assign("tsUserF",$tsAdmin->getUserData());
break;themes/default/templates/modules/m.cuenta_cuenta.tpl
Buscar:
Código: ( Seleccionar Todo )
{if $tsConfig.c_allow_firma}
<div class="field">
<label for="firma">Firma:<br /> <small style="font-weight:normal">(Acepta BBCode) Max. 300 car.</small></label>
<textarea name="firma" id="firma" class="cuenta-save-1">{$tsPerfil.user_firma}</textarea>
</div>
{/if}Agregar debajo:
Código: ( Seleccionar Todo )
{if $tsPerfil.user_act== 'si'}{else}
{if $tsUser->is_admod || $tsUser->permisos.goda}
<div class="field">
<label for="avatar">Avatar:<br /> <small style="font-weight:normal">(Podes usar formato <b>gif</b>)</small></label>
<textarea style="height:16px;" name="avatar" id="avatar" value="{$tsPerfil.user_avatar}" class="cuenta-save-1" >{$tsPerfil.user_avatar}</textarea>
</div>
<div class="field">
<label>Activar</label>
<ul class="fields" style="margin-top:7px;">
<li>
<label><input type="radio" value="s" name="pavat" class="radio cuenta-save-1" {if $tsPerfil.user_pavat == '1'}checked="checked"{/if}/>Si</label>
</li>
<li>
<label><input type="radio" value="n" name="pavat" class="radio cuenta-save-1" {if $tsPerfil.user_pavat == '0'}checked="checked"{/if}/>No</label>
</li>
</ul>
</div>
<div class="field">
<img src="{if $tsPerfil.user_avatar==''}{$tsConfig.url}/files/avatar/{$tsPerfil.user_id}_50.jpg{else}{$tsPerfil.user_avatar}{/if}" style="width:50px; height:50px; margin-left:160px;"/>
</div>
{/if}
{/if}themes/default/templates/modules/m.perfil_headinfo.tpl
Buscar:
Código: ( Seleccionar Todo )
{$tsConfig.url}/files/avatar/{if $tsInfo.p_avatar}{$tsInfo.uid}_120{else}avatar{/if}.jpgCambiar por:
Código: ( Seleccionar Todo )
{if $tsInfo.user_act== 'no' && $tsInfo.user_avatar!='' && $tsInfo.user_pavat=='1' && $tsUser->permisos.goda || $tsInfo.user_act== 'no' && $tsUser->uid != $tsInfo.uid && $tsInfo.user_avatar!='' && $tsInfo.user_pavat== '1'|| $tsUser->is_member== false && $tsInfo.user_act== 'no' && $tsInfo.user_avatar!='' && $tsInfo.user_act== '1' }{$tsInfo.user_avatar}{else}{$tsConfig.url}/files/avatar/{if $tsInfo.p_avatar}{$tsInfo.uid}_120{else}avatar{/if}.jpg{/if}themes/default/templates/modules/m.posts_autor.tpl
Buscar:
Código: ( Seleccionar Todo )
{$tsConfig.url}/files/avatar/{$tsAutor.user_id}_120.jpgCambiar por:
Código: ( Seleccionar Todo )
{if $tsAutor.user_act== 'no' && $tsAutor.user_avatar!='' && $tsAutor.user_pavat=='1' && $tsUser->permisos.goda || $tsAutor.user_act== 'no' && $tsAutor.user_id != $tsUser->uid && $tsAutor.user_avatar!='' && $tsAutor.user_pavat== '1'|| $tsUser->is_member== false && $tsAutor.user_act== 'no' && $tsAutor.user_avatar!='' && $tsAutor.user_act== '1' }{$tsAutor.user_avatar}{else}{$tsConfig.url}/files/avatar/{$tsAutor.user_id}_120.jpg{/if}themes/default/templates/admin_mods/m.admin_users.tpl
Buscar:
Código: ( Seleccionar Todo )
<option value="8"{if $tsType == 8} selected="true"{/if}>Firma</option>Agregar debajo:
Código: ( Seleccionar Todo )
<option value="9"{if $tsType == 9} selected="true"{/if}>Editar Avatar</option>
<option value="10"{if $tsType == 10} selected="true"{/if}>Desactivar Avatar</option>Buscar:
Código: ( Seleccionar Todo )
{elseif $tsType == 8}
<legend>Modificar firma de usuario</legend>
<textarea name="firma" rows="3" cols="50">{$tsUserF.user_firma}</textarea>Agregar debajo:
Código: ( Seleccionar Todo )
{elseif $tsType == 9}
<legend>Modificar Avatar</legend>
<input type="text" name="avatar" class="inp-v" value="{$tsUserF.user_avatar}">
{elseif $tsType == 10}
<legend>Desactivar Avatar Permanentemente</legend>
(Ingresar <b>si</b> o <b>no</b> para desactivar avatar)
<br/><br/>
<input type="text" name="act" id="act" value="{$tsUserF.user_act}" class="inp-va" />themes/default/templates/admin_mods/m.admin_rangos.tpl
Buscar:
Código: ( Seleccionar Todo )
<legend>Global</legend>
<input type="checkbox" id="godp" name="global-darpuntos" {if $tsRango.permisos.godp}checked{/if} /><label style="font-weight:bold;" for="godp">Puntuar Posts</label><label for="godp"> Podrán puntuar posts.</label>
<br /><hr>Agregar debajo:
Código: ( Seleccionar Todo )
<input type="checkbox" id="goda" name="global-avatargif" {if $tsRango.permisos.goda}checked{/if} /><label style="font-weight:bold;" for="goda">Avatar Gif</label><label for="goda"> Podrán usar avatar gif.</label>
<br /><hr>themes/default/estilo.css
Agregar al final:
Código: ( Seleccionar Todo )
.inp-v,.inp-van{border:1px solid #999}.inp-v{width:40%;box-shadow:inset 0 0 5px #CCC;-moz-box-shadow:inset 0 0 5px #CCC;-webkit-box-shadow:inset 0 0 5px #CCC;-o-box-shadow:inset 0 0 5px #CCC;border-radius:2px;-moz-border-radius:2px;-webkit-border-radius:2px;-o-border-radius:2px}
.inp-van,.inp-vas{color:#FFF;width:5%;text-align:center;font-size:18px;font-weight:700}.inp-van{background:#0F0;box-shadow:inset 0 0 10px green;-moz-box-shadow:inset 0 0 10px green;-webkit-box-shadow:inset 0 0 10px green;-o-box-shadow:inset 0 0 10px green;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;-o-border-radius:4px}
.inp-vas{background:#900;box-shadow:inset 0 0 10px red;-moz-box-shadow:inset 0 0 10px red;-webkit-box-shadow:inset 0 0 10px #FFO000;-o-box-shadow:inset 0 0 10px red;border:1px solid #999;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;-o-border-radius:4px}Creditos: Debes agradecer para ver el contenido...




Facebook
Twitter
Reddit
Digg
del.icio.us
Tumblr
Pinterest
Blogger
Fark
LinkedIn
Mix
Google