Skip to content

Instantly share code, notes, and snippets.

View joelmiguelvalente's full-sized avatar
😎

Miguel92 joelmiguelvalente

😎
View GitHub Profile
@joelmiguelvalente
joelmiguelvalente / footer.php
Last active January 20, 2020 18:33
Para reemplazar
<?php if ( ! defined('TS_HEADER')) exit('No se permite el acceso directo al script');
/**
* Modelo para el control del chat
*
* @name c.chat.php
* @author RhuanCarlos
*/
class tsChat {
// ENVIAR UN MENSAJE NUEVO
@joelmiguelvalente
joelmiguelvalente / acciones.js
Created June 20, 2020 17:22
Agregar al final del archivo
$(document).ready(function(){
$('#generar_post').on('click', function(e){
$('#generator').slideToggle();
$(this).attr('value', 'Haz Clic Aqui para Agregar el Código a tu Post')
.addClass('btnGreen').
attr('onclick', 'hxywg()');
});
});
@joelmiguelvalente
joelmiguelvalente / m.agregar_javascript.tpl
Created June 22, 2020 00:16
Este pertenece al theme crakle
<script type="text/javascript">
//
var button_title = ' {if $tsDraft}Aplicar Cambios{else}Agregar post{/if} ';
// {literal}
function countUpperCase(string) {
var len = string.length, strip = string.replace(/([A-Z])+/g, '').length, strip2 = string.replace(/([a-zA-Z])+/g, '').length, percent = (len - strip) / (len - strip2) * 100;
return percent;
}
//
function showError(obj, str) {
<?php if (!defined('TS_HEADER')) {
exit('No se permite el acceso directo al script');
}
/**
* Modelo para el control del registro de usuarios
*
* @name c.registro.php
* @author PHPost Team
*/
<?php if ( ! defined('TS_HEADER')) exit('No se permite el acceso directo al script');
/**
* Modelo para el control del registro de usuarios
*
* @name c.registro.php
* @author PHPost Team
*/
class tsRegistro{
/**
En templates/m.posts_metadata.tpl o donde quieran agregan
<div class="col-12 text-center mb-3">
<ul class="emojis list-unstyled d-flex justify-content-around align-items-center">
<li><a class="d-flex justify-content-center align-content-center" href="#" data-user="{$tsUser->uid}" data-voto="megusta" title="&iexcl;ME GUSTA!"><span class="smile">😍</span><span class="count">{$tsPost.megusta.0}</span></a></li>
<li><a class="d-flex justify-content-center align-content-center" href="#" data-user="{$tsUser->uid}" data-voto="loamo" title="&iexcl;LO AMO!"><span class="smile">🤩</span><span class="count">{$tsPost.loamo.0}</span></a></li>
<li><a class="d-flex justify-content-center align-content-center" href="#" data-user="{$tsUser->uid}" data-voto="sinpalabras" title="SIN PALABRAS"><span class="smile">🤐</span><span class="count">{$tsPost.sinpalabras.0}</span></a></li>
<li><a class="d-flex justify-content-center align-content-center" href="#" data-user="{$tsUser->uid}" data-voto="wtf" title="
@joelmiguelvalente
joelmiguelvalente / t.buscador.tpl
Created August 29, 2020 01:01
Para crear o reemplazar el buscador
{include file='sections/main_header.tpl'}
{literal}
<style>.d-grid,.resul{display:grid;grid-template-columns:1fr 75px;}.resul{grid-template-columns:1fr 175px;}.resul img{height:175px;object-fit:cover;}.d-grid input{border-radius:0;}.d-grid input[type=text]{border-right:none;}.d-grid input[type=submit]{border:0;}.userFound{margin:4px;min-width:170px;max-width:220px;padding:2px 4px;}.userFound img{width:40px;height:40px;margin-right:6px;}</style>
{/literal}
<script>
function buscador_select(type) {
switch(type) {
case 'web':
$('#select_tags, #select_fotos').removeClass('btn-success');
$('input[name=q]').attr('placeholder', 'Buscar posts');
{if $tsListaU}
{foreach $tsListaU item=user}
<div class="d-inline-block">
<div class="userFound d-flex justify-content-start align-items-center">
<img src="{$tsConfig.url}/files/avatar/{$user.user_id}.webp" class="avatar avatar-circle shadow">
<span>
<a class="d-block font-weight-bolder text-dark" href="{$tsConfig.url}/perfil/{$user.user_name}" style="margin-bottom: -6px;">{$user.user_name} #{$user.user_id}</a>
<small class="text-{if $user.user_activo == 1 && $user.user_baneado == 0}success{else}danger{/if} font-weight-bold">{if $user.user_baneado == 1}Baneado{else}{if $user.user_activo == 1}Activado{else}Cuenta desactivada{/if}{/if}</small>
</span>
</div>
@joelmiguelvalente
joelmiguelvalente / ajax.buscador.php
Last active August 31, 2020 17:12
Ajax buscador
<?php if ( ! defined('TS_HEADER')) exit('No se permite el acceso directo al script');
/**
* Controlador AJAX
*
* @name ajax.buscador.php
* @author Miguel92
*/
/**********************************\
* (VARIABLES POR DEFAULT) *