Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal

Search the Community

Showing results for tags 'html'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • El núcleo de PHPost
    • Novedades e información
    • Off Topic
    • Presentaciones
  • PHPost Risus
    • Actualizaciones
    • Versión 1.1
    • Versión 1.2
  • La esquina
    • Rincón del PC
    • Rincón del móvil
  • Actualizaciones individuales de PHPost Risus's PHP 7/8
  • Actualizaciones individuales de PHPost Risus's Smarty
  • Actualizaciones individuales de PHPost Risus's EXTRAS
  • Actualizaciones individuales de PHPost Risus's Fixes
  • Actualizaciones individuales de PHPost Risus's Actualizaciones
  • Actualizaciones individuales de PHPost Risus's Complementos

Calendars

There are no results to display.

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Sitio web


ICQ


Yahoo


Jabber


Skype


Localización


Intereses

Found 3 results

  1. Esto le va a gustar ya que vamos a simplificar un poco más lo que sería la sección de cuenta, y será bastante largo, y en mi caso le he quitado el porcentaje que se muestra en cuenta y varias opciones que ningún usuario se toma el tiempo en completar, como por ejemplo "Intereses y preferencias" 1 - En .htaccess buscamos RewriteRule ^cuenta.php$ inc/php/cuenta.php [QSA,L] y debajo agregamos RewriteRule ^cuenta/([A-Za-z0-9_-]+)$ inc/php/cuenta.php?accion=$1 [QSA,L] 2 - En tema/templates/t.cuenta.tpl y reemplazamos el contenido por esto {include file='sections/main_header.tpl'} <script src="{$tsConfig.js}/cuenta.js?{$smarty.now}"></script> <script> $(document).ready(() => { avatar.uid = '{$tsUser->uid}'; avatar.current = '{$tsConfig.url}/files/avatar/{if $tsPerfil.p_avatar}{$tsPerfil.user_id}{else}avatar{/if}.jpg'; }); </script> <div class="tabbed-d"> <div class="floatL"> <div id="alerta_guarda"></div> <ul class="menu-tab"> <li{if $tsAccion == ''} class="active"{/if}><a href="{$tsConfig.url}/cuenta/">Cuenta</a></li> <li{if $tsAccion == 'perfil'} class="active"{/if}><a href="{$tsConfig.url}/cuenta/perfil">Perfil</a></li> <li{if $tsAccion == 'block'} class="active"{/if}><a href="{$tsConfig.url}/cuenta/block">Bloqueados</a></li> <li{if $tsAccion == 'clave'} class="active"{/if}><a href="{$tsConfig.url}/cuenta/clave">Cambiar Clave</a></li> <li{if $tsAccion == 'nick'} class="active"{/if}><a href="{$tsConfig.url}/cuenta/nick">Cambiar Nick</a></li> <li{if $tsAccion == 'config'} class="active"{/if}><a href="{$tsConfig.url}/cuenta/config">Privacidad</a></li> </ul> <a name="alert-cuenta"></a> <form class="horizontal" method="post" name="editarcuenta"> <input type="hidden" name="pagina" value="{$tsAccion}"> {include file="modules/m.cuenta_$tsAccion.tpl"} </form> </div> <div class="floatR"> {include file='modules/m.cuenta_sidebar.tpl'} </div> </div> <div style="clear:both"></div> {include file='sections/main_footer.tpl'} 3 - Luego acceden a tema/templates/modules/ y buscan todos los m.cuenta_*.tpl y le quitan (al inicio del archivo) style="display:none" también (7 el numero puede variar, dependiendo de la sección) <div class="alert-cuenta cuenta-7"></div> y luego en los divs con la clase .buttons lo reemplazan por <div class="buttons"> <input type="button" value="Guardar" onclick="cuenta.guardar_datos()" class="mBtn btnOk"> </div> 4 - En inc/php/cuenta.php buscan } elseif($action == 'desactivate'){ if(!empty($_POST['validar'])) echo $tsCuenta->desCuenta(); } y debajo agregan $smarty->assign("tsAccion", $_GET["accion"]); 5 - Luego inc/class/c.cuenta.php en la funcion "savePerfil()" cambian $save = $_POST['save']; por $save = $_POST['pagina']; dentro del switch hacen lo siguiente, cambian el número por el nombre - case 1 -> case '' - case 2 -> case 'perfil' - case 6 -> case 'clave' - case 7 -> case 'config' - case 8 -> case 'nick' luego eliminan estos - case 3: ...todo hasta el break... break; - case 4: ...todo hasta el break... break; - case 5: ...todo hasta el break... break; más abajo buscamos y borramos // COMPROBAR PORCENTAJE $total = array(5,8,9,8,9); // CAMPOS EN CADA CATEGORIA $tid = $save - 1; if($save > 1 && $save < 6){ $total[$tid] = $this->getPorcentTotal($perfilData, $total[$tid]); if($save == 1) $total[$tid] = $total[$tid] - 2; $porcen = db_exec('fetch_assoc', db_exec(array(__FILE__, __LINE__), 'query', 'SELECT p_total FROM u_perfil WHERE user_id = \''.$tsUser->uid.'\' LIMIT 1')); $porcen = unserialize($porcen['p_total']); $porcen[$tid] = $total[$tid]; $porcenNow = $this->getPorcentVal($porcen); $porcen = serialize($porcen); db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE u_perfil SET p_total = \''.$porcen.'\' WHERE user_id = \''.$tsUser->uid.'\''); } justo debajo de eso seleccionan // ACTUALIZAR if($save == 1) { db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE u_miembros SET user_email = \''.$tsCore->setSecure($perfilData['email'], true).'\' WHERE user_id = \''.$tsUser->uid.'\''); array_splice($perfilData, 0, 1); // HACK $updates = $tsCore->getIUP($perfilData, 'user_'); if(!db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE u_perfil SET '.$updates.' WHERE user_id = \''.$tsUser->uid.'\'')) return array('error' => show_error('Error al ejecutar la consulta de la línea '.__LINE__.' de '.__FILE__.'.', 'db')); } else { $updates = $tsCore->getIUP($perfilData, 'p_'); if(!db_exec(array(__FILE__, __LINE__), 'query', 'UPDATE u_perfil SET '.$updates.' WHERE user_id = \''.$tsUser->uid.'\'')) return array('error' => show_error('Error al ejecutar la consulta de la línea '.__LINE__.' de '.__FILE__.'.', 'db')); } // if(is_array($msg_return)) return $msg_return; else return array('porc' => $porcenNow); y lo reemplazan por // ACTUALIZAR if($save == '' or $save == 'perfil' or $save == 'config') { if($save == '') { db_exec([__FILE__, __LINE__], "query", "UPDATE u_miembros SET user_email = '{$perfilData['email']}' WHERE user_id = " . $tsUser->uid); array_splice($perfilData, 0, 1); } $updates = $tsCore->getIUP($perfilData, ($save == '' ? 'user_' : 'p_')); $msg_return = (db_exec([__FILE__, __LINE__], "query", "UPDATE u_perfil SET {$updates} WHERE user_id = " . $tsUser->uid)) ? array("error" => "Los cambios fueron aceptados y serán aplicados.") : die(show_error('Error al ejecutar la consulta de la línea '.__LINE__.' de '.__FILE__.'.', 'Base de datos')); } // return $msg_return; 6 - Crean un archivo llamado ajax.cuenta.php en inc/php/ajax y agregan lo siguiente <?php if ( ! defined('TS_HEADER')) exit('No se permite el acceso directo al script'); /** * Controlador AJAX * * @name ajax.cuenta.php * @author Miguel92 */ $files = [ 'cuenta-guardar' => ['n' => 2, 'p' => ''], ]; // REDEFINIR VARIABLES $tsPage = 'ajax/p.cuenta.'.$files[$action]['p']; $tsLevel = $files[$action]['n']; $tsAjax = empty($files[$action]['p']) ? 1 : 0; // DEPENDE EL NIVEL $tsLevelMsg = $tsCore->setLevel($tsLevel, true); if($tsLevelMsg != 1): echo '0: '.$tsLevelMsg['mensaje']; die(); endif; // CLASE require("../class/c.cuenta.php"); $tsCuenta = new tsCuenta(); // CODIGO switch($action){ case 'cuenta-guardar': echo json_encode($tsCuenta->savePerfil()); break; } 7 - En tema/templates/modules/m.cuenta_cuenta.tpl lo renombran a m.cuenta_.tpl 8 - En tema/templates/modules/m.cuenta_perfil.tpl y reemplazan el contenido por esto, y aplica este Redes sociales en perfil [Mejorado][Simplificado][Sugerencia] <div class="content-tabs perfil"> <fieldset> <div class="field"> <label for="nombrez">Nombre completo</label> <input type="text" value="{$tsPerfil.p_nombre}" maxlength="60" name="nombrez" id="nombrez" class="text cuenta-save-2" style="width:230px"> </div> <div class="field"> <label for="sitio">Mensaje Personal</label> <textarea value="" maxlength="60" name="mensaje" id="mensaje" class="cuenta-save-2">{$tsPerfil.p_mensaje}</textarea> </div> <div class="field"> <label for="sitio">Sitio Web</label> <input type="text" value="{$tsPerfil.p_sitio}" maxlength="60" name="sitio" id="sitio" class="text cuenta-save-2" style="width:230px"> </div> <div class="field"> <label for="red">Redes sociales</label> <div style="display:grid;grid-template-columns: repeat(2, 1fr);gap: 10px;"> {foreach $tsPerfil.redes key=name item=red} <div style="display:flex;justify-content: flex-start;align-items: center;"> <div class="icon"> <img src="{$tsConfig.images}/icons/{$name}.png" width="16" height="16" /> </div> <input type="text" class="text cuenta-save-2" value="{$tsPerfil.p_socials.$name}" placeholder="{$red}" name="red[{$name}]"> </div> {/foreach} </div> </div> <div class="field"> <label>Me gustaría</label> <div class="input-fake"> <ul> {foreach from=$tsPData.gustos key=val item=text} <li><input type="checkbox" name="g_{$val}" class="cuenta-save-2" value="1"{if $tsPerfil.p_gustos.$val == 1} checked{/if}>{$text}</li> {/foreach} </ul> </div> </div> <div class="field"> <label for="estado">Estado Civil</label> <div class="input-fake"> <select class="cuenta-save-2" name="estado" id="estado"> {foreach from=$tsPData.estado key=val item=text} <option value="{$val}"{if $tsPerfil.p_estado == $val} selected{/if}>{$text}</option> {/foreach} </select> </div> </div> <div class="buttons"> <input type="button" value="Guardar" onclick="cuenta.guardar_datos()" class="mBtn btnOk"> </div> </fieldset> <div class="clearfix"></div> </div> 9 - Ahora se viene lo genial, busca en tema/js/cuenta.js , justo antes que empieza var avatar = { var cuenta = {... HASTA ... } y lo reemplazas por var cuenta = { alerta: (alerta) => { $(".alert-cuenta").show(); $("#alerta_guarda").html(`<div style="background:#FFFFCC;text-align:center;margin-bottom: 10px;"><p style="display: block;font-size: 16px;padding: 10px 0;">${alerta}</p></div>`) window.scrollTo(0, 0) // Despues de 5s quitamos el alerta setTimeout(() => $("#alerta_guarda").html(''), 5000) }, chgpais: () => { // Campo pais const pais = $("select[name=pais]").val(); const estado = $("select[name=estado]"); if(empty(pais)) estado.addClass('disabled').attr('disabled', 'disabled').val(''); else { //Obtengo las estados $(estado).html(''); $('#loading').fadeIn(250); $.get(global_data.url + '/registro-geo.php', 'pais_code=' + pais, h => { if(h.charAt(0) === '1') estado.append(h.substring(3)).removeAttr('disabled').val('').focus(); $('#loading').fadeOut(250); }) } }, guardar_datos: () => { $('#loading').slideDown(250); $.ajax({ type: 'post', url: global_data.url + '/cuenta-guardar.php', data: $("form[name=editarcuenta]").serialize(), dataType: 'json', success: response => cuenta.alerta(response.error) }); } } Eso sería todo, espero no olvidarme de ningún paso.
  2. Redes sociales en perfil Mejorado y simplificado Esto es una forma mucho más rápida y sencilla de poder añadir redes sociales a su sitio 1 - En inc/class/c.cuenta.php debajo de class tsCuenta { agregan lo siguiente (solo agregan las redes desde aquí y nada más, ya no tienen que agregar más líneas) # Redes sociales disponibles /** * Si van a agregar más debe ser así 'nombre_minuscula => 'nombre_inicial_mayuscula', */ var $redes = [ 'facebook' => 'Facebook', 'twitter' => 'Twitter', 'instagram' => 'Instagram', 'youtube' => 'Youtube', 'twitch' => 'Twitch', ]; Luego un poco más abajo buscamos private function unData($data) $data['p_socials'] = unserialize($data['p_socials']); $data['p_socials']['f'] = $data['p_socials'][0]; $data['p_socials']['t'] = $data['p_socials'][1]; y la reemplazamos por $data["redes"] = $this->redes; $data['p_socials'] = json_decode($data['p_socials'], true); foreach ($this->redes as $name => $valor) $data['p_socials'][$name]; Luego un poco más abajo buscamos function loadHeadInfo($user_id) $data['p_socials'] = unserialize($data['p_socials']); $data['p_socials']['f'] = $data['p_socials'][0]; $data['p_socials']['t'] = $data['p_socials'][1]; y la reemplazamos por $data['p_socials'] = json_decode($data['p_socials'], true); foreach ($this->redes as $name => $valor) $data['p_socials'][$name]; Más abajo buscan // EXTERNAS $facebook = $tsCore->setSecure($tsCore->parseBadWords($_POST['facebook']), true); $twitter = $tsCore->setSecure($tsCore->parseBadWords($_POST['twitter']), true); y la reemplazan por # Redes sociales $red__social = []; foreach ($_POST["red"] as $llave => $id) $red__social[$llave] = $tsCore->setSecure($tsCore->parseBadWords($id), true); allí mismo buscan 'socials' => serialize(array($facebook,$twitter)), y la reemplazan por 'socials' => json_encode($red__social), 2 - Luego en inc/php/perfil.php buscan $smarty->assign("tsInfo",$tsInfo); y debajo agregan $smarty->assign("tsRedes", $tsCuenta->redes); 3 - Despues en tema/templates/modules/m.cuenta_perfil_me.tpl buscan <div class="field"> <label for="ft">Redes sociales</label> <img src="{$tsConfig.default}/images/icons/facebook.png" width="16" height="16" style="margin:5px; float:left" /> <strong>facebook.com/</strong><input type="text" value="{$tsPerfil.p_socials.f}" maxlength="64" name="facebook" id="ft" class="text cuenta-save-2" style="width:204px"><br /> <img src="{$tsConfig.default}/images/icons/twitter.png" width="16" height="16" style="margin:8px 5px 5px 160px; float:left" /> <strong>twitter.com/</strong><input type="text" value="{$tsPerfil.p_socials.t}" maxlength="64" name="twitter" id="ft2" class="text cuenta-save-2" style="margin-top:3px; width:204px"><br /> </div> y la reemplazan por <div class="field"> <label for="red">Redes sociales</label> <div style="display:grid;grid-template-columns: repeat(2, 1fr);gap: 10px;"> {foreach $tsPerfil.redes key=name item=red} <div style="display:flex;justify-content: flex-start;align-items: center;"> <div class="icon"> <img src="{$tsConfig.images}/icons/{$name}.png" width="16" height="16" /> </div> <input type="text" class="text cuenta-save-2" value="{$tsPerfil.p_socials.$name}" placeholder="{$red}" name="red[{$name}]"> </div> {/foreach} </div> </div> NOTA: En esta parte "{$tsConfig.images}/icons/{$name}.png", deben agregar el icono de la red social que utilicen. Por que "{$name}.png" seria igual a esto "facebook.png", etc. 4 - Por último en tema/templates/modules/m.perfil_sidebar.tpl y arriba de <div style="margin-bottom: 10px"> {$tsConfig.ads_300} </div> agregan esto (En realidad lo pueden poner donde ustedes quieran) {if $tsInfo.p_socials != ''} {foreach $tsRedes key=name item=red} {if $tsInfo.p_socials.$name !== ''} <a class="sitio {$name}" target="_blank" href="https://{$name}.{if $name == 'twitch'}tv{else}com{/if}/{$tsInfo.p_socials.$name}" title="{$red}"><img height="14" width="14" alt="{$name}" src="{$tsConfig.images}/icons/{$name}.png"/></a> {/if} {/foreach} </div> {/if} NOTA: Les debo los iconos de instagram, youtube y twitch Eso sería todo.
  3. Bueno hace tiempo hice este cambio para el modal, el cual facilitaría la creaciones de modales con botones. Antes se tenia que usar así: mydialog.buttons(true, true, 'SI', "bloquear('"+user+"', true, '"+lugar+"', true)", true, false, true, 'NO', 'close', true, true); Ahora es poco más largo, pero más fácil de entender mydialog.buttons([ {mostrar:true,texto:'SI',accion:"bloquear('"+user+"', true, '"+lugar+"', true)",activo:true}, {mostrar:true,texto:'NO',accion:'cerrar',activo:true} ]) Tiene varias maneras de poder emplearlo, la primera es como se muestra en el código de arriba ↑ y las otras 2 son de estas formas: mydialog.buttons({mostrar:true,texto:'SI',accion:"bloquear('"+user+"', true, '"+lugar+"', true)",activo:true}) mydialog.buttons(false) // Puede ser true Y se le podrá agregar más de 2 botones, puede ser 3,4, etc... Vamos al archivo acciones.js, buscamos buttons: function(display_all, btn1_display, btn1_val, btn1_action, btn1_enabled, btn1_focus, btn2_display, btn2_val, btn2_action, btn2_enabled, btn2_focus){ ... TODO EL CODIGO INCLUIDO ... }, La reemplazamos por buttons: function(object) { let agregar_botones = ''; // Es un objeto... if(typeof object === 'object') { // Es un Arreglo (array)... if(Array.isArray(object)) { for(let i = 0; i < object.length; i++) { if(object[i].mostrar) { let clase = !empty(object[i].clase) ? object[i].clase : (!i ? 'btnOk' : 'btnCancel'); let activo = object[i].activo ? '' : ' disabled' // Si la acción es igual a "cerrar" let accion = (object[i].accion == 'cerrar') ? ` onclick="mydialog.close()"` : ` onclick="${object[i].accion}"` agregar_botones += `<input type="button" class="mBtn ${clase}${activo}" style="display:inline-block" value="${object[i].texto}"${accion}${activo} >`; } } } else { if(object.mostrar) { let clase = !empty(object.clase) ? object.clase : 'btnOk'; let activo = object.activo ? '' : ' disabled' // Si la acción es igual a "cerrar" o contiene una función let accion = (object.accion == 'cerrar') ? `onclick="mydialog.close()"` : ` onclick="${object.accion}"` agregar_botones += `<input type="button" class="mBtn ${clase}${activo}" style="display:inline-block" value="${object.texto}"${accion}${activo}>`; } } // Si el boolean es TRUE entonces mostrará este botón por defecto, si es FALSE no mostrará nada } else if(typeof object === 'boolean') { agregar_botones += object ? `<input type="button" class="mBtn btnOk" style="display:inline-block" value="Aceptar" onclick="mydialog.close()">` : '' } $('#mydialog #buttons').html(agregar_botones) }, El objeto que se puede pasar, si solo contendrá un botón pude ir solo el objeto, en caso que sean 2 o más botones deberá ir así [ { ... PARAMETROS DEL OBJETO 1 ... }, { ... PARAMETROS DEL OBJETO 2 ... } ] Los parámetros que se pueden usar { mostrar: boolean, // TRUE o FALSE texto: string, // El texto que se mostrará accion: string, // Función que se empleará o "cerrar" activo: boolean, // TRUE o FALSE clase: string // Opcional, puede incluir clase para modificar la apariencia del botón } Espero que sea clara la explicación y lo puedan entender...
×