Skip to content

Instantly share code, notes, and snippets.

View septor's full-sized avatar
👾

Patrick Weaver septor

👾
View GitHub Profile
@septor
septor / gist:4165057
Created November 28, 2012 22:13
Latest GitHub Activity
<?php
@$git = simplexml_load_file("https://github.com/septor.atom");
$git_posted = date("F jS, Y @ h:iA", strtotime($git->entry[$i]->published));
$git_ago = ago(strtotime($git->entry[$i]->published));
$git_content = "<a href='".$git->entry[$i]->link['href']."'>".str_replace("septor ", "", $git->entry[$i]->title)."</a>";
if(($git_content)){
echo $git_content." &rarr; <b title='".$git_posted."'>".$git_ago."</b>";
@septor
septor / arcade.php
Created November 24, 2012 11:06
Autogallery BPL Fix
<?php
// THIS IS A FIX FOR THE AUTOGALLERY PLUGIN. OVERWRITE YOUR CURRENT arcade.php FILE WITH THE CONTENTS OF THIS GIST!!
/*********************************************************************************************
* e107 PLUGIN: Auto Gallery - Arcade Integration
* VERSION: 2.xx
* DESCRIPTION: Integration with arcade high scores. Special thanks to SpooK (Rob Fay) for
* his code and assistance.
* WRITTEN BY: Mr_Visible (www.cerebralsynergy.com)
@septor
septor / gist:3915574
Created October 19, 2012 00:26
Last5 Last.fm
<?php
// see here for the URL needed: http://www.last.fm/api/show/user.getRecentTracks
@$latest = simplexml_load_file("YOURLASTFMRECENTTRACTRSSFEED");
for($a = 0; $a <= 4; $a++){
if($latest->recenttracks->track[$a]->image[2] != ""){
echo "<div class='album'><img src='".$latest->recenttracks->track[$a]->image[2]."' title='".$latest->recenttracks->track[$a]->album."' /></div>\n";
}else{
echo "<div class='wherethefuckisthealbumimage'><img src='what.gif' title='Hold on while I pull this motherfucker up...' /></div>\n";
}
@septor
septor / gist:3304282
Created August 9, 2012 13:44
userclassName() function for e107
<?php
// return the name of the userclass ID submitted, also works with custom userclasses
// requires the inclusion of the userclass_class file (or the LAN file):
// require_once(e_HANDLER."userclass_class.php");
// include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_userclass.php");
function userclassName($id){
if($id == "0"){
$output = UC_LAN_0;
@septor
septor / chatbox_menu.php
Created August 6, 2012 22:46
{AVATAR} shortcode support for chatbox_menu.php (1.0.1)
<?php
/*
+ ----------------------------------------------------------------------------+
| e107 website system
|
| Copyright (C) 2001-2002 Steve Dunstan (jalist@e107.org)
| Copyright (C) 2008-2010 e107 Inc (e107.org)
|
|
| Released under the terms and conditions of the
@septor
septor / gist:2974070
Created June 22, 2012 17:22
LoadQuestionDatabase() function
public void LoadQuestionDatabase()
{
// first line is used for local testing, comment it out and uncomment the line below it for production use
XmlTextReader reader = new XmlTextReader("http://localhost/AnswerIt.xml");
//XmlTextReader reader = new XmlTextReader("https://raw.github.com/septor/answerit/master/AnswerIt.xml");
while (reader.Read())
{
if (reader.NodeType == XmlNodeType.Element && reader.Name == "category")
@septor
septor / gist:2968970
Created June 21, 2012 22:21
AnswerIt Question Database Example
<?xml version="1.0" encoding="utf-8"?>
<AnswerIt>
<question is="How do you kill a beeeeeeeeeeeeees?">
<answer couldbe="Step on it!" />
<answer couldbe="Spray it with acid!" />
<answer couldbe="Punch it!" />
</question>
<question is="How do you kill a beeeeeeeeeeeeees?">
<answer couldbe="Step on it!" />
<answer couldbe="Spray it with acid!" />
@septor
septor / gist:2653044
Created May 10, 2012 13:37
sendpm e107 function
function sendpm($to, $from, $subject, $message){
global $tp;
$spm = new db();
return $spm->db_Insert("private_msg", "0, '".intval($to)."', '".intval($from)."', '".intval(time())."', '0', '".$tp->toDB($subject)."', '".$tp->toDB($message)."', '1', '0', '', '', '".intval(strlen($message))."'");
}