Skip to content

Instantly share code, notes, and snippets.

View mauriciogofas's full-sized avatar

Mauricio Gofas mauriciogofas

View GitHub Profile
Uso em MB do Disco: {$diskusage}
Limite em MB do Disco: {$disklimit}
Porcentagem de uso do Disco: {$diskusage_percent}
Limite em MB para alerta de Uso do Disco: {$disklimit_alert}
Uso em MB de Largura de Banda: {$bwusage}
Limite em MB de Largura de Banda: {$bwlimit}
Porcentagem de uso da Largura de Banda: {$bwusage_percent}
Limite em MB para alerta de Largura de Banda: {$bwlimit_alert}
URL de upgrade específico do serviço {$upgradeurl}
@mauriciogofas
mauriciogofas / whmcs_e-mail_template_if_payment_method.txt
Last active January 12, 2021 20:40
Condicional lógica para template de e-mail - texto diferente no botão de acordo com o método de pagamento
{if $invoice_payment_method eq "Boleto Bancário"}
<br />
<a class="paybuttom" href="{$whmcs_url}auth.php?email={$client_email}&amp;userid={$client_id}&amp;firstname={$client_first_name}&amp;lastname={$client_last_name}&amp;hash={$hash}&amp;whmcsurl={$whmcs_url}&amp;goto=viewinvoice.php?id={$invoice_id}">Visualizar Boleto</a>
<br />
{else}
<br />
<a class="paybuttom" href="{$whmcs_url}auth.php?email={$client_email}&amp;userid={$client_id}&amp;firstname={$client_first_name}&amp;lastname={$client_last_name}&amp;hash={$hash}&amp;whmcsurl={$whmcs_url}&amp;goto=viewinvoice.php?id={$invoice_id}">Visualizar Fatura</a>
<br />
{/if}
@mauriciogofas
mauriciogofas / gofas_ClientAreaHeadOutput.php
Created July 30, 2017 07:26
WHMCS - Include custom code in template head
<?php
/**
* Include custom code in template head
* © 2017 gofas.net
*
*/
add_hook( 'ClientAreaHeadOutput', 1, function( $vars ) {
$gofas_js_css = array();
$gofas_js_css['gofas_js_css'] ='
@mauriciogofas
mauriciogofas / remove_users_from_blog_based_userdata.php
Created March 8, 2017 07:31
Massive remove users from blog based on user meta data
<?php
/**
*
* Massive remove users from blog
* remove_users_from_blog_based_userdata.php
*
*/
// Load WP components, no themes
define('WP_USE_THEMES', false);
@mauriciogofas
mauriciogofas / gofas_custom_affliates_redirect.php
Last active March 3, 2017 05:00
Custom WHMCS affliates redirects - Redireciona cliques em links de afiliados específicos para URLs específicos
<?php
/**
* Custom affliates redirects
* © 2017 gofas.net
*
*/
add_hook( 'AffiliateClickthru', 1, function( $vars ) {
if ( $vars['affiliateId'] == 6 ) { // ID do afiliado
header( 'Location: https://example.com/custom-slug/' ); // Link para redirecionar visitantes indicados por esse afiliado
exit;
<?php
/**
* Auto Login Hash Merge Tag Email Template ( Versão resumida )
* @author Mauricio Gofas | gofas.net
* @copyright Copyright (c) 2016 https://gofas.net
*/
// Modelo de URL para colar no template de email:
// {$whmcs_url}auth.php?email={$client_email}&hash={$hash}&whmcsurl={$whmcs_url}&goto=viewinvoice.php?id={$invoice_id}
$autoauthkey = "xxxxx_autoauthkey_xxxxx"; // chave igual à inserida no arquivo /configuration.php
@mauriciogofas
mauriciogofas / ticket_link
Created December 29, 2016 15:34
WHMCS Auto Login {$hash}
@mauriciogofas
mauriciogofas / clientarea
Created December 29, 2016 15:32
WHMCS Auto Login {$hash}
{$whmcs_url}auth.php?email={$client_email}&uid={$client_id}&uname={$client_first_name}{$client_last_name}&hash={$hash}&whmcsurl={$whmcs_url}&goto=clientarea.php?action=details
@mauriciogofas
mauriciogofas / viewinvoice
Last active December 29, 2016 15:33
WHMCS Auto Login {$hash}
{$whmcs_url}auth.php?email={$client_email}&uid={$client_id}&uname={$client_first_name}{$client_last_name}&hash={$hash}&whmcsurl={$whmcs_url}&goto=viewinvoice.php?id={$invoice_id}
{
"event_types":[
{
"name":"BILLING.PLAN.CREATED",
"description":"This event is triggered when a billing plan is created.",
"status":"ENABLED"
},
{
"name":"BILLING.PLAN.UPDATED",
"description":"This event is triggered when a billing plan is updated.",