Skip to content
This repository has been archived by the owner on Mar 3, 2021. It is now read-only.

Commit

Permalink
First commit: 1.0.b1
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-zene committed Feb 25, 2011
0 parents commit a9089b0
Show file tree
Hide file tree
Showing 38 changed files with 5,130 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .htaccess
@@ -0,0 +1,12 @@
DirectoryIndex index.php

# disable directory browsing
Options -Indexes

#Rewrites, also handles error pages
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9\/\-\_\.\:]+) index.php?p=$1 [L]
</IfModule>
186 changes: 186 additions & 0 deletions GPLv3.txt

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions bp_admin/ajax.php
@@ -0,0 +1,80 @@
<?php
/*
BasicPages
Author: Ben Merrill <ben@basicpages.org>
This file is part of BasicPages.
BasicPages is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Foobar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with BasicPages. If not, see <http://www.gnu.org/licenses/>.
BasicPages and associated trademarks are property of their respective owners.
*/

define('BP_START', true);

//load up libraries
require_once('../bp_config.php');
require_once(PATH.'/bp_lib/bp_functions.php');
require_once(PATH.'/bp_lib/bp_content.php');

//see if we have permissions to be here
if (false === bp_admin_check_auth()) {
die(json_encode(array('success' => 0, 'msg' => 'Unauthorized Access')));
}

//make sure we're using POST
if (false === isset($_POST)) {
die(json_encode(array('success' => 0, 'msg' => 'POST method is required')));
}

//figure out what we're doing
switch ($_POST['m']) {
case 'auto_save':
//make sure we have what we need
if (false === isset($_POST['p']) || false === isset($_POST['content'])) {
die(json_encode(array('success' => 0, 'msg' => 'Missing some data')));
}
//load up the page object
$bp = new bp_Content($_POST['p'], 'unpublished');
$options = array(
'publish' => 0,
'theme' => $_POST['theme'],
'style' => $_POST['style'],
'nav' => intval($_POST['nav']),
'sitemap' => intval($_POST['sitemap']),
'keywords' => (($_POST['keywords'] == 'keyword, another keyword, etc') ? '' : $_POST['keywords']),
'description' => (($_POST['description'] == 'a description of what this page has to offer; shown in search engine listings') ? '' : $_POST['description']),
);
//save the contents and report
if (false !== $bp->save($_POST['p'], $_POST['content'], $options)) {
die(json_encode(array('success' => 1, 'msg' => 'Saved <abbr class="timeago" title="'.date(DATE_ATOM).'">'.date(DATE_ATOM).'</abbr> ')));
}
else {
die(json_encode(array('success' => 0, 'msg' => 'Auto Save Failed.')));
}
break;
case 'upload_image':
//process the upload
if (false === ($filename = @bp_admin_upload_image())) {
die(json_encode(array('success' => 0, 'msg' => 'Upload Failed.')));
}
else {
die(json_encode(array('success' => 1, 'msg' => $filename)));
}
break;
default:
die(json_encode(array('success' => 0, 'msg' => 'Nothing to do')));
break;
}
?>
Binary file added bp_admin/bp_logo.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions bp_admin/footer.php
@@ -0,0 +1,31 @@
<?php
/*
BasicPages
Author: Ben Merrill <ben@basicpages.org>
This file is part of BasicPages.
BasicPages is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Foobar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with BasicPages. If not, see <http://www.gnu.org/licenses/>.
BasicPages and associated trademarks are property of their respective owners.
*/
?>

<div class="clear"></div>
</div>
<div class="credits">&copy; <?php print date("Y");?> <a href="http://www.basicpages.org">BasicPages</a> <?php print bp_version();?></div>
</div>

</body>
</html>
45 changes: 45 additions & 0 deletions bp_admin/header.php
@@ -0,0 +1,45 @@
<?php
/*
BasicPages
Author: Ben Merrill <ben@basicpages.org>
This file is part of BasicPages.
BasicPages is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Foobar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with BasicPages. If not, see <http://www.gnu.org/licenses/>.
BasicPages and associated trademarks are property of their respective owners.
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-style-type" content="text/css" />
<meta name="resource-type" content="document" />
<meta name="language" content="en-gb" />
<meta name="distribution" content="global" />
<meta name="copyright" content="<?php print date('Y').' Basic Info Site';?>" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="generator" content="BasicPages" />

<title>Site Administration</title>
<link rel="stylesheet" type="text/css" href="<?php print bp_url('bp_themes/basic/blue-grey.css');?>" />
<script type="text/javascript" src="<?php print bp_url('bp_lib/js/jquery-1.5.min.js');?>"></script>
</head>

<body>
<div align="center">
<?php if (isset($msg)) { print $msg; } ?>
<div class="corners" id="body_container" align="left" style="padding-top:10px;">

0 comments on commit a9089b0

Please sign in to comment.