├── .gitattributes
├── CONTRIBUTING.md
├── LICENSE
├── README.md
└── Upload
├── admin
├── jscripts
│ └── asb
│ │ ├── asb_inline.js
│ │ ├── asb_inline.min.js
│ │ ├── asb_modal.js
│ │ ├── asb_modal.min.js
│ │ ├── asb_scripts.js
│ │ ├── asb_scripts.min.js
│ │ ├── asb_sideboxes.js
│ │ └── asb_sideboxes.min.js
└── styles
│ └── default
│ ├── asb
│ └── global.css
│ └── images
│ └── asb
│ ├── add.png
│ ├── delete.png
│ ├── donate.png
│ ├── edit.png
│ ├── help.png
│ ├── logo.png
│ ├── manage.png
│ ├── pixel.png
│ ├── settings.png
│ ├── trashcan_bg.png
│ └── visibility.png
├── images
└── asb
│ ├── left_arrow.png
│ ├── right_arrow.png
│ ├── see_all.png
│ └── transparent.png
├── inc
├── languages
│ └── english
│ │ ├── admin
│ │ ├── asb.lang.php
│ │ └── asb_addon.lang.php
│ │ ├── asb.lang.php
│ │ └── asb_addon.lang.php
└── plugins
│ ├── adv_sidebox.php
│ ├── asb.php
│ └── asb
│ ├── acp.php
│ ├── classes
│ ├── AdvancedSideboxCache.php
│ ├── AdvancedSideboxInstaller.php
│ ├── CustomSidebox.php
│ ├── ExternalModule010000.php
│ ├── ExternalModuleInterface010000.php
│ ├── HTMLGenerator010000.php
│ ├── MalleableObject010000.php
│ ├── MalleableObjectInterface010000.php
│ ├── PortableObject010102.php
│ ├── PortableObjectInterface010100.php
│ ├── ScriptInfo.php
│ ├── SideboxExternalModule.php
│ ├── SideboxObject.php
│ ├── StorableObject010001.php
│ ├── StorableObjectInterface010000.php
│ ├── WildcardPluginCache010300.php
│ ├── WildcardPluginCacheInterface010200.php
│ ├── WildcardPluginInstaller020000.php
│ ├── WildcardPluginInstallerInterface010000.php
│ └── index.html
│ ├── cleanup.php
│ ├── forum.php
│ ├── functions.php
│ ├── functions_acp.php
│ ├── functions_addon.php
│ ├── index.html
│ ├── install.php
│ ├── install_data.php
│ ├── modules
│ ├── birthdays.php
│ ├── forum_age.php
│ ├── goals.php
│ ├── index.html
│ ├── latest_threads.php
│ ├── private_messages.php
│ ├── rand_quote.php
│ ├── recent_posts.php
│ ├── search_box.php
│ ├── slideshow.php
│ ├── staff_online_box.php
│ ├── statistics.php
│ ├── top_poster.php
│ ├── welcome_box.php
│ └── whosonline.php
│ └── upgrade.php
└── jscripts
└── asb
├── Slideshow.js
├── Slideshow.min.js
├── asb.js
├── asb.min.js
├── asb_xmlhttp.js
└── asb_xmlhttp.min.js
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 | *.sln merge=union
7 | *.csproj merge=union
8 | *.vbproj merge=union
9 | *.fsproj merge=union
10 | *.dbproj merge=union
11 |
12 | # Standard to msysgit
13 | *.doc diff=astextplain
14 | *.DOC diff=astextplain
15 | *.docx diff=astextplain
16 | *.DOCX diff=astextplain
17 | *.dot diff=astextplain
18 | *.DOT diff=astextplain
19 | *.pdf diff=astextplain
20 | *.PDF diff=astextplain
21 | *.rtf diff=astextplain
22 | *.RTF diff=astextplain
23 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | First of all, thanks for your interest in contributing to Advanced Sidebox. This document is intended to ease the process for first time contributors and long-time contributors alike.
2 |
3 | ## Reporting Bugs/Requesting Features
4 |
5 | - If you have found a bug in the plugin, or you would like to request a new feature, create a new issue.
6 | - If you would like to send a pull request to add a new feature or fix a bug, we are thrilled, but please create an issue so that we can reach a consensus on how to handle the patch/enhancement.
7 | - Please do not attempt to hijack an exisitng issue to discuss separate issues, create a new issue.
8 | - Please try to contain issues to one problem, create a new issue.
9 |
10 | ## Submitting Pull Requests
11 |
12 | - No PR shall be accepted to the `master` branch.
13 | - Code should conform to PSR-2 coding standards
14 | - The first commit in the PR must be titled after this pattern: `Fixes #{Issue Number}` e.g. "Fixes #474".
15 | - If there are multiple commits in the PR, subsequent commits must be title after this pattern: `For #{Issue Number}` e.g. "For #474"
16 | - Commit titles may include any other text after the required pattern as long as it is separated by at least one space.
17 | - PR must include the issue that is being addressed anywhere in the title e.g. #474
18 |
19 | ## Editing Documentation
20 |
21 | This project's wiki is currently closed to public edits. If you are interested in contributing to the documentation of this software please contact the project administrator via email: `admin@rantcentralforums.com`
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Advanced-Sidebox 3.1.19
2 |
3 |
8 | A plugin for MyBB forums that displays custom boxes on various forum pages.
9 |
10 |
11 | ASB is ***the*** side box plugin for MyBB forums. It is versatile, powerful, and built using the advice of its users.
12 |
13 | ## Features:
14 |
15 | * create an **unlimited** amount of side **boxes** on the left, right or both
16 | * **add** side boxes **to** almost **any page**
17 | * side boxes can be create**d using core modules** (listed below) or **static HTML** created by the admin
18 | * static HTML (termed **custom** side **boxes**) may be **imported**/**exported** to XML to backup, restore and share
19 | * side boxes expand/collapse just like the MyBB core windows
20 | * JavaScript **visibility toggle** icons for columns (uses **cookies** to remember states)
21 | * intuitive, **drag and drop**, side box management interface in ACP
22 | * context-sensitive **help pages** in ACP
23 | * easily **extensible** from single file modules for **third-party** developers and the hobbyist admin
24 | * **CodeMirror** supported when editing custom side boxes (if enabled in ACP)
25 | * compatible with **Page Manager** pages and custom scripts
26 | * **AJAX Update** integrated into the core and eight of the core modules! (listed below)
27 |
28 |
29 | ## Controls:
30 |
31 | * which user **group(s)** the side boxes display for
32 | * which **script(s)** the side boxes display in
33 | * which **theme(s)** the side boxes display on
34 | * disable the plugin for **specific themes**
35 | * admin **option to allow users to disable side boxes** globally from usercp.php
36 |
37 |
38 | ## Current default side box types available:
39 |
40 | *  Birthdays
41 | *  Forum Age 
42 | * Forum Goals 
43 | * Top Poster
44 | * Slideshow
45 | * Recent Posts 
46 | * Who's Online 
47 | * Latest Threads 
48 | * Welcome
49 | * Statistics
50 | * Private Messages 
51 | * Search
52 | * Random Quotes 
53 | * Staff Online 
54 | * You can also create your own custom box types with static content
--------------------------------------------------------------------------------
/Upload/admin/jscripts/asb/asb_inline.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Plugin Name: Advanced Sidebox for MyBB 1.8.x
3 | * Copyright 2014 WildcardSearch
4 | * http://www.rantcentralforums.com
5 | *
6 | * inline controls
7 | */
8 |
9 | /**
10 | * @var object the inline controls module
11 | */
12 | var ASB = (function(a, $) {
13 | /**
14 | * @var int the currently checked
15 | */
16 | var checkCount = 0,
17 |
18 | /**
19 | * @var object the default language
20 | */
21 | lang = {
22 | go: 'Go',
23 | noSelection: 'You did not select anything.',
24 | };
25 |
26 | /**
27 | * initiate the selected count and observe inputs
28 | *
29 | * @return void
30 | */
31 | function init() {
32 | initialCount();
33 | $('#asb_select_all').click(selectAll);
34 | $('.asb_check').click(keepCount);
35 | $('#asb_inline_clear').click(clearAll);
36 | $('#asb_inline_submit').click(submitCheck);
37 | }
38 |
39 | /**
40 | * allow custom language overrides
41 | *
42 | * @param object the custom language
43 | * @return void
44 | */
45 | function setup(language) {
46 | $.extend(lang, language || {});
47 | }
48 |
49 | /**
50 | * squeal if admin is submitting inline with nothing checked
51 | *
52 | * @param object the event
53 | * @return void
54 | */
55 | function submitCheck(e) {
56 | if (!checkCount) {
57 | e.preventDefault();
58 | $.jGrowl(lang.noSelection);
59 | }
60 | }
61 |
62 | /**
63 | * sync all check boxes on this page with the master
64 | *
65 | * @param object the event
66 | * @return void
67 | */
68 | function selectAll(e) {
69 | var onOff = false;
70 |
71 | if($(this).prop("checked")) {
72 | onOff = true;
73 | }
74 | setAllChecks(onOff);
75 | }
76 |
77 | /**
78 | * set all check boxes on this page on/off
79 | *
80 | * @param bool true for checked, false for unchecked
81 | * @return void
82 | */
83 | function setAllChecks(onOff) {
84 | if (onOff !== true) {
85 | onOff = false;
86 | }
87 | checkCount = 0;
88 | $('#asb_select_all').prop("checked", onOff);
89 | $('.asb_check').each(function(k, check) {
90 | $(check).prop("checked", onOff);
91 | if (onOff) {
92 | ++checkCount;
93 | }
94 | });
95 | updateCheckCount();
96 | }
97 |
98 | /**
99 | * adjust checked count on-the-fly
100 | *
101 | * @param object the event
102 | * @return void
103 | */
104 | function keepCount(e) {
105 | if(this.checked) {
106 | ++checkCount;
107 | } else {
108 | --checkCount;
109 | }
110 | updateCheckCount();
111 | }
112 |
113 | /**
114 | * update the go button text to reflect the currently checked count
115 | *
116 | * @return void
117 | */
118 | function updateCheckCount() {
119 | $('#asb_inline_submit').val(lang.go + ' (' + checkCount + ')');
120 | }
121 |
122 | /**
123 | * clear all check boxes when the clear button is clicked
124 | *
125 | * @param object the event
126 | * @return void
127 | */
128 | function clearAll(e) {
129 | setAllChecks();
130 | }
131 |
132 | /**
133 | * count the initially checked boxes
134 | *
135 | * @return void
136 | */
137 | function initialCount() {
138 | checkCount = 0;
139 | $('.asb_check').each(function(k, check) {
140 | if ($(check).prop("checked")) {
141 | ++checkCount;
142 | }
143 | });
144 | updateCheckCount();
145 | }
146 |
147 | $(init);
148 |
149 | // the public method
150 | a.inline = {
151 | setup: setup,
152 | };
153 |
154 | return a;
155 | })(ASB || {}, jQuery);
156 |
--------------------------------------------------------------------------------
/Upload/admin/jscripts/asb/asb_inline.min.js:
--------------------------------------------------------------------------------
1 | var ASB=function(f,b){function h(a){c||(a.preventDefault(),b.jGrowl(e.noSelection))}function k(a){a=!1;b(this).prop("checked")&&(a=!0);g(a)}function g(a){!0!==a&&(a=!1);c=0;b("#asb_select_all").prop("checked",a);b(".asb_check").each(function(e,d){b(d).prop("checked",a);a&&++c});d()}function l(a){this.checked?++c:--c;d()}function d(){b("#asb_inline_submit").val(e.go+" ("+c+")")}function m(a){g()}function n(){c=0;b(".asb_check").each(function(a,d){b(d).prop("checked")&&++c});d()}var c=0,e={go:"Go",
2 | noSelection:"You did not select anything."};b(function(){n();b("#asb_select_all").click(k);b(".asb_check").click(l);b("#asb_inline_clear").click(m);b("#asb_inline_submit").click(h)});f.inline={setup:function(a){b.extend(e,a||{})}};return f}(ASB||{},jQuery);
--------------------------------------------------------------------------------
/Upload/admin/jscripts/asb/asb_modal.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Plugin Name: Advanced Sidebox for MyBB 1.8.x
3 | * Copyright 2014 WildcardSearch
4 | * http://www.rantcentralforums.com
5 | *
6 | * intercept the submit button, submit
7 | * with ajax, and eval return scripts
8 | */
9 |
10 | !function($) {
11 | function init() {
12 | $("#modalSubmit").click(submitForm);
13 | }
14 |
15 | function submitForm (e) {
16 | e.preventDefault();
17 |
18 | $.ajax({
19 | type: "POST",
20 | url: $("#modal_form").attr("action") + "&ajax=1",
21 | data: $("#modal_form").serialize(),
22 | success: function(data) {
23 | $(data).filter("script").each(function(e) {
24 | eval($(this).text());
25 | });
26 | $.modal.close();
27 | },
28 | error: function(jqXHR, textStatus, errorThrown) {
29 | alert(textStatus +
30 | "\n\n" +
31 | errorThrown);
32 | },
33 | });
34 | }
35 |
36 | $(init);
37 | }(jQuery);
38 |
--------------------------------------------------------------------------------
/Upload/admin/jscripts/asb/asb_modal.min.js:
--------------------------------------------------------------------------------
1 | !function($){function init(){$("#modalSubmit").click(submitForm)}function submitForm(e){e.preventDefault();$.ajax({type:"POST",url:$("#modal_form").attr("action")+"&ajax=1",data:$("#modal_form").serialize(),success:function(data){$(data).filter("script").each(function(e){eval($(this).text())});$.modal.close()},error:function(jqXHR,textStatus,errorThrown){alert(textStatus+"\n\n"+errorThrown)}})}$(init)}(jQuery);
--------------------------------------------------------------------------------
/Upload/admin/jscripts/asb/asb_scripts.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Plugin Name: Advanced Sidebox for MyBB 1.8.x
3 | * Copyright 2014 WildcardSearch
4 | * http://www.rantcentralforums.com
5 | *
6 | * this file contains JavaScript for the ACP script edit functions
7 | */
8 |
9 | var ASB = (function(a, $) {
10 | var current = "",
11 | lang = {
12 | nothing_found: "nothing found",
13 | hooks: "hooks",
14 | actions: "actions",
15 | templates: "templates",
16 | error_file_name_empty: "no file name",
17 | error_file_does_not_exist: "file does not exist",
18 | error_file_empty: "file empty or corrupted",
19 | };
20 |
21 | /**
22 | * hide/show the appropriate inputs based on current values,
23 | * observe action/hook/template detection drop-downs and
24 | * bind detection to changing of the script filename
25 | *
26 | * @return void
27 | */
28 | function init() {
29 | // only show replace all options when selected
30 | new Peeker($(".replace_all"), $("#replace_content"), /1/, true);
31 |
32 | // hide search & replace inputs when replacing
33 | new Peeker($(".replace_all"), $("#header_search"), /0/, true);
34 | new Peeker($(".replace_all"), $("#footer_search"), /0/, true);
35 |
36 | // if we are eval()ing, hide all the inputs that are unnecessary
37 | new Peeker($(".eval"), $("#template_row"), /0/, true);
38 | new Peeker($(".eval"), $("#header_search"), /0/, true);
39 | new Peeker($(".eval"), $("#footer_search"), /0/, true);
40 | new Peeker($(".eval"), $("#replace_all"), /0/, true);
41 | new Peeker($(".eval"), $("#replace_content"), /0/, true);
42 |
43 | if ($("#replace_all_yes").prop("checked")) {
44 | $("#header_search").hide();
45 | $("#footer_search").hide();
46 | } else {
47 | $("#replace_content").hide();
48 | }
49 |
50 | if ($("#eval_yes").prop("checked")) {
51 | $("#header_search").hide();
52 | $("#footer_search").hide();
53 | $("#template_row").hide();
54 | $("#replace_all").hide();
55 | $("#replace_content").hide();
56 | }
57 |
58 | // watch the "detected" selectors and send the chosen
59 | // item to the appropriate text box
60 | observeInputs();
61 |
62 | /*
63 | * watch the file name input and if it has changed on blur
64 | * attempt to detect hooks, template and URL attributes
65 | * (page, action)and display them as selectable lists
66 | */
67 | $("#filename").blur(update);
68 | }
69 |
70 | /**
71 | * show the spinners and launch the detection request
72 | *
73 | * @param Event the blur event object
74 | * @return void
75 | */
76 | function update(event) {
77 | // if nothing has changed, get out
78 | if (this.value == current ||
79 | this.value == "") {
80 | return;
81 | }
82 |
83 | // otherwise, update the current script
84 | current = this.value;
85 |
86 | // hide the "detected" selectors
87 | $("#hook_list").hide();
88 | $("#template_list").hide();
89 | $("#action_list").hide();
90 |
91 | // show all the spinners
92 | $("div.ajax_spinners").show();
93 |
94 | $.ajax({
95 | type: "post",
96 | url: "index.php",
97 | data: {
98 | module: "config-asb",
99 | action: "xmlhttp",
100 | mode: "analyze_script",
101 | filename: this.value,
102 | selected: {
103 | hook: $("#hook").val(),
104 | template: $("#template_name").val(),
105 | action: $("#action").val(),
106 | },
107 | },
108 | success: showResults,
109 | error: function(jqXHR, textStatus, errorThrown) {
110 | alert("error" +
111 | "\n\n" +
112 | textStatus +
113 | "\n\n" +
114 | errorThrown);
115 | },
116 | });
117 | }
118 |
119 | /**
120 | * hide the spinners and build the select elements
121 | *
122 | * @param Response the XMLHTTP response object
123 | * @return void
124 | */
125 | function showResults(info) {
126 | var $fileInfo = $("#file_info"),
127 | errorMessage;
128 |
129 | // hide all the spinners
130 | $("div.ajax_spinners").hide();
131 |
132 | // check for errors
133 | if (typeof info.error !== "undefined") {
134 | switch (info.error) {
135 | case 1:
136 | errorMessage = lang.error_file_name_empty;
137 | break;
138 | case 3:
139 | errorMessage = lang.error_file_empty;
140 | break;
141 | default:
142 | errorMessage = lang.error_file_does_not_exist;
143 | break;
144 | }
145 |
146 | $fileInfo.html(errorMessage);
147 | return;
148 | } else {
149 | $fileInfo.html("")
150 | }
151 |
152 | /*
153 | * use each of the key words in the array to
154 | * show detected items or a message that there
155 | * was nothing to show
156 | */
157 | $.each(["hook", "template", "action"], function(i, k) {
158 | // make the plural version
159 | var ks = k + "s",
160 | // the no content message
161 | html = ' out
217 | sidebox = $(sideboxId);
218 | sidebox.css({
219 | backgroundColor: "#f00",
220 | });
221 | sidebox.html(lang.deleting_sidebox);
222 | sidebox.fadeOut(800, function() {
223 | $(this).remove();
224 | });
225 | }
226 | }
227 |
228 | $(init);
229 |
230 | a.sidebox = {
231 | createDiv: createDiv,
232 | updateDiv: updateDiv,
233 | };
234 |
235 | return a;
236 | })(ASB || {}, jQuery);
237 |
--------------------------------------------------------------------------------
/Upload/admin/jscripts/asb/asb_sideboxes.min.js:
--------------------------------------------------------------------------------
1 | var ASB=(function(h,c){function j(){c(".draggable").draggable({revert:true,start:function(k,a){a.helper.css("z-index",999)},stop:function(k,a){a.helper.css("z-index",50)}});c(".sortable").sortable({connectWith:".column",update:function(l,k){var a=c(this);c.ajax({type:"post",url:"index.php",data:{module:"config-asb",action:"xmlhttp",mode:"order",pos:a.prop("id"),data:a.sortable("serialize")},success:function(m){if(!m){return}if(typeof m=="string"&&m.search('value="login"')!=-1){location.reload(true)}var n=m.split(",");c(n).each(function(o,p){n[o]=parseInt(p)});e(n)},error:function(m,o,n){alert(o+"\n\n"+n)}})}}).disableSelection();c(".droppable").droppable({accept:".draggable",hoverClass:"hover",drop:d});c("a[id^='edit_sidebox_']").click(i);c(".del_icon").remove();c(".add_box_link").each(function(a,k){k.replaceWith(c(k).html())})}function i(a){a.preventDefault();g(c(this).prop("href")+"&ajax=1")}function d(l,k){var m=(c(this).prop("id")=="left_column")?0:1,a="index.php?module=config-asb&action=edit_box&ajax=1&box=0&addon="+k.draggable.prop("id")+"&pos="+m;g(a)}function g(a){c.get(a,function(k){if(!k||k.length==0){return}if(typeof k=="string"&&k.search("errors")!=-1&&k.search("login")!=-1){location.reload(true);return}c(k).appendTo("body").modal({fadeDuration:250,zIndex:(typeof modal_zindex!=="undefined"?modal_zindex:9999)})})}function f(l,k,a){if(!c("#"+a)){return}c("#"+a).append(c("
",{id:"sidebox_"+l,"class":"sidebox"}).html(k))}function b(k){var a="#sidebox_"+k;if(!c(a)){return}c(a).load("index.php",{module:"config-asb",action:"xmlhttp",mode:"build_info",id:k,ajax:"1"})}function e(k){if(k.length==0){return}var a,m,l;for(a=0;a
20 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/adv_sidebox.php:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb.php:
--------------------------------------------------------------------------------
1 |
Please make sure IN_MYBB is defined.');
13 | }
14 |
15 | // for modules
16 | define('IN_ASB', true);
17 | define('ASB_MODULES_DIR', MYBB_ROOT.'inc/plugins/asb/modules');
18 | define('ASB_VERSION', '3.1.19');
19 | define('ASB_CUSTOM_VERSION', '2.0');
20 | define('ASB_SCRIPT_VERSION', '2.0');
21 |
22 | // register custom class autoloader
23 | spl_autoload_register('asbClassAutoload');
24 |
25 | // some basic functions used everywhere
26 | require_once MYBB_ROOT.'inc/plugins/asb/functions.php';
27 |
28 | // load the install/admin routines only if in ACP.
29 | if (defined('IN_ADMINCP')) {
30 | require_once MYBB_ROOT.'inc/plugins/asb/acp.php';
31 | } else {
32 | require_once MYBB_ROOT.'inc/plugins/asb/forum.php';
33 | }
34 |
35 | /**
36 | * class autoloader
37 | *
38 | * @param string the name of the class to load
39 | */
40 | function asbClassAutoload($className)
41 | {
42 | $path = MYBB_ROOT."inc/plugins/asb/classes/{$className}.php";
43 |
44 | if (file_exists($path)) {
45 | require_once $path;
46 | }
47 | }
48 |
49 | ?>
50 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/classes/AdvancedSideboxCache.php:
--------------------------------------------------------------------------------
1 | read();
44 |
45 | // if the cache has never been built or has been marked as changed
46 | // then rebuild and store it
47 | if ((int) $data['last_run'] == 0 ||
48 | $data['has_changed']) {
49 | $this->buildCache($data);
50 | $this->update(null, $data);
51 | }
52 |
53 | // returned the cached info
54 | return $data;
55 | }
56 |
57 | /**
58 | * build all of the relevant info needed to manage side boxes
59 | *
60 | * @param array cache data variable
61 | * @return void
62 | */
63 | public function buildCache(&$data)
64 | {
65 | global $db;
66 |
67 | // fresh start
68 | $data['custom'] = $data['sideboxes'] = $data['scripts'] = $data['all_scripts'] = array();
69 |
70 | // update the run time and changed flag before we even start
71 | $data['last_run'] = TIME_NOW;
72 | $data['has_changed'] = false;
73 |
74 | // get all the active scripts' info
75 | $allScripts = asbGetAllScripts();
76 |
77 | // no scripts, no work to do
78 | if (!is_array($allScripts) ||
79 | empty($allScripts)) {
80 | return;
81 | }
82 |
83 | // store the script definitions and a master list
84 | foreach ($allScripts as $filename => $script) {
85 | $data['scripts'][$filename] = $script;
86 | }
87 | $data['all_scripts'] = array_keys($allScripts);
88 |
89 | // load all detected modules
90 | $addons = asbGetAllModules();
91 |
92 | // get any custom boxes
93 | $custom = asbGetAllCustomBoxes();
94 |
95 | // get any sideboxes
96 | $sideboxes = asbGetAllSideBoxes();
97 |
98 | if (!is_array($sideboxes) ||
99 | empty($sideboxes)) {
100 | return;
101 | }
102 |
103 | foreach ($sideboxes as $sidebox) {
104 | // build basic data
105 | $scripts = $sidebox->get('scripts');
106 | $id = (int) $sidebox->get('id');
107 | $pos = $sidebox->get('position') ? 1 : 0;
108 | $data['sideboxes'][$id] = $sidebox->get('data');
109 | $module = $sidebox->get('box_type');
110 |
111 | // no scripts == all scripts
112 | if (empty($scripts)) {
113 | // add this side box to the 'global' set (to be merged with the current script when applicable)
114 | $scripts = array('global');
115 | }
116 |
117 | // for each script in which the side box is used, add a pointer and if it is a custom box, cache its contents
118 | foreach ($scripts as $filename) {
119 | // side box from a module?
120 | if (isset($addons[$module]) &&
121 | $addons[$module] instanceof SideboxExternalModule) {
122 | // store the module name and all the template vars used
123 | $data['scripts'][$filename]['sideboxes'][$pos][$id] = $module;
124 | $data['scripts'][$filename]['template_vars'][$id] = "{$module}_{$id}";
125 |
126 | // if there are any templates get their names so we can cache them
127 | $templates = $addons[$module]->get('templates');
128 | if (is_array($templates) &&
129 | !empty($templates)) {
130 | foreach ($templates as $template) {
131 | $data['scripts'][$filename]['templates'][] = $template['title'];
132 | }
133 | }
134 |
135 | // AJAX?
136 | if ($addons[$module]->xmlhttp &&
137 | $sidebox->hasSettings) {
138 | $settings = $sidebox->get('settings');
139 |
140 | // again, default here is off if anything goes wrong
141 | if ($settings['xmlhttp_on']) {
142 | // if all is good add the script building info
143 | $data['scripts'][$filename]['extra_scripts'][$id]['position'] = $pos;
144 | $data['scripts'][$filename]['extra_scripts'][$id]['module'] = $module;
145 | $data['scripts'][$filename]['extra_scripts'][$id]['rate'] = $settings['xmlhttp_on'];
146 | }
147 | }
148 |
149 | if ($addons[$module]->hasScripts) {
150 | foreach ($addons[$module]->get('scripts') as $script) {
151 | $data['scripts'][$filename]['js'][$script] = $script;
152 | }
153 | }
154 | // side box from a custom box?
155 | } else if(isset($custom[$module]) &&
156 | $custom[$module] instanceof CustomSidebox) {
157 | // store the pointer
158 | $data['scripts'][$filename]['sideboxes'][$pos][$id] = $module;
159 | $data['scripts'][$filename]['template_vars'][$id] = "{$module}_{$id}";
160 |
161 | // and cache the contents
162 | $data['custom'][$module] = $custom[$module]->get('data');
163 | }
164 | }
165 | }
166 | }
167 | }
168 |
169 | ?>
170 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/classes/AdvancedSideboxInstaller.php:
--------------------------------------------------------------------------------
1 |
40 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/classes/CustomSidebox.php:
--------------------------------------------------------------------------------
1 | noStore[] = 'baseName';
51 | parent::__construct($data);
52 | }
53 |
54 | /**
55 | * attempts to load the side box's data from the db, or if given no data create a blank object
56 | *
57 | * @param array|int data or id
58 | * @return bool true on success, false on fail
59 | */
60 | public function load($data)
61 | {
62 | if (parent::load($data)) {
63 | $this->baseName = 'asb_custom_'.$this->id;
64 | return true;
65 | }
66 | return false;
67 | }
68 |
69 | /**
70 | * removes the custom side box from the database
71 | *
72 | * @param bool prevent removal of sideboxes of this type?
73 | * @return bool success/fail
74 | */
75 | public function remove($noCleanup=false)
76 | {
77 | // unless specifically requested otherwise clean up
78 | if (!$noCleanup) {
79 | $this->removeChildren();
80 | }
81 | return parent::remove();
82 | }
83 |
84 | /**
85 | * delete all the side boxes of this type
86 | *
87 | * @return void
88 | */
89 | protected function removeChildren()
90 | {
91 | global $db;
92 |
93 | // delete all boxes of this type in use
94 | $module = $db->escape_string(strtolower($this->baseName));
95 | $db->delete_query('asb_sideboxes', "LOWER(box_type)='{$module}'");
96 | }
97 |
98 | /**
99 | * builds the content for the template variable used for this custom box
100 | *
101 | * @param string
102 | * @return bool success/fail
103 | */
104 | public function buildTemplate($template_variable)
105 | {
106 | global $$template_variable, $mybb, $lang;
107 |
108 | $content = $this->content;
109 | $returnVal = true;
110 |
111 | // if the user doesn't want content then at least make it validate
112 | if (strlen($content) == 0) {
113 | $returnVal = false;
114 | $content = '
115 |
116 | |
117 |
';
118 | } else {
119 | $content = str_replace("\\'", "'", addslashes($content));
120 | eval("\${$template_variable} = \"{$content}\";");
121 | }
122 | return $returnVal;
123 | }
124 | }
125 |
126 | ?>
127 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/classes/ExternalModule010000.php:
--------------------------------------------------------------------------------
1 | valid = $this->load($module);
53 | }
54 |
55 | /**
56 | * attempt to load the module's info
57 | *
58 | * @param string base name of the module to load
59 | * @return bool true on success, false on fail
60 | */
61 | public function load($module)
62 | {
63 | if (!$module ||
64 | !$this->path ||
65 | !$this->prefix) {
66 | return false;
67 | }
68 |
69 | // store the unique name
70 | $this->baseName = trim($module);
71 |
72 | // store the info
73 | $info = $this->run('info');
74 | return $this->set($info);
75 | }
76 |
77 | /**
78 | * safely access the module's functions
79 | *
80 | * @param string function name
81 | * @param array
82 | * @return mixed
83 | */
84 | public function run($function_name, $args = '')
85 | {
86 | $function_name = trim($function_name);
87 | if (!$function_name ||
88 | !$this->baseName ||
89 | !$this->path ||
90 | !$this->prefix) {
91 | return false;
92 | }
93 |
94 | $fullpath = "{$this->path}/{$this->baseName}.php";
95 | if (!file_exists($fullpath)) {
96 | return false;
97 | }
98 | require_once $fullpath;
99 |
100 | $this_function = "{$this->prefix}_{$this->baseName}_{$function_name}";
101 | if (!function_exists($this_function)) {
102 | return false;
103 | }
104 | return $this_function($args);
105 | }
106 |
107 | /**
108 | * physically delete the module from the server
109 | *
110 | * @return bool
111 | */
112 | public function remove()
113 | {
114 | $filename = "{$this->path}/{$this->baseName}.php";
115 | @unlink($filename);
116 |
117 | return !file_exists($filename);
118 | }
119 | }
120 |
121 | ?>
122 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/classes/ExternalModuleInterface010000.php:
--------------------------------------------------------------------------------
1 |
20 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/classes/HTMLGenerator010000.php:
--------------------------------------------------------------------------------
1 | input
25 | * variable names, add custom keys in
26 | * __construct() or in-line
27 | */
28 | public $allowed_url_keys = array(
29 | 'module',
30 | 'action',
31 | 'mode',
32 | 'id',
33 | 'uid',
34 | 'tid',
35 | 'page',
36 | 'my_post_key',
37 | );
38 |
39 | /**
40 | * @var array
41 | */
42 | public $allowed_img_properties = array(
43 | 'id',
44 | 'name',
45 | 'title',
46 | 'alt',
47 | 'style',
48 | 'class',
49 | 'onclick',
50 | );
51 |
52 | /**
53 | * @var array
54 | */
55 | public $allowed_link_properties = array(
56 | 'id',
57 | 'name',
58 | 'title',
59 | 'style',
60 | 'class',
61 | 'onclick',
62 | 'target',
63 | );
64 |
65 | /**
66 | * constructor
67 | *
68 | * @param string base URL
69 | * @param string|array 1+ key names
70 | * @return void
71 | */
72 | public function __construct($url = '', $extra_keys = '')
73 | {
74 | // custom base URL?
75 | if (trim($url)) {
76 | $this->base_url = trim($url);
77 | }
78 |
79 | // custom keys?
80 | if (!$extra_keys) {
81 | return;
82 | }
83 |
84 | foreach ((array) $extra_keys as $key) {
85 | $key = trim($key);
86 | if ($key &&
87 | !in_array($key, $this->allowed_url_keys)) {
88 | $this->allowed_url_keys[] = $key;
89 | }
90 | }
91 | }
92 |
93 | /**
94 | * builds a URL from standard options array
95 | *
96 | * @param array
97 | * @param string override URL base
98 | * @param bool override URL encoded ampersand
99 | * @return string URL
100 | */
101 | public function url($options = array(), $base_url = '', $encoded = true)
102 | {
103 | $url = $this->base_url;
104 | if ($base_url &&
105 | trim($base_url)) {
106 | $url = $base_url;
107 | }
108 |
109 | $amp = '&';
110 | if ($encoded) {
111 | $amp = '&';
112 | }
113 | $sep = $amp;
114 | if (strpos($url, '?') === false) {
115 | $sep = '?';
116 | }
117 |
118 | // check for the allowed options
119 | foreach ((array) $this->allowed_url_keys as $item) {
120 | if (isset($options[$item]) &&
121 | $options[$item]) {
122 | // and add them if set
123 | $url .= "{$sep}{$item}={$options[$item]}";
124 | $sep = $amp;
125 | }
126 | }
127 | return $url;
128 | }
129 |
130 | /**
131 | * builds an HTML anchor from the provided options
132 | *
133 | * @param string
134 | * @param string
135 | * @param array
136 | * @param array
137 | * @return string
138 | */
139 | public function link($url = '', $caption = '', $options = '', $icon_options = array())
140 | {
141 | $properties = $this->build_property_list($options, $this->allowed_link_properties);
142 |
143 | if (isset($options['icon'])) {
144 | $icon_img = $this->img($options['icon'], $icon_options);
145 | $icon_link = <<{$icon_img}
147 | EOF;
148 | }
149 |
150 | if (!$url) {
151 | $url = $this->url();
152 | }
153 | if (!isset($caption) ||
154 | !$caption) {
155 | $caption = $url;
156 | }
157 |
158 | return <<{$caption}
160 | EOF;
161 | }
162 |
163 | /**
164 | * generate HTML image markup
165 | *
166 | * @param string
167 | * @param array
168 | * @return string
169 | */
170 | public function img($url, $options = array())
171 | {
172 | $properties = $this->build_property_list($options, $this->allowed_img_properties);
173 |
174 | return <<
176 | EOF;
177 | }
178 |
179 | /**
180 | * build HTML property list
181 | *
182 | * @param array
183 | * @param array
184 | * @return string
185 | */
186 | protected function build_property_list($options = array(), $allowed = array())
187 | {
188 | if (!is_array($options) ||
189 | !is_array($allowed)) {
190 | return false;
191 | }
192 |
193 | foreach ($allowed as $key) {
194 | if (isset($options[$key]) &&
195 | $options[$key]) {
196 | $property_list .= <<
206 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/classes/MalleableObject010000.php:
--------------------------------------------------------------------------------
1 | $property;
30 | }
31 | }
32 | return $returnArray;
33 | } else {
34 | if (property_exists($this, $properties)) {
35 | return $this->$properties;
36 | }
37 | return false;
38 | }
39 | }
40 |
41 | /**
42 | * sets a single property or multiple properties at once
43 | *
44 | * @param array|string
45 | * @param mixed the property value
46 | * @return bool success/fail
47 | */
48 | public function set($properties, $value = '')
49 | {
50 | if (!is_array($properties)) {
51 | $properties = array($properties => $value);
52 | }
53 |
54 | foreach ($properties as $property => $value) {
55 | if (isset($value) &&
56 | property_exists($this, $property)) {
57 | $this->$property = $value;
58 | }
59 | }
60 | return true;
61 | }
62 |
63 | /**
64 | * allows access to the protected valid property
65 | *
66 | * @return bool the valid property value
67 | */
68 | public function isValid()
69 | {
70 | return $this->valid;
71 | }
72 | }
73 |
74 | ?>
75 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/classes/MalleableObjectInterface010000.php:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/classes/PortableObject010102.php:
--------------------------------------------------------------------------------
1 | tableName ||
23 | !$this->id) {
24 | return false;
25 | }
26 |
27 | $row = $this->buildRow();
28 | $id = (int) $this->id;
29 |
30 | if (!$row) {
31 | return false;
32 | }
33 |
34 | $options = $this->buildOptions($options);
35 | $xml = $this->buildXml($row, $options);
36 |
37 | if ($return === true) {
38 | return $xml;
39 | }
40 |
41 | $this->output($xml, $options);
42 |
43 | return true;
44 | }
45 |
46 | /**
47 | * import an object from XML
48 | *
49 | * @param string the contents of the XML file to be imported
50 | * @return bool success/fail
51 | */
52 | public function import($xml)
53 | {
54 | $tree = $this->getTree($xml);
55 | if (!is_array($tree) ||
56 | !is_array($tree[$this->tableName])) {
57 | return false;
58 | }
59 |
60 | foreach ($tree[$this->tableName] as $property => $entry) {
61 | // skip the info
62 | if (in_array($property, array('tag', 'value', 'attributes')) ||
63 | !is_array($entry) ||
64 | empty($entry)) {
65 | continue;
66 | }
67 |
68 | foreach ($entry as $key => $value) {
69 | // skip the info
70 | if (in_array($key, array('tag', 'value'))) {
71 | continue;
72 | }
73 |
74 | // get the field name from the array key
75 | $newKey = explode('-', $key);
76 | $newKey = $newKey[0];
77 |
78 | // is it a valid property name for this object?
79 | if (property_exists($this, $newKey)) {
80 | // then store it
81 | $this->$newKey = $value['value'];
82 | }
83 | }
84 | }
85 | return true;
86 | }
87 |
88 | public function output($xml, $options = '')
89 | {
90 | // send out headers (opens a save dialogue)
91 | header("Content-Disposition: attachment; filename={$options['filename']}");
92 | header('Content-Type: application/xml');
93 | header('Content-Length: ' . strlen($xml));
94 | header('Pragma: no-cache');
95 | header('Expires: 0');
96 | echo <<getCleanIdentifier();
106 | $defaultValues = array(
107 | "charset" => 'UTF-8',
108 | "version" => '1.0',
109 | "website" => 'http://www.rantcentralforums.com',
110 | "filename" => "{$this->tableName}_{$name}-backup.xml",
111 | );
112 |
113 | // try to get MyBB default charset
114 | if (isset($lang->settings['charset'])) {
115 | $defaultValues['charset'] = $lang->settings['charset'];
116 | }
117 |
118 | if (is_array($options) &&
119 | !empty($options)) {
120 | foreach ($defaultValues as $key => $value) {
121 | if (!isset($options[$key]) ||
122 | !$options[$key]) {
123 | $options[$key] = $value;
124 | }
125 | }
126 | } else {
127 | $options = $defaultValues;
128 | }
129 | return $options;
130 | }
131 |
132 | public function buildXml($rows, $options = '')
133 | {
134 | return <<
136 | <{$this->tableName} version="{$options['version']}" xmlns="{$options['website']}">
137 | <{$this->tableName}_{$this->id}>
138 | {$rows}
139 | {$this->tableName}_{$this->id}>
140 | {$this->tableName}>
141 | EOF;
142 | }
143 |
144 | /**
145 | * build a single row of XML markup for this object
146 | *
147 | * @return string|bool the XML markup or false on fail
148 | */
149 | public function buildRow()
150 | {
151 | // object must have been saved (it exists in the db) in order to be exported
152 | if (!$this->tableName ||
153 | !$this->id) {
154 | return false;
155 | }
156 |
157 | $row = '';
158 | $id = (int) $this->id;
159 | foreach ($this as $property => $value) {
160 | // skip inherited properties
161 | if (in_array($property, $this->noStore)) {
162 | continue;
163 | }
164 | $row .= <<{$property}-{$id}>
166 |
167 | EOF;
168 | }
169 | return $row;
170 | }
171 |
172 | /**
173 | * process the XML
174 | *
175 | * @param string
176 | * @return array|bool
177 | */
178 | protected function getTree($xml)
179 | {
180 | if (!$xml) {
181 | return false;
182 | }
183 |
184 | require_once MYBB_ROOT . 'inc/class_xml.php';
185 | $parser = new XMLParser($xml);
186 | return $parser->get_tree();
187 | }
188 |
189 | /**
190 | * returns the name, title or id to be used as a unique identifier
191 | *
192 | * @access private
193 | * @return string the identifier
194 | */
195 | protected function getCleanIdentifier()
196 | {
197 | if (property_exists($this, 'name') &&
198 | trim($this->name)) {
199 | $name = $this->name;
200 | } else if (property_exists($this, 'title') &&
201 | trim($this->title)) {
202 | $name = $this->title;
203 | }
204 |
205 | if (!$name) {
206 | return (int) $this->id;
207 | }
208 |
209 | // clean and return
210 | $find = array(
211 | "#(\s)+#s",
212 | "#[^\w_]#is"
213 | );
214 | $replace = array(
215 | '_',
216 | ''
217 | );
218 | return preg_replace($find, $replace, strtolower(trim($name)));
219 | }
220 | }
221 |
222 | ?>
223 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/classes/PortableObjectInterface010100.php:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/classes/ScriptInfo.php:
--------------------------------------------------------------------------------
1 |
94 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/classes/SideboxExternalModule.php:
--------------------------------------------------------------------------------
1 | compatibility ||
114 | version_compare('2.1', $this->compatibility, '>')) {
115 | return false;
116 | }
117 |
118 | $this->hasSettings = !empty($this->settings);
119 | $this->hasScripts = !empty($this->scripts);
120 | $oldVersion = $this->getCacheVersion();
121 |
122 | // new module
123 | if ((!isset($oldVersion) ||
124 | $oldVersion === 0) &&
125 | !defined('IN_ASB_UNINSTALL')) {
126 | $this->install();
127 | // newly updated module
128 | } elseif ($oldVersion &&
129 | version_compare($oldVersion, $this->version, '<') &&
130 | !defined('IN_ASB_UNINSTALL')) {
131 | $this->upgrade();
132 | // pre-existing module
133 | } else {
134 | // otherwise mark upgrade status
135 | $this->isUpgraded = $this->isInstalled = true;
136 | }
137 | return true;
138 | }
139 |
140 | /**
141 | * install templates if they exist to allow the add-on module to function correctly
142 | *
143 | * @param bool remove install data before beginning?
144 | * @return void
145 | */
146 | public function install($cleanup=true)
147 | {
148 | global $db;
149 |
150 | // already installed? unless $cleanup is specifically denied...
151 | if ($this->isInstalled &&
152 | $cleanup) {
153 | // ...remove the leftovers before installing
154 | $this->uninstall();
155 | }
156 |
157 | $this->isUpgraded = $this->isInstalled = true;
158 | $this->setCacheVersion();
159 |
160 | // if there are no templates we're done
161 | if (!is_array($this->templates)) {
162 | return;
163 | }
164 |
165 | $insertArray = array();
166 | foreach ($this->templates as $template) {
167 | $template['sid'] = -2;
168 | $query = $db->simple_select('templates', '*', "title='{$template['title']}' AND sid IN('-2', '-1')");
169 |
170 | // if it exists, update
171 | if ($db->num_rows($query) > 0) {
172 | $db->update_query('templates', $template, "title='{$template['title']}' AND sid IN('-2', '-1')");
173 | } else {
174 | // if not, create a new template
175 | $insertArray[] = $template;
176 | }
177 | }
178 |
179 | if (!empty($insertArray)) {
180 | $db->insert_query_multiple('templates', $insertArray);
181 | }
182 | }
183 |
184 | /**
185 | * remove any templates used by the module and clean up any boxes created
186 | * using this add-on module
187 | *
188 | * @param bool remove children
189 | * @return void
190 | */
191 | public function uninstall($cleanup=true)
192 | {
193 | $this->unsetCacheVersion();
194 |
195 | // unless specifically asked not to, delete any boxes that use this module
196 | if ($cleanup) {
197 | $this->removeChildren();
198 | }
199 |
200 | // if there are no templates we're done
201 | if (!is_array($this->templates)) {
202 | return;
203 | }
204 |
205 | // remove them all
206 | $deleteList = $sep = '';
207 | foreach ($this->templates as $template) {
208 | $deleteList .= "{$sep}'{$template['title']}'";
209 | $sep = ',';
210 | }
211 |
212 | if ($deleteList) {
213 | global $db;
214 | $db->delete_query('templates', "title IN({$deleteList})");
215 | }
216 | }
217 |
218 | /**
219 | * called upon add-on version change to verify module's templates/settings
220 | *
221 | * @return void
222 | */
223 | protected function upgrade()
224 | {
225 | global $db;
226 |
227 | // don't waste time if everything is in order
228 | if ($this->isUpgraded) {
229 | return;
230 | }
231 |
232 | // if any templates were dropped in this version
233 | if (is_array($this->discarded_templates)) {
234 | // delete them
235 | $deleteList = $sep = '';
236 | foreach ($this->discarded_templates as $template) {
237 | $deleteList .= "{$sep}'{$template}'";
238 | $sep = ',';
239 | }
240 |
241 | if ($deleteList) {
242 | $db->delete_query('templates', "title IN({$deleteList})");
243 | }
244 | }
245 |
246 | /*
247 | * install the updated module
248 | *
249 | * $cleanup = false directs the install method not to uninstall the module as normal
250 | */
251 | $this->install(false);
252 | if ($this->hasSettings) {
253 | $this->updateChildren();
254 | }
255 |
256 | // update the version cache and the upgrade is complete
257 | $this->isUpgraded = $this->setCacheVersion();
258 | $this->isInstalled = true;
259 | }
260 |
261 | /**
262 | * uninstalls (if necessary) and physically deletes the module from the server
263 | *
264 | * @return bool success/fail
265 | */
266 | public function remove()
267 | {
268 | // make sure no trash is left behind
269 | $this->uninstall();
270 |
271 | // nuke it
272 | $filename = "{$this->path}/{$this->baseName}.php";
273 | @unlink($filename);
274 |
275 | return !file_exists($filename);
276 | }
277 |
278 | /**
279 | * delete all the side boxes of this type
280 | *
281 | * @return void
282 | */
283 | protected function removeChildren()
284 | {
285 | global $db;
286 |
287 | // delete all boxes of this type in use
288 | $module = $db->escape_string(strtolower($this->baseName));
289 | $db->delete_query('asb_sideboxes', "LOWER(box_type)='{$module}'");
290 | }
291 |
292 | /**
293 | * update settings for side boxes of this type
294 | *
295 | * @return void
296 | */
297 | protected function updateChildren()
298 | {
299 | global $db;
300 |
301 | // get all boxes of this type in use
302 | $module = $db->escape_string(strtolower($this->baseName));
303 | $query = $db->simple_select('asb_sideboxes', '*', "LOWER(box_type)='{$module}'");
304 | if ($db->num_rows($query) == 0) {
305 | // this module has no children so we are done
306 | return;
307 | }
308 |
309 | // loop through all the children
310 | while ($data = $db->fetch_array($query)) {
311 | // create a new SideboxObject from the data
312 | $sidebox = new SideboxObject($data);
313 |
314 | if (!$sidebox->isValid()) {
315 | // something went wrong and this box has no ID
316 | // if we continue, we'll be creating a side box
317 | continue;
318 | }
319 |
320 | // retrieve the settings
321 | $sideboxSettings = $sidebox->get('settings');
322 |
323 | // unset any removed settings
324 | foreach ($sideboxSettings as $name => $setting) {
325 | if (!isset($this->settings[$name])) {
326 | unset($sideboxSettings[$name]);
327 | }
328 | }
329 |
330 | // update any settings which are missing
331 | foreach ($this->settings as $name => $setting) {
332 | if (!isset($sideboxSettings[$name])) {
333 | // new setting-- default value
334 | $sideboxSettings[$name] = $this->settings[$name]['value'];
335 | }
336 | }
337 |
338 | // save the side box
339 | $sidebox->set('settings', $sideboxSettings);
340 | $sidebox->save();
341 | }
342 | }
343 |
344 | /**
345 | * version control
346 | *
347 | * @return string|int version or 0
348 | */
349 | protected function getCacheVersion()
350 | {
351 | $addonVersions = AdvancedSideboxCache::getInstance()->read('addon_versions');
352 |
353 | if (is_array($addonVersions) &&
354 | isset($addonVersions[$this->baseName]) &&
355 | isset($addonVersions[$this->baseName]['version'])) {
356 | return $addonVersions[$this->baseName]['version'];
357 | }
358 | return 0;
359 | }
360 |
361 | /**
362 | * version control
363 | *
364 | * @return bool true
365 | */
366 | protected function setCacheVersion()
367 | {
368 | $myCache = AdvancedSideboxCache::getInstance();
369 |
370 | // update version cache to latest
371 | $addonVersions = $myCache->read('addon_versions');
372 | $addonVersions[$this->baseName]['version'] = $this->version;
373 | $myCache->update('addon_versions', $addonVersions);
374 | return true;
375 | }
376 |
377 | /**
378 | * version control
379 | *
380 | * @return bool true
381 | */
382 | protected function unsetCacheVersion()
383 | {
384 | $myCache = AdvancedSideboxCache::getInstance();
385 |
386 | $addonVersions = $myCache->read('addon_versions');
387 | if (isset($addonVersions[$this->baseName])) {
388 | unset($addonVersions[$this->baseName]);
389 | }
390 | $myCache->update('addon_versions', $addonVersions);
391 | return true;
392 | }
393 |
394 | /**
395 | * runs template building code for the module
396 | *
397 | * @return mixed|bool return value of function or false
398 | */
399 | public function buildTemplate($settings, $template_var, $width, $script)
400 | {
401 | foreach (array('settings', 'template_var', 'width', 'script') as $key) {
402 | $args[$key] = $$key;
403 | }
404 | return $this->run('build_template', $args);
405 | }
406 |
407 | /**
408 | * run the modules XMLHTTP function
409 | *
410 | * @param int UNIX timestamp representing last update
411 | * @param array settings
412 | * @param int column width
413 | * @return mixed|bool return value of function or false
414 | */
415 | public function doXmlhttp($dateline, $settings, $width)
416 | {
417 | foreach (array('dateline', 'settings', 'width') as $key) {
418 | $args[$key] = $$key;
419 | }
420 | return $this->run('xmlhttp', $args);
421 | }
422 |
423 | /**
424 | * run the module's settings_load function
425 | *
426 | * @return mixed|bool return value of function or false
427 | */
428 | public function doSettingsLoad()
429 | {
430 | return $this->run('settings_load', $settings);
431 | }
432 |
433 | /**
434 | * run the module's settings_save function
435 | *
436 | * @param array settings
437 | * @return mixed|bool return value of function or false
438 | */
439 | public function doSettingsSave($settings)
440 | {
441 | $returnVal = $this->run('settings_save', $settings);
442 | if ($returnVal) {
443 | return $returnVal;
444 | }
445 | return $settings;
446 | }
447 | }
448 |
449 | ?>
450 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/classes/SideboxObject.php:
--------------------------------------------------------------------------------
1 | noStore[] = 'hasSettings';
81 | parent::__construct($data);
82 | }
83 |
84 | /**
85 | * create a sidebox/load a side box
86 | *
87 | * @param array|int data or id
88 | * @return bool true on success, false on fail
89 | */
90 | public function load($data)
91 | {
92 | if (!parent::load($data)) {
93 | return false;
94 | }
95 |
96 | foreach (array('settings', 'groups', 'scripts', 'themes') as $property) {
97 | if (property_exists($this, $property) &&
98 | isset($this->$property)) {
99 | // if so decode them
100 | $this->$property = json_decode($this->$property, true);
101 | }
102 | }
103 |
104 | $this->hasSettings = (is_array($this->settings) && !empty($this->settings));
105 | return true;
106 | }
107 | }
108 |
109 | ?>
110 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/classes/StorableObject010001.php:
--------------------------------------------------------------------------------
1 | valid = $this->load($data);
43 | }
44 |
45 | /**
46 | * load the object from the database
47 | *
48 | * @param array|int
49 | * @return bool
50 | */
51 | public function load($data)
52 | {
53 | if (!isset($data) ||
54 | !$data ||
55 | (int) $data == 0) {
56 | return false;
57 | }
58 |
59 | if (!is_array($data) &&
60 | $this->tableName) {
61 | // attempt to load the object by ID
62 | global $db;
63 | $data = (int) $data;
64 | $query = $db->simple_select($this->tableName, '*', "id='{$data}'");
65 |
66 | // if it exists
67 | if ($db->num_rows($query) == 1) {
68 | // store it in our passed var
69 | $data = $db->fetch_array($query);
70 | }
71 | }
72 |
73 | // if we have a (hopefully) valid array
74 | if (is_array($data) &&
75 | !empty($data)) {
76 | // store it in the object
77 | foreach ($data as $key => $val) {
78 | if (property_exists($this, $key)) {
79 | $this->$key = $this->data[$key] = $val;
80 | }
81 | }
82 | return true;
83 | }
84 | // new blank object
85 | return false;
86 | }
87 |
88 | /**
89 | * stores the objects data in the database
90 | *
91 | * @return mixed|bool return of db wrapper or false
92 | */
93 | public function save()
94 | {
95 | global $db;
96 |
97 | $this->data = array();
98 | foreach ($this as $property => $value) {
99 | if (in_array($property, $this->noStore)) {
100 | continue;
101 | }
102 |
103 | switch (gettype($this->$property)) {
104 | case 'boolean':
105 | $this->data[$property] = (bool) $value;
106 | break;
107 | case 'integer':
108 | $this->data[$property] = (int) $value;
109 | break;
110 | case 'NULL':
111 | $this->data[$property] = null;
112 | break;
113 | case 'double':
114 | $this->data[$property] = (float) $value;
115 | break;
116 | case 'string':
117 | $this->data[$property] = $db->escape_string($value);
118 | break;
119 | case 'array':
120 | case 'object':
121 | case 'resource':
122 | $this->data[$property] = $db->escape_string(json_encode($value));
123 | break;
124 | }
125 | }
126 | $this->data['dateline'] = TIME_NOW;
127 |
128 | // insert or update depending upon the content of ID
129 | if ($this->id) {
130 | // return true/false
131 | return $db->update_query($this->tableName, $this->data, "id='{$this->id}'");
132 | } else {
133 | // return the ID on success/false on fail
134 | return $this->id = $db->insert_query($this->tableName, $this->data);
135 | }
136 | }
137 |
138 | /**
139 | * remove the object from the database
140 | *
141 | * @return mixed|bool return of db wrapper or false
142 | */
143 | public function remove($noCleanup = false)
144 | {
145 | // valid ID and DB info?
146 | if (!$this->id ||
147 | !$this->tableName) {
148 | return false;
149 | }
150 |
151 | global $db;
152 | return $db->delete_query($this->tableName, "id='{$this->id}'");
153 | }
154 | }
155 |
156 | ?>
157 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/classes/StorableObjectInterface010000.php:
--------------------------------------------------------------------------------
1 |
18 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/classes/WildcardPluginCache010300.php:
--------------------------------------------------------------------------------
1 | cacheData = $cache->read($this->cacheKey);
29 | }
30 |
31 | /**
32 | * retrieve an individual cache entry
33 | *
34 | * @param string the name of the entry
35 | * @return bool
36 | */
37 | public function read($key = null)
38 | {
39 | if ($key === null) {
40 | if ($this->subKey) {
41 | return $this->cacheData[$this->subKey];
42 | }
43 | return $this->cacheData;
44 | }
45 |
46 | if ($this->subKey &&
47 | isset($this->cacheData[$this->subKey][$key])) {
48 | return $this->cacheData[$this->subKey][$key];
49 | } elseif (isset($this->cacheData[$key])) {
50 | return $this->cacheData[$key];
51 | }
52 | return false;
53 | }
54 |
55 | /**
56 | * update the value of a single cache entry
57 | *
58 | * @param string the name of the entry
59 | * @param mixed the value of the entry
60 | * @param bool true to save immediately or
61 | * false (default) to wait till shut down
62 | * @param bool true (default) to update the
63 | * entire cache in the db
64 | * @return void
65 | */
66 | public function update($key = null, $val, $hard = false)
67 | {
68 | if ($key === null) {
69 | if ($this->subKey) {
70 | $this->cacheData[$this->subKey] = $val;
71 | } else {
72 | $this->cacheData = $val;
73 | }
74 | } else {
75 | if ($this->subKey) {
76 | $this->cacheData[$this->subKey][$key] = $val;
77 | } else {
78 | $this->cacheData[$key] = $val;
79 | }
80 | }
81 | $this->hasChanged($hard);
82 | }
83 |
84 | /**
85 | * save the entire cache to the db
86 | *
87 | * @return void
88 | */
89 | public function save()
90 | {
91 | global $cache;
92 | $cache->update($this->cacheKey, $this->cacheData);
93 | }
94 |
95 | /**
96 | * clear the entire cache
97 | *
98 | * @param bool true to clear and save immediately or
99 | * false (default) to wait till shut down
100 | * @return void
101 | */
102 | public function clear($hard = false)
103 | {
104 | if ($this->subKey) {
105 | $this->cacheData[$this->subKey] = null;
106 | } else {
107 | $this->cacheData = null;
108 | }
109 | $this->hasChanged($hard);
110 | }
111 |
112 | /**
113 | * mark the cache as in need of saving if shut
114 | * down functionality is enabled, or save immediately
115 | * if not
116 | *
117 | * @param bool true to clear and save immediately or
118 | * false (default) to wait till shut down
119 | * @return void
120 | */
121 | protected function hasChanged($hard = false)
122 | {
123 | global $mybb;
124 | if ($hard ||
125 | !$mybb->use_shutdown) {
126 | $this->save();
127 | return;
128 | }
129 |
130 | add_shutdown(array($this, 'save'));
131 | }
132 |
133 | /**
134 | * get the cached version
135 | *
136 | * @return string|int
137 | */
138 | public function getVersion()
139 | {
140 | $version = trim($this->read('version'));
141 | if (!$version) {
142 | $version = 0;
143 | }
144 | return $version;
145 | }
146 |
147 | /**
148 | * set the cached version
149 | *
150 | * @param string
151 | * @return string|int
152 | */
153 | public function setVersion($version)
154 | {
155 | $this->update('version', trim($version));
156 | }
157 | }
158 |
159 | ?>
160 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/classes/WildcardPluginCacheInterface010200.php:
--------------------------------------------------------------------------------
1 |
21 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/classes/WildcardPluginInstallerInterface010000.php:
--------------------------------------------------------------------------------
1 |
14 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/classes/index.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 | forbidden
8 |
23 |
24 |
25 | you don't have permission to access this resource
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/cleanup.php:
--------------------------------------------------------------------------------
1 | settings['bburl']}/{$config['admin_dir']}/index.php?module=config-plugins");
47 |
48 | ?>
49 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/functions_addon.php:
--------------------------------------------------------------------------------
1 | \s\(\)])(http|https|ftp|news){1}://([^\/\"\s\<\[\.]+\.([^\/\"\s\<\[\.]+\.)*[\w]+(:[0-9]+)?(/[^\"\s<\[]*)?)#i", '', $message);
42 | $message = preg_replace("#([\>\s\(\)])(www|ftp)\.(([^\/\"\s\<\[\.]+\.)*[\w]+(:[0-9]+)?(/[^\"\s<\[]*)?)#i", '', $message);
43 | return my_substr($message, 1);
44 | }
45 |
46 | /**
47 | * build a cleaned list of numeric ids and optionally return it as an SQL IN() function
48 | *
49 | * @param int|string id or comma-separated list of ids
50 | * @param string field name
51 | * @param bool present the id list as SQL IN()?
52 | * @return string id list
53 | */
54 | function asbBuildIdList($ids, $field='id', $wrap=true)
55 | {
56 | if (strlen($ids) == 0) {
57 | return false;
58 | }
59 |
60 | if (strpos($ids, ',') !== false) {
61 | $idArray = explode(',', $ids);
62 |
63 | foreach ($idArray as $key => $id) {
64 | if((int) $id == 0)
65 | {
66 | unset($idArray[$key]);
67 | }
68 | }
69 |
70 | if (count($idArray) > 1) {
71 | $idList = implode(',', $idArray);
72 | } elseif (count($idArray) == 1) {
73 | $idList = (int) $idArray[key($idArray)];
74 | }
75 | } else {
76 | $idList = (int) $ids;
77 | }
78 |
79 | if (!$idList) {
80 | return false;
81 | }
82 |
83 | if ($wrap &&
84 | $field) {
85 | $idList = <<isDot()) {
152 | continue;
153 | }
154 |
155 | if ($file->isDir()) {
156 | // no recursion, just skip this
157 | if (!$recursive) {
158 | continue;
159 | }
160 |
161 | // get the files from this directory
162 | $subFiles = asbGetImagesFromPath($folder.'/'.$file->getFilename(), $subfolder.$file->getFilename(), $recursive);
163 | if ($subFiles) {
164 | $filenames .= "{$sep}{$subFiles}";
165 | $sep = ',';
166 | }
167 | continue;
168 | }
169 |
170 | // only certain extensions allowed
171 | $extension = pathinfo($file->getFilename(), PATHINFO_EXTENSION);
172 | if (!in_array($extension, array('gif', 'png', 'jpg', 'jpeg'))) {
173 | continue;
174 | }
175 |
176 | $filenames .= "{$sep}'{$subfolder}{$file->getFilename()}'";
177 | $sep = ',';
178 | }
179 | return $filenames;
180 | }
181 |
182 | ?>
183 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/index.html:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 | forbidden
8 |
23 |
24 |
25 | you don't have permission to access this resource
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Upload/inc/plugins/asb/install.php:
--------------------------------------------------------------------------------
1 |
Please make sure IN_MYBB is defined.');
14 | }
15 |
16 | /**
17 | * information about the plugin used by MyBB for display as well as to connect with updates
18 | *
19 | * @return array plugin info
20 | */
21 | function asb_info()
22 | {
23 | global $mybb, $lang, $cp_style, $cache;
24 |
25 | if (!$lang->asb) {
26 | $lang->load('asb');
27 | }
28 |
29 | $extraLinks = '
';
30 | $settingsLink = asbBuildSettingsLink();
31 | if ($settingsLink) {
32 | if (file_exists(MYBB_ROOT.'inc/plugins/asb/cleanup.php') &&
33 | file_exists(MYBB_ROOT.'inc/plugins/adv_sidebox/acp_functions.php')) {
34 | $removeLink = <<
37 | {$lang->asb_remove_old_files_desc}
{$lang->asb_remove_old_files}
38 |
39 | EOF;
40 | }
41 |
42 | // only show Manage Sideboxes link if active
43 | $pluginList = $cache->read('plugins');
44 | $manageLink = '';
45 | if (!empty($pluginList['active']) &&
46 | is_array($pluginList['active']) &&
47 | in_array('asb', $pluginList['active'])) {
48 | $url = ASB_URL;
49 | $manageLink = <<
51 | {$lang->asb_manage_sideboxes}
52 |
53 | EOF;
54 | }
55 |
56 | $settingsLink = <<
58 | {$settingsLink}
59 |
60 | EOF;
61 | $extraLinks = <<
63 | {$settingsLink}
64 | {$manageLink}{$removeLink}
65 |
66 | {$lang->asb_help}
67 |
68 |
69 | EOF;
70 |
71 | $asbDescription = <<
73 |
74 |
75 |
76 | {$lang->asb_description1}
{$lang->asb_description2}{$extraLinks}
77 | |
78 |
79 | 
80 |
81 | |
82 |
83 |
84 |
85 | EOF;
86 | } else {
87 | $asbDescription = $lang->asb_description1;
88 | }
89 |
90 | $name = <<{$lang->asb}
92 | EOF;
93 | $author = <<Wildcard
95 | EOF;
96 |
97 | // This array returns information about the plugin, some of which was prefabricated above based on whether the plugin has been installed or not.
98 | return array(
99 | 'name' => $name,
100 | 'description' => $asbDescription,
101 | 'website' => 'https://github.com/WildcardSearch/Advanced-Sidebox',
102 | 'author' => $author,
103 | 'authorsite' => 'http://www.rantcentralforums.com',
104 | 'version' => ASB_VERSION,
105 | 'compatibility' => '18*',
106 | 'codename' => 'asb',
107 | );
108 | }
109 |
110 | /**
111 | * check to see if the plugin's settings group is installed-- assume the plugin is installed if so
112 | *
113 | * @return bool true if installed, false if not
114 | */
115 | function asb_is_installed()
116 | {
117 | return asbGetSettingsGroup();
118 | }
119 |
120 | /**
121 | * add tables, a column to the mybb_users table (show_sidebox),
122 | * install the plugin setting group (asb_settings), settings, templates and
123 | * check for existing modules and install any detected
124 | *
125 | * @return void
126 | */
127 | function asb_install()
128 | {
129 | global $lang;
130 |
131 | if (!$lang->asb) {
132 | $lang->load('asb');
133 | }
134 |
135 | AdvancedSideboxInstaller::getInstance()->install();
136 |
137 | $addons = asbGetAllModules();
138 | foreach ($addons as $addon) {
139 | $addon->install();
140 | }
141 |
142 | asbCreateScriptInfo();
143 |
144 | @unlink(MYBB_ROOT.'inc/plugins/adv_sidebox.php');
145 | }
146 |
147 | /**
148 | * handle version control (a la pavemen), upgrade if necessary and
149 | * change permissions for ASB
150 | *
151 | * @return void
152 | */
153 | function asb_activate()
154 | {
155 | global $asbOldVersion;
156 |
157 | $myCache = AdvancedSideboxCache::getInstance();
158 |
159 | // if we just upgraded...
160 | $asbOldVersion = $myCache->getVersion();
161 | if (isset($asbOldVersion) &&
162 | $asbOldVersion &&
163 | version_compare($asbOldVersion, ASB_VERSION, '<')) {
164 | require_once MYBB_ROOT.'inc/plugins/asb/upgrade.php';
165 | }
166 |
167 | $myCache->setVersion(ASB_VERSION);
168 |
169 | // change the permissions to on by default
170 | change_admin_permission('config', 'asb');
171 |
172 | require_once MYBB_ROOT . '/inc/adminfunctions_templates.php';
173 | find_replace_templatesets('usercp_options', "#" . preg_quote('{$board_style}') . "#i", '{$asbShowSideboxes}{$board_style}');
174 | }
175 |
176 | /**
177 | * disable admin permissions
178 | *
179 | * @return void
180 | */
181 | function asb_deactivate()
182 | {
183 | // remove the permissions
184 | change_admin_permission('config', 'asb', -1);
185 |
186 | require_once MYBB_ROOT . '/inc/adminfunctions_templates.php';
187 | find_replace_templatesets('usercp_options', "#" . preg_quote('{$asbShowSideboxes}') . "#i", '');
188 | }
189 |
190 | /**
191 | * drop the table added to the DB and the column added to
192 | * the mybb_users table (show_sidebox),
193 | * delete the plugin settings, templates and style sheets
194 | *
195 | * @return void
196 | */
197 | function asb_uninstall()
198 | {
199 | if (!defined('IN_ASB_UNINSTALL')) {
200 | define('IN_ASB_UNINSTALL', true);
201 | }
202 |
203 | global $mybb;
204 |
205 | // remove the modules first
206 | $addons = asbGetAllModules();
207 |
208 | // if there are add-on modules installed
209 | if (is_array($addons)) {
210 | // uninstall them
211 | foreach ($addons as $addon) {
212 | $addon->uninstall();
213 | }
214 | }
215 |
216 | AdvancedSideboxInstaller::getInstance()->uninstall();
217 |
218 | // delete our cached version
219 | AdvancedSideboxCache::getInstance()->clear();
220 | }
221 |
222 | /*
223 | * settings
224 | */
225 |
226 | /**
227 | * retrieves the plugin's settings group gid if it exists
228 | * attempts to cache repeat calls
229 | *
230 | * @return int gid
231 | */
232 | function asbGetSettingsGroup()
233 | {
234 | static $gid;
235 |
236 | // if we have already stored the value
237 | if (!isset($gid)) {
238 | global $db;
239 |
240 | $query = $db->simple_select('settinggroups', 'gid', "name='asb_settings'");
241 | $gid = (int) $db->fetch_field($query, 'gid');
242 | }
243 |
244 | return $gid;
245 | }
246 |
247 | /**
248 | * builds the url to modify plugin settings if given valid info
249 | *
250 | * @param int settings group id
251 | * @return string url
252 | */
253 | function asbBuildSettingsUrl($gid)
254 | {
255 | if ($gid) {
256 | return 'index.php?module=config-settings&action=change&gid='.$gid;
257 | }
258 | }
259 |
260 | /**
261 | * builds a link to modify plugin settings if it exists
262 | *
263 | * @return string html
264 | */
265 | function asbBuildSettingsLink()
266 | {
267 | global $lang;
268 |
269 | if (!$lang->asb) {
270 | $lang->load('asb');
271 | }
272 |
273 | $gid = asbGetSettingsGroup();
274 |
275 | // does the group exist?
276 | if ($gid) {
277 | // if so build the URL
278 | $url = asbBuildSettingsUrl($gid);
279 |
280 | // did we get a URL?
281 | if ($url) {
282 | // if so build the link
283 | return "asb_plugin_settings}\">{$lang->asb_plugin_settings}";
284 | }
285 | }
286 | return false;
287 | }
288 |
289 | /**
290 | * create the default script information rows (tailored to mimic the previous versions)
291 | *
292 | * @param bool return associative array?
293 | * @return array|true see above dependency
294 | */
295 | function asbCreateScriptInfo($return=false)
296 | {
297 | $scripts = array(
298 | 'index' => array(
299 | 'title' => 'Index',
300 | 'filename' => 'index.php',
301 | 'template_name' => 'index',
302 | 'hook' => 'index_start',
303 | 'find_top' => '{$header}',
304 | 'find_bottom' => '{$footer}',
305 | 'replace_all' => 0,
306 | 'eval' => 0,
307 | 'active' => 1,
308 | ),
309 | 'forumdisplay' => array(
310 | 'title' => 'Forum Display',
311 | 'filename' => 'forumdisplay.php',
312 | 'template_name' => 'forumdisplay_threadlist',
313 | 'hook' => 'forumdisplay_start',
314 | 'find_top' => '
315 | {$newthread}
316 |
',
317 | 'find_bottom' => '{$inline_edit_js}',
318 | 'replace_all' => 0,
319 | 'eval' => 0,
320 | 'active' => 1,
321 | ),
322 | 'showthread' => array(
323 | 'title' => 'Show Thread',
324 | 'filename' => 'showthread.php',
325 | 'template_name' => 'showthread',
326 | 'hook' => 'showthread_start',
327 | 'find_top' => '{$ratethread}',
328 | 'find_bottom' => '{$footer}',
329 | 'replace_all' => 0,
330 | 'eval' => 0,
331 | 'active' => 1,
332 | ),
333 | 'member' => array(
334 | 'title' => 'Member Profile',
335 | 'filename' => 'member.php',
336 | 'action' => 'profile',
337 | 'template_name' => 'member_profile',
338 | 'hook' => 'member_profile_start',
339 | 'find_top' => '{$header}',
340 | 'find_bottom' => '{$footer}',
341 | 'replace_all' => 0,
342 | 'eval' => 0,
343 | 'active' => 1,
344 | ),
345 | 'memberlist' => array(
346 | 'title' => 'Member List',
347 | 'filename' => 'memberlist.php',
348 | 'template_name' => 'memberlist',
349 | 'hook' => 'memberlist_start',
350 | 'find_top' => '{$multipage}',
351 | 'find_bottom' => '{$footer}',
352 | 'replace_all' => 0,
353 | 'eval' => 0,
354 | 'active' => 1,
355 | ),
356 | 'showteam' => array(
357 | 'title' => 'Forum Team',
358 | 'filename' => 'showteam.php',
359 | 'template_name' => 'showteam',
360 | 'hook' => 'showteam_start',
361 | 'find_top' => '{$header}',
362 | 'find_bottom' => '{$footer}',
363 | 'replace_all' => 0,
364 | 'eval' => 0,
365 | 'active' => 1,
366 | ),
367 | 'stats' => array(
368 | 'title' => 'Statistics',
369 | 'filename' => 'stats.php',
370 | 'template_name' => 'stats',
371 | 'hook' => 'stats_start',
372 | 'find_top' => '{$header}',
373 | 'find_bottom' => '{$footer}',
374 | 'replace_all' => 0,
375 | 'eval' => 0,
376 | 'active' => 1,
377 | ),
378 | 'portal' => array(
379 | 'title' => 'Portal',
380 | 'filename' => 'portal.php',
381 | 'template_name' => 'portal',
382 | 'hook' => 'portal_start',
383 | 'replace_all' => 1,
384 | 'replacement' => <<
386 |
387 | {\$mybb->settings['bbname']}
388 | {\$headerinclude}
389 |
390 |
391 | {\$header}
392 | {\$asb_left}
393 | {\$announcements}
394 | {\$asb_right}
395 | {\$footer}
396 |
397 |