Skip to content

Instantly share code, notes, and snippets.

View pabloprogramador's full-sized avatar
🏠
Working from home

Pablo Erick pabloprogramador

🏠
Working from home
View GitHub Profile
@pabloprogramador
pabloprogramador / Se usuario.php
Last active December 21, 2015 01:19
Se tal pagina, ou seja slug faça abre um arquivo javascript ou se usuario tal tags especiais do pyrocms
<?php
{{ if user:logged_in }}
<p>This is just for logged in users.</p>
{{ endif }}
?>
@pabloprogramador
pabloprogramador / Página_padrão.php
Last active December 21, 2015 01:19
Página view padrão do pyrocms, carrega file:image helper character_limiter strip_tags custom field
<?php
{{page:title}}
{{page:body}}
<div class="tk-postcontent tk-postcontent-0 clearfix">
<div class="tk-content-layout">
<div class="tk-content-layout-row">
<div class="tk-layout-cell layout-item-0" style="width: 35%" >
<h1>empresa</h1>
@pabloprogramador
pabloprogramador / Email_codegniter.php
Last active December 21, 2015 01:19
Email codeigniter
<?php
//echo $valor;
// ini_set('php_flag mail_filter', 0);
$this->load->library('email');
$config['smtp_host'] = 'smtp.manualdama.dominiotemporario.com';
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = 'manual1';
$config['protocol'] = 'SMTP';
$config['smtp_port'] = '587';
@pabloprogramador
pabloprogramador / Email_pyrocms.php
Last active December 21, 2015 01:19
Email pyrocms precisa de modelo
<?php
//$data['subject'] = $this->settings->get('site_name') . ' - Meu Filho na Capa';
$data['slug'] = 'denuncia';
//$data['to'] = '[email protected], [email protected]';
//$data['from'] = $this->settings->get('server_email');
//$data['name'] = $this->settings->get('site_name');
//$data['reply-to'] = $this->settings->get('contact_email');
$data['valor'] = $valor;
$resultado = Events::trigger('email', $data, 'array');
echo $resultado;
@pabloprogramador
pabloprogramador / Plugin_contato.php
Last active December 21, 2015 01:19
Plugin contato pyrocms
<?php
{{ if {session:flash name="success"} }}<div class="sucesso">{{ session:flash name="success" }}</div>{{ endif }}
{{ contato:form
nome = "text|required"
email = "text|required|valid_email"
telefone = "text"
mensagem = "textarea|required"
botao = "submit|value=Enviar|class=cenario-button cenario-button"
template = "contact"
sent = "Mensagem enviada."
@pabloprogramador
pabloprogramador / .htaccess
Created August 13, 2013 23:44
Carrega subpasta e camufla
RewriteEngine on
RewriteRule ^(.*)$ /site/$1 [L]
@pabloprogramador
pabloprogramador / social.php
Created August 14, 2013 15:54
Barra compartilhar rede sociais
<?php defined('BASEPATH') or exit('No direct script access allowed');
/**
* {{social:barra}}
*/
class Plugin_Social extends Plugin
{
public $version = '1.0.0';
public $name = array(
@pabloprogramador
pabloprogramador / metatag_facebook.html
Created August 14, 2013 16:00
Descrição para compartilhar o facebook
<meta property="og:title" content="Facebook Open Graph META Tags"/>
<meta property="og:image" content="http://davidwalsh.name/wp-content/themes/klass/img/facebooklogo.png"/>
<meta property="og:site_name" content="David Walsh Blog"/>
<meta property="og:description" content="Facebook's Open Graph protocol allows for web developers to turn their websites into Facebook "graph" objects, allowing a certain level of customization over how information is carried over from a non-Facebook website to Facebook when a page is 'recommended', 'liked', or just generally shared."/>
@pabloprogramador
pabloprogramador / Voltar pagina anterior.php
Created August 15, 2013 17:46
Voltar a última pagina aberta.
<?php echo !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : base_url(); ?>
<?php
# Conteúdo a ser examinado
$string = 'abcedf';
# Ocorrências
preg_match('/[0-9]]/', $string); // Pode conter números de 0 à 9
preg_match('/[4-8]]/', $string); // Pode conter números de 4 à 8
preg_match('/[A-Z]]/', $string); // Pode conter letras de A à Z maiusculas
preg_match('/[a-z]/', $string); // Pode conter letras de A à Z minusculas
preg_match('/[F-P]]/', $string); // Pode conter letras de F à P maiusculas