Skip to content

Instantly share code, notes, and snippets.

View navarr's full-sized avatar
🖥️
Magento

Navarr Barnier navarr

🖥️
Magento
View GitHub Profile
<?php
/* Notes:
- This is part of a much bigger "core" class for a website.
- ->make_time($unix_timestamp,$data_parameters) is pretty much date() but using the logged in user's timezone
*/
function fb_reltime($time,$html = true) // assumes a date in the past
{
if($time > TIME)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
html *
{
font-family: sans-serif;
}
body *
function ()
{
a = 'app118296574867324_iji';
b = 'app118296574867324_aja';
rew = 'app118296574867324_rew';
qwe = 'app118296574867324_qwe';
qtt = 'app118296574867324_qtt';
eval(function (p, a, c, k, e, r)
{
e = function (c)
<?php
class User
{
private $core;
private $data;
private $loaded = false;
function __construct(&$core,$uid = null)
{
$this->core = $core;
<?php
class Database
{
/**
* A list of Electron database functions and their eqivalents.
* This can be used to adapt Electron Forums to other database types.
*/
var $functions = array(
'connect' => 'mysql_connect' ,
'pconnect' => 'mysql_pconnect' ,
<?php
$q = $db->query("SELECT * FROM `gallery_categories` ORDER BY `parent` ASC,`order` ASC");
while($r = $db->fetch_assoc($q))
{
if($r["parent"])
{
if(!isset($cats[$r["parent"]]["children"])) { $cats[$r["parent"]]["children"] = array(); }
$i = count($cats[$r["parent"]]["children"]);
$cats[$r["parent"]]["children"][$i] = $r;
$cats[$r["id"]] = &$cats[$r["parent"]]["children"][$i];
<?php
// $all_cats;
// $categories;
$completed_categories = array();
$level = 0;
foreach($all_cats as $category)
{
if(!in_array($category["id"],$completed_categories)) // The category we are doing hasn't been done yet, Should indicate a parent.
jQuery(document).ready(function($) {
var support = ('placeholder' in (document.createElement("input")));
if(!support)
{
var eles = document.getElementsByTagName("input");
for(var i = 0;i < eles.length;i++)
{
if(eles[i].getAttribute("placeholder"))
{
if(!eles[i].value) { eles[i].value = eles[i].getAttribute("placeholder"); }
<?php
/**
* Creates a thumbnail for any type of pre-existing image. Always saves as PNG image
* Works properly with GIF transparency and PNG Alpha Transparency.
* If Image is less than max_width and max_height it will stay at the size of the image.
*
* @param string - The location of the pre-existing image.
* @param string - The location to save the thumbnail, including filename and extension.
<?php
class GenericVariable
{
private $var;
function __construct($variable)
{
$this->var = $variable;
}
function __get($var)