Skip to content

Instantly share code, notes, and snippets.

View jamsesso's full-sized avatar

Sam Jesso jamsesso

  • Fredericton, Canada
  • 08:11 (UTC -03:00)
View GitHub Profile
<?php
/* Configuration variables, edit accordingly */
$username = "cloudica";
$domain = "cloudi.ca"; //Alternative is cloudica.net
$max_posts = "10"; //Leave empty for all available posts.
/* Fetch the posts and loop. */
$xml = simplexml_load_file("http://".$domain."/feeds/".$username.".rss");
if(!empty($max_posts))
<?php
/* FrostBB - Open source bulletin board.
http://www.frostbb.net/
License: http://www.frostbb.net/about:license
File: /resources/class_core.php
Author: Sam Jesso (www.xiofire.com)
Handles the core class and functions of FrostBB. */
<?php
function upload($file) {
$allowed = array("image/png", "image/jpg", "image/jpeg", "image/gif");
$type = $file['type'];
$extension = end(explode("/", $type));
$destination = sha1(time().rand().md5($file['name'])).".".$extension;
$directory = "./uploads/";
$limit = 1024000;
$success = "Your photo has been uploaded!";
$sql = fopen("installation.sql", "r");
$new_sql = str_replace("{PREFIX}", $_POST['prefix'], $sql);
$new_sql = str_replace("{USERNAME}", $post['username'], $sql);
$new_sql = str_replace("{PASSWORD}", $post['password'], $sql);
$new_sql = str_replace("{EMAIL}", $post['email'], $sql);
$new_sql = str_replace("{IPADDR}", $post['ipaddr'], $sql);
$new_sql = str_replace("{BLOGTITLE}", $post['title'], $sql);
$new_sql = str_replace("{BLOGKEYWORDS}", $post['keywords'], $sql);
$new_sql = str_replace("{BLOGDESCRIPTION}", $post['description'], $sql);
body {
background: #fff url(images/bg.png) repeat-x top center;
font: normal 12px Georgia;
color: #000;
margin: 0px auto;
}
a:link, a:visited { color: #000; }
a:hover, a:visited:hover { text-decoration:none; }
p { clear: both; }
h1 {
function valid($setting, $string) {
if($setting == "email") {
if(preg_match("/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/", $string)) {
return true;
} else {
return false;
}
} elseif($setting == "website") {
if(preg_match("/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/", $string)) {
return true;