Added the licenseDefined more of what each setting does
Jeremy D

Jeremy D commited on 2012-01-23 21:06:46
Showing 14 changed files, with 153 additions and 19 deletions.

... ...
@@ -0,0 +1,14 @@
1
+*** SMF Powered PasteBin ***
2
+I've never been good at writing these, so here it goes.
3
+
4
+See license.txt for the license this script uses.
5
+
6
+*** Install ***
7
+1. Upload files
8
+2. Modify settings.php to accommodate your needs.
9
+	a. When using SMF as the database, you muse set the correct path in smf_dir to your SMF install.
10
+	b. When using SMF as the database, you must set the smf_paste_board to a valid board id.
11
+3. Done.
12
+
13
+*** Geshi ***
14
+You can download and install the geshi syntax highlighter. Just need to set that up in settings once you do.
0 15
\ No newline at end of file
... ...
@@ -1,8 +1,16 @@
1 1
 <?php
2
+/*
3
+ * SMF PasteBin
4
+ * Author: SleePy (JeremyD)
5
+ * Repository: https://github.com/jdarwood007/pastebin
6
+ * License: BSD 3 Clause; See license.txt
7
+*/
8
+if (!defined('SMFPasteBin')) { exit('[' . basename(__FILE__) . '] Direct access restricted');}
9
+
2 10
 define('PB_SHOW_SOURCE', $_SERVER['HTTP_HOST'] == 'sleepycode.com' ? true : false);
3 11
 
4
-error_reporting(E_ALL);
5 12
 $_SERVER['REQUEST_URI'] = '/pastebin';
13
+
6 14
 require_once('../wp-ssi.php');
7 15
 $specialPage['noClear'] = true;
8 16
 $specialPage['class'] = 'post';
... ...
@@ -1,4 +1,11 @@
1 1
 <?php
2
+/*
3
+ * SMF PasteBin
4
+ * Author: SleePy (JeremyD)
5
+ * Repository: https://github.com/jdarwood007/pastebin
6
+ * License: BSD 3 Clause; See license.txt
7
+*/
8
+define('SMFPasteBin', true);
2 9
 
3 10
 // Load the primary file.
4 11
 require_once(dirname(__FILE__) . '/settings.php');
... ...
@@ -1,4 +1,11 @@
1 1
 <?php
2
+/*
3
+ * SMF PasteBin
4
+ * Author: SleePy (JeremyD)
5
+ * Repository: https://github.com/jdarwood007/pastebin
6
+ * License: BSD 3 Clause; See license.txt
7
+*/
8
+if (!defined('SMFPasteBin')) { exit('[' . basename(__FILE__) . '] Direct access restricted');}
2 9
 
3 10
 /*
4 11
 * PasteBin language
... ...
@@ -0,0 +1,9 @@
1
+Copyright (c) 2011, JeremyD (SleePy [at] simplemachines [period] org)
2
+All rights reserved.
3
+
4
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
7
+Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
8
+
9
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0 10
\ No newline at end of file
... ...
@@ -1,4 +1,11 @@
1 1
 <?php
2
+/*
3
+ * SMF PasteBin
4
+ * Author: SleePy (JeremyD)
5
+ * Repository: https://github.com/jdarwood007/pastebin
6
+ * License: BSD 3 Clause; See license.txt
7
+*/
8
+if (!defined('SMFPasteBin')) { exit('[' . basename(__FILE__) . '] Direct access restricted');}
2 9
 
3 10
 /*
4 11
 * PasteBin Settings
... ...
@@ -1,61 +1,94 @@
1 1
 <?php
2
+/*
3
+ * SMF PasteBin
4
+ * Author: SleePy (JeremyD)
5
+ * Repository: https://github.com/jdarwood007/pastebin
6
+ * License: BSD 3 Clause; See license.txt
7
+*/
8
+if (!defined('SMFPasteBin')) { exit('[' . basename(__FILE__) . '] Direct access restricted');}
2 9
 
3 10
 /*
4 11
 * PasteBin Settings
5 12
 */
6 13
 class pBS
