File structure changes
This commit is contained in:
parent
273cfe7bd2
commit
e88635441e
12 changed files with 70 additions and 49 deletions
|
@ -22,7 +22,8 @@
|
|||
"20150604",
|
||||
"20150619",
|
||||
"20150620",
|
||||
"20150621"
|
||||
"20150621",
|
||||
"20150627"
|
||||
|
||||
]
|
||||
|
||||
|
@ -1293,6 +1294,15 @@
|
|||
"change": "Added a bbcode parser."
|
||||
}
|
||||
|
||||
],
|
||||
|
||||
"20150627": [
|
||||
|
||||
{
|
||||
"type": "UPD",
|
||||
"change": "Put the Forum Listing and Front Page in the same PHP file as they both request nearly identical info (only difference is probably news post/forum posts)."
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
}
|
||||
|
|
|
@ -708,6 +708,32 @@ class Users {
|
|||
|
||||
}
|
||||
|
||||
// Get the available profile fields
|
||||
public static function getProfileFields() {
|
||||
|
||||
// Get profile fields
|
||||
$profileFields = Database::fetch('profilefields');
|
||||
|
||||
// If there's nothing just return null
|
||||
if(!count($profileFields))
|
||||
return null;
|
||||
|
||||
// Create output array
|
||||
$fields = [];
|
||||
|
||||
// Iterate over the fields and clean them up
|
||||
foreach($profileFields as $field) {
|
||||
|
||||
$fields[$field['id']] = $field;
|
||||
$fields[$field['id']]['ident'] = Main::cleanString($field['name'], true, true);
|
||||
|
||||
}
|
||||
|
||||
// Return the yeahs
|
||||
return $fields;
|
||||
|
||||
}
|
||||
|
||||
// Get user's profile fields
|
||||
public static function getUserProfileFields($id, $inputIsData = false) {
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
namespace Sakura;
|
||||
|
||||
// Define Sakura version
|
||||
define('SAKURA_VERSION', '20150625');
|
||||
define('SAKURA_VERSION', '20150627');
|
||||
define('SAKURA_VLABEL', 'Eminence');
|
||||
define('SAKURA_VTYPE', 'Development');
|
||||
define('SAKURA_COLOUR', '#6C3082');
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
<div class="content news settings">
|
||||
<div class="head">Forgot Password</div>
|
||||
<form method="post" action="/authenticate" id="passwordForm">
|
||||
<input type="hidden" name="redirect" value="//iihsalf.net/" />
|
||||
<input type="hidden" name="session" value="{{ php.sessionid }}" />
|
||||
<input type="hidden" name="time" value="{{ php.time }}" />
|
||||
<input type="hidden" name="uid" value="{{ auth.userId }}" />
|
||||
|
|
|
@ -70,9 +70,9 @@ RewriteRule ^a/([0-9]+)$|a/([0-9]+).png$ imageserve.php?m=avatar&u=$1 [L,QSA]
|
|||
RewriteRule ^bg/([0-9]+)$|bg/([0-9]+).png$ imageserve.php?m=background&u=$1 [L,QSA]
|
||||
|
||||
# Forum
|
||||
RewriteRule ^forum/?$ forum/index.php [L,QSA]
|
||||
RewriteRule ^forum/([0-9]+)/?$ forum/viewforum.php?id=$2 [L,QSA]
|
||||
RewriteRule ^forum/(thread|topic)/([0-9]+)/?$ forum/viewtopic.php?id=$2 [L,QSA]
|
||||
RewriteRule ^forum/?$ index.php?forums=true [L,QSA]
|
||||
RewriteRule ^forum/([0-9]+)/?$ viewforum.php?id=$2 [L,QSA]
|
||||
RewriteRule ^forum/(thread|topic|[0-9+])/([0-9]+)/?$ viewtopic.php?id=$2 [L,QSA]
|
||||
|
||||
# Management
|
||||
RewriteRule ^manage/?$ manage.php [L,QSA]
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* Sakura Forum Index
|
||||
*/
|
||||
|
||||
// Declare Namespace
|
||||
namespace Sakura;
|
||||
|
||||
// Include components
|
||||
require_once str_replace(basename(__DIR__), '../', dirname(__FILE__)) .'_sakura/sakura.php';
|
||||
|
||||
// Add page specific things
|
||||
$renderData['page'] = [
|
||||
'title' => 'Forum Listing',
|
||||
'boards' => Forum::getBoardList()
|
||||
];
|
||||
$renderData['stats'] = [
|
||||
'userCount' => ($_INDEX_USER_COUNT = count($_INDEX_USERS = Users::getAllUsers(false))) .' user'. ($_INDEX_USER_COUNT == 1 ? '' : 's'),
|
||||
'newestUser' => ($_INDEX_NEWEST_USER = max($_INDEX_USERS)),
|
||||
'lastRegDate' => ($_INDEX_LAST_REGDATE = date_diff(date_create(date('Y-m-d', $_INDEX_NEWEST_USER['regdate'])), date_create(date('Y-m-d')))->format('%a')) .' day'. ($_INDEX_LAST_REGDATE == 1 ? '' : 's'),
|
||||
'chatOnline' => ($_INDEX_CHAT_ONLINE = count(SockChat::getOnlineUsers())) .' user'. ($_INDEX_CHAT_ONLINE == 1 ? '' : 's'),
|
||||
'onlineUsers' => Users::checkAllOnline(),
|
||||
'topicCount' => '0 topics',
|
||||
'postCount' => '0 posts'
|
||||
];
|
||||
|
||||
// Print page contents
|
||||
print Templates::render('forum/index.tpl', $renderData);
|
|
@ -1,10 +0,0 @@
|
|||
<?php
|
||||
/*
|
||||
* Sakura Forum Topic Viewer
|
||||
*/
|
||||
|
||||
// Declare Namespace
|
||||
namespace Sakura;
|
||||
|
||||
// Include components
|
||||
require_once str_replace(basename(__DIR__), '../', dirname(__FILE__)) .'_sakura/sakura.php';
|
|
@ -9,10 +9,15 @@ namespace Sakura;
|
|||
// Include components
|
||||
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php';
|
||||
//print Permissions::check('SITE', 'USE_CHAT', Session::$userId, 1);
|
||||
|
||||
// Are we in forum mode?
|
||||
$forumMode = isset($_GET['forums']) ? ($_GET['forums'] == true) : false;
|
||||
|
||||
// Add page specific things
|
||||
$renderData['newsPosts'] = Main::getNewsPosts(3);
|
||||
$renderData['newsPosts'] = ($forumMode ? null : Main::getNewsPosts(3));
|
||||
$renderData['page'] = [
|
||||
'title' => Configuration::getConfig('sitename')
|
||||
'title' => ($forumMode ? 'Forum Listing' : Configuration::getConfig('sitename')),
|
||||
'boards' => ($forumMode ? Forum::getBoardList() : null)
|
||||
];
|
||||
$renderData['stats'] = [
|
||||
'userCount' => ($_INDEX_USER_COUNT = count($_INDEX_USERS = Users::getAllUsers(false))) .' user'. ($_INDEX_USER_COUNT == 1 ? '' : 's'),
|
||||
|
@ -25,4 +30,4 @@ $renderData['stats'] = [
|
|||
];
|
||||
|
||||
// Print page contents
|
||||
print Templates::render('main/index.tpl', $renderData);
|
||||
print Templates::render(($forumMode ? 'forum' : 'main') .'/index.tpl', $renderData);
|
||||
|
|
|
@ -223,7 +223,15 @@ if(Users::checkLogin()) {
|
|||
// Section specific
|
||||
switch($currentPage) {
|
||||
|
||||
// Notification history
|
||||
// Profile
|
||||
case 'profile':
|
||||
$renderData['profile'] = [
|
||||
'user' => Users::getUserProfileData(Session::$userId),
|
||||
'fields' => Database::fetch('profilefields')
|
||||
];
|
||||
break;
|
||||
|
||||
// Friends
|
||||
case 'friends':
|
||||
$renderData['friends'] = Users::getFriends();
|
||||
break;
|
||||
|
|
|
@ -7,4 +7,4 @@
|
|||
namespace Sakura;
|
||||
|
||||
// Include components
|
||||
require_once str_replace(basename(__DIR__), '../', dirname(__FILE__)) .'_sakura/sakura.php';
|
||||
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php';
|
11
main/viewtopic.php
Normal file
11
main/viewtopic.php
Normal file
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
/*
|
||||
* Sakura Forum Topic Viewer
|
||||
*/
|
||||
|
||||
// Declare Namespace
|
||||
namespace Sakura;
|
||||
|
||||
// Include components
|
||||
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php';
|
||||
print 'THIS IS VIEWTOPIC';
|
Reference in a new issue