7 14
 {
8
-	// Private pastebin?
15
+	/* Private pastebin? */
9 16
 	private static $private = false;
10 17
 
11
-	// Where are the sources?
18
+	/* Where are the sources? */
12 19
 	private static $sources = './sources';
13 20
 
14
-	// Database Handler.
21
+	/* Database Handler. */
15 22
 	private static $db = 'smf';
16 23
 
17
-	// User Handler.
24
+	/* User Handler. */
18 25
 	private static $user = 'smf';
19 26
 
20
-	// Template Handler.
27
+	/* Template Handler. */
21 28
 	private static $tpl = 'wp';
22 29
 
23
-	// Any preloader file needed?
30
+	/* Any preloader file needed? */
24 31
 	private static $preload = '__integrate.php';
25 32
 
26
-	// Language files location and default.
33
+	/* Language files location and default. */
27 34
 	private static $languages = './languages';
35
+
36
+	/* The default language. */
28 37
 	private static $default_language = 'english';
29 38
 
30
-	// The URLs
39
+	/* Where is the CSS? */
40
+	private static $css = '/../pastebin/pb.css';
41
+
42
+	/* Recent limits. First is default secondary is administrator. */
43
+	private static $recent_limit = 10;
44
+	private static $recent_limit_admin = 50;
45
+
46
+	/* SEF: Should we use SEF? */
31 47
 	private static $url_sef = true;
48
+
49
+	/* SEF: The base url for SEF */
32 50
 	private static $sef_base = '/pastebin';
51
+
52
+	/* PORTAL: Should we use a portal? SEF has presidence. */
33 53
 	private static $use_portal = false;
34
-	private static $portal_url = '';
35 54
 
36
-	// Where is the CSS?
37
-	private static $css = '/../pastebin/pb.css';
55
+	/* PORTAL: The url to the portal page this is on. */
56
+	private static $portal_url = '';
38 57
 
39
-	// Geshi stuff.
58
+	/* GESHI: Enable Geshi. */
40 59
 	private static $use_geshi = true;
60
+
61
+	/* GESHI: The location to the geshi.php file. */
41 62
 	private static $geshi_location = './geshi';
63
+
64
+	/* GESHI: The default language to use. */
42 65
 	private static $geshi_default = 'php';
43 66
 
44
-	// Be ye robot?
67
+	/* HUMAN CHECK: Enable the human check? */
45 68
 	private static $human_check = true;
69
+
70
+	/* HUMAN CHECK: The question to ask. */
46 71
 	private static $human_question = 'A duck, cat and a goose walk into a bar. How many animals walked into a bar?';
47
-	private static $human_answer = '3';
48 72
 
49
-	// Recent limits.
50
-	private static $recent_limit = 10;
51
-	private static $recent_limit_admin = 50;
73
+	/* HUMAN CHECK: The answer they need to provide. */
74
+	private static $human_answer = '3';
52 75
 
53
-	// When we are using SMF, we need to know where it is.
76
+	/* SMF: When we are using SMF, we need to know where it is. */
54 77
 	private static $smf_dir = '../forum/';
78
+
79
+	/* SMF: The paste board ID. Does not need to be a public board. */
55 80
 	private static $smf_paste_board = 4;
81
+
82
+	/* SMF: Should we increase the users post count? */
56 83
 	private static $smf_increase_postcout = true;
84
+
85
+	/* SMF: Should we check whether this needs post approval? */
57 86
 	private static $smf_post_approval = false;
87
+
88
+	/* SMF: Use SMF themes? Only works when $tpl above is set to smf. */
58 89
 	private static $smf_use_theme = true;
90
+
91
+	/* SMF: The SMF theme ID to use when using its theme. */
59 92
 	private static $smf_theme_id = 1;
60 93
 
61 94
 	/*
... ...
@@ -1,4 +1,11 @@
1 1
 <?php
2
+/*
3
+ * SMF PasteBin
4
+ * Author: SleePy (JeremyD)
5
+ * Repository: https://github.com/jdarwood007/pastebin
6
+ * License: BSD 3 Clause; See license.txt
7
+*/
8
+if (!defined('SMFPasteBin')) { exit('[' . basename(__FILE__) . '] Direct access restricted');}
2 9
 
3 10
 /*
4 11
 * SMF handler for database interaction.
... ...
@@ -1,4 +1,11 @@
1 1
 <?php
2
+/*
3
+ * SMF PasteBin
4
+ * Author: SleePy (JeremyD)
5
+ * Repository: https://github.com/jdarwood007/pastebin
6
+ * License: BSD 3 Clause; See license.txt
7
+*/
8
+if (!defined('SMFPasteBin')) { exit('[' . basename(__FILE__) . '] Direct access restricted');}
2 9
 
3 10
 /*
4 11
 * Basic handler for database interaction.
... ...
@@ -1,4 +1,11 @@
1 1
 <?php
2
+/*
3
+ * SMF PasteBin
4
+ * Author: SleePy (JeremyD)
5
+ * Repository: https://github.com/jdarwood007/pastebin
6
+ * License: BSD 3 Clause; See license.txt
7
+*/
8
+if (!defined('SMFPasteBin')) { exit('[' . basename(__FILE__) . '] Direct access restricted');}
2 9
 
3 10
 /*
4 11
 * SMF Theme handler for Pastebin.
... ...
@@ -1,4 +1,11 @@
1 1
 <?php
2
+/*
3
+ * SMF PasteBin
4
+ * Author: SleePy (JeremyD)
5
+ * Repository: https://github.com/jdarwood007/pastebin
6
+ * License: BSD 3 Clause; See license.txt
7
+*/
8
+if (!defined('SMFPasteBin')) { exit('[' . basename(__FILE__) . '] Direct access restricted');}
2 9
 
3 10
 /*
4 11
 * WordPress Theme handler for Pastebin.
... ...
@@ -1,4 +1,11 @@
1 1
 <?php
2
+/*
3
+ * SMF PasteBin
4
+ * Author: SleePy (JeremyD)
5
+ * Repository: https://github.com/jdarwood007/pastebin
6
+ * License: BSD 3 Clause; See license.txt
7
+*/
8
+if (!defined('SMFPasteBin')) { exit('[' . basename(__FILE__) . '] Direct access restricted');}
2 9
 
3 10
 /*
4 11
 * Basic Theme handler for Pastebin.
... ...
@@ -1,4 +1,11 @@
1 1
 <?php
2
+/*
3
+ * SMF PasteBin
4
+ * Author: SleePy (JeremyD)
5
+ * Repository: https://github.com/jdarwood007/pastebin
6
+ * License: BSD 3 Clause; See license.txt
7
+*/
8
+if (!defined('SMFPasteBin')) { exit('[' . basename(__FILE__) . '] Direct access restricted');}
2 9
 
3 10
 /*
4 11
 * SMF User handler for Pastebin.
... ...
@@ -1,4 +1,11 @@
1 1
 <?php
2
+/*
3
+ * SMF PasteBin
4
+ * Author: SleePy (JeremyD)
5
+ * Repository: https://github.com/jdarwood007/pastebin
6
+ * License: BSD 3 Clause; See license.txt
7
+*/
8
+if (!defined('SMFPasteBin')) { exit('[' . basename(__FILE__) . '] Direct access restricted');}
2 9
 
3 10
 /*
4 11
 * Basic User handler for Pastebin.
5 12