Browse Source

initial commit with snapshot 20140213

master
Piotr Dergun 10 years ago
commit
12cd5888c5
93 changed files with 7038 additions and 0 deletions
  1. +17
    -0
      config.php
  2. BIN
      images/avatars/11.jpg
  3. BIN
      images/avatars/6.jpg
  4. BIN
      images/smiles/big_smile.gif
  5. BIN
      images/smiles/cool.gif
  6. BIN
      images/smiles/cry.png
  7. BIN
      images/smiles/curve.gif
  8. BIN
      images/smiles/evil.gif
  9. BIN
      images/smiles/exclaim.gif
  10. BIN
      images/smiles/lol.gif
  11. BIN
      images/smiles/mad.gif
  12. BIN
      images/smiles/neutral.gif
  13. BIN
      images/smiles/redface.gif
  14. BIN
      images/smiles/roll.gif
  15. BIN
      images/smiles/sad.gif
  16. BIN
      images/smiles/smile.gif
  17. BIN
      images/smiles/tongue.gif
  18. BIN
      images/smiles/wink.gif
  19. BIN
      images/smiles/yikes.gif
  20. +34
    -0
      inc/askModel.class.php
  21. +111
    -0
      inc/bbcode.php
  22. +35
    -0
      inc/constants.php
  23. +53
    -0
      inc/controller.class.php
  24. +605
    -0
      inc/controllers/AdminController.class.php
  25. +724
    -0
      inc/controllers/MainController.class.php
  26. +6
    -0
      inc/database_connection.php
  27. +5
    -0
      inc/misc_functions.php
  28. +56
    -0
      inc/model.class.php
  29. +64
    -0
      inc/models/BansModel.class.php
  30. +38
    -0
      inc/models/ConfigModel.class.php
  31. +119
    -0
      inc/models/ForumsModel.class.php
  32. +43
    -0
      inc/models/NavigationModel.class.php
  33. +126
    -0
      inc/models/PostsModel.class.php
  34. +125
    -0
      inc/models/SessionModel.class.php
  35. +56
    -0
      inc/models/StatisticsModel.class.php
  36. +128
    -0
      inc/models/UsersModel.class.php
  37. +29
    -0
      inc/view.class.php
  38. +536
    -0
      inc/views/MainView.class.php
  39. +43
    -0
      index.php
  40. +81
    -0
      templates/admin/admin.css
  41. +56
    -0
      templates/admin/ban_form.tpl.php
  42. +36
    -0
      templates/admin/banlist.tpl.php
  43. +41
    -0
      templates/admin/cat_form.tpl.php
  44. +49
    -0
      templates/admin/config.tpl.php
  45. +76
    -0
      templates/admin/forum_form.tpl.php
  46. +69
    -0
      templates/admin/forums.tpl.php
  47. BIN
      templates/admin/images/button_beam.gif
  48. BIN
      templates/admin/images/category_beam.gif
  49. BIN
      templates/admin/images/delete.gif
  50. BIN
      templates/admin/images/lock.gif
  51. BIN
      templates/admin/images/move.gif
  52. BIN
      templates/admin/images/no_av.gif
  53. BIN
      templates/admin/images/offline.gif
  54. BIN
      templates/admin/images/online.gif
  55. BIN
      templates/admin/images/td_beam_top.gif
  56. +289
    -0
      templates/admin/images/uf_logo.svg
  57. BIN
      templates/admin/images/unlock.gif
  58. +489
    -0
      templates/admin/kopia admin.css
  59. +112
    -0
      templates/admin/main.tpl.php
  60. +46
    -0
      templates/admin/overall_header.tpl.php
  61. +73
    -0
      templates/admin/userlist.tpl.php
  62. +34
    -0
      templates/confirm_action.tpl.php
  63. +175
    -0
      templates/edprofile.tpl.php
  64. +28
    -0
      templates/forum_message.tpl.php
  65. BIN
      templates/images/button_beam.gif
  66. BIN
      templates/images/category_beam.gif
  67. BIN
      templates/images/delete.gif
  68. BIN
      templates/images/lock.gif
  69. BIN
      templates/images/move.gif
  70. BIN
      templates/images/no_av.gif
  71. BIN
      templates/images/offline.gif
  72. BIN
      templates/images/online.gif
  73. BIN
      templates/images/td_beam_top.gif
  74. +289
    -0
      templates/images/uf_logo.svg
  75. BIN
      templates/images/unlock.gif
  76. +489
    -0
      templates/kopia main.css
  77. +146
    -0
      templates/kopia viewtopic.tpl.php
  78. +54
    -0
      templates/login_form.tpl.php
  79. +81
    -0
      templates/main.css
  80. +123
    -0
      templates/main.tpl.php
  81. +67
    -0
      templates/move_topic.tpl.php
  82. +6
    -0
      templates/overall_footer.tpl.php
  83. +56
    -0
      templates/overall_header.tpl.php
  84. +126
    -0
      templates/posting.tpl.php
  85. +83
    -0
      templates/register_form.tpl.php
  86. +33
    -0
      templates/scripts/chkcookie.js
  87. +62
    -0
      templates/scripts/nick.js
  88. +70
    -0
      templates/scripts/posting.js
  89. +415
    -0
      templates/styles.css
  90. +65
    -0
      templates/userlist.tpl.php
  91. +74
    -0
      templates/viewforum.tpl.php
  92. +65
    -0
      templates/viewprofile.tpl.php
  93. +127
    -0
      templates/viewtopic.tpl.php

+ 17
- 0
config.php View File

@ -0,0 +1,17 @@
<?php
//uForum config
//don't modifiy this file!
ini_set('display_errors', '1');
define('DB_HOST','localhost');
define('DB_USER','root');
define('DB_PASSWD','');
define('DB_NAME','uf2');
define('DB_PREFIX','uf_');
define('VERSION','2.0.0');
define('UF_INSTALLED',true);
define('COOKIE_DOMAIN', '');
define('COOKIE_PATH', '/uf2');
?>

BIN
images/avatars/11.jpg View File

Before After
Width: 120  |  Height: 120  |  Size: 2.6 KiB

BIN
images/avatars/6.jpg View File

Before After
Width: 120  |  Height: 120  |  Size: 2.6 KiB

BIN
images/smiles/big_smile.gif View File

Before After
Width: 20  |  Height: 20  |  Size: 696 B

BIN
images/smiles/cool.gif View File

Before After
Width: 22  |  Height: 20  |  Size: 1.4 KiB

BIN
images/smiles/cry.png View File

Before After
Width: 20  |  Height: 20  |  Size: 995 B

BIN
images/smiles/curve.gif View File

Before After
Width: 18  |  Height: 18  |  Size: 1.1 KiB

BIN
images/smiles/evil.gif View File

Before After
Width: 18  |  Height: 23  |  Size: 1.1 KiB

BIN
images/smiles/exclaim.gif View File

Before After
Width: 20  |  Height: 20  |  Size: 1.1 KiB

BIN
images/smiles/lol.gif View File

Before After
Width: 18  |  Height: 18  |  Size: 515 B

BIN
images/smiles/mad.gif View File

Before After
Width: 20  |  Height: 20  |  Size: 465 B

BIN
images/smiles/neutral.gif View File

Before After
Width: 20  |  Height: 20  |  Size: 1.2 KiB

BIN
images/smiles/redface.gif View File

Before After
Width: 20  |  Height: 20  |  Size: 906 B

BIN
images/smiles/roll.gif View File

Before After
Width: 20  |  Height: 20  |  Size: 705 B

BIN
images/smiles/sad.gif View File

Before After
Width: 20  |  Height: 20  |  Size: 698 B

BIN
images/smiles/smile.gif View File

Before After
Width: 18  |  Height: 18  |  Size: 1.1 KiB

BIN
images/smiles/tongue.gif View File

Before After
Width: 20  |  Height: 20  |  Size: 698 B

BIN
images/smiles/wink.gif View File

Before After
Width: 20  |  Height: 20  |  Size: 696 B

BIN
images/smiles/yikes.gif View File

Before After
Width: 20  |  Height: 20  |  Size: 698 B

+ 34
- 0
inc/askModel.class.php View File

@ -0,0 +1,34 @@
<?php
abstract class AskModel
{
protected $models = array();
function loadModel($model)
{
if (file_exists('./inc/models/'.$model.'.class.php') && !array_key_exists($model, $this->models)) //realizowany singleton
{
require_once('./inc/models/'.$model.'.class.php');
$this->models[$model] = new $model($this->db);
}
else
{
throw new Exception('Could not load selected model: '.$model);
}
}
function getModel($model)
{
if (array_key_exists($model, $this->models))
return $this->models[$model];
else
throw new Exception('Could not get selected model: '.$model);
}
function putExistingModel($model, &$model_ptr)
{
$this->models[$model] = $model_ptr;
}
}
?>

+ 111
- 0
inc/bbcode.php View File

@ -0,0 +1,111 @@
<?php
function BBCode($content)
{
$pattern = array(
'/\:\)/s', # :)
'/\:\|/s', # :|
'/\:\(/s', # :(
'/\;\(/s', # ;(
'/\:D/is', # :D
'/\:o/is', # :o
'/\;\)/s', # ;)
'/\:p/is', # :p
'/\:curve:/is', # :curve:
'/\:!:/is', # :!:
'/\:lol\:/is', # :lol:
'/\:evil\:/is', # :evil:
'/\:mad\:/is', # :mad:
'/\:roll\:/is', # :roll:
'/\:cool\:/is', # :cool:
'/\:redface\:/is', # :redface:
'/\[b\](.*?)\[\/b\]/is', # [b]
'/\[i\](.*?)\[\/i\]/is', # [i]
'/\[u\](.*?)\[\/u\]/is', # [u]
'/\[s\](.*?)\[\/s\]/is', # [s]
'/\[center\](.*?)\[\/center\]/is', # [center]
'/\[url=((http:\/\/)[-a-zA-Z0-9@:%_\+.~#?&\/\/=]+)\](.*?)\[\/url\]/is', # [url=]
'/\[url]((http:\/\/)[-a-zA-Z0-9@:%_\+.~#?&\/\/=]+)\[\/url\]/is', # [url]
'/\[color=#?([A-F0-9]{3}|[A-F0-9]{6})\](.*?)\[\/color\]/is', # [color] (hex)
'/\[color=?([A-Z]+)\](.*?)\[\/color\]/is', # [color] (text)
'/\[list\](.*?)\[\/list\]/is', # [list]
'/\[\*\](.*?)(\n|\r\n)/is', # [*]
'/\[quote\](.*?)\[\/quote\]/is', # [quote]
'/\[quote=(.+?)\](.*?)\[\/quote\]/is', # [quote=]
'/\[code\](.*?)\[\/code\]/is', # [code]
'/\\n/', # \n
'/\\r/', # \r
'/(^|[^"])((http:\/\/)[-a-zA-Z0-9@:%_\+.~#?&\/\/=]+)/i',
);
$replace = array(
'<img src="images/smiles/smile.gif" alt=":)">', # :)
'<img src="images/smiles/neutral.gif" alt=":|">', # :|
'<img src="images/smiles/sad.gif" alt=":(" >', # :(
'<img src="images/smiles/cry.png" alt=":(" >', # ;(
'<img src="images/smiles/big_smile.gif" alt=":D" >', # :D
'<img src="images/smiles/yikes.gif" alt=":o" >', # :o
'<img src="images/smiles/wink.gif" alt=";)" >', # ;)
'<img src="images/smiles/tongue.gif" alt=":p" >', # :p
'<img src="images/smiles/curve.gif" alt=":/" >', # :curve:
'<img src="images/smiles/exclaim.gif" alt=":!:" >', # :!:
'<img src="images/smiles/lol.gif" alt=":lol:" >', # :lol:
'<img src="images/smiles/evil.gif" alt=":evil:" >', # :evil:
'<img src="images/smiles/mad.gif" alt=":mad:" >', # :mad:
'<img src="images/smiles/roll.gif" alt=":roll:" >', # :roll:
'<img src="images/smiles/cool.gif" alt=":cool:" >', # :cool:
'<img src="images/smiles/redface.gif" alt=":redface:" >', # :redface:
'<span style="font-weight: bold;">\1</span>', # [b]
'<span style="font-style: italic;">\1</i>', # [i]
'<span style="text-decoration: underline;">\1</span>', # [u]
'<span style="text-decoration: line-through;">\1</span>', # [s]
'<p style="text-align: center;">\1</p>', # [center]
'<a href="\1">\3</a>', # [url=]
'<a href="\1">\1</a>', # [url]
'<span style="color: #\1;">\2</span>', # [color] (hex)
'<span style="color: \1;">\2</span>', # [color] (text)
'<ul>\1</ul>', # [list]
'<li>\1</li>', # [*]
'<div class="qpost"><span style="font-weight: bold">Quote:</span><br>\1</div>', # [quote]
'<div class="qpost"><span style="font-weight: bold">\1 wrote:</span><br>\2</div>', # [quote=]
'<div class="cpost"><span style="font-weight: bold">Code:</span><br>\1</div>', # [code]
'<br>', # \n
'', # \r
'\\1<a href="\\2">\\2</a>',
);
return preg_replace($pattern, $replace, $content);
}
function StripBBCode($content)
{
$pattern = array(
'/\\n/', # \n
'/\\r/', # \r
'/\[b\](.*?)\[\/b\]/is', # [b]
'/\[i\](.*?)\[\/i\]/is', # [i]
'/\[u\](.*?)\[\/u\]/is', # [u]
'/\[s\](.*?)\[\/s\]/is', # [s]
'/\[url=(.*?)\](.*?)\[\/url\]/is', # [url=]
'/\[url](.*?)\[\/url\]/is', # [url]
'/\[img](.*?)\[\/img\]/is', # [img]
'/\[color=(.*?)\](.*?)\[\/color\]/is', # [color]
);
$replace = array(
'', # \n
'', # \r
'\1', # [b]
'\1', # [i]
'\1', # [u]
'\1', # [s]
'\2', # [url=]
'\1', # [url]
'', # [img]
'\2', # [color]
);
return preg_replace($pattern, $replace, $content);
}
?>

+ 35
- 0
inc/constants.php View File

@ -0,0 +1,35 @@
<?php
//tables
define('BANLIST_TABLE',DB_PREFIX.'banlist');
define('CATS_TABLE',DB_PREFIX.'categories');
define('CONFIG_TABLE',DB_PREFIX.'config');
define('FORUMS_TABLE',DB_PREFIX.'forums');
define('POSTS_TABLE',DB_PREFIX.'posts');
define('SESSIONS_TABLE',DB_PREFIX.'sessions');
define('USERS_TABLE',DB_PREFIX.'users');
define('USERS_INFO_TABLE',DB_PREFIX.'users_information');
define('TOPICS_TABLE',DB_PREFIX.'topics');
//views
define('FORUMS_VIEW', DB_PREFIX.'view_forums');
define('TOPICS_VIEW', DB_PREFIX.'view_topics');
define('POSTS_VIEW', DB_PREFIX.'view_posts');
define('LOGGED_USERS_VIEW', DB_PREFIX.'view_logged_users');
define('USERS_PC_VIEW', DB_PREFIX.'view_users_post_count');
define('TOPICS_PC_VIEW', DB_PREFIX.'view_topics_post_count');
define('COOKIE_NAME', 'uf2_auth');
define('RANK_USER', 0);
define('RANK_MOD', 1);
define('RANK_ADMIN', 2);
define('POSTING_REPLY', 'reply');
define('POSTING_QUOTE', 'quote');
define('POSTING_EDIT', 'edit');
define('POSTING_NEWTOPIC', 'new_topic');
define('POSTING_EDITTOPIC', 'edit_topic');
$allowed_avatars = array('image/jpeg', 'image/gif', 'image/png');
?>

+ 53
- 0
inc/controller.class.php View File

@ -0,0 +1,53 @@
<?php
require_once('./inc/askModel.class.php');
abstract class Controller extends AskModel {
protected $views = array();
protected $db;
abstract public function loadDefault(); //domyślna metoda
public function __call($m, $arg)
{
if(method_exists($this, $m))
$this->$m($arg);
else
$this->forward('index.php');
}
public function __construct(&$db)
{
$this->db = $db;
}
public function forward($address)
{
header('Location: ' . $address);
}
public function loadView($view)
{
if (file_exists('./inc/views/'.$view.'.class.php') && !array_key_exists($view, $this->views))
{
require_once('./inc/views/'.$view.'.class.php');
$this->views[$view] = new $view($this->db);
}
else
{
throw new Exception('Could not load selected view: '.$view);
}
}
public function getView($view)
{
if (array_key_exists($view, $this->views))
return $this->views[$view];
else
throw new Exception('Could not get selected view: '.$widok);
}
}
?>

+ 605
- 0
inc/controllers/AdminController.class.php View File

@ -0,0 +1,605 @@
<?php
require ('./inc/controller.class.php');
class AdminController extends Controller
{
public function loadDefault()
{
$this->main();
}
private function loadDependencies() // zależności (sesje itp)
{
$this->loadModel('SessionModel'); //aktywacja sesji
$this->loadModel('ConfigModel'); //konfiguracja ogólna skryptu
$this->loadView('MainView');
$this->getView('MainView')->putExistingModel('SessionModel', $this->getModel('SessionModel'));
$this->getView('MainView')->putExistingModel('ConfigModel', $this->getModel('ConfigModel'));
if ($_SERVER['REQUEST_SCHEME'] == 'http')
$this->forward('https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
if (!$this->getModel('SessionModel')->isLogged())
{
$this->getView('MainView')->forum_message('You are not logged.', 'index.php?mode=login', true);
$lockv = true;
}
if ($this->getModel('SessionModel')->getRank() == RANK_USER && !isset($lockv))
{
$this->getView('MainView')->forum_message('You are not admin', 'index.php');
$lockv = true;
}
if (!isset($lockv))
return true;
else
return false;
}
public function main()
{
if ($this->loadDependencies())
{
$this->getView('MainView')->admin_main();
}
}
public function eduser()
{
if ($this->loadDependencies())
{
$this->loadModel('UsersModel');
$user_info = $this->getModel('UsersModel')->getUserInformation($_GET['id'], true);
if ($user_info == null)
{
$this->getView('MainView')->forum_message('User does not exist!', 'index.php?mode=admin&amp;submode=users');
$lockv = true;
}
else
{
$msg = '';
if (isset($_POST['nick'], $_POST['passwd'], $_POST['passwd_confirm'], $_POST['email']))
{
//secure pools
$_POST['nick'] = trim(strip_tags($this->db->real_escape_string($_POST['nick'])));
$_POST['passwd'] = trim(strip_tags($_POST['passwd']));
$_POST['passwd_confirm'] = trim(strip_tags($_POST['passwd_confirm']));
$_POST['email'] = trim(strip_tags($this->db->real_escape_string($_POST['email'])));
$_POST['location'] = trim(strip_tags($this->db->real_escape_string($_POST['location'])));
$_POST['signature'] = trim(strip_tags($this->db->real_escape_string($_POST['signature'])));
$_POST['user_rank'] = trim(strip_tags($this->db->real_escape_string($_POST['user_rank'])));
if ($_POST['passwd'] != '')
{
if (strlen($_POST['passwd']) < 8)
$msg .= 'Password is too short (min 8 characters)<br>';
if ($_POST['passwd'] != $_POST['passwd_confirm'])
$msg .= 'Password do not match!<br>';
}
if ($_GET['id'] == $this->getModel('SessionModel')->getID() && $_POST['user_rank'] != RANK_ADMIN)
{
$msg .= 'You cannot set rank for your profile<br>';
$_POST['user_rank'] = RANK_ADMIN;
}
if ($this->getModel('UsersModel')->nickExists($_POST['nick']) == true && $_POST['nick'] != $user_info['nick'])
$msg .= 'Nick is in use. Type another one.<br>';
if (strlen($_POST['nick']) < 3)
$msg .= 'Nick is too short (min 3 characters)<br>';
if ($_POST['user_rank'] > RANK_ADMIN || $_POST['user_rank'] < RANK_USER)
$msg .= 'Rank is not valid!<br>';
//check if avatar is uploaded
if ($_FILES['avatar']['tmp_name'] != null)
{
global $allowed_avatars;
$image_size = @getimagesize($_FILES['avatar']['tmp_name']);
if ($image_size == null)
$msg .= 'Type of uploaded file are not allowed.<br>';
else
if (!in_array($image_size['mime'], $allowed_avatars))
$msg .= 'Type of uploaded avatar is not supported.<br>';
else
if ($image_size[0] > 120 || $image_size[1] > 150)
$msg .= 'Uploaded avatar is too big (maximum 120x150 px).<br>';
}
if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL))
$msg .= 'Email is incorrect<br>';
if ($msg == '')
{
if ($_FILES['avatar']['tmp_name'] != null && !isset($_POST['delete_avatar'])) //change an avatar
{
if ($user_info['avatar'] != '')
unlink('./'.$user_info['avatar']);
$ext = pathinfo($_FILES['avatar']['name'], PATHINFO_EXTENSION);
$av = 'images/avatars/'.$this->getModel('SessionModel')->getID().'.'.$ext;
move_uploaded_file($_FILES['avatar']['tmp_name'], './'.$av);
}
else
if (isset($_POST['delete_avatar']))
{
unlink('./'.$user_info['avatar']);
$av = '';
}
else
$av = $user_info['avatar']; //if new avatar is not set
if ($_POST['passwd'] != '')
$this->getModel('UsersModel')->changeUserPassword($_GET['id'], sha1($_POST['passwd']));
$this->getModel('UsersModel')->changeUserRank($_GET['id'], $_POST['user_rank']);
$this->getModel('UsersModel')->updateUserProfile($_GET['id'], $_POST['nick'], $_POST['email'], $_POST['location'], $_POST['signature'], $av);
$this->getView('MainView')->forum_message('User profile has changed.', 'index.php?mode=admin&amp;submode=users');
$lockv = true;
}
}
$_POST['nick'] = (isset($_POST['nick'])) ? $_POST['nick'] : $user_info['nick'];
$_POST['email'] = (isset($_POST['email'])) ? $_POST['email'] : $user_info['email'];
$_POST['location'] = (isset($_POST['location'])) ? $_POST['location'] : $user_info['location'];
$_POST['signature'] = (isset($_POST['signature'])) ? $_POST['signature'] : $user_info['signature'];
$_POST['user_rank'] = (isset($_POST['user_rank'])) ? $_POST['user_rank'] : $user_info['rank'];
$this->getView('MainView')->putExistingModel('UsersModel', $this->getModel('UsersModel'));
if (!isset($lockv))
$this->getView('MainView')->edprofile_form($msg, true);
}
}
}
public function users()
{
if ($this->loadDependencies())
{
if (isset($_GET['rank']))
{
switch ($_GET['rank'])
{
case 'admin':
$_GET['rank'] = RANK_ADMIN;
break;
case 'mod':
$_GET['rank'] = RANK_MOD;
break;
case 'user':
$_GET['rank'] = RANK_USER;
break;
default:
$_GET['rank'] = '';
break;
}
}
else
$_GET['rank'] = '';
$_POST['sort_type'] = (isset($_POST['sort_type'])) ? $this->db->real_escape_string($_POST['sort_type']) : 'regdate';
$allowed_sorting = array('regdate', 'lastvisit', 'nick', 'post_count');
if (!in_array($_POST['sort_type'], $allowed_sorting))
$_POST['sort_type'] = '';
$_POST['sort_desc'] = (isset($_POST['sort_desc'])) ? 'DESC' : 'ASC';
$this->getView('MainView')->admin_userlist();
}
}
public function deluser()
{
if ($this->loadDependencies())
{
$this->loadModel('UsersModel');
$this->getView('MainView')->putExistingModel('UsersModel', $this->getModel('UsersModel'));
$_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0;
$user_info = $this->getModel('UsersModel')->getUserInformation($_GET['id']);
if ($user_info == null)
{
$this->getView('MainView')->forum_message('User does not exist!', 'index.php?mode=admin&amp;submode=users');
$lockv = true;
}
else
{
if ($_GET['id'] == $this->getModel('SessionModel')->getID())
{
$this->getView('MainView')->forum_message('You cannot delete own profile!', 'index.php?mode=admin&amp;submode=users');
$lockv = true;
}
}
if (isset($_POST['confirmed']) && !isset($lockv))
{
if (!isset($_POST['rejected']))
{
$this->getModel('UsersModel')->deleteUser($_GET['id']);
$this->getView('MainView')->forum_message('Profile deleted. Redirecting to users list...', 'index.php?mode=admin&amp;submode=users');
$lockv = true;
}
else
{
$this->forward('index.php?mode=admin&submode=users');
}
}
if (!isset($lockv))
$this->getView('MainView')->confirm_action('Do you want delete user <span style="font-weight: bold">'.$user_info['nick'].'</span>? This operation cannot undone.');
}
}
public function config()
{
if ($this->loadDependencies())
{
$msg = '';
if (isset($_POST['forum_name'], $_POST['forum_desc']))
{
$_POST['forum_name'] = trim(htmlspecialchars($this->db->real_escape_string($_POST['forum_name'])));
$_POST['forum_desc'] = trim(htmlspecialchars($_POST['forum_desc']));
if (strlen($_POST['forum_name']) < 3)
{
$msg .= 'Forum name is too short (min 3 characters)!<br>';
}
if (strlen($_POST['forum_name']) > 30)
{
$msg .= 'Forum name is too long (max 30 characters)!<br>';
}
if (strlen($_POST['forum_desc']) > 50)
{
$msg .= 'Forum description is too long (max 50 characters)!<br>';
}
if ($msg == '')
{
$what = '';
if ($_POST['forum_name'] != $this->getModel('ConfigModel')->getConf('forum_name'))
$this->getModel('ConfigModel')->updateConf('forum_name', $_POST['forum_name']);
if ($_POST['forum_desc'] != $this->getModel('ConfigModel')->getConf('forum_desc'))
$this->getModel('ConfigModel')->updateConf('forum_desc', $_POST['forum_desc']);
$this->getView('MainView')->forum_message('Forum configuration updated. Redirecting...', 'index.php?mode=admin&amp;submode=config');
$lockv = true;
}
}
$_POST['forum_name'] = (isset($_POST['forum_name'])) ? $_POST['forum_name'] : $this->getModel('ConfigModel')->getConf('forum_name');
$_POST['forum_desc'] = (isset($_POST['forum_desc'])) ? $_POST['forum_desc'] : $this->getModel('ConfigModel')->getConf('forum_desc');
if (!isset($lockv))
{
$this->getView('MainView')->admin_config($msg);
}
}
}
public function forums()
{
if ($this->loadDependencies())
{
$this->getView('MainView')->admin_forums();
}
}
public function addcat()
{
if ($this->loadDependencies())
{
$this->modify_cat('add');
}
}
public function edcat()
{
if ($this->loadDependencies())
{
$this->modify_cat('edit');
}
}
public function addforum()
{
if ($this->loadDependencies())
{
$this->modify_forum('add');
}
}
public function edforum()
{
if ($this->loadDependencies())
{
$this->modify_forum('edit');
}
}
public function delforum()
{
if ($this->loadDependencies())
{
$this->loadModel('ForumsModel');
$_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0;
$forum_info = $this->getModel('ForumsModel')->getForum($_GET['id']);
if ($forum_info == null)
{
$this->getView('MainView')->forum_message('Forum does not exist!', 'index.php?mode=admin&amp;submode=forums');
$lockv = true;
}
if (isset($_POST['confirmed']) && !isset($lockv))
{
if (!isset($_POST['rejected']))
{
$this->getModel('ForumsModel')->deleteForum($_GET['id']);
$this->getView('MainView')->forum_message('Forum deleted. Redirecting...', 'index.php?mode=admin&amp;submode=forums');
$lockv = true;
}
else
$this->forward('index.php?mode=admin&submode=forums');
}
if (!isset($lockv))
$this->getView('MainView')->confirm_action('Do you REALLY want delete forum <span style="font-weight: bold">'.$forum_info['name'].'</span> with ALL CONTENT? <span style="text-decoration: underline">This operation cannot undone!</span>');
}
}
public function delcat()
{
if ($this->loadDependencies())
{
$this->loadModel('ForumsModel');
$_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0;
$cat_info = $this->getModel('ForumsModel')->getCat($_GET['id']);
if ($cat_info == null)
{
$this->getView('MainView')->forum_message('Category does not exist!', 'index.php?mode=admin&amp;submode=forums');
$lockv = true;
}
if (isset($_POST['confirmed']) && !isset($lockv))
{
if (!isset($_POST['rejected']))
{
$this->getModel('ForumsModel')->deleteCat($_GET['id']);
$this->getView('MainView')->forum_message('Category deleted. Redirecting...', 'index.php?mode=admin&amp;submode=forums');
$lockv = true;
}
else
$this->forward('index.php?mode=admin&submode=forums');
}
if (!isset($lockv))
$this->getView('MainView')->confirm_action('Do you REALLY want delete category <span style="font-weight: bold">'.$cat_info['name'].'</span> with ALL FORUMS AND CONTENT? <span style="text-decoration: underline">This operation cannot undone!</span>');
}
}
private function modify_cat($m)
{
$msg = '';
$this->loadModel('ForumsModel');
if ($m == 'edit')
{
$_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0;
$cat_info = $this->getModel('ForumsModel')->getCat($_GET['id']);
if ($cat_info == null)
{
$this->getView('MainView')->forum_message('Category does not exist!', 'index.php?mode=admin&amp;submode=forums');
$lockv = true;
}
}
if (isset($_POST['name']) && !isset($lockv))
{
$_POST['name'] = trim(htmlspecialchars($this->db->real_escape_string($_POST['name'])));
if (strlen($_POST['name']) < 3)
$msg .= 'Category name is too short (min 3 characters)!<br>';
if ($msg == '')
{
if ($m == 'add')
{
$this->getModel('ForumsModel')->addCat($_POST['name']);
$this->getView('MainView')->forum_message('Category added. Redirecting...', 'index.php?mode=admin&amp;submode=forums');
$lockv = true;
}
else
{
$this->getModel('ForumsModel')->changeCat($_GET['id'], $_POST['name']);
$this->getView('MainView')->forum_message('Category updated. Redirecting...', 'index.php?mode=admin&amp;submode=forums');
$lockv = true;
}
}
}
if (!isset($lockv))
{
if ($m == 'add')
$_POST['name'] = (isset($_POST['name'])) ? $_POST['name'] : '';
else
$_POST['name'] = (isset($_POST['name'])) ? $_POST['name'] : $cat_info['name'];
$this->getView('MainView')->putExistingModel('ForumsModel', $this->getModel('ForumsModel'));
$this->getView('MainView')->admin_cat_form($msg, $m);
}
}
private function modify_forum($m)
{
$msg = '';
$this->loadModel('ForumsModel');
if ($m == 'edit')
{
$_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0;
$forum_info = $this->getModel('ForumsModel')->getForum($_GET['id']);
if ($forum_info == null)
{
$this->getView('MainView')->forum_message('Forum does not exist!', 'index.php?mode=admin&amp;submode=forums');
$lockv = true;
}
}
if (isset($_POST['name']) && !isset($lockv))
{
$_POST['name'] = trim(htmlspecialchars($this->db->real_escape_string($_POST['name'])));
$_POST['desc'] = trim(htmlspecialchars($this->db->real_escape_string($_POST['desc'])));
$_POST['category_id'] = trim(strip_tags($this->db->real_escape_string($_POST['category_id'])));
$_POST['locked'] = trim(strip_tags($this->db->real_escape_string($_POST['locked'])));
$_POST['locked'] = ($_POST['locked'] == true) ? true : false;
if (strlen($_POST['name']) < 3)
$msg .= 'Forum name is too short (min 3 characters)!<br>';
$c = $this->getModel('ForumsModel')->getCat($_POST['category_id']);
if ($c == null)
$msg .= 'Category does not exist!<br>';
if ($msg == '')
{
if ($m == 'add')
{
$this->getModel('ForumsModel')->addForum($_POST['name'], $_POST['desc'], $_POST['category_id'], $_POST['locked']);
$this->getView('MainView')->forum_message('Forum added. Redirecting...', 'index.php?mode=admin&amp;submode=forums');
$lockv = true;
}
else
{
$this->getModel('ForumsModel')->changeForum($_GET['id'], $_POST['name'], $_POST['desc'], $_POST['category_id'], $_POST['locked']);
$this->getView('MainView')->forum_message('Forum updated. Redirecting...', 'index.php?mode=admin&amp;submode=forums');
$lockv = true;
}
}
}
if (!isset($lockv))
{
if ($m == 'add')
{
$_POST['name'] = (isset($_POST['name'])) ? $_POST['name'] : '';
$_POST['desc'] = (isset($_POST['desc'])) ? $_POST['desc'] : '';
$_POST['category_id'] = (isset($_POST['category_id'])) ? $_POST['category_id'] : '';
$_POST['locked'] = (isset($_POST['locked'])) ? $_POST['locked'] : '';
}
else
{
$_POST['name'] = (isset($_POST['name'])) ? $_POST['name'] : $forum_info['name'];
$_POST['desc'] = (isset($_POST['desc'])) ? $_POST['desc'] : $forum_info['desc'];
$_POST['category_id'] = (isset($_POST['category_id'])) ? $_POST['category_id'] : $forum_info['category_id'];
$_POST['locked'] = (isset($_POST['locked'])) ? $_POST['locked'] : $forum_info['locked'];
}
$this->getView('MainView')->putExistingModel('ForumsModel', $this->getModel('ForumsModel'));
$this->getView('MainView')->admin_forum_form($msg, $m);
}
}
public function banlist()
{
if ($this->loadDependencies())
$this->getView('MainView')->admin_banlist();
}
public function delban()
{
if ($this->loadDependencies())
{
$this->loadModel('BansModel');
$_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0;
$ban_info = $this->getModel('BansModel')->getBan($_GET['id']);
if ($ban_info == null)
{
$this->getView('MainView')->forum_message('Ban does not exist!', 'index.php?mode=admin&amp;submode=banlist');
$lockv = true;
}
if (isset($_POST['confirmed']) && !isset($lockv))
{
if (!isset($_POST['rejected']))
{
$this->getModel('BansModel')->deleteBan($_GET['id']);
$this->getView('MainView')->forum_message('Ban deleted. Redirecting...', 'index.php?mode=admin&amp;submode=banlist');
$lockv = true;
}
else
$this->forward('index.php?mode=admin&submode=banlist');
}
if (!isset($lockv))
$this->getView('MainView')->confirm_action('Do you want delete ban for user <span style="font-weight: bold">'.$ban_info['nick'].'</span>?');
}
}
public function addban()
{
if ($this->loadDependencies())
{
$msg = '';
$this->loadModel('BansModel');
$this->loadModel('UsersModel');
if (isset($_POST['user_id'], $_POST['reason']))
{
$_POST['user_id'] = trim(strip_tags($this->db->real_escape_string($_POST['user_id'])));
$_POST['reason'] = trim(strip_tags($this->db->real_escape_string($_POST['reason'])));
if ($_POST['user_id'] == $this->getModel('SessionModel')->getID())
$msg .= 'You cannot ban your profile!<br>';
if ($this->getModel('BansModel')->getUserBan($_POST['user_id']) != null)
$msg .= 'This user has already been banned!<br>';
if ($this->getModel('UsersModel')->getUserInformation($_POST['user_id']) == null)
$msg .= 'User does not exist!<br>';
if ($msg == '')
{
$this->getModel('BansModel')->addBan($_POST['user_id'], $_POST['reason']);
$this->getView('MainView')->forum_message('Ban added. Redirecting...', 'index.php?mode=admin&amp;submode=banlist');
$lockv = true;
}
}
if (!isset($lockv))
{
$_POST['user_id'] = (isset($_POST['user_id'])) ? $_POST['user_id'] : '';
$_POST['reason'] = (isset($_POST['reason'])) ? $_POST['reason'] : '';
$this->getView('MainView')->admin_ban_form($msg);
}
}
}
}
?>

+ 724
- 0
inc/controllers/MainController.class.php View File

@ -0,0 +1,724 @@
<?php
require ('./inc/controller.class.php');
class MainController extends Controller
{
public function loadDefault()
{
$this->main();
}
private function loadDependencies() // zależności (sesje itp)
{
$this->loadModel('SessionModel'); //aktywacja sesji
$this->loadModel('ConfigModel'); //konfiguracja ogólna skryptu
$this->loadView('MainView');
$this->getView('MainView')->putExistingModel('SessionModel', $this->getModel('SessionModel'));
$this->getView('MainView')->putExistingModel('ConfigModel', $this->getModel('ConfigModel'));
}
public function main()
{
$this->loadDependencies();
$this->getView('MainView')->main();
}
public function viewforum()
{
$this->loadDependencies();
$this->loadModel('ForumsModel');
$_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0;
$f = $this->getModel('ForumsModel')->getForum($_GET['id']);
if ($f == null)
$this->getView('MainView')->forum_message('Forum does not exist!', 'index.php');
else
{
$this->getView('MainView')->putExistingModel('ForumsModel', $this->getModel('ForumsModel'));
$this->getView('MainView')->viewforum();
}
}
public function userlist()
{
$this->loadDependencies();
if (isset($_GET['rank']))
{
switch ($_GET['rank'])
{
case 'admin':
$_GET['rank'] = RANK_ADMIN;
break;
case 'mod':
$_GET['rank'] = RANK_MOD;
break;
case 'user':
$_GET['rank'] = RANK_USER;
break;
default:
$_GET['rank'] = '';
break;
}
}
else
$_GET['rank'] = '';
$_POST['sort_type'] = (isset($_POST['sort_type'])) ? $this->db->real_escape_string($_POST['sort_type']) : 'regdate';
$allowed_sorting = array('regdate', 'lastvisit', 'nick', 'post_count');
if (!in_array($_POST['sort_type'], $allowed_sorting))
$_POST['sort_type'] = '';
$_POST['sort_desc'] = (isset($_POST['sort_desc'])) ? 'DESC' : 'ASC';
$this->getView('MainView')->userlist();
}
public function viewtopic()
{
$this->loadDependencies();
$this->loadModel('PostsModel');
$_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0;
$t = $this->getModel('PostsModel')->getTopic($_GET['id']);
if ($t == null)
$this->getView('MainView')->forum_message('Topic does not exist!', 'index.php');
else
{
$this->getView('MainView')->putExistingModel('PostsModel', $this->getModel('PostsModel'));
$this->getView('MainView')->viewtopic();
}
}
public function newtopic()
{
$this->posting(POSTING_NEWTOPIC);
}
public function reply()
{
$this->posting(POSTING_REPLY);
}
public function editpost()
{
$this->posting(POSTING_EDIT);
}
public function quote()
{
$this->posting(POSTING_QUOTE);
}
public function moderate()
{
$this->loadDependencies();
$this->loadModel('PostsModel');
$this->loadModel('ForumsModel');
$_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0;
$_GET['submode'] = (isset($_GET['submode'])) ? trim(strip_tags($this->db->real_escape_string($_GET['submode']))) : 0;
if (!$this->getModel('SessionModel')->isLogged())
{
$this->getView('MainView')->forum_message('You are not logged.', 'index.php?mode=login');
$lockv = true;
}
if ($this->getModel('SessionModel')->getRank() == RANK_USER && !isset($lockv))
{
$this->getView('MainView')->forum_message('Only mods have access to this menu', 'index.php');
$lockv = true;
}
//sprawdź czy wątek/post istnieje
if (!isset($lockv))
switch($_GET['submode'])
{
case 'deletetopic':
case 'locktopic':
case 'movetopic':
$t = $this->getModel('PostsModel')->getTopic($_GET['id']);
if ($t == null)
{
$this->getView('MainView')->forum_message('Topic does not exist!', 'index.php');
$lockv = true;
}
break;
case 'deletepost':
$p = $this->getModel('PostsModel')->getPost($_GET['id']);
if ($p == null)
{
$this->getView('MainView')->forum_message('Post does not exist!', 'index.php');
$lockv = true;
}
else
{
$t = $this->getModel('PostsModel')->getTopic($p['topic_id']);
if ($t['post_count'] == 1)
{
$this->getView('MainView')->forum_message('If topic has only one post, use <span style="font-weight: bold">delete topic</span> option.', 'index.php?mode=viewtopic&amp;id='.$p['topic_id'], 3);
$lockv = true;
}
}
break;
default:
$this->getView('MainView')->forum_message('Invalid mode', 'index.php');
$lockv = true;
break;
}
//wysyłanie formularza
if (isset($_POST['confirmed']) && !isset($lockv))
{
if (!isset($_POST['rejected']))
{
switch($_GET['submode'])
{
case 'deletepost':
$this->getModel('PostsModel')->deletePost($_GET['id']);
$this->getView('MainView')->forum_message('Post deleted. Redirecting...', 'index.php?mode=viewtopic&amp;id='.$p['topic_id']);
$lockv = true;
break;
case 'deletetopic':
$this->getModel('PostsModel')->deleteTopic($_GET['id']);
$this->getView('MainView')->forum_message('Topic deleted. Redirecting...', 'index.php?mode=viewforum&amp;id='.$t['forum_id']);
$lockv = true;
break;
case 'locktopic':
if ($t['topic_locked'] == false)
{
$this->getModel('PostsModel')->lockTopic($_GET['id']);
$this->getView('MainView')->forum_message('Topic locked. Redirecting...', 'index.php?mode=viewtopic&amp;id='.$_GET['id']);
}
else
{
$this->getModel('PostsModel')->lockTopic($_GET['id'], false);
$this->getView('MainView')->forum_message('Topic unlocked. Redirecting...', 'index.php?mode=viewtopic&amp;id='.$_GET['id']);
}
$lockv = true;
break;
case 'movetopic':
if ($this->getModel('ForumsModel')->getForum($_POST['forum_id']) == null)
$this->getView('MainView')->forum_message('Forum does not exist!', 'index.php?mode=viewtopic&amp;id='.$_GET['id']);
else
{
$this->getModel('PostsModel')->moveTopic($_GET['id'], $_POST['forum_id']);
$this->getView('MainView')->forum_message('Topic moved. Redirecting...', 'index.php?mode=viewtopic&amp;id='.$_GET['id']);
}
$lockv = true;
break;
}
}
else
{
switch ($_GET['submode'])
{
case 'deletetopic':
case 'locktopic':
case 'movetopic':
$this->forward('index.php?mode=viewtopic&id='.$_GET['id']);
break;
case 'deletepost':
$this->forward('index.php?mode=viewtopic&id='.$p['topic_id']);
}
}
}
if (!isset($lockv))
switch($_GET['submode'])
{
case 'deletepost':
$this->getView('MainView')->confirm_action('Do you really want delete post <span style="font-weight: bold">#'.$_GET['id'].'</span>?');
break;
case 'deletetopic':
$this->getView('MainView')->confirm_action('Do you really want delete topic <span style="font-weight: bold">#'.$_GET['id'].'</span> with all posts? This operation cannot undone.');
break;
case 'locktopic':
if ($t['topic_locked'] == false)
$this->getView('MainView')->confirm_action('Do you want lock topic <span style="font-weight: bold">#'.$_GET['id'].'</span>?');
else
$this->getView('MainView')->confirm_action('Do you want unlock topic <span style="font-weight: bold">#'.$_GET['id'].'</span>?');
break;
case 'movetopic':
$this->getView('MainView')->putExistingModel('PostsModel', $this->getModel('PostsModel'));
$this->getView('MainView')->move_topic();
break;
}
}
public function posting($type)
{
$this->loadDependencies();
$msg = '';
$this->loadModel('PostsModel');
$this->loadModel('ForumsModel');
$_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0;
if (!$this->getModel('SessionModel')->isLogged())
{
$this->getView('MainView')->forum_message('You are not logged.', 'index.php?mode=login');
$lockv = true;
}
//SPRAWDZANIE CZY TEMAT/FORUM ISTNIEJE I CZY NIE ZABLOKOWANE
if (!isset($lockv))
switch($type)
{
case POSTING_NEWTOPIC: //sprawdzenie czy forum istnieje i czy nie zablokowane
$f = $this->getModel('ForumsModel')->getForum($_GET['id']);
if ($f == null)
{
$this->getView('MainView')->forum_message('Forum does not exist!', 'index.php');
$lockv = true;
}
else
if ($f['locked'] == true)
{
$this->getView('MainView')->forum_message('Forum is locked', 'index.php?mode=viewforum&amp;id='.$_GET['id']);
$lockv = true;
}
break;
case POSTING_REPLY: //sprawdzenie czy temat istnieje
case POSTING_QUOTE:
$t = $this->getModel('PostsModel')->getTopic($_GET['id']);
if ($t == null)
{
$this->getView('MainView')->forum_message('Topic does not exist!', 'index.php');
$lockv = true;
}
else
{
if ($t['forum_locked'] == true && $this->getModel('SessionModel')->getRank() < RANK_MOD)
{
$this->getView('MainView')->forum_message('Forum is locked', 'index.php?mode=viewtopic&amp;id='.$t['topic_id']);
$lockv = true;
}
if ($t['topic_locked'] == true && $this->getModel('SessionModel')->getRank() < RANK_MOD)
{
$this->getView('MainView')->forum_message('Topic is locked', 'index.php?mode=viewtopic&amp;id='.$t['topic_id']);
$lockv = true;
}
if ($type == POSTING_QUOTE)
{
$_GET['q'] = (isset($_GET['q'])) ? trim(strip_tags($this->db->real_escape_string($_GET['q']))) : 0;
$qp = $this->getModel('PostsModel')->getPost($_GET['q']);
if ($qp == null)
{
$this->getView('MainView')->forum_message('Invalid quoted post', 'index.php?mode=viewtopic&amp;id='.$t['topic_id']);
$lockv = true;
}
else
{
if ($qp['topic_id'] != $_GET['id'])
{
$this->getView('MainView')->forum_message('Invalid quoted post', 'index.php?mode=viewtopic&amp;id='.$t['topic_id']);
$lockv = true;
}
}
}
}
break;
case POSTING_EDIT:
$p = $this->getModel('PostsModel')->getPost($_GET['id']);
if ($p == null)
{
$this->getView('MainView')->forum_message('Post does not exist!', 'index.php');
$lockv = true;
}
else
{
$t = $this->getModel('PostsModel')->getTopic($p['topic_id']);
if ($t['forum_locked'] == true && $this->getModel('SessionModel')->getRank() < RANK_MOD)
{
$this->getView('MainView')->forum_message('Forum is locked', 'index.php?mode=viewtopic&amp;id='.$t['topic_id']);
$lockv = true;
}
if ($t['topic_locked'] == true && $this->getModel('SessionModel')->getRank() < RANK_MOD)
{
$this->getView('MainView')->forum_message('Topic is locked', 'index.php?mode=viewtopic&amp;id='.$t['topic_id']);
$lockv = true;
}
//sprawdzić czy edycja tematu
// i ustawić opdowiednie parametry $type = POSTING_EDITTOPIC
$first = $this->getModel('PostsModel')->getFirstPost($t['topic_id']);
if ($first['post_id'] == $_GET['id'])
$type = POSTING_EDITTOPIC;
if ($p['user_id'] != $this->getModel('SessionModel')->getID() && $this->getModel('SessionModel')->getRank() < RANK_MOD)
{
$this->getView('MainView')->forum_message('You can edit only own posts', 'index.php?mode=viewtopic&amp;id='.$t['topic_id']);
$lockv = true;
}
}
break;
}
//przesłanie formularza --------------------------------------------------------------------------------
if (isset($_POST['post']) && !isset($_POST['preview']) && !isset($lockv))
{
$_POST['post'] = trim(htmlspecialchars($this->db->real_escape_string($_POST['post'])));
if ($type == POSTING_NEWTOPIC || $type == POSTING_EDITTOPIC) //walidacja tytułu tematu (add, edit)
{
$_POST['topic'] = trim(strip_tags($this->db->real_escape_string($_POST['topic'])));
if (strlen($_POST['topic']) < 3)
$msg .= 'Topic title is too short (min 3 characters)<br>';
}
if (strlen($_POST['post']) < 3)
$msg .= 'Post content is too short (min 3 characters)<br>';
if ($msg == null)
{
switch ($type)
{
case POSTING_NEWTOPIC: //akcje dodania nowego tematu
$topic_id = $this->getModel('PostsModel')->addTopic($_POST['topic'], $_POST['post'], $_GET['id'], $this->getModel('SessionModel')->getID());
if ($topic_id != null)
{
$this->getView('MainView')->forum_message('Topic created, Redirecting...', 'index.php?mode=viewtopic&amp;id='.$topic_id);
$lockv = true;
}
else
$msg .= 'Something went wrong, try again.';
break;
case POSTING_EDITTOPIC:
case POSTING_EDIT:
$this->getModel('PostsModel')->changePost($_GET['id'], $_POST['post']);
if ($type == POSTING_EDITTOPIC)
$this->getModel('PostsModel')->changeTopic($t['topic_id'], $_POST['topic']);
$this->getView('MainView')->forum_message('Post edited. Redirecting to topic...', 'index.php?mode=viewtopic&amp;id='.$t['topic_id']);
$lockv = true;
break;
case POSTING_QUOTE:
case POSTING_REPLY:
$this->getModel('PostsModel')->addPost($_GET['id'], $this->getModel('SessionModel')->getID(), $_POST['post']);
$this->getView('MainView')->forum_message('Reply saved. Redirecting to topic...', 'index.php?mode=viewtopic&amp;id='.$_GET['id']);
$lockv = true;
break;
}
}
}
if (!isset($lockv))
{
switch ($type)
{
case POSTING_NEWTOPIC:
case POSTING_REPLY:
$_POST['post'] = (isset($_POST['post'])) ? $_POST['post'] : '';
break;
case POSTING_EDITTOPIC:
$_POST['post'] = (isset($_POST['post'])) ? $_POST['post'] : $p['content'];
$_POST['topic'] = (isset($_POST['topic'])) ? $_POST['topic'] : $t['topic_title'];
break;
case POSTING_EDIT:
$_POST['post'] = (isset($_POST['post'])) ? $_POST['post'] : $p['content'];
break;
case POSTING_QUOTE:
$quote = ($qp['nick'] != null) ? '='.$qp['nick'] : '';
$_POST['post'] = (isset($_POST['post'])) ? $_POST['post'] : '[quote'.$quote.']'.$qp['content'].'[/quote]';
break;
}
if ($type == POSTING_NEWTOPIC)
$_POST['topic'] = (isset($_POST['topic'])) ? $_POST['topic'] : ''; //tylko edycja/tworzenie tematu
$this->getView('MainView')->putExistingModel('PostsModel', $this->getModel('PostsModel'));
$this->getView('MainView')->putExistingModel('ForumsModel', $this->getModel('ForumsModel'));
$this->getView('MainView')->posting_form($type, $msg);
}
}
public function myprofile()
{
$this->loadDependencies();
if (!$this->getModel('SessionModel')->isLogged())
$this->forward('index.php');
else
$this->forward('index.php?mode=viewprofile&id='.$this->getModel('SessionModel')->getID());
}
public function viewprofile()
{
$this->loadDependencies();
$this->loadModel('UsersModel');
$this->getView('MainView')->putExistingModel('UsersModel', $this->getModel('UsersModel'));
$_GET['id'] = (isset($_GET['id'])) ? trim(strip_tags($this->db->real_escape_string($_GET['id']))) : 0;
if ($this->getModel('UsersModel')->getUserInformation($_GET['id']) == null)
$this->getView('MainView')->forum_message('User does not exist!', 'index.php');
else
{
//$this->getView('MainView')->putExistingModel('PostsModel', $this->getModel('PostsModel'));
$this->getView('MainView')->viewprofile();
}
}
public function editprofile()
{
$this->loadDependencies();
$this->loadModel('UsersModel');
$user_info = $this->getModel('UsersModel')->getUserInformation($this->getModel('SessionModel')->getID(), true);
if (!$this->getModel('SessionModel')->isLogged())
{
$this->getView('MainView')->forum_message('You are not logged.', 'index.php?mode=login');
}
else
{
$msg = '';
if (isset($_POST['nick'], $_POST['passwd'], $_POST['passwd_confirm'], $_POST['email']))
{
//secure pools
$_POST['nick'] = trim(strip_tags($this->db->real_escape_string($_POST['nick'])));
$_POST['passwd_old'] = trim(strip_tags($_POST['passwd_old']));
$_POST['passwd'] = trim(strip_tags($_POST['passwd']));
$_POST['passwd_confirm'] = trim(strip_tags($_POST['passwd_confirm']));
$_POST['email'] = trim(strip_tags($this->db->real_escape_string($_POST['email'])));
$_POST['location'] = trim(strip_tags($this->db->real_escape_string($_POST['location'])));
$_POST['signature'] = trim(strip_tags($this->db->real_escape_string($_POST['signature'])));
if ($_POST['email'] != $user_info['email'] || $_POST['passwd'] != '')
{
if (sha1($_POST['passwd_old']) != $user_info['password'])
$msg .= 'Old password is incorrect!<br>';
}
if ($_POST['passwd'] != '')
{
if (strlen($_POST['passwd']) < 8)
$msg .= 'Password is too short (min 8 characters)<br>';
if ($_POST['passwd'] != $_POST['passwd_confirm'])
$msg .= 'Password do not match!<br>';
}
//check if avatar is uploaded
if ($_FILES['avatar']['tmp_name'] != null)
{
global $allowed_avatars;
$image_size = @getimagesize($_FILES['avatar']['tmp_name']);
if ($image_size == null)
$msg .= 'Type of uploaded file are not allowed.<br>';
else
if (!in_array($image_size['mime'], $allowed_avatars))
$msg .= 'Type of uploaded avatar is not supported.<br>';
else
if ($image_size[0] > 120 || $image_size[1] > 150)
$msg .= 'Uploaded avatar is too big (maximum 120x150 px).<br>';
}
if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL))
$msg .= 'Email is incorrect<br>';
if ($msg == '')
{
if ($_FILES['avatar']['tmp_name'] != null && !isset($_POST['delete_avatar'])) //change an avatar
{
if ($user_info['avatar'] != '')
unlink('./'.$user_info['avatar']);
$ext = pathinfo($_FILES['avatar']['name'], PATHINFO_EXTENSION);
$av = 'images/avatars/'.$this->getModel('SessionModel')->getID().'.'.$ext;
move_uploaded_file($_FILES['avatar']['tmp_name'], './'.$av);
}
else
if (isset($_POST['delete_avatar']))
{
unlink('./'.$user_info['avatar']);
$av = '';
}
else
$av = $user_info['avatar']; //if new avatar is not set
if ($_POST['passwd'] != '')
$this->getModel('UsersModel')->changeUserPassword($this->getModel('SessionModel')->getID(), sha1($_POST['passwd']));
$this->getModel('UsersModel')->updateUserProfile($this->getModel('SessionModel')->getID(), '', $_POST['email'], $_POST['location'], $_POST['signature'], $av);
$this->getView('MainView')->forum_message('Your profile has changed.', 'index.php?mode=viewprofile&amp;id='.$this->getModel('SessionModel')->getID());
$lockv = true;
}
}
$_POST['nick'] = (isset($_POST['nick'])) ? $_POST['nick'] : $user_info['nick'];
$_POST['email'] = (isset($_POST['email'])) ? $_POST['email'] : $user_info['email'];
$_POST['location'] = (isset($_POST['location'])) ? $_POST['location'] : $user_info['location'];
$_POST['signature'] = (isset($_POST['signature'])) ? $_POST['signature'] : $user_info['signature'];
$this->getView('MainView')->putExistingModel('UsersModel', $this->getModel('UsersModel'));
if (!isset($lockv))
$this->getView('MainView')->edprofile_form($msg);
}
}
public function logout()
{
$this->loadDependencies();
if (!$this->getModel('SessionModel')->isLogged())
$this->forward('index.php');
$this->getModel('SessionModel')->deleteSession();
$this->getView('MainView')->forum_message('You are logged out.', 'index.php');
}
public function login()
{
$this->loadDependencies();
$this->loadModel('BansModel');
if ($_SERVER['REQUEST_SCHEME'] == 'http')
$this->forward('https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
if ($this->getModel('SessionModel')->isLogged())
$this->forward('index.php');
$msg = '';
if (isset($_POST['nick'], $_POST['passwd']))
{
//secure pools
$_POST['nick'] = trim(strip_tags($this->db->real_escape_string($_POST['nick'])));
$_POST['passwd'] = sha1(trim(strip_tags($this->db->real_escape_string($_POST['passwd']))));
$userinfo = $this->getModel('SessionModel')->tryGetUser($_POST['nick'], $_POST['passwd']);
if (count($userinfo) == 0)
$msg = 'Invalid username or password.';
if ($msg == '')
{
$ban_info = $this->getModel('BansModel')->getUserBan($userinfo['user_id']);
if ($ban_info == null)
{
$this->getModel('SessionModel')->registerNewSession($userinfo['user_id']);
$this->getView('MainView')->forum_message('You are logged as: <span style="font-weight: bold">'.$userinfo['nick'].'</span>', 'index.php');
}
else
{
$reason = ($ban_info['reason'] != '') ? '<br>Reason: <span style="font-style: italic">'.$ban_info['reason'].'</span>' : '';
$this->getView('MainView')->forum_message('You are banned!'.$reason);
}
$lockv = true;
}
}
$_POST['nick'] = (isset($_POST['nick'])) ? $_POST['nick'] : '';
if (!isset($lockv))
$this->getView('MainView')->login_form($msg);
}
public function register()
{
$this->loadDependencies();
$this->loadModel('UsersModel');
if ($this->getModel('SessionModel')->isLogged())
$this->forward('index.php');
if ($_SERVER['REQUEST_SCHEME'] == 'http')
$this->forward('https://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
$msg = '';
if (isset($_POST['nick'], $_POST['passwd'], $_POST['passwd_confirm'], $_POST['email']))
{
//secure pools
$_POST['nick'] = trim(strip_tags($this->db->real_escape_string($_POST['nick'])));
$_POST['passwd'] = trim(strip_tags($_POST['passwd']));
$_POST['passwd_confirm'] = trim(strip_tags($_POST['passwd_confirm']));
$_POST['email'] = trim(strip_tags($this->db->real_escape_string($_POST['email'])));
if (strlen($_POST['nick']) < 3)
$msg .= 'Nick is too short (min 3 characters)<br>';
if (strlen($_POST['passwd']) < 8)
$msg .= 'Password is too short (min 8 characters)<br>';
if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL))
$msg .= 'Email is incorrect<br>';
if ($this->getModel('UsersModel')->nickExists($_POST['nick']) == true)
$msg .= 'Nick is in use. Type another one.<br>';
if ($_POST['passwd'] != $_POST['passwd_confirm'])
$msg .= 'Password do not match';
if ($msg == '')
{
$this->getModel('UsersModel')->createNewUser($_POST['nick'], sha1($_POST['passwd']), $_POST['email']);
$this->getView('MainView')->forum_message('Your account has created. Log in to write new posts.', 'index.php');
$lockv = true;
}
}
$_POST['nick'] = (isset($_POST['nick'])) ? $_POST['nick'] : '';
$_POST['email'] = (isset($_POST['email'])) ? $_POST['email'] : '';
if (!isset($lockv))
$this->getView('MainView')->register_form($msg);
}
public function checknick()
{
$this->loadModel('UsersModel');
if (!isset($_GET['nick']))
$_GET['nick'] = '';
$_GET['nick'] = trim($this->db->real_escape_string(strip_tags($_GET['nick'])));
if ($this->getModel('UsersModel')->nickExists($_GET['nick']) == true)
echo 'true';
else
echo 'false';
}
}
?>

+ 6
- 0
inc/database_connection.php View File

@ -0,0 +1,6 @@
<?php
$DB = new MySQLi(DB_HOST, DB_USER, DB_PASSWD, DB_NAME);
$DB->query("SET NAMES `utf8`");
?>

+ 5
- 0
inc/misc_functions.php View File

@ -0,0 +1,5 @@
<?php
?>

+ 56
- 0
inc/model.class.php View File

@ -0,0 +1,56 @@
<?php
require_once('./inc/askModel.class.php');
abstract class Model extends AskModel
{
protected $db;
function __construct(&$db)
{
$this->db = $db;
}
public function select($table, $what='*', $where = '', $sorting = '', $limit = '')
{
$sql="SELECT $what FROM $table";
if ($where != '')
$sql .= " WHERE $where";
if($sorting != '')
$sql .= " ORDER BY $sorting";
if($limit != '')
$sql .= " LIMIT $limit";
$result = $this->db->query($sql);
$out = array();
if ($result->num_rows > 0)
{
while ($row = $result->fetch_assoc())
{
$out[]=$row;
}
}
return $out;
}
public function select_query($sql)
{
$result = $this->db->query($sql);
$out = array();
if ($result->num_rows > 0)
{
while ($row = $result->fetch_assoc())
{
$out[]=$row;
}
}
return $out;
}
}

+ 64
- 0
inc/models/BansModel.class.php View File

@ -0,0 +1,64 @@
<?php
require_once('./inc/model.class.php');
class BansModel extends Model
{
private $ban_info = null;
public function getBans()
{
$query = 'SELECT b.ban_id as ban_id, b.user_id as user_id, u.nick as nick, b.reason as reason
FROM '.BANLIST_TABLE.' b
LEFT JOIN '.USERS_TABLE.' u ON u.user_id = b.user_id';
return $this->select_query($query);
}
public function getBan($ban_id)
{
if ($this->ban_info == null)
{
$query = 'SELECT b.ban_id as ban_id, b.user_id as user_id, u.nick as nick, b.reason as reason
FROM '.BANLIST_TABLE.' b
LEFT JOIN '.USERS_TABLE.' u ON u.user_id = b.user_id
WHERE `ban_id`=\''.$ban_id.'\'';
$out = $this->select_query($query);
if (count($out) > 0)
$this->ban_info = $out[0];
}
return $this->ban_info;
}
public function getUserBan($user_id)
{
$out = $this->select(BANLIST_TABLE, '*', 'user_id=\''.$user_id.'\'');
if (count($out) > 0)
return $out[0];
else
return null;
}
public function addBan($user_id, $reason)
{
$query = 'INSERT INTO '.BANLIST_TABLE.'
(`ban_id`, `user_id`, `reason`)
VALUES (NULL, \''.$user_id.'\', \''.$reason.'\')';
$this->db->query($query);
$query = 'DELETE FROM '.SESSIONS_TABLE.' WHERE `user_id`=\''.$user_id.'\'';
$this->db->query($query);
}
public function deleteBan($ban_id)
{
$query = 'DELETE FROM '.BANLIST_TABLE.' WHERE `ban_id`=\''.$ban_id.'\'';
$this->db->query($query);
}
}
?>

+ 38
- 0
inc/models/ConfigModel.class.php View File

@ -0,0 +1,38 @@
<?php
require_once('./inc/model.class.php');
class ConfigModel extends Model
{
private $confList = array();
public function __construct(&$db)
{
$this->db = $db;
$result = $this->select (CONFIG_TABLE);
for ($i=0; $i<count($result); $i++)
$this->confList[$result[$i]['name']] = $result[$i]['value'];
}
public function getConf($name)
{
if (isset($this->confList[$name]))
return $this->confList[$name];
else
return null;
}
public function updateConf($name, $value)
{
$query = 'UPDATE '.CONFIG_TABLE.'
SET `value`=\''.$value.'\'
WHERE `name`=\''.$name.'\'';
$this->db->query($query);
}
}
?>

+ 119
- 0
inc/models/ForumsModel.class.php View File

@ -0,0 +1,119 @@
<?php
require_once('./inc/model.class.php');
class ForumsModel extends Model
{
private $forum_info = null;
private $cat_info = null;
public function getForums()
{
return $this->select (FORUMS_VIEW);
}
public function getCats()
{
return $this->select (CATS_TABLE);
}
public function getForumsNames()
{
$out = $this->select (FORUMS_TABLE, 'forum_id, name', '', 'forum_id ASC');
if (count($out) > 0)
return $out;
else
return array();
}
public function getForum($forum_id)
{
if ($this->forum_info == null)
{
$out = $this->select(FORUMS_TABLE, '*', 'forum_id=\''.$forum_id.'\'');
if (count($out) > 0)
$this->forum_info = $out[0];
}
return $this->forum_info;
}
public function getTopics($forum_id)
{
$out = $this->select(TOPICS_VIEW, '*', 'forum_id=\''.$forum_id.'\'', 'lastpost_post_id DESC');
if (count($out) > 0)
return $out;
else
return array();
}
public function getCat($cat_id)
{
if ($this->cat_info == null)
{
$out = $this->select(CATS_TABLE, '*', 'category_id=\''.$cat_id.'\'');
if (count($out) > 0)
$this->cat_info = $out[0];
}
return $this->cat_info;
}
public function changeCat($cat_id, $cat_name)
{
$query = 'UPDATE '.CATS_TABLE.'
SET `name`=\''.$cat_name.'\'
WHERE `category_id`=\''.$cat_id.'\'';
$this->db->query($query);
}
public function addCat($cat_name)
{
$query = 'INSERT INTO '.CATS_TABLE.'
(category_id, name)
VALUES (NULL, \''.$cat_name.'\')';
$this->db->query($query);
}
public function deleteCat($cat_id)
{
$query = 'DELETE FROM '.CATS_TABLE.'
WHERE `category_id`=\''.$cat_id.'\'';
$this->db->query($query);
}
public function changeForum($forum_id, $forum_name, $forum_desc, $forum_category_id, $forum_locked)
{
$query = 'UPDATE '.FORUMS_TABLE.'
SET `name`=\''.$forum_name.'\',
`desc`=\''.$forum_desc.'\',
`category_id`=\''.$forum_category_id.'\',
`locked`=\''.$forum_locked.'\'
WHERE `forum_id`=\''.$forum_id.'\'';
$this->db->query($query);
}
public function addForum($forum_name, $forum_desc, $forum_category_id, $forum_locked)
{
$query = 'INSERT INTO '.FORUMS_TABLE.'
(`forum_id`, `name`, `desc`, `category_id`, `locked`)
VALUES (NULL, \''.$forum_name.'\', \''.$forum_desc.'\', \''.$forum_category_id.'\', \''.$forum_locked.'\')';
$this->db->query($query);
}
public function deleteForum($forum_id)
{
$query = 'DELETE FROM '.FORUMS_TABLE.'
WHERE `forum_id`=\''.$forum_id.'\'';
$this->db->query($query);
}
}
?>

+ 43
- 0
inc/models/NavigationModel.class.php View File

@ -0,0 +1,43 @@
<?php
require_once('./inc/model.class.php');
class NavigationModel extends Model
{
private $linksList = array();
private $title = '';
public function setForumName($fn)
{
$this->addLink('Forum '.$fn, 'index.php');
$this->title = $fn. ' &bull; ';
}
public function addLink($name, $url = '')
{
if ($url == null)
$url = $_SERVER['REQUEST_URI'];
$l = array(
'name' => $name,
'url' => $url
);
array_push($this->linksList, $l);
}
public function setSubTitle($t)
{
$this->title .= $t;
}
public function getTitle()
{
return $this->title;
}
public function getNav()
{
return $this->linksList;
}
}
?>

+ 126
- 0
inc/models/PostsModel.class.php View File

@ -0,0 +1,126 @@
<?php
require_once('./inc/model.class.php');
class PostsModel extends Model
{
private $topic_info = null;
private $post_info = null;
public function getTopic($topic_id)
{
if ($this->topic_info == null)
{
$query = '
SELECT
t.topic_id as topic_id, t.title as topic_title, t.locked as topic_locked, t.forum_id as forum_id, f.name as forum_name, f.locked as forum_locked, pc.post_count as post_count
FROM '.TOPICS_TABLE.' t
LEFT JOIN '.FORUMS_TABLE.' f ON f.forum_id = t.forum_id
LEFT JOIN '.TOPICS_PC_VIEW.' pc ON pc.topic_id = t.topic_id
WHERE t.topic_id=\''.$topic_id.'\'';
$out = $this->select_query($query);
if (count($out) > 0)
$this->topic_info = $out[0];
}
return $this->topic_info;
}
public function getPosts($topic_id)
{
$out = $this->select (POSTS_VIEW, '*', 'topic_id=\''.$topic_id.'\'', 'post_id ASC');
if ($out != null)
return $out;
else
return null;
}
public function getPost($post_id)
{
$out = $this->select (POSTS_VIEW, '*', 'post_id=\''.$post_id.'\'');
if (count($out) > 0)
return $out[0];
else
return null;
}
public function getFirstPost($topic_id)
{
$out = $this->select (POSTS_VIEW, 'post_id', 'topic_id=\''.$topic_id.'\'', 'post_id ASC', 1);
if (count($out) > 0)
return $out[0];
else
return null;
}
//mod options
public function deletePost($post_id)
{
$query = 'DELETE FROM '.POSTS_TABLE.' WHERE post_id=\''.$post_id.'\';';
$this->db->query($query);
}
public function deleteTopic($topic_id)
{
$query = 'call delete_topic(\''.$topic_id.'\');';
$this->db->query($query);
}
public function lockTopic($topic_id, $locked = true)
{
$query = 'UPDATE '.TOPICS_TABLE.' SET locked=\''.$locked.'\' WHERE topic_id=\''.$topic_id.'\';';
$this->db->query($query);
}
public function moveTopic($topic_id, $forum_id)
{
$query = 'UPDATE '.TOPICS_TABLE.' SET forum_id=\''.$forum_id.'\' WHERE topic_id=\''.$topic_id.'\';';
$this->db->query($query);
}
public function addTopic($title, $content, $forum_id, $user_id)
{
$query = 'call add_topic(\''.$title.'\',
\''.$content.'\',
\''.$forum_id.'\',
\''.$user_id.'\',
\''.$_SERVER['HTTP_USER_AGENT'].'\',
@out);';
$this->db->query($query);
$result = $this->db->query('select @out as topic_id');
if ($result != null)
return $result->fetch_assoc()['topic_id'];
else
return null;
}
public function changePost($post_id, $content)
{
$query = 'UPDATE '.POSTS_TABLE.' SET `content`=\''.$content.'\' WHERE `post_id`=\''.$post_id.'\'';
$this->db->query($query);
}
public function changeTopic($topic_id, $title)
{
$query = 'UPDATE '.TOPICS_TABLE.' SET `title`=\''.$title.'\' WHERE `topic_id`=\''.$topic_id.'\'';
$this->db->query($query);
}
public function addPost($topic_id, $user_id, $content)
{
$query = 'INSERT INTO '.POSTS_TABLE.'
(post_id, topic_id, user_id, content, date, user_agent)
VALUES
(NULL, \''.$topic_id.'\', \''.$user_id.'\', \''.$content.'\', NOW(), \''.$_SERVER['HTTP_USER_AGENT'].'\')';
$this->db->query($query);
}
}
?>

+ 125
- 0
inc/models/SessionModel.class.php View File

@ -0,0 +1,125 @@
<?php
require_once('./inc/model.class.php');
class SessionModel extends Model
{
private $userdata = array();
public function __construct(&$db)
{
$this->db = $db;
if (isset($_COOKIE[COOKIE_NAME]))
{
$result = $this->select(SESSIONS_TABLE, '*', 'session_id=\''.$_COOKIE[COOKIE_NAME].'\' AND expiry_time>=NOW()');
if (count($result) > 0)
{
//update session expiry time in database and in cookie
if ($result[0]['IP'] != $_SERVER['REMOTE_ADDR'])
{
$this->deleteSession();
}
else
{
$this->updateSession();
$uid = $result[0]['user_id'];
$result = $this->select(USERS_TABLE, 'user_id, nick, rank', 'user_id=\''.$uid.'\'');
$this->userdata = $result[0];
}
}
else
{
$this->deleteSession();
}
}
}
public function updateSession()
{
/*$this->db->query('UPDATE '.SESSIONS_TABLE.' SET expiry_time=(NOW() + INTERVAL 120 MINUTE) WHERE session_id=\''.$_COOKIE[COOKIE_NAME].'\'');
setcookie(COOKIE_NAME, $_COOKIE[COOKIE_NAME], $_SERVER['REQUEST_TIME']+7200, COOKIE_PATH, COOKIE_DOMAIN, false, true); */
$newid = $this->generateSessionID();
$this->db->query('UPDATE '.SESSIONS_TABLE.' SET expiry_time=(NOW() + INTERVAL 120 MINUTE), session_id=\''.$newid.'\' WHERE session_id=\''.$_COOKIE[COOKIE_NAME].'\'');
setcookie(COOKIE_NAME, $newid, $_SERVER['REQUEST_TIME']+7200, COOKIE_PATH, COOKIE_DOMAIN, false, true);
$_COOKIE[COOKIE_NAME] = $newid;
}
public function deleteSession()
{
setcookie(COOKIE_NAME, '', $_SERVER['REQUEST_TIME']-3600, COOKIE_PATH, COOKIE_DOMAIN, false, true);
$this->db->query('DELETE FROM '.SESSIONS_TABLE.' WHERE session_id=\''.$_COOKIE[COOKIE_NAME].'\'');
}
private function generateSessionID()
{
$out = $_SERVER['HTTP_USER_AGENT'].$_SERVER['REQUEST_TIME_FLOAT'].$_SERVER['REMOTE_ADDR'].rand(1, 50000);
return md5($out);
}
public function registerNewSession($user_id)
{
$newID = $this->generateSessionID();
$query = 'UPDATE '.USERS_INFO_TABLE.'
SET lastvisit=NOW()
WHERE user_id=\''.$user_id.'\'';
$this->db->query($query);
$query =
'INSERT INTO
'.SESSIONS_TABLE.'
(session_id, user_id, IP, expiry_time)
VALUES
(\''.$newID.'\', \''.$user_id.'\', \''.$_SERVER['REMOTE_ADDR'].'\', (NOW() + INTERVAL 120 MINUTE) );';
$this->db->query($query);
setcookie(COOKIE_NAME, $newID, $_SERVER['REQUEST_TIME']+7200, COOKIE_PATH, COOKIE_DOMAIN, false, true);
}
public function tryGetUser($nick, $passwd)
{
$result = $this->select(USERS_TABLE, 'user_id, nick', 'nick=\''.$nick.'\' AND password=\''.$passwd.'\'', '', 1);
if (count($result) > 0 )
return $result[0];
else
return array();
}
public function isLogged()
{
if (count($this->userdata) > 0)
return true;
else
return false;
}
public function getNick()
{
if ($this->isLogged())
return $this->userdata['nick'];
else
return null;
}
public function getRank()
{
if ($this->isLogged())
return $this->userdata['rank'];
else
return null;
}
public function getID()
{
if ($this->isLogged())
return $this->userdata['user_id'];
else
return null;
}
}
?>

+ 56
- 0
inc/models/StatisticsModel.class.php View File

@ -0,0 +1,56 @@
<?php
require_once('./inc/model.class.php');
class StatisticsModel extends Model
{
private $logged_users = null;
public function getPostsCount()
{
$out = $this->select(POSTS_TABLE, 'count(post_id) AS posts_count');
return $out[0]['posts_count'];
}
public function getTopicsCount()
{
$out = $this->select(TOPICS_TABLE, 'count(topic_id) AS topics_count');
return $out[0]['topics_count'];
}
public function getUsersCount()
{
$out = $this->select(USERS_TABLE, 'count(user_id) AS users_count');
return $out[0]['users_count'];
}
public function getLastRegisteredUser()
{
$out = $this->select(USERS_TABLE, 'user_id, nick, rank', '', 'user_id DESC', '1');
return $out[0];
}
private function retrieveLoggedUsers()
{
if ($this->logged_users == null)
{
$this->logged_users = $this->select(LOGGED_USERS_VIEW);
}
}
public function getLoggedUsersCount()
{
$this->retrieveLoggedUsers();
return count($this->logged_users);
}
public function getLoggedUsers()
{
$this->retrieveLoggedUsers();
return $this->logged_users;
}
}
?>

+ 128
- 0
inc/models/UsersModel.class.php View File

@ -0,0 +1,128 @@
<?php
require_once('./inc/model.class.php');
class UsersModel extends Model
{
private $user_info = null;
public function nickExists($nick)
{
$out = $this->select(USERS_TABLE, 'nick', '`nick`=\''.$nick.'\'', '', 1);
if (count($out) > 0)
return true;
else
return false;
}
public function createNewUser($nick, $passwd, $email)
{
$this->db->query('call add_user(\''.$nick.'\', \''.$passwd.'\', \''.$email.'\');');
}
public function getUsersNicks()
{
$out = $this->select (USERS_TABLE, 'user_id, nick', '', 'user_id ASC');
if (count($out) > 0)
return $out;
else
return array();
}
public function getUserInformation($user_id, $passwd = false)
{
if ($this->user_info == null)
{
$query = '
SELECT
u.nick as nick, u.email as email, u.rank as rank, u.active as active,
ui.regdate as regdate, ui.lastvisit as lastvisit, ui.avatar as avatar, ui.location as location, ui.signature as signature, pc.post_count as post_count, lu.IP as user_IP ';
if ($passwd)
$query .= ',u.password as password ';
$query .= '
FROM '.USERS_TABLE.' u
LEFT JOIN '.USERS_INFO_TABLE.' ui on ui.user_id = u.user_id
LEFT JOIN '.USERS_PC_VIEW.' pc on pc.user_id = u.user_id
LEFT JOIN '.LOGGED_USERS_VIEW.' lu on lu.user_id = u.user_id
WHERE u.user_id = \''.$user_id.'\'';
$out = $this->select_query($query);
if (count($out) > 0)
$this->user_info = $out[0];
}
return $this->user_info;
}
public function changeUserPassword($user_id, $passwd)
{
$query =
'UPDATE .'.USERS_TABLE.'
SET `password`=\''.$passwd.'\'
WHERE `user_id` = \''.$user_id.'\'';
$this->db->query($query);
}
public function changeUserRank($user_id, $rank)
{
$query =
'UPDATE .'.USERS_TABLE.'
SET `rank`=\''.$rank.'\'
WHERE `user_id` = \''.$user_id.'\'';
$this->db->query($query);
}
public function updateUserProfile($user_id, $nick, $email, $location, $signature, $avatar)
{
$query =
'UPDATE .'.USERS_TABLE.'
SET ';
if ($nick != null)
$query .= '`nick`=\''.$nick.'\',';
$query .= '`email`=\''.$email.'\'
WHERE `user_id` = \''.$user_id.'\'';
$this->db->query($query);
//profile informations
$query =
'UPDATE .'.USERS_INFO_TABLE.'
SET
`avatar`=\''.$avatar.'\',
`location`=\''.$location.'\',
`signature`=\''.$signature.'\'
WHERE `user_id` = \''.$user_id.'\'';
$this->db->query($query);
}
public function getUsers($stype, $sorder, $rank)
{
$query = '
SELECT
u.user_id as user_id, u.nick as nick, u.rank as rank, ui.regdate as regdate, ui.lastvisit as lastvisit, pc.post_count as post_count
FROM '.USERS_TABLE.' u
LEFT JOIN '.USERS_INFO_TABLE.' ui on ui.user_id = u.user_id
LEFT JOIN '.USERS_PC_VIEW.' pc on pc.user_id = u.user_id ';
if ($rank !== '')
$query .= 'WHERE rank=\''.$rank.'\'';
$query .= '
ORDER BY '.$stype.' '.$sorder;
$out = $this->select_query($query);
return $out;
}
public function deleteUser($user_id)
{
$query =
'DELETE FROM .'.USERS_TABLE.'
WHERE `user_id` = \''.$user_id.'\'';
$this->db->query($query);
}
}
?>

+ 29
- 0
inc/view.class.php View File

@ -0,0 +1,29 @@
<?php
require_once('./inc/askModel.class.php');
abstract class View extends AskModel
{
protected $TPL = array();
protected $db;
function show($template)
{
if (file_exists('./templates/'.$template.'.tpl.php'))
require_once('./templates/'.$template.'.tpl.php');
else
throw new Exception('Could not show selected template: '.$template);
}
function assign($n, $v) //osadzanie elementu skórki
{
$this->TPL[$n] = $v;
}
function __construct(&$db)
{
$this->db = $db;
}
}
?>

+ 536
- 0
inc/views/MainView.class.php View File

@ -0,0 +1,536 @@
<?php
require_once('./inc/view.class.php');
class MainView extends View
{
private function setDefaults($admin = false)
{
//logged user information
$this->assign('is_logged', $this->getModel('SessionModel')->isLogged());
$this->assign('my_nick', $this->getModel('SessionModel')->getNick());
$this->assign('my_id', $this->getModel('SessionModel')->getID());
$this->assign('my_rank', $this->getModel('SessionModel')->getRank());
$this->assign('actual_time', date('Y-m-d G:i', $_SERVER['REQUEST_TIME']));
//forum prefs
$this->assign('forum_name', $this->getModel('ConfigModel')->getConf('forum_name'));
$this->assign('forum_desc', $this->getModel('ConfigModel')->getConf('forum_desc'));
//navigation
$this->loadModel('NavigationModel');
$this->getModel('NavigationModel')->setForumName($this->getModel('ConfigModel')->getConf('forum_name'));
if ($admin)
$this->getModel('NavigationModel')->addLink('ACP Admin', 'index.php?mode=admin');
}
//widok strony głównej
public function main()
{
$this->setDefaults();
// get categories, forums, forums statistics
$this->loadModel('ForumsModel');
$this->assign('forums_list', $this->getModel('ForumsModel')->getForums());
//get data for bottom statistics
$this->loadModel('StatisticsModel');
$this->assign('posts_count', $this->getModel('StatisticsModel')->getPostsCount());
$this->assign('users_count', $this->getModel('StatisticsModel')->getUsersCount());
$this->assign('last_user', $this->getModel('StatisticsModel')->getLastRegisteredUser());
$this->assign('logged_users_count', $this->getModel('StatisticsModel')->getLoggedUsersCount());
$this->assign('logged_users', $this->getModel('StatisticsModel')->getLoggedUsers());
//nawigacja po witrynie
$this->getModel('NavigationModel')->setSubTitle('Main Page');
$this->getModel('NavigationModel')->addLink('Main Page', 'index.php');
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('main');
}
public function viewforum()
{
$this->setDefaults();
// get forum info
$f_info = $this->getModel('ForumsModel')->getForum($_GET['id']);
$this->assign('f_name', $f_info['name']);
$this->assign('forum_info', $f_info);
$this->assign('topics_list', $this->getModel('ForumsModel')->getTopics($_GET['id']));
//nawigacja po witrynie
$this->getModel('NavigationModel')->setSubTitle('View forum: '.$f_info['name']);
$this->getModel('NavigationModel')->addLink($f_info['name'], 'index.php?mode=viewforum&amp;id='.$_GET['id']);
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('viewforum');
}
public function userlist()
{
$this->setDefaults();
$this->loadModel('UsersModel');
$this->assign('users_list', $this->getModel('UsersModel')->getUsers($_POST['sort_type'], $_POST['sort_desc'], $_GET['rank']));
$this->assign('regdate_selected', ($_POST['sort_type'] == 'regdate') ? 'selected="selected"' : '');
$this->assign('lastvisit_selected', ($_POST['sort_type'] == 'lastvisit') ? 'selected="selected"' : '');
$this->assign('username_selected', ($_POST['sort_type'] == 'nick') ? 'selected="selected"' : '');
$this->assign('posts_selected', ($_POST['sort_type'] == 'post_count') ? 'selected="selected"' : '');
$this->assign('desc_checked', ($_POST['sort_desc'] == 'DESC') ? 'checked="checked"' : '');
//nawigacja po witrynie
$this->getModel('NavigationModel')->setSubTitle('Users list');
$this->getModel('NavigationModel')->addLink('Users list', 'index.php?mode=userlist');
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('userlist');
}
public function viewtopic()
{
$this->setDefaults();
// get forum info
$t_info = $this->getModel('PostsModel')->getTopic($_GET['id']);
$this->assign('topic_info', $t_info);
$this->assign('posts_list', $this->getModel('PostsModel')->getPosts($_GET['id']));
//nawigacja po witrynie
$this->getModel('NavigationModel')->setSubTitle('View topic: '.$t_info['topic_title']);
$this->getModel('NavigationModel')->addLink($t_info['forum_name'], 'index.php?mode=viewforum&amp;id='.$t_info['forum_id']);
$this->getModel('NavigationModel')->addLink($t_info['topic_title'], 'index.php?mode=viewtopic&amp;id='.$_GET['id']);
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('viewtopic');
}
public function login_form($msg)
{
$this->setDefaults();
$this->assign('nick', $_POST['nick']);
$this->assign('error_msg', $msg);
//nawigacja po witrynie
$this->getModel('NavigationModel')->setSubTitle('Log in');
$this->getModel('NavigationModel')->addLink('Log in', 'index.php?mode=login');
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('login_form');
}
public function register_form($msg)
{
$this->setDefaults();
$this->assign('nick', $_POST['nick']);
$this->assign('email', $_POST['email']);
$this->assign('error_msg', $msg);
//nawigacja po witrynie
$this->getModel('NavigationModel')->setSubTitle('Register');
$this->getModel('NavigationModel')->addLink('Register', 'index.php?mode=register');
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('register_form');
}
public function viewprofile()
{
$this->setDefaults();
$this->loadModel('StatisticsModel');
$user_info = $this->getModel('UsersModel')->getUserInformation($_GET['id']);
$this->assign('user_info', $user_info);
$total_posts = $this->getModel('StatisticsModel')->getPostsCount();
$posts_ration = ($total_posts > 0) ? round(100*$user_info['post_count']/$total_posts, 2) : 0;
$this->assign('post_ratio', $total_posts);
$this->assign('logged_id', $this->getModel('SessionModel')->getID());
//nawigacja po witrynie
$this->getModel('NavigationModel')->addLink('Users list', 'index.php?mode=userlist');
$this->getModel('NavigationModel')->setSubTitle('View profile: '.$user_info['nick']);
$this->getModel('NavigationModel')->addLink('Profile: '.$user_info['nick'], 'index.php?mode=viewprofile&amp;id='.$_GET['id']);
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('viewprofile');
}
public function edprofile_form($msg, $admin = false)
{
$this->setDefaults($admin);
if ($admin)
$user_info = $this->getModel('UsersModel')->getUserInformation($_GET['id']);
else
$user_info = $this->getModel('UsersModel')->getUserInformation($this->getModel('SessionModel')->getID());
$this->assign('nick', $_POST['nick']);
$this->assign('is_admin', $admin);
$this->assign('email', $_POST['email']);
$this->assign('location', $_POST['location']);
$this->assign('signature', $_POST['signature']);
$this->assign('avatar', $user_info['avatar']);
$this->assign('error_msg', $msg);
if ($admin)
{
$this->assign('user_selected', ($_POST['user_rank'] == RANK_USER) ? 'checked="checked"' : '');
$this->assign('mod_selected', ($_POST['user_rank'] == RANK_MOD) ? 'checked="checked"' : '');
$this->assign('admin_selected', ($_POST['user_rank'] == RANK_ADMIN) ? 'checked="checked"' : '');
}
//nawigacja po witrynie
if ($admin)
{
$this->getModel('NavigationModel')->setSubTitle('ACP &bull; Edit profile');
$this->getModel('NavigationModel')->addLink('Users list', 'index.php?mode=admin&amp;submode=users');
$this->getModel('NavigationModel')->addLink('Edit user: '.$user_info['nick']);
}
else
{
$this->getModel('NavigationModel')->setSubTitle('Edit profile');
$this->getModel('NavigationModel')->addLink('Edit profile', 'index.php?mode=editprofile');
}
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('edprofile');
}
public function posting_form($type, $msg='')
{
$this->setDefaults();
$this->assign('error_msg', $msg);
//nawigacja po witrynie
switch ($type)
{
case POSTING_NEWTOPIC:
$forum_info = $this->getModel('ForumsModel')->getForum($_GET['id']);
$this->getModel('NavigationModel')->setSubTitle('New topic');
$this->getModel('NavigationModel')->addLink($forum_info['name'], 'index.php?mode=viewforum&amp;id='.$forum_info['forum_id']);
$this->getModel('NavigationModel')->addLink('New topic', $_SERVER['REQUEST_URI']);
break;
case POSTING_REPLY:
case POSTING_QUOTE:
$topic_info = $this->getModel('PostsModel')->getTopic($_GET['id']);
$this->getModel('NavigationModel')->setSubTitle('Reply');
$this->getModel('NavigationModel')->addLink($topic_info['forum_name'], 'index.php?mode=viewforum&amp;id='.$topic_info['forum_id']);
$this->getModel('NavigationModel')->addLink($topic_info['topic_title'], 'index.php?mode=viewtopic&amp;id='.$topic_info['topic_id']);
$this->getModel('NavigationModel')->addLink('Write a reply', $_SERVER['REQUEST_URI']);
break;
case POSTING_EDIT:
$topic_info = $this->getModel('PostsModel')->getTopic($_GET['id']);
$this->getModel('NavigationModel')->setSubTitle('Edit post');
$this->getModel('NavigationModel')->addLink($topic_info['forum_name'], 'index.php?mode=viewforum&amp;id='.$topic_info['forum_id']);
$this->getModel('NavigationModel')->addLink($topic_info['topic_title'], 'index.php?mode=viewtopic&amp;id='.$topic_info['topic_id']);
$this->getModel('NavigationModel')->addLink('Edit post', $_SERVER['REQUEST_URI']);
break;
case POSTING_EDITTOPIC:
$topic_info = $this->getModel('PostsModel')->getTopic($_GET['id']);
$this->getModel('NavigationModel')->setSubTitle('Edit topic');
$this->getModel('NavigationModel')->addLink($topic_info['forum_name'], 'index.php?mode=viewforum&amp;id='.$topic_info['forum_id']);
$this->getModel('NavigationModel')->addLink($topic_info['topic_title'], 'index.php?mode=viewtopic&amp;id='.$topic_info['topic_id']);
$this->getModel('NavigationModel')->addLink('Edit topic', $_SERVER['REQUEST_URI']);
break;
}
$this->assign('post', $_POST['post']);
if (isset($_POST['preview']))
$this->assign('preview', addslashes(htmlspecialchars($_POST['post'])));
if ($type == POSTING_NEWTOPIC || $type == POSTING_EDITTOPIC)
$this->assign('topic', $_POST['topic']);
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('posting');
}
public function move_topic()
{
$this->setDefaults();
$this->loadModel('ForumsModel');
//nawigacja po witrynie
$this->getModel('NavigationModel')->setSubTitle('Move topic');
$this->getModel('NavigationModel')->addLink('Move topic', $_SERVER['REQUEST_URI']);
$this->assign('topic_info', $this->getModel('PostsModel')->getTopic($_GET['id']));
$this->assign('forums_list', $this->getModel('ForumsModel')->getForumsNames());
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('move_topic');
}
public function forum_message($msg, $url = '', $timeout = 2)
{
$this->setDefaults();
$this->assign('message', $msg);
$this->assign('url', $url);
$this->assign('timeout', $timeout);
//nawigacja po witrynie
$this->getModel('NavigationModel')->setSubTitle('Forum message');
$this->getModel('NavigationModel')->addLink('Forum message', 'index.php');
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('forum_message');
}
public function confirm_action($msg)
{
$this->setDefaults();
$this->assign('message', $msg);
//nawigacja po witrynie
$this->getModel('NavigationModel')->setSubTitle('Confirm action');
$this->getModel('NavigationModel')->addLink('Confirm action', $_SERVER['REQUEST_URI']);
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('confirm_action');
}
public function colorRank($username, $rank)
{
if ($rank == RANK_ADMIN)
return '<span class="fadmin">'.$username.'</span>';
if ($rank == RANK_MOD)
return '<span class="fmod">'.$username.'</span>';
return $username;
}
public function getRankLevel($rank)
{
if ($rank == RANK_ADMIN)
return $this->colorRank('Admin', $rank);
if ($rank == RANK_MOD)
return $this->colorRank('Mod', $rank);
return 'User';
}
// ADMIN PANEL -----------------------------------------------------------------
public function admin_main()
{
$this->setDefaults(true);
$this->loadModel('StatisticsModel');
//nawigacja po witrynie
$this->getModel('NavigationModel')->setSubTitle('Main Page');
$this->assign('installation_date', $this->getModel('ConfigModel')->getConf('installation_date'));
$this->assign('topics_total', $this->getModel('StatisticsModel')->getTopicsCount());
$this->assign('posts_total', $this->getModel('StatisticsModel')->getPostsCount());
$this->assign('users_total', $this->getModel('StatisticsModel')->getUsersCount());
$this->assign('script_version', VERSION);
$this->assign('logged_users', $this->getModel('StatisticsModel')->getLoggedUsers());
$this->assign('logged_users_total', $this->getModel('StatisticsModel')->getLoggedUsersCount());
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('admin/main');
}
public function admin_userlist()
{
$this->setDefaults(true);
$this->loadModel('UsersModel');
$this->assign('users_list', $this->getModel('UsersModel')->getUsers($_POST['sort_type'], $_POST['sort_desc'], $_GET['rank']));
$this->assign('regdate_selected', ($_POST['sort_type'] == 'regdate') ? 'selected="selected"' : '');
$this->assign('lastvisit_selected', ($_POST['sort_type'] == 'lastvisit') ? 'selected="selected"' : '');
$this->assign('username_selected', ($_POST['sort_type'] == 'nick') ? 'selected="selected"' : '');
$this->assign('posts_selected', ($_POST['sort_type'] == 'post_count') ? 'selected="selected"' : '');
$this->assign('desc_checked', ($_POST['sort_desc'] == 'DESC') ? 'checked="checked"' : '');
//nawigacja po witrynie
$this->getModel('NavigationModel')->setSubTitle('ACP &bull; Users list');
$this->getModel('NavigationModel')->addLink('Users list');
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('admin/userlist');
}
public function admin_config($msg)
{
$this->setDefaults(true);
$this->loadModel('UsersModel');
$this->assign('forum_name', $_POST['forum_name']);
$this->assign('forum_desc', $_POST['forum_desc']);
$this->assign('error_msg', $msg);
//nawigacja po witrynie
$this->getModel('NavigationModel')->setSubTitle('ACP &bull; Admin config');
$this->getModel('NavigationModel')->addLink('Forum configuration');
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('admin/config');
}
//widok strony głównej
public function admin_forums()
{
$this->setDefaults(true);
// get categories, forums, forums statistics
$this->loadModel('ForumsModel');
$this->assign('forums_list', $this->getModel('ForumsModel')->getForums());
//nawigacja po witrynie
$this->getModel('NavigationModel')->setSubTitle('ACP &bull; Forums list');
$this->getModel('NavigationModel')->addLink('Forums list');
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('admin/forums');
}
public function admin_cat_form($msg, $m)
{
$this->setDefaults(true);
$this->assign('name', $_POST['name']);
$this->assign('error_msg', $msg);
//nawigacja po witrynie
$this->getModel('NavigationModel')->addLink('Forums list', 'index.php?mode=admin&amp;submode=forums');
if ($m == 'add')
{
$this->getModel('NavigationModel')->setSubTitle('ACP &bull; Add category');
$this->getModel('NavigationModel')->addLink('Add category');
$this->assign('cat_form_name', 'Add new category');
}
else
{
$cat_info = $this->getModel('ForumsModel')->getCat($_GET['id']);
$this->getModel('NavigationModel')->setSubTitle('ACP &bull; Edit category');
$this->getModel('NavigationModel')->addLink('Edit category: '.$cat_info['name']);
$this->assign('cat_form_name', 'Edit category');
}
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('admin/cat_form');
}
public function admin_forum_form($msg, $m)
{
$this->setDefaults(true);
$this->assign('name', $_POST['name']);
$this->assign('desc', $_POST['desc']);
$this->assign('category_id', $_POST['category_id']);
$this->assign('lock_selected', ($_POST['locked']) ? 'checked="checked"' : '');
$this->assign('unlock_selected', (!$_POST['locked']) ? 'checked="checked"' : '');
$this->assign('error_msg', $msg);
$this->assign('cats_list', $this->getModel('ForumsModel')->getCats());
//nawigacja po witrynie
$this->getModel('NavigationModel')->addLink('Forums list', 'index.php?mode=admin&amp;submode=forums');
if ($m == 'add')
{
$this->getModel('NavigationModel')->setSubTitle('ACP &bull; Add forum');
$this->getModel('NavigationModel')->addLink('Add forum');
$this->assign('forum_form_name', 'Add new forum');
}
else
{
$forum_info = $this->getModel('ForumsModel')->getForum($_GET['id']);
$this->getModel('NavigationModel')->setSubTitle('ACP &bull; Edit forum');
$this->getModel('NavigationModel')->addLink('Edit forum'.$forum_info['name']);
$this->assign('forum_form_name', 'Edit forum');
}
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('admin/forum_form');
}
public function admin_banlist()
{
$this->setDefaults(true);
$this->loadModel('BansModel');
$this->assign('bans_list', $this->getModel('BansModel')->getBans());
//nawigacja po witrynie
$this->getModel('NavigationModel')->setSubTitle('ACP &bull; Banlist');
$this->getModel('NavigationModel')->addLink('Banlist');
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('admin/banlist');
}
public function admin_ban_form($msg)
{
$this->setDefaults(true);
$this->assign('user_id', $_POST['user_id']);
$this->assign('reason', $_POST['reason']);
$this->loadModel('UsersModel');
$this->assign('error_msg', $msg);
$this->assign('users_list', $this->getModel('UsersModel')->getUsersNicks());
//nawigacja po witrynie
$this->getModel('NavigationModel')->addLink('Banlist', 'index.php?mode=admin&amp;submode=banlist');
$this->getModel('NavigationModel')->setSubTitle('ACP &bull; Add ban');
$this->getModel('NavigationModel')->addLink('Add ban');
$this->assign('forum_form_name', 'Add ban');
// końcowe rzeczy
$this->assign('nav', $this->getModel('NavigationModel')->getNav());
$this->assign('meta_title', $this->getModel('NavigationModel')->getTitle());
$this->show('admin/ban_form');
}
}
?>

+ 43
- 0
index.php View File

@ -0,0 +1,43 @@
<?php
$_GET['mode'] = (isset($_GET['mode'])) ? trim(strip_tags($_GET['mode'])) : '';
$_GET['submode'] = (isset($_GET['submode'])) ? trim(strip_tags($_GET['submode'])) : '';
require_once('./config.php');
require_once('./inc/constants.php');
require_once('./inc/database_connection.php');
require_once('./inc/bbcode.php');
try
{
switch ($_GET['mode'])
{
default:
require_once('./inc/controllers/MainController.class.php');
$ob = new MainController($DB);
if ($_GET['mode'] != null)
$ob->$_GET['mode']();
else
$ob->loadDefault();
break;
case 'admin':
require_once('./inc/controllers/AdminController.class.php');
$ob = new AdminController($DB);
if ($_GET['submode'] != null)
$ob->$_GET['submode']();
else
$ob->loadDefault();
break;
}
}
catch (Exception $e)
{
echo
'<span style="color: red">Unexpected error occured:<br>
<span style="font-weight: bold">'.$e->getMessage().'</span><br>
<br>
File: '.$e->getFile().'<br>
Line: '.$e->getLine().'<br>
Trace: '.$e->getTraceAsString().'</span>';
exit;
}
?>

+ 81
- 0
templates/admin/admin.css View File

@ -0,0 +1,81 @@
#container {
background-color: lightgray;
border: 2px solid #551c1c;
}
a:hover {
color: #551c1c;
}
#container #top {
background-color: lightgray;
height: 70px;
}
#container #top h1 {
top: 0%;
color: #551c1c;
}
#container #footer {
background-color: #551c1c;
}
#container #menu {
background-image: url('images/button_beam.gif');
}
.navigation {
color: #551c1c;
}
.row:last-child .tc1, .row:last-child .tc2, .row:last-child .tc3, .row:last-child .tc4 {
border-bottom: 1px solid #551c1c;
}
.rcol {
border: 1px solid #551c1c;
}
.tc1 {
border-left: 1px solid #551c1c;
}
.tc4 {
border-right: 1px solid #551c1c;
}
.hc1, .hc2, .hc3, .hc4 {
background-image: url('images/category_beam.gif');
border-top: 1px solid #551c1c;
}
.hc1 {
border-left: 1px solid #551c1c;
}
.hc4 {
border-right: 1px solid #551c1c;
}
.tab_desc {
color: #551c1c;
}
input[type="button"], input[type="reset"], input[type="submit"] {
background-color: #f8e3e3;
border: 1px solid #f8d6d6;
color: #A30000;
}
input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover {
background-color: #f8f1f1;
}
.btn {
background-image: url('images/button_beam.gif');
}
.btn_small {
background-image: url('images/button_beam.gif');
}

+ 56
- 0
templates/admin/ban_form.tpl.php View File

@ -0,0 +1,56 @@
<?
if ($_GET['mode'] == 'admin')
require_once('./templates/admin/overall_header.tpl.php');
else
require_once('./templates/overall_header.tpl.php');
?>
<div id="content">
<? if ($this->TPL['error_msg'] != '') { ?>
<div class="error_form">
<?= $this->TPL['error_msg']; ?>
</div>
<? } ?>
<br><form action="<?= $_SERVER['REQUEST_URI']; ?>" method="post">
<div class="forum_table">
<div class="row">
<div class="hc1"><?= $this->TPL['forum_form_name']; ?></div>
<div class="hc4">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 lc">
User:
</div>
<div class="tc4 rc">
<select name="user_id">
<?php
for ($i=0; $i<count($this->TPL['users_list']); $i++)
{
$sel = ($this->TPL['users_list'][$i]['user_id'] == $this->TPL['user_id']) ? 'selected="selected"' : '';
echo '<option value="'.$this->TPL['users_list'][$i]['user_id'].'" '.$sel.'>'.$this->TPL['users_list'][$i]['nick'].'</option>';
}
?>
</select>
</div>
</div>
<div class="row">
<div class="tc1 lc">
Reason:
</div>
<div class="tc4 rc">
<textarea id="signature" name="reason" id="reason" maxlength="150"><?= $this->TPL['reason']; ?></textarea>
</div>
</div>
<div class="row">
<div class="tc1 lc">
&nbsp;
</div>
<div class="tc4 rc">
<input type="submit" value="Add">
</div>
</div>
</div>
</form>
</div>
<? require_once('./templates/overall_footer.tpl.php'); ?>

+ 36
- 0
templates/admin/banlist.tpl.php View File

@ -0,0 +1,36 @@
<? require_once('./templates/admin/overall_header.tpl.php'); ?>
<div id="content">
<a href="index.php?mode=admin&amp;submode=addban" class="btn">Add ban</a>
<br />
<div class="forum_table">
<div class="row">
<div class="hc1" style="width: 150px">Banlist</div>
<div class="hc2">&nbsp;</div>
<div class="hc4" style="width: 70px">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 tab_desc" style="width: 150px">Username</div>
<div class="tc2 tab_desc">Reason</div>
<div class="tc4 tab_desc" style="width: 70px"></div>
</div>
<?
for ($i=0; $i<count($this->TPL['bans_list']); $i++)
{
echo '<div class="row">'."\n";
echo "\t\t\t".'<div class="tc1 tc2" style="width: 150px">'.$this->TPL['bans_list'][$i]['nick'].'</div>'."\n";
echo "\t\t\t".'<div class="tc2" style="font-style:italic">'.$this->TPL['bans_list'][$i]['reason'].'</div>'."\n";
echo "\t\t\t".'<div class="tc4" style="width: 70px">
<a href="index.php?mode=admin&amp;submode=delban&amp;id='.$this->TPL['bans_list'][$i]['ban_id'].'" class="btn_small">Delete</a>
</div>';
echo "\t\t".'</div>'."\n";
}
if (count($this->TPL['bans_list']) == 0)
{
echo '<div class="rcol">Banlist is empty.</div>';
}
?>
</div>
<br>
</div>
<? require_once('./templates/overall_footer.tpl.php'); ?>

+ 41
- 0
templates/admin/cat_form.tpl.php View File

@ -0,0 +1,41 @@
<?
if ($_GET['mode'] == 'admin')
require_once('./templates/admin/overall_header.tpl.php');
else
require_once('./templates/overall_header.tpl.php');
?>
<div id="content">
<? if ($this->TPL['error_msg'] != '') { ?>
<div class="error_form">
<?= $this->TPL['error_msg']; ?>
</div>
<? } ?>
<br><form action="<?= $_SERVER['REQUEST_URI']; ?>" method="post">
<div class="forum_table">
<div class="row">
<div class="hc1"><?= $this->TPL['cat_form_name']; ?></div>
<div class="hc4">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 lc">
Category name:
</div>
<div class="tc4 rc">
<input type="text" maxlength="30" name="name" id="name" value="<?= $this->TPL['name']; ?>" required pattern=".{3,}" required title="3 characters minimum">
</div>
</div>
<div class="row">
<div class="tc1 lc">
&nbsp;
</div>
<div class="tc4 rc">
<input type="submit" value="Save">
</div>
</div>
</div>
</form>
</div>
<? require_once('./templates/overall_footer.tpl.php'); ?>

+ 49
- 0
templates/admin/config.tpl.php View File

@ -0,0 +1,49 @@
<?
if ($_GET['mode'] == 'admin')
require_once('./templates/admin/overall_header.tpl.php');
else
require_once('./templates/overall_header.tpl.php');
?>
<div id="content">
<? if ($this->TPL['error_msg'] != '') { ?>
<div class="error_form">
<?= $this->TPL['error_msg']; ?>
</div>
<? } ?>
<br><form action="<?= $_SERVER['REQUEST_URI']; ?>" method="post">
<div class="forum_table">
<div class="row">
<div class="hc1">Overall configuration</div>
<div class="hc4">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 lc">
Forum name:
</div>
<div class="tc4 rc">
<input type="text" maxlength="30" name="forum_name" id="forum_name" value="<?= $this->TPL['forum_name']; ?>" required pattern=".{3,}" required title="3 characters minimum">
</div>
</div>
<div class="row">
<div class="tc1 lc">
Forum description:
</div>
<div class="tc4 rc">
<input type="text" maxlength="50" name="forum_desc" id="forum_desc" value="<?= $this->TPL['forum_desc']; ?>">
</div>
</div>
<div class="row">
<div class="tc1 lc">
&nbsp;
</div>
<div class="tc4 rc">
<input type="submit" value="Save">
</div>
</div>
</div>
</form>
</div>
<? require_once('./templates/overall_footer.tpl.php'); ?>

+ 76
- 0
templates/admin/forum_form.tpl.php View File

@ -0,0 +1,76 @@
<?
if ($_GET['mode'] == 'admin')
require_once('./templates/admin/overall_header.tpl.php');
else
require_once('./templates/overall_header.tpl.php');
?>
<div id="content">
<? if ($this->TPL['error_msg'] != '') { ?>
<div class="error_form">
<?= $this->TPL['error_msg']; ?>
</div>
<? } ?>
<br><form action="<?= $_SERVER['REQUEST_URI']; ?>" method="post">
<div class="forum_table">
<div class="row">
<div class="hc1"><?= $this->TPL['forum_form_name']; ?></div>
<div class="hc4">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 lc">
Forum name:
</div>
<div class="tc4 rc">
<input type="text" maxlength="50" name="name" id="name" value="<?= $this->TPL['name']; ?>" required pattern=".{3,}" required title="3 characters minimum">
</div>
</div>
<div class="row">
<div class="tc1 lc">
Forum description:
</div>
<div class="tc4 rc">
<input type="text" maxlength="150" name="desc" id="desc" value="<?= $this->TPL['desc']; ?>" style="width: 400px">
</div>
</div>
<div class="row">
<div class="tc1 lc">
Category:
</div>
<div class="tc4 rc">
<select name="category_id">
<?php
for ($i=0; $i<count($this->TPL['cats_list']); $i++)
{
$sel = ($this->TPL['cats_list'][$i]['category_id'] == $this->TPL['category_id']) ? 'selected="selected"' : '';
echo '<option value="'.$this->TPL['cats_list'][$i]['category_id'].'" '.$sel.'>'.$this->TPL['cats_list'][$i]['name'].'</option>';
}
?>
</select>
</div>
</div>
<div class="row">
<div class="tc1 lc">
Forum locked:
</div>
<div class="tc4 rc">
<input type="radio" name="locked" value="1" <?= $this->TPL['lock_selected']; ?>>
Yes&nbsp;&nbsp;
<input type="radio" name="locked" value="0" <?= $this->TPL['unlock_selected']; ?>>
No
</div>
</div>
<div class="row">
<div class="tc1 lc">
&nbsp;
</div>
<div class="tc4 rc">
<input type="submit" value="Save">
</div>
</div>
</div>
</form>
</div>
<? require_once('./templates/overall_footer.tpl.php'); ?>

+ 69
- 0
templates/admin/forums.tpl.php View File

@ -0,0 +1,69 @@
<? require_once('./templates/admin/overall_header.tpl.php'); ?>
<div id="content">
<br>
<a href="index.php?mode=admin&amp;submode=addcat" class="btn" style="width: 130px; float: left">New Category</a>
<a href="index.php?mode=admin&amp;submode=addforum" class="btn" style="width: 130px; float: right">New Forum</a>
<div style="clear: both">&nbsp;</div>
<?
for ($i=0; $i<count($this->TPL['forums_list']); $i++)
{
if ($i > 0)
{
if ($this->TPL['forums_list'][$i-1]['category_id'] != $this->TPL['forums_list'][$i]['category_id'])
echo '</div><br><div class="forum_table">
<div class="row">
<div class="hc1">'.$this->TPL['forums_list'][$i]['category_name'].'</div>
<div class="hc2 hcpost" style="width: 70px">
<a href="index.php?mode=admin&amp;submode=edcat&amp;id='.$this->TPL['forums_list'][$i]['category_id'].'">
Edit &raquo;
</a>
</div>
<div class="hc4 hcpost" style="width: 70px">
<a href="index.php?mode=admin&amp;submode=delcat&amp;id='.$this->TPL['forums_list'][$i]['category_id'].'">
Delete &raquo;
</a>
</div>
</div>';
}
else
{
echo '<div class="forum_table">
<div class="row">
<div class="hc1">'.$this->TPL['forums_list'][$i]['category_name'].'</div>
<div class="hc2 hcpost" style="width: 70px">
<a href="index.php?mode=admin&amp;submode=edcat&amp;id='.$this->TPL['forums_list'][$i]['category_id'].'">
Edit &raquo;
</a>
</div>
<div class="hc4 hcpost" style="width: 70px">
<a href="index.php?mode=admin&amp;submode=delcat&amp;id='.$this->TPL['forums_list'][$i]['category_id'].'">
Delete &raquo;
</a>
</div>
</div>';
}
if ($this->TPL['forums_list'][$i]['forum_id'] != null)
{
echo '<div class="row">'."\n";
echo "\t\t\t".'<div class="tc1">
<span class="sect">'.$this->TPL['forums_list'][$i]['forum_name'].'</span><br>
<span class="fsmall">'.$this->TPL['forums_list'][$i]['forum_desc'].'</span></div>'."\n";
echo "\t\t\t".'<div class="tc2" style="width: 70px">
<a href="index.php?mode=admin&amp;submode=edforum&amp;id='.$this->TPL['forums_list'][$i]['forum_id'].'" class="btn_small">Edit</a>
</div>'."\n";
echo "\t\t\t".'<div class="tc4" style="width: 70px">
<a href="index.php?mode=admin&amp;submode=delforum&amp;id='.$this->TPL['forums_list'][$i]['forum_id'].'" class="btn_small">Delete</a>
</div>'."\n";
echo "\t\t".'</div>'."\n";
}
else
{
echo '<div class="rcol">No forums in this category.</div>';
}
}
?>
<? if (count($this->TPL['forums_list']) > 0) echo '</div>'; ?>
<br>
</div>
<? require_once('./templates/overall_footer.tpl.php'); ?>

BIN
templates/admin/images/button_beam.gif View File

Before After
Width: 47  |  Height: 50  |  Size: 1.1 KiB

BIN
templates/admin/images/category_beam.gif View File

Before After
Width: 28  |  Height: 30  |  Size: 457 B

BIN
templates/admin/images/delete.gif View File

Before After
Width: 19  |  Height: 18  |  Size: 1.0 KiB

BIN
templates/admin/images/lock.gif View File

Before After
Width: 19  |  Height: 18  |  Size: 1.0 KiB

BIN
templates/admin/images/move.gif View File

Before After
Width: 19  |  Height: 18  |  Size: 1.0 KiB

BIN
templates/admin/images/no_av.gif View File

Before After
Width: 80  |  Height: 80  |  Size: 2.5 KiB

BIN
templates/admin/images/offline.gif View File

Before After
Width: 12  |  Height: 16  |  Size: 131 B

BIN
templates/admin/images/online.gif View File

Before After
Width: 12  |  Height: 16  |  Size: 131 B

BIN
templates/admin/images/td_beam_top.gif View File

Before After
Width: 1  |  Height: 19  |  Size: 139 B

+ 289
- 0
templates/admin/images/uf_logo.svg View File

@ -0,0 +1,289 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="392"
height="425"
id="svg2"
version="1.1"
inkscape:version="0.47pre4 r22446"
sodipodi:docname="uf_logo.svg">
<defs
id="defs4">
<linearGradient
id="linearGradient3656">
<stop
id="stop3658"
offset="0"
style="stop-color:#03006f;stop-opacity:1;" />
<stop
id="stop3660"
offset="1"
style="stop-color:#7549b4;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3637">
<stop
id="stop3639"
offset="0"
style="stop-color:#ff2d00;stop-opacity:1;" />
<stop
id="stop3641"
offset="1"
style="stop-color:#ffc200;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3661">
<stop
style="stop-color:#ffff0c;stop-opacity:1;"
offset="0"
id="stop3663" />
<stop
style="stop-color:#ff411b;stop-opacity:1;"
offset="1"
id="stop3665" />
</linearGradient>
<linearGradient
id="linearGradient3627">
<stop
style="stop-color:#7e4eec;stop-opacity:1;"
offset="0"
id="stop3629" />
<stop
id="stop3651"
offset="1"
style="stop-color:#b181f9;stop-opacity:0.49803922;" />
</linearGradient>
<linearGradient
id="linearGradient3593">
<stop
style="stop-color:#fdfdfd;stop-opacity:1;"
offset="0"
id="stop3619" />
<stop
style="stop-color:#f3f3f3;stop-opacity:0;"
offset="1"
id="stop3597" />
</linearGradient>
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
id="perspective10" />
<inkscape:perspective
id="perspective3648"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3593"
id="linearGradient3617"
x1="179.83696"
y1="592.03351"
x2="470.73511"
y2="800.63373"
gradientUnits="userSpaceOnUse"
spreadMethod="pad"
gradientTransform="translate(-103.28948,-3.2894722)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3627"
id="linearGradient3633"
x1="203.92857"
y1="685.79077"
x2="373.12314"
y2="685.79077"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(-103.28948,-3.2894722)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3661"
id="linearGradient3667"
x1="175.7372"
y1="704.34076"
x2="411.27054"
y2="704.34076"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(0.65789474,-74.342105)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3656"
id="linearGradient3654"
x1="35.421013"
y1="1176.5903"
x2="216.89119"
y2="1176.5903"
gradientUnits="userSpaceOnUse" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3661"
id="radialGradient3671"
cx="120.95009"
cy="158.30397"
fx="120.95009"
fy="158.30397"
r="56.21793"
gradientTransform="matrix(1,0,0,0.97391725,0,4.1290024)"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1"
inkscape:cx="293.30863"
inkscape:cy="236.8775"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1400"
inkscape:window-height="998"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-19.712531,-534.11398)">
<path
style="fill:#c1b6af;fill-opacity:1;stroke:#333333;stroke-width:1.35215460999999992px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 38.543346,554.26267 c 121.746544,-23.52918 230.267474,-22.35482 344.838384,0 20.55724,99.4991 23.37603,191.82013 -6.32731,259.70332 -29.62138,17.3006 -216.86506,25.8575 -335.347434,2.9851 -24.41612,-83.88895 -29.30521,-170.84875 -3.16364,-262.68842 z"
id="path3614"
sodipodi:nodetypes="ccccc" />
<path
style="fill:url(#linearGradient3617);fill-opacity:1;stroke:#333333;stroke-width:1.06500006000000003;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 75.481966,584.62058 c 98.408524,-18.05257 186.126674,-17.15158 278.735104,0 16.61655,76.33986 18.89499,147.17242 -5.11442,199.25522 -23.94313,13.2738 -175.29344,19.83905 -271.063484,2.29036 C 58.303446,721.803 54.351576,655.0838 75.481966,584.62058 z"
id="path3614-6"
sodipodi:nodetypes="ccccc" />
<path
style="fill:#c1b6af;stroke:#1a1a1a;stroke-width:1.18485594000000005px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
d="m 128.78534,827.71059 c 55.82779,4.00558 109.72,3.77923 161.47265,0.79576 0.25391,14.22607 1.39995,27.15853 27.82212,46.23231 -79.95656,14.53314 -159.56037,11.12398 -222.458974,-2.31576 17.682194,-10.59777 32.975424,-27.96809 33.164204,-44.71231 z"
id="path3662"
sodipodi:nodetypes="ccccc" />
<path
style="fill:url(#linearGradient3633);fill-opacity:1;stroke:#668000;stroke-width:0.54194838px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 100.91006,591.55796 139.43848,0 c 45.61241,83.74005 31.67333,137.30619 0,181.88663 l -139.43848,0 c 51.3425,-53.23528 29.51784,-117.00702 0,-181.88663 z"
id="path2818"
sodipodi:nodetypes="ccccc" />
<path
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3598"
d="m 131.40417,737.78812 c 1.23778,-2.81789 2.5533,-5.61187 3.79115,-8.43289 0.66498,-1.48844 1.10648,-3.04589 1.67663,-4.56384 0.0502,-0.13353 0.71012,-1.85987 0.86986,-1.95947 2.18608,-1.36299 4.54115,-2.48557 6.81172,-3.72835 0.26168,0.24264 0.57099,0.44911 0.78504,0.7279 0.35077,0.45686 1.32121,2.45945 1.47912,2.80362 1.0737,2.34021 1.95087,4.75351 2.86256,7.14837 1.45643,3.11721 1.95694,6.70902 4.11567,9.52234 1.31377,1.32079 3.03783,1.21345 4.71924,0.61471 3.30002,-1.6801 -3.19164,1.67618 -4.80089,2.49251 -0.26723,0.13553 0.51533,-0.30027 0.77394,-0.44906 0.27707,-0.15942 0.54967,-0.32571 0.83308,-0.47557 7.25426,-3.83571 4.71074,-2.8128 8.09562,-4.12571 1.80565,-0.54791 3.71519,-0.62248 5.60053,-0.68206 1.94522,0.0322 3.85317,-0.33241 5.74334,-0.69977 1.90587,-0.37491 3.85767,-0.4588 5.79981,-0.52651 1.91632,0.0435 3.79344,-0.13759 5.58944,-0.75915 0.30693,-0.12674 0.61609,-0.24909 0.92079,-0.38022 0.68065,-0.29292 2.65134,-1.2999 1.99811,-0.95898 -12.07421,6.30156 -1.23404,0.58483 2.95405,-1.55222 1.7444,-0.79466 2.94624,-1.47753 4.83846,-0.71617 0.98022,0.77608 2.00142,1.33962 3.26461,1.61232 1.78607,0.23155 3.59822,0.21232 5.39826,0.22 1.98081,0.0696 3.73625,0.95293 5.6207,1.41607 1.71237,0.34653 3.46779,0.41788 5.21506,0.45432 1.8518,0.23001 2.7866,-0.32061 4.38081,-0.95219 -1.07766,0.55275 4.06357,-2.07919 2.80336,-1.41341 -1.86743,0.98658 -15.38166,8.05177 1.3008,-0.6733 1.54793,-0.65008 2.43154,-0.69117 4.00859,-0.17082 1.26218,0.72559 2.68347,1.00205 4.14216,1.16858 1.81808,0.0161 3.55796,-0.48675 5.32857,-0.79235 1.56075,-0.34244 2.76087,0.42449 3.93458,1.24349 0.96794,0.65036 2.00292,0.846 3.16511,0.6769 1.14932,-0.20107 2.31892,-0.24333 3.48232,-0.32715 0.49375,-0.11641 0.5855,0.25538 0.75924,0.60186 0,0 -6.66977,3.29773 -6.66977,3.29773 l 0,0 c 0.20513,0.152 0.13407,0.2077 -0.16367,0.18469 -1.16383,0.064 -2.31653,0.20665 -3.47391,0.32896 -1.27816,0.007 -2.44508,-0.387 -3.46377,-1.09535 -1.09799,-0.75007 -2.16115,-1.14229 -3.55052,-0.78526 -1.80587,0.33197 -3.61697,0.78999 -5.47744,0.60632 -1.48814,-0.22211 -2.89625,-0.60991 -4.24019,-1.24278 -1.2999,-0.31834 -2.47308,0.0113 -3.63325,0.60397 13.52536,-7.1587 0.15799,0.10769 -4.13212,2.03677 -1.49295,0.61517 -2.93782,0.88493 -4.58863,0.70992 -1.78328,-0.0678 -3.5733,-0.18793 -5.30719,-0.60051 -1.8136,-0.49721 -3.54728,-1.30519 -5.48519,-1.27698 -1.85652,-0.015 -3.74154,0.0328 -5.56425,-0.33755 -1.22665,-0.36239 -2.23631,-0.98634 -3.28776,-1.64963 -1.59233,-0.35131 -3.03692,0.49641 -4.41186,1.14688 -0.32664,0.16531 -1.30177,0.66884 -0.97991,0.49591 1.78829,-0.96083 7.17415,-3.81066 5.3795,-2.85975 -3.37394,1.78771 -6.69488,3.88001 -10.3774,5.16784 -1.86688,0.48937 -3.77648,0.61953 -5.71534,0.60781 -1.92246,0.0821 -3.846,0.2191 -5.72595,0.61791 -1.91652,0.36808 -3.86285,0.59703 -5.82454,0.61281 -1.84191,0.0829 -3.70903,0.20594 -5.42093,0.89021 -2.68633,1.20616 -1.42269,0.66023 4.74668,-2.58834 0.54727,-0.28818 -1.06068,0.62753 -1.60567,0.91931 -7.22804,3.86972 -4.68048,2.86751 -8.10138,4.15712 -1.99144,0.43109 -3.88812,0.18874 -5.23345,-1.35161 -2.08094,-2.94939 -2.57108,-6.56319 -4.00186,-9.77965 -0.87955,-2.3278 -0.98372,-2.69676 -1.99103,-4.98765 -0.52983,-1.20497 -1.44053,-3.46858 -2.39353,-4.50457 -0.0722,-0.0784 -0.2155,-0.0575 -0.32324,-0.0862 1.97667,-1.11688 3.87886,-2.3517 5.93001,-3.35065 0.26815,-0.13059 -0.35685,0.45222 -0.49021,0.70137 -0.20363,0.38045 -0.35634,0.78214 -0.5165,1.1795 -0.61552,1.52716 -1.05323,3.10818 -1.71139,4.62199 -1.19081,2.75144 -2.3513,5.52102 -3.69467,8.21317 0,0 -6.76111,3.03249 -6.76111,3.03249 z" />
<path
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3602"
d="m 143.92618,682.44467 c 2.65584,-1.19892 5.30323,-2.40662 8.05899,-3.41274 2.7316,-1.16963 3.66903,-1.78228 6.50206,-0.51167 2.51199,1.14187 4.74557,2.67666 6.87008,4.33182 1.65933,1.33716 2.9811,2.92373 4.84714,4.03366 2.56807,1.21945 3.88507,1.37668 6.62007,0.59879 2.56802,-0.88425 5.09072,-1.87112 7.71028,-2.62341 1.97244,-0.73518 4.0124,-1.17263 6.1269,-1.356 2.11832,-0.11812 4.21741,-0.0398 6.30855,-0.4049 2.51036,-0.62665 4.98747,-1.34077 7.54748,-1.78289 2.79399,-0.53281 4.52708,0.45813 6.48874,2.13139 1.36678,1.35604 2.61242,2.78483 4.6444,3.242 1.76594,0.17998 3.51497,-0.0995 5.27254,0.15077 2.30886,0.52709 4.37266,1.61836 6.63534,2.27377 2.30103,0.58513 4.30549,0.64262 6.56424,-0.0745 2.35354,-1.02973 4.85289,-1.74653 7.24083,-2.69399 1.51304,-0.65864 3.16475,-0.9207 4.79455,-1.2187 1.53542,-0.48955 3.11743,-0.81383 4.68524,-1.19804 1.80244,-0.41279 3.66971,-0.44993 5.517,-0.50125 1.8726,-0.0426 3.74597,-0.0358 5.619,-0.0361 0.25304,0.033 0.50607,0.066 0.75911,0.0991 0,0 -5.01472,3.24367 -5.01472,3.24367 l 0,0 c -0.23596,-0.0182 -0.47191,-0.0364 -0.70787,-0.0546 -1.86357,-0.004 -3.72755,-0.008 -5.59053,0.0423 -1.83234,0.0667 -3.67892,0.1552 -5.452,0.62047 -1.56252,0.40407 -3.14776,0.72549 -4.69959,1.16503 -1.6063,0.32579 -3.21935,0.62607 -4.71059,1.29041 -2.42219,0.875 -4.85297,1.72883 -7.26016,2.63924 -2.28771,0.55495 -4.53382,0.46438 -6.79976,-0.19359 -2.20723,-0.69475 -4.25698,-1.7839 -6.56813,-2.18165 -1.78492,-0.14067 -3.59069,0.15929 -5.35378,-0.21913 -2.01662,-0.66661 -3.35673,-2.04201 -4.76488,-3.46779 -1.93017,-1.59553 -3.50443,-2.26435 -6.15463,-1.7063 -2.55369,0.48675 -5.02755,1.23159 -7.56578,1.77625 -2.1074,0.28893 -4.22756,0.21669 -6.34717,0.39064 -2.07379,0.2407 -4.06569,0.74483 -6.02067,1.42331 -2.61286,0.78816 -5.13049,1.80468 -7.73624,2.6128 -2.81604,0.63034 -4.3925,0.28922 -6.93004,-0.98292 -1.86308,-1.14741 -3.19522,-2.74566 -4.86395,-4.10255 -2.08966,-1.61986 -4.29262,-3.12977 -6.79361,-4.18883 -0.3439,-0.12602 -0.67398,-0.2896 -1.03168,-0.37806 -1.81963,-0.45001 -3.53163,0.6603 -5.14605,1.22937 -2.76867,1.0536 -5.43273,2.29369 -8.13332,3.47822 0,0 4.83261,-3.48332 4.83261,-3.48332 z" />
<path
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3608"
d="m 131.58,629.5385 c 0.40641,-0.0886 0.8139,-0.17314 1.21923,-0.26576 1.90423,-0.43514 3.71046,-0.95078 5.48259,-1.73792 0.73544,-0.32666 2.85008,-1.46079 2.16725,-1.04997 -0.96359,0.57976 -2.00818,1.03892 -3.01227,1.55838 3.40539,-1.90834 6.82327,-3.79714 10.33938,-5.53513 0.99363,-0.49114 1.89689,-0.60017 2.95314,-0.35866 1.03645,0.71906 1.99576,1.38312 3.27775,1.66344 1.46699,0.28784 2.97675,0.15775 4.44974,0.36766 1.97805,0.32354 3.35054,1.22646 4.53208,2.67038 0.78786,1.25771 1.18897,2.47397 3.00563,2.353 1.47015,-0.41913 2.83438,-0.141 4.29168,0.13257 1.6649,0.57549 2.93104,0.83763 4.57762,0.0924 -10.41309,5.7597 -0.34556,-0.609 3.4424,-1.54194 0.82893,-0.20416 0.81752,-0.15054 1.61225,-0.10677 0.19826,0.0758 0.40881,0.1291 0.59477,0.22749 0.21674,0.11469 0.7783,0.57254 0.99681,0.70408 0.56573,0.34059 1.198,0.51578 1.84005,0.68972 -0.31066,0.72411 3.16713,-1.28849 2.28518,-0.85372 -7.31723,3.60712 -4.77403,2.79229 -3.09965,1.0761 1.44822,-1.72733 4.70695,-5.07497 6.55675,-3.20432 0.452,0.4571 0.58023,1.17021 0.7913,1.73333 0.53243,1.0816 1.88503,1.52918 3.10313,1.31014 0.21379,-0.12258 0.86305,-0.47798 0.64135,-0.36772 -1.52287,0.7574 -3.01006,1.57448 -4.54595,2.30967 -0.26195,0.12539 0.46236,-0.33969 0.71708,-0.47689 1.94471,-1.04751 3.84425,-2.17767 5.87719,-3.07508 0.50465,-0.22277 1.03222,0.71195 1.14416,0.85435 0.80817,1.4344 0.31293,3.24516 1.36034,4.56744 0.13252,-0.0107 0.28506,0.0326 0.39756,-0.0321 0.22043,-0.12691 0.78541,-0.60422 0.54566,-0.51091 -1.48391,0.57748 -2.75507,1.64228 -4.3249,1.98168 -0.55036,0.11899 0.67141,-0.83078 0.98562,-1.25972 0.34218,-0.46713 1.75442,-2.55791 2.07835,-3.03533 1.33337,-1.992 2.48138,-4.13555 4.21451,-5.87407 2.0196,-1.50323 1.74321,-1.34884 6.3167,-3.01285 0.30204,-0.1099 1.72461,1.93385 1.92649,2.21209 0.69469,1.26456 1.57995,2.19445 3.0635,2.63482 1.62446,0.20094 3.25489,0.36408 4.88414,0.56251 2.01631,0.22269 4.04901,0.25467 6.07732,0.28103 1.99626,0.0144 3.99263,0.0134 5.98894,0.0106 1.79648,-0.11631 3.55277,0.23974 5.33073,0.40091 2.27864,0.12128 4.56823,0.27357 6.80179,0.72023 1.42796,0.53866 2.79785,0.94207 4.346,0.91563 1.31361,-0.47903 2.7201,-0.55504 4.11506,-0.65344 1.69168,-0.1065 3.38767,-0.12628 5.08269,-0.13607 0.24535,-5.2e-4 0.49071,-8.7e-4 0.73606,-0.002 0,0 -4.97296,3.29738 -4.97296,3.29738 l 0,0 c -0.24422,5.2e-4 -0.48843,0.002 -0.73265,0.002 -1.68021,0.012 -3.36198,0.0341 -5.03736,0.16165 -1.41876,0.12737 -2.78703,0.41335 -4.18328,0.62723 -1.54198,-0.0684 -2.92246,-0.59022 -4.37738,-1.02441 -2.23175,-0.39326 -4.49537,-0.56207 -6.76275,-0.67534 -1.76413,-0.16646 -3.51533,-0.45866 -5.29797,-0.3524 -1.99449,-1.3e-4 -3.98911,0.006 -5.98339,-0.0262 -2.05002,-0.0354 -4.10467,-0.0698 -6.13976,-0.32161 -1.66272,-0.20978 -3.35834,-0.27922 -4.98423,-0.65377 -1.51597,-0.59001 -2.50182,-1.60106 -3.24368,-2.9411 -0.37417,-0.50308 -0.76822,-1.24851 -1.31275,-1.62868 -0.0914,-0.0638 -0.42067,-0.0477 -0.32503,-0.10606 2.97468,-1.81501 6.80494,-3.55818 4.35709,-2.43448 -1.92611,1.57949 -3.02428,3.83149 -4.3861,5.8001 -2.48313,3.66199 0.41088,-0.6146 -2.04479,3.04139 -0.29859,0.44454 -0.45189,1.00845 -0.90143,1.33045 -1.91103,1.36886 -4.00291,2.51783 -6.07896,3.66957 -0.72076,0.39986 -0.88686,0.16061 -1.47435,-0.12515 -0.9691,-1.3834 -0.72114,-3.03687 -1.33861,-4.54176 -0.0885,-0.0937 -0.13827,-0.23853 -0.26562,-0.28094 -0.12308,-0.041 -0.49773,0.12732 -0.38685,0.0637 1.51548,-0.87028 3.06162,-1.69659 4.6231,-2.49636 0.25877,-0.13254 -0.45529,0.35065 -0.70876,0.49148 -1.97572,1.09773 -3.9536,2.1942 -5.97423,3.22169 -0.23743,0.12072 -0.52082,0.14228 -0.78122,0.21342 -1.48375,-0.0651 -2.90806,-0.61387 -3.53834,-1.92262 -0.13674,-0.35473 -0.23054,-0.72335 -0.38448,-1.07218 -0.0372,-0.0843 -0.0715,-0.18674 -0.15842,-0.2311 -0.0574,-0.0293 -0.24421,0.0859 -0.1883,0.0542 5.15298,-2.91883 6.0182,-4.04173 4.41164,-2.18439 -1.97947,2.37925 -3.79146,2.74324 -7.30518,4.62297 -0.82616,0.44197 -1.65159,0.67112 -2.60685,0.49713 -0.70107,-0.22549 -1.3452,-0.46281 -1.96651,-0.84257 -0.26939,-0.16465 -0.57058,-0.43132 -0.8846,-0.54221 -0.14917,-0.0527 -0.31334,-0.0589 -0.47001,-0.0884 -0.862,0.0623 -1.58882,0.25866 -2.38442,0.58175 -0.30847,0.12526 -1.19756,0.56795 -0.90809,0.40939 1.56908,-0.85954 12.50342,-6.54807 -1.6137,0.81295 -1.67309,0.45034 -3.1701,0.17295 -4.79573,-0.34237 -1.44049,-0.25783 -2.79077,-0.27898 -4.24424,-0.0639 -1.88103,-0.27696 -2.44997,-1.33664 -3.27526,-2.77506 -1.10749,-1.32802 -2.44221,-2.07153 -4.2828,-2.28478 -1.50295,-0.13144 -3.0328,-0.0826 -4.50608,-0.4336 -1.21647,-0.35595 -2.15788,-1.03112 -3.24127,-1.61089 -0.67724,-0.0372 -0.70135,-0.0881 -1.44789,0.14337 -0.39951,0.12386 -1.51694,0.66417 -1.16478,0.45215 1.17473,-0.70725 2.42272,-1.30785 3.64462,-1.94515 1.26027,-0.65731 -5.32062,2.86371 -3.7197,2.0663 -5.38855,2.84032 -10.17803,5.75064 -16.31143,6.85681 0,0 4.88854,-3.40925 4.88854,-3.40925 z" />
<path
sodipodi:type="arc"
style="fill:#d0c9c4;fill-opacity:1;stroke:#666666;stroke-width:1.06500006000000003;stroke-miterlimit:4;stroke-dasharray:none"
id="path3637"
sodipodi:cx="446.76724"
sodipodi:cy="806.88806"
sodipodi:rx="10.129311"
sodipodi:ry="10.129311"
d="m 456.89655,806.88806 a 10.129311,10.129311 0 1 1 -20.25862,0 10.129311,10.129311 0 1 1 20.25862,0 z"
transform="matrix(0.79786056,0,0,0.79786056,-29.352526,165.93576)" />
<path
sodipodi:type="arc"
style="fill:#d0c9c4;fill-opacity:1;stroke:#b3b3b3;stroke-width:1.06500006000000003;stroke-miterlimit:4;stroke-dasharray:none"
id="path3639"
sodipodi:cx="432.6825"
sodipodi:cy="812.63739"
sodipodi:rx="3.348757"
sodipodi:ry="3.4642315"
d="m 436.03125,812.63739 a 3.348757,3.4642315 0 1 1 -6.69751,0 3.348757,3.4642315 0 1 1 6.69751,0 z"
transform="translate(-105.54412,-2.7589622)" />
<path
style="fill:#666666;fill-opacity:1;stroke:#b3b3b3;stroke-width:0.92901093px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 327.15554,804.5324 0,4.15222"
id="path3647"
sodipodi:nodetypes="cc" />
<flowRoot
xml:space="preserve"
id="flowRoot2837"
style="font-size:40px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
transform="translate(19.712531,534.11398)"><flowRegion
id="flowRegion2839"><rect
id="rect2841"
width="378.94736"
height="59.210526"
x="3.2894738"
y="354.60526" /></flowRegion><flowPara
id="flowPara2843" /></flowRoot> <text
xml:space="preserve"
style="font-size:40px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
x="157.23685"
y="390.78946"
id="text2845"
transform="translate(19.712531,534.11398)"><tspan
sodipodi:role="line"
id="tspan2847" /></text>
<text
xml:space="preserve"
style="font-size:491.34445190000002412px;font-style:normal;font-weight:normal;line-height:125%;fill:url(#linearGradient3654);fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
x="29.149523"
y="1197.3451"
id="text3643"
transform="scale(1.2794953,0.78155817)"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3645"
x="29.149523"
y="1197.3451"
style="font-size:80.27507018999997968px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Arial;-inkscape-font-specification:Arial;fill-opacity:1;fill:url(#linearGradient3654)">µForum</tspan></text>
<path
sodipodi:type="star"
style="fill:url(#radialGradient3671);fill-opacity:1;stroke:none"
id="path3663"
sodipodi:sides="5"
sodipodi:cx="119.62617"
sodipodi:cy="153.97195"
sodipodi:r1="58.707661"
sodipodi:r2="13.366334"
sodipodi:arg1="0.24111768"
sodipodi:arg2="-0.07032258"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 176.63551,167.99065 -43.67605,-14.95788 -9.049,59.49031 0.72914,-46.16063 -59.374944,9.7774 44.126684,-13.57097 -27.646723,-53.44754 26.542653,37.77331 42.28832,-42.80979 -27.72242,36.91615 53.78234,26.98964 z"
transform="matrix(1.4489505,0,0,1.4094179,14.29205,492.45047)" />
<path
style="fill:url(#linearGradient3667);fill-opacity:1;stroke:#000000;stroke-width:1.26388943000000009px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 395.07143,542.23523 -161.4278,96.02682 c 39.86364,-7.02254 6.25927,1.13166 105.53238,-15.13393 l -137.07575,75.31075 11.13295,-30.72859 -36.20618,50.05181 64.26014,-8.23606 -29.90946,-4.68537 168.3403,-94.86433 -100.81192,13.03751 132.39039,-80.34077 -16.22505,-0.43784 z"
id="path3610"
sodipodi:nodetypes="cccccccccccc" />
</g>
</svg>

BIN
templates/admin/images/unlock.gif View File

Before After
Width: 19  |  Height: 18  |  Size: 1.0 KiB

+ 489
- 0
templates/admin/kopia admin.css View File

@ -0,0 +1,489 @@
body {
font-family: Helvetica;
font-size: 11pt;
background-color: #E5E7E9;
}
#container {
width: 900px;
background-color: lightgray;
margin: 0 auto;
text-align: center;
border: 2px solid #551c1c;
border-collapse: collapse;
border-radius: 10px;
}
a, a:visited {
text-decoration: none;
}
img {
border: 0px;
}
a:hover {
color: #551c1c;
text-decoration: underline;
}
a {
color: #000000;
}
#container #top {
width: 100%;
background-color: lightgray;
height: 70px;
vertical-align: middle;
padding-top: 20px;
border-bottom: 1px solid #777777;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
#container #userpanel {
text-align: right;
font-size: 0.8em;
width: 100%;
}
#container #navi_bar
{
padding-left: 10px;
text-align: left;
width: 100%;
}
#container #top h1
{
margin: 0px;
position: relative;
top: 0%;
color: #551c1c;
font-size: 36pt;
font-weight: bold;
}
#container #top h2
{
color: #005AE5;
font-size: 20px;
text-decoration: none;
font-weight: bold;
}
#container #footer
{
width: 100%;
background-color: #551c1c;
font-size: 8pt;
color: #FFFFFF;
height: 18px;
line-height: 18px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
box-shadow: 0 8px 6px -6px black;
}
#container #footer a
{
color: #FFFFFF;
}
#contanier #footer a:visited
{
color: #FFFFFF;
}
#container #content {
text-align: left;
min-height: 200px;
padding: 10px;
}
#container #content h3 {
margin-left: 20px;
color: gray;
font-size: 1.5em;
}
#container #content table {
border: 1px solid;
border-collapse: collapse;
}
#container #content table td {
border: 1px solid;
border-color: orange;
border-collapse: collapse;
font-size: 10pt;
background-color: #ffffbd;
text-align: center;
}
#container #content table .heading {
background-color: orange;
color: #FFFFFF;
font-weight: bold;
}
#container #menu {
text-align: center;
margin: 0 auto;
width: 100%;
height: 50px;
background-color: #99CCFF;
background-image: url('images/button_beam.gif');
}
#container #menu ul {
list-style-type: none;
margin: 0px;
padding: 0px;
}
#container #menu li {
display: inline-block;
border-right: 1px #9A9A9A solid;
height: 37px;
width: 120px;
padding-top: 13px;
margin: auto -4px auto auto;
}
#container #menu li:hover {
}
#container #menu li a {
color: #FFFFFF;
font-weight: bold;
font-family: Verdana;
font-size: 14px;
font-weight: bold;
}
#container #menu li:last-child {
border: 0px;
}
.sect
{
color: #434354;
font-family: Verdana;
font-size: 10pt;
font-weight: bold;
text-decoration: none;
}
.navigation {
color: #551c1c;
text-decoration: none;
font-size: 12px;
font-weight: bold;
}
.forum_table {
display: table;
width: 100%;
border-collapse: separate;
box-shadow: 0 8px 6px -6px black;
}
.fsmall
{
color: #434354;
font-size: 8pt;
text-decoration: none;
}
.row {
display: table-row;
width: 100%;
}
.row:last-child .tc1, .row:last-child .tc2, .row:last-child .tc3, .row:last-child .tc4
{
border-bottom: 1px solid #551c1c;
}
.rcol
{
display: table-caption;
border: 1px solid #551c1c;
border-collapse: collapse;
background-color: #e1f0ff;
padding: 3px;
vertical-align: middle;
border-top: 0px;
caption-side: bottom;
text-align: center;
font-style: italic;
}
.tc1, .tc2, .tc3, .tc4
{
display: table-cell;
background-color: #F0F8FF;
padding: 3px;
vertical-align: middle;
word-wrap: break-word;
}
.tc1
{
border-left: 1px solid #551c1c;
}
.tc2, .tc3
{
vertical-align: middle;
text-align: center;
}
.tc4 {
text-align: center;
vertical-align: middle;
width: 150px;
border-right: 1px solid #551c1c;
}
.hc1, .hc2, .hc3, .hc4
{
color: #FFFFFF;
font-weight: bold;
background-color: yellow;
vertical-align: middle;
display: table-cell;
padding-left: 15px;
background-image: url('images/category_beam.gif');
height: 30px;
border-top: 1px solid #551c1c;
word-wrap: break-word;
}
.hc1 {
border-top-left-radius: 10px;
border-left: 1px solid #551c1c;
}
.hc4 {
border-top-right-radius: 10px;
border-right: 1px solid #551c1c;
width: 150px;
}
.tab_desc {
text-align: center;
font-weight: bold;
color: #551c1c;
background-image: url('images/td_beam_top.gif');
height: 19px;
}
.lc {
width: 30%;
text-align: right;
margin-right: 10px;
}
.rc {
width: 70%;
text-align: left;
margin-left: 10px;
}
.rc input[type="text"], input[type="password"], input[type="email"] {
width: 200px;
}
input[type="button"], input[type="reset"], input[type="submit"] {
border-radius: 5px;
background-color: #f8e3e3;
padding: 5px;
border: 1px solid #f8d6d6;
min-width: 30px;
font-size: 12px;
color: #A30000;
cursor: pointer;
}
input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover
{
background-color: #f8f1f1;
}
#signature {
width: 490px;
height: 60px;
resize: vertical;
}
#post {
width: 490px;
height: 180px;
resize: vertical;
}
#signature, #post, input[type="text"], input[type="password"], input[type="email"], select
{
border-radius: 5px;
border: 1px solid #C7E2FB;
min-height: 20px;
font-size: 12px;
background-color: #FFFFE8;
}
.error_form
{
margin: 0 auto;
text-align: center;
width: 90%;
border: 1px solid #FF0000;
background-color: #FFCC99;
padding: 10px;
color: #FF0000;
border-radius: 10px;
font-weight: bold;
}
.fadmin, .fmod
{
font-weight: bold;
}
.fmod
{
color: darkgreen;
}
.fadmin
{
color: orange;
}
.btn
{
width: 90px;
height: 30px;
color: #FFFFFF;
font-weight: bold;
text-align: center;
font-size: 1em;
background-image: url('images/button_beam.gif');
border-radius: 10px;
line-height: 30px;
box-shadow: 0 8px 6px -6px black;
}
.btn_small
{
width: 60px;
height: 20px;
color: #FFFFFF;
font-weight: bold;
text-align: center;
font-size: 0.8em;
background-image: url('images/button_beam.gif');
border-radius: 10px;
margin: 0 auto;
line-height: 20px;
margin-top: 3px;
box-shadow: 0 8px 6px -6px black;
}
.ut
{
padding: 0px;
border-left: 0px;
}
.tc1 .forum_table .tc1, .tc1 .forum_table .tc2, .tc1 .forum_table .tc3 {
border: 0px;
border-top: 1px solid lightgray;
}
.mod_pool
{
margin: 0 auto;
width: 90%;
background-color: #FFFF99;
text-align: center;
padding: 5px;
border: 1px solid orange;
border-radius: 10px;
}
hr {
border: 0;
border-bottom: 1px dashed #ccc;
background: #999;
width: 50%;
margin: 0;
margin-top: 5px;
}
.hcpost
{
height: 10px;
}
.f_hc4
{
text-align: right;
padding-right: 10px;
}
.post_3c
{
width: 120px;
}
.f_tc2
{
width: 120px;
vertical-align: top;
height: 150px;
text-align: center;
}
.topic_mod
{
width: 80px;
float: right;
}
.p_uinfo
{
width: 38%;
}
.post_content
{
vertical-align: top;
position: relative;
text-align: left;
max-width: 500px;
}
.row .hcpost a {
color: #FFFFFF;
}
.qpost
{
background-color: #DDDAC5;
width: 95%;
font-style: italic;
box-shadow: 7px 8px 6px -3px gray;
padding: 5px;
}
.cpost
{
background-color: #C5DDCC;
width: 95%;
font-family: Courier New;
box-shadow: 7px 8px 6px -3px gray;
padding: 5px;
}

+ 112
- 0
templates/admin/main.tpl.php View File

@ -0,0 +1,112 @@
<? require_once('./templates/admin/overall_header.tpl.php'); ?>
<script type="text/javascript">
function confirm_action(c_name, url)
{
if (confirm(c_name))
{
document.location = url;
}
}
</script>
<div id="content">
<span class="fsmall">
<span style="font-weight: bold">Welcome in &micro;Forum Admin Control Panel!</span><br>
Choose option from menu to manage forum.</span>
<br><br>
<div class="forum_table">
<div class="row">
<div class="hc1" style="width: 50%">Forum statistics</div>
<div class="hc4">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 lc">
Installation date:
</div>
<div class="tc4 rc">
<span style="font-weight: bold"><?= $this->TPL['installation_date']; ?></span>
</div>
</div>
<div class="row">
<div class="tc1 lc">
Topics total:
</div>
<div class="tc4 rc">
<span style="font-weight: bold"><?= $this->TPL['topics_total']; ?></span>
</div>
</div>
<div class="row">
<div class="tc1 lc">
Posts total:
</div>
<div class="tc4 rc">
<span style="font-weight: bold"><?= $this->TPL['posts_total']; ?></span>
</div>
</div>
<div class="row">
<div class="tc1 lc">
Users total:
</div>
<div class="tc4 rc">
<span style="font-weight: bold"><?= $this->TPL['users_total']; ?></span>
</div>
</div>
<div class="row">
<div class="tc1 lc">
Logged users total (last 5 min):
</div>
<div class="tc4 rc">
<span style="font-weight: bold"><?= $this->TPL['logged_users_total']; ?></span>
</div>
</div>
<div class="row">
<div class="tc1 lc">
Script version:
</div>
<div class="tc4 rc">
<span style="font-weight: bold"><?= $this->TPL['script_version']; ?></span>
</div>
</div>
<div class="row">
<div class="tc1 lc">
Updates:
</div>
<div class="tc4 rc">
<span style="font-weight: bold">in future...</span>
</div>
</div>
</div>
<br>
<div class="forum_table">
<div class="row">
<div class="hc1"">Logged users (last 5 min)</div>
<div class="hc3">&nbsp;</div>
<div class="hc4">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 tab_desc">Username</div>
<div class="tc3 tab_desc">Rank</div>
<div class="tc4 tab_desc">IP</div>
</div>
<?
for ($i=0; $i < count($this->TPL['logged_users']); $i++)
{
echo '
<div class="row">
<div class="tc1 tc2">'.$this->TPL['logged_users'][$i]['nick'].'</div>
<div class="tc3">'.$this->getRankLevel($this->TPL['logged_users'][$i]['rank']).'</div>
<div class="tc4">'.$this->TPL['logged_users'][$i]['IP'].'</div>
</div>';
}
if (count($this->TPL['logged_users']) == 0)
echo '<div class="rcol">No logged users.</div>';
?>
</div>
</div>
<? require_once('./templates/overall_footer.tpl.php'); ?>

+ 46
- 0
templates/admin/overall_header.tpl.php View File

@ -0,0 +1,46 @@
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?= $this->TPL['meta_title']; ?></title>
<meta name="author" content="Piotr Dergun" />
<meta name="generator" content="medit/1.2.0" />
<link rel="stylesheet" href="templates/styles.css" type="text/css" />
<link rel="stylesheet" href="templates/admin/admin.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="top">
<h1>&micro;Forum ACP</h1>
</div>
<div id="menu">
<ul>
<li><a href="index.php?mode=admin">ACP Main</a></li>
<li><a href="index.php?mode=admin&amp;submode=config">Configuration</a></li>
<li><a href="index.php?mode=admin&amp;submode=forums">Forums</a></li>
<li><a href="index.php?mode=admin&amp;submode=users">Users</a></li>
<li><a href="index.php?mode=admin&amp;submode=banlist">Banlist</a></li>
<li><a href="index.php">Go to forum</a></li>
</ul>
</div>
<br>
<div id="userpanel">
<? if ( $this->TPL['is_logged']) { ?>
You are logged as: <span style="font-weight: bold"><?= $this->TPL['my_nick'] ?></span>
<? } else { ?>
Welcome Guest! You are not logged.
<? } ?><br>
Actual time: <span style="font-weight: bold"><?= $this->TPL['actual_time']; ?></span><br>
</div>
<br>
<div id="navi_bar">
<?
for ($i=0; $i<count($this->TPL['nav']); $i++)
{
echo '<a href="'.$this->TPL['nav'][$i]['url'].'" class="navigation">'.$this->TPL['nav'][$i]['name'].'</a>';
if ($i < count($this->TPL['nav'])-1)
echo ' &raquo; ';
}
?>
</div>

+ 73
- 0
templates/admin/userlist.tpl.php View File

@ -0,0 +1,73 @@
<? require_once('./templates/admin/overall_header.tpl.php'); ?>
<div id="content">
<br />
<div class="forum_table">
<div class="row">
<div class="hc1">Users list</div>
<div class="hc2" style="width: 180px">&nbsp;</div>
<div class="hc3" style="width: 180px">&nbsp;</div>
<div class="hc3" style="width: 100px">&nbsp;</div>
<div class="hc3" style="width: 70px">&nbsp;</div>
<div class="hc4" style="width: 70px">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 tab_desc">Username</div>
<div class="tc2 tab_desc" style="width: 180px">Joined</div>
<div class="tc3 tab_desc" style="width: 180px">Last visit</div>
<div class="tc3 tab_desc" style="width: 100px">Posts</div>
<div class="tc3 tab_desc" style="width: 70px"></div>
<div class="tc4 tab_desc" style="width: 70px"></div>
</div>
<?
for ($i=0; $i<count($this->TPL['users_list']); $i++)
{
echo '<div class="row">'."\n";
echo "\t\t\t".'<div class="tc1 tc3">
<a href="index.php?mode=viewprofile&amp;id='.$this->TPL['users_list'][$i]['user_id'].'">
'.$this->colorRank($this->TPL['users_list'][$i]['nick'], $this->TPL['users_list'][$i]['rank']).'
</a>
</div>'."\n";
echo "\t\t\t".'<div class="tc3">'.$this->TPL['users_list'][$i]['regdate'].'</div>'."\n";
echo "\t\t\t".'<div class="tc3">'.(($this->TPL['users_list'][$i]['lastvisit']!= null) ? $this->TPL['users_list'][$i]['lastvisit'] : 'Never').'</div>'."\n";
echo "\t\t\t".'<div class="tc3" style="width: 100px">'.$this->TPL['users_list'][$i]['post_count'].'</div>'."\n";
echo "\t\t\t".'<div class="tc3" style="width: 70px; margin: 0 auto; text-align: center">
<a href="index.php?mode=admin&submode=eduser&amp;id='.$this->TPL['users_list'][$i]['user_id'].'" class="btn_small">Edit</a></div> '."\n";
echo "\t\t\t".'<div class="tc4" style="width: 70px; margin: 0 auto; text-align: center">
<a href="index.php?mode=admin&submode=deluser&amp;id='.$this->TPL['users_list'][$i]['user_id'].'" class="btn_small">Delete</a></div> '."\n";
echo "\t\t".'</div>'."\n";
}
?>
</div>
<br>
<div class="forum_table">
<div class="row">
<div class="hc1 hc4 hcpost">Options</div>
</div>
<div class="row">
<div class="tc1 tc4">
<form action="<?= $_SERVER['REQUEST_URI']; ?>" method="post">
Sort users by:
<select name="sort_type">
<option value="regdate" <?= $this->TPL['regdate_selected']; ?>>Registration date</option>
<option value="lastvisit" <?= $this->TPL['lastvisit_selected']; ?>>Lastvisit</option>
<option value="nick" <?= $this->TPL['username_selected']; ?>>Username</option>
<option value="post_count" <?= $this->TPL['posts_selected']; ?>>Posts count</option>
</select>
&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="sort_desc" value="Delete avatar" <?= $this->TPL['desc_checked']; ?> />Descending
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="Sort">
</form>
</div>
</div>
<div class="row">
<div class="tc1 tc4">Select only users with rank:
<a href="index.php?mode=admin&amp;submode=users&amp;rank=admin"><?= $this->getRankLevel(RANK_ADMIN); ?></a> &bull;
<a href="index.php?mode=admin&amp;submode=users&amp;rank=mod"><?= $this->getRankLevel(RANK_MOD); ?></a> &bull;
<a href="index.php?mode=admin&amp;submode=users&amp;rank=user"><?= $this->getRankLevel(RANK_USER); ?></a></div>
</div>
</div>
</div>
<? require_once('./templates/overall_footer.tpl.php'); ?>

+ 34
- 0
templates/confirm_action.tpl.php View File

@ -0,0 +1,34 @@
<?
if ($_GET['mode'] == 'admin')
require_once('./templates/admin/overall_header.tpl.php');
else
require_once('./templates/overall_header.tpl.php');
?>
<form action="<?= $_SERVER['REQUEST_URI']; ?>" method="post">
<div id="content">
<br>
<div class="forum_table">
<div class="row">
<div class="hc1 hc4">Confirm your action</div>
</div>
<div class="row">
<div class="tc1 tc4" style="padding-top: 20px; padding-bottom: 20px">
<?= $this->TPL['message']; ?>
</div>
</div>
<div class="row">
<div class="tc1 tc4" style="padding-top: 20px; padding-bottom: 20px">
<input type="hidden" name="confirmed" id="confirmed" value="true">
<input type="submit" value="Yes" style="font-weight: bold">
<input type="submit" name="rejected" value="No">
</div>
</div>
</div>
</div>
</form>
<? require_once('./templates/overall_footer.tpl.php'); ?>

+ 175
- 0
templates/edprofile.tpl.php View File

@ -0,0 +1,175 @@
<?
if ($_GET['mode'] == 'admin')
require_once('./templates/admin/overall_header.tpl.php');
else
require_once('./templates/overall_header.tpl.php');
?>
<script type="text/javascript">
function checkForm()
{
value = document.getElementById('passwd').value;
value2 = document.getElementById('passwd_confirm').value;
if (value != value2)
{
alert("Password do not match!");
return false;
}
if (document.getElementById('nick-inuse').style.display == 'inline')
{
return false;
}
return true;
}
</script>
<div id="content">
<? if ($this->TPL['error_msg'] != '') { ?>
<div class="error_form">
<?= $this->TPL['error_msg']; ?>
</div>
<? } ?>
<br><form action="<?= $_SERVER['REQUEST_URI']; ?>" method="post" onsubmit="return checkForm();" enctype="multipart/form-data">
<div class="forum_table">
<div class="row">
<div class="hc1">Basic informations</div>
<div class="hc4">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 lc">
Nick:
</div>
<div class="tc4 rc">
<? if ($this->TPL['is_admin']) {?>
<input type="text" maxlength="30" name="nick" id="nick" value="<?= $this->TPL['nick']; ?>" required pattern=".{3,}" required title="3 characters minimum">
<? } else { ?>
<span style="font-weight: bold"><?= $this->TPL['nick']; ?></span>
<input type="hidden" maxlength="30" name="nick" id="nick" value="<?= $this->TPL['nick']; ?>">
<? } ?>
</div>
</div>
<? if (!$this->TPL['is_admin']) {?>
<div class="row">
<div class="tc1 lc">
Old password:
</div>
<div class="tc4 rc">
<input type="password" name="passwd_old" id="passwd_old" value=""> (type only if you want to change password or email.)
</div>
</div>
<? } ?>
<div class="row">
<div class="tc1 lc">
New password:
</div>
<div class="tc4 rc">
<input type="password" name="passwd" id="passwd" value=""> (type only if you want to change it.)
</div>
</div>
<div class="row">
<div class="tc1 lc">
Confirm password:
</div>
<div class="tc4 rc">
<input type="password" name="passwd_confirm" id="passwd_confirm" value="">
</div>
</div>
<div class="row">
<div class="tc1 lc">
Email address:
</div>
<div class="tc4 rc">
<input type="email" name="email" id="email" value="<?= $this->TPL['email']; ?>" required>
</div>
</div>
<div class="row">
<div class="tc1 lc">
&nbsp;
</div>
<div class="tc4 rc">
<input type="submit" value="Edit profile">
</div>
</div>
</div>
<br>
<div class="forum_table">
<div class="row">
<div class="hc1">Profile informations</div>
<div class="hc4">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 lc">
Location:
</div>
<div class="tc4 rc">
<input type="text" maxlength="40" name="location" id="location" value="<?= $this->TPL['location']; ?>">
</div>
</div>
<div class="row">
<div class="tc1 lc">
Signature:
</div>
<div class="tc4 rc">
<textarea name="signature" id="signature" maxlength="300"><?= $this->TPL['signature']; ?></textarea>
</div>
</div>
<div class="row">
<div class="tc1 lc">
Avatar:
</div>
<div class="tc4 rc">
Current avatar:<br>
<img src="<? if ($this->TPL['avatar'] == null) echo 'templates/images/no_av.gif'; else echo $this->TPL['avatar']; ?>" alt="user avatar"><br>
<? if ($this->TPL['avatar'] != null) { ?> <input type="checkbox" name="delete_avatar" value="Delete avatar" /> Delete avatar<br> <? } ?>
<input type="file" name="avatar" id="avatar" value="">
</div>
</div>
<div class="row">
<div class="tc1 lc">
&nbsp;
</div>
<div class="tc4 rc">
<input type="submit" value="Edit profile">
</div>
</div>
</div>
<? if ($this->TPL['is_admin']) {?>
<br>
<div class="forum_table">
<div class="row">
<div class="hc1">Admin options</div>
<div class="hc4">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 lc">
User rank:
</div>
<div class="tc4 rc">
<input type="radio" name="user_rank" value="0" <?= $this->TPL['user_selected']; ?> >
User&nbsp;&nbsp;
<input type="radio" name="user_rank" value="1" <?= $this->TPL['mod_selected']; ?>>
<span class="fmod">Mod</span>&nbsp;&nbsp;
<input type="radio" name="user_rank" value="2" <?= $this->TPL['admin_selected']; ?>>
<span class="fadmin">Admin</span>
</div>
</div>
<div class="row">
<div class="tc1 lc">
&nbsp;
</div>
<div class="tc4 rc">
<input type="submit" value="Edit profile">
</div>
</div>
</div>
<? } ?>
</form>
</div>
<? require_once('./templates/overall_footer.tpl.php'); ?>

+ 28
- 0
templates/forum_message.tpl.php View File

@ -0,0 +1,28 @@
<?
if ($_GET['mode'] == 'admin')
require_once('./templates/admin/overall_header.tpl.php');
else
require_once('./templates/overall_header.tpl.php');
?>
<? if ($this->TPL['url'] != '') { ?>
<meta http-equiv="refresh" content="<?= $this->TPL['timeout']; ?>; url=<?= $this->TPL['url']; ?>">
<? } ?>
<div id="content">
<br>
<div class="forum_table">
<div class="row">
<div class="hc1 hc4">Forum message</div>
</div>
<div class="row">
<div class="tc1 tc4" style="padding-top: 20px; padding-bottom: 20px">
<?= $this->TPL['message']; ?>
</div>
</div>
</div>
</div>
<? require_once('./templates/overall_footer.tpl.php'); ?>

BIN
templates/images/button_beam.gif View File

Before After
Width: 100  |  Height: 50  |  Size: 1.3 KiB

BIN
templates/images/category_beam.gif View File

Before After
Width: 28  |  Height: 30  |  Size: 998 B

BIN
templates/images/delete.gif View File

Before After
Width: 19  |  Height: 18  |  Size: 1.0 KiB

BIN
templates/images/lock.gif View File

Before After
Width: 19  |  Height: 18  |  Size: 1.0 KiB

BIN
templates/images/move.gif View File

Before After
Width: 19  |  Height: 18  |  Size: 1.0 KiB

BIN
templates/images/no_av.gif View File

Before After
Width: 80  |  Height: 80  |  Size: 2.5 KiB

BIN
templates/images/offline.gif View File

Before After
Width: 12  |  Height: 16  |  Size: 131 B

BIN
templates/images/online.gif View File

Before After
Width: 12  |  Height: 16  |  Size: 131 B

BIN
templates/images/td_beam_top.gif View File

Before After
Width: 1  |  Height: 19  |  Size: 139 B

+ 289
- 0
templates/images/uf_logo.svg View File

@ -0,0 +1,289 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="392"
height="425"
id="svg2"
version="1.1"
inkscape:version="0.47pre4 r22446"
sodipodi:docname="uf_logo.svg">
<defs
id="defs4">
<linearGradient
id="linearGradient3656">
<stop
id="stop3658"
offset="0"
style="stop-color:#03006f;stop-opacity:1;" />
<stop
id="stop3660"
offset="1"
style="stop-color:#7549b4;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3637">
<stop
id="stop3639"
offset="0"
style="stop-color:#ff2d00;stop-opacity:1;" />
<stop
id="stop3641"
offset="1"
style="stop-color:#ffc200;stop-opacity:1;" />
</linearGradient>
<linearGradient
id="linearGradient3661">
<stop
style="stop-color:#ffff0c;stop-opacity:1;"
offset="0"
id="stop3663" />
<stop
style="stop-color:#ff411b;stop-opacity:1;"
offset="1"
id="stop3665" />
</linearGradient>
<linearGradient
id="linearGradient3627">
<stop
style="stop-color:#7e4eec;stop-opacity:1;"
offset="0"
id="stop3629" />
<stop
id="stop3651"
offset="1"
style="stop-color:#b181f9;stop-opacity:0.49803922;" />
</linearGradient>
<linearGradient
id="linearGradient3593">
<stop
style="stop-color:#fdfdfd;stop-opacity:1;"
offset="0"
id="stop3619" />
<stop
style="stop-color:#f3f3f3;stop-opacity:0;"
offset="1"
id="stop3597" />
</linearGradient>
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18109 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09448 : 526.18109 : 1"
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
id="perspective10" />
<inkscape:perspective
id="perspective3648"
inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
inkscape:vp_z="1 : 0.5 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_x="0 : 0.5 : 1"
sodipodi:type="inkscape:persp3d" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3593"
id="linearGradient3617"
x1="179.83696"
y1="592.03351"
x2="470.73511"
y2="800.63373"
gradientUnits="userSpaceOnUse"
spreadMethod="pad"
gradientTransform="translate(-103.28948,-3.2894722)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3627"
id="linearGradient3633"
x1="203.92857"
y1="685.79077"
x2="373.12314"
y2="685.79077"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(-103.28948,-3.2894722)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3661"
id="linearGradient3667"
x1="175.7372"
y1="704.34076"
x2="411.27054"
y2="704.34076"
gradientUnits="userSpaceOnUse"
gradientTransform="translate(0.65789474,-74.342105)" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient3656"
id="linearGradient3654"
x1="35.421013"
y1="1176.5903"
x2="216.89119"
y2="1176.5903"
gradientUnits="userSpaceOnUse" />
<radialGradient
inkscape:collect="always"
xlink:href="#linearGradient3661"
id="radialGradient3671"
cx="120.95009"
cy="158.30397"
fx="120.95009"
fy="158.30397"
r="56.21793"
gradientTransform="matrix(1,0,0,0.97391725,0,4.1290024)"
gradientUnits="userSpaceOnUse" />
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1"
inkscape:cx="293.30863"
inkscape:cy="236.8775"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1400"
inkscape:window-height="998"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1" />
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-19.712531,-534.11398)">
<path
style="fill:#c1b6af;fill-opacity:1;stroke:#333333;stroke-width:1.35215460999999992px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 38.543346,554.26267 c 121.746544,-23.52918 230.267474,-22.35482 344.838384,0 20.55724,99.4991 23.37603,191.82013 -6.32731,259.70332 -29.62138,17.3006 -216.86506,25.8575 -335.347434,2.9851 -24.41612,-83.88895 -29.30521,-170.84875 -3.16364,-262.68842 z"
id="path3614"
sodipodi:nodetypes="ccccc" />
<path
style="fill:url(#linearGradient3617);fill-opacity:1;stroke:#333333;stroke-width:1.06500006000000003;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
d="m 75.481966,584.62058 c 98.408524,-18.05257 186.126674,-17.15158 278.735104,0 16.61655,76.33986 18.89499,147.17242 -5.11442,199.25522 -23.94313,13.2738 -175.29344,19.83905 -271.063484,2.29036 C 58.303446,721.803 54.351576,655.0838 75.481966,584.62058 z"
id="path3614-6"
sodipodi:nodetypes="ccccc" />
<path
style="fill:#c1b6af;stroke:#1a1a1a;stroke-width:1.18485594000000005px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
d="m 128.78534,827.71059 c 55.82779,4.00558 109.72,3.77923 161.47265,0.79576 0.25391,14.22607 1.39995,27.15853 27.82212,46.23231 -79.95656,14.53314 -159.56037,11.12398 -222.458974,-2.31576 17.682194,-10.59777 32.975424,-27.96809 33.164204,-44.71231 z"
id="path3662"
sodipodi:nodetypes="ccccc" />
<path
style="fill:url(#linearGradient3633);fill-opacity:1;stroke:#668000;stroke-width:0.54194838px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 100.91006,591.55796 139.43848,0 c 45.61241,83.74005 31.67333,137.30619 0,181.88663 l -139.43848,0 c 51.3425,-53.23528 29.51784,-117.00702 0,-181.88663 z"
id="path2818"
sodipodi:nodetypes="ccccc" />
<path
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3598"
d="m 131.40417,737.78812 c 1.23778,-2.81789 2.5533,-5.61187 3.79115,-8.43289 0.66498,-1.48844 1.10648,-3.04589 1.67663,-4.56384 0.0502,-0.13353 0.71012,-1.85987 0.86986,-1.95947 2.18608,-1.36299 4.54115,-2.48557 6.81172,-3.72835 0.26168,0.24264 0.57099,0.44911 0.78504,0.7279 0.35077,0.45686 1.32121,2.45945 1.47912,2.80362 1.0737,2.34021 1.95087,4.75351 2.86256,7.14837 1.45643,3.11721 1.95694,6.70902 4.11567,9.52234 1.31377,1.32079 3.03783,1.21345 4.71924,0.61471 3.30002,-1.6801 -3.19164,1.67618 -4.80089,2.49251 -0.26723,0.13553 0.51533,-0.30027 0.77394,-0.44906 0.27707,-0.15942 0.54967,-0.32571 0.83308,-0.47557 7.25426,-3.83571 4.71074,-2.8128 8.09562,-4.12571 1.80565,-0.54791 3.71519,-0.62248 5.60053,-0.68206 1.94522,0.0322 3.85317,-0.33241 5.74334,-0.69977 1.90587,-0.37491 3.85767,-0.4588 5.79981,-0.52651 1.91632,0.0435 3.79344,-0.13759 5.58944,-0.75915 0.30693,-0.12674 0.61609,-0.24909 0.92079,-0.38022 0.68065,-0.29292 2.65134,-1.2999 1.99811,-0.95898 -12.07421,6.30156 -1.23404,0.58483 2.95405,-1.55222 1.7444,-0.79466 2.94624,-1.47753 4.83846,-0.71617 0.98022,0.77608 2.00142,1.33962 3.26461,1.61232 1.78607,0.23155 3.59822,0.21232 5.39826,0.22 1.98081,0.0696 3.73625,0.95293 5.6207,1.41607 1.71237,0.34653 3.46779,0.41788 5.21506,0.45432 1.8518,0.23001 2.7866,-0.32061 4.38081,-0.95219 -1.07766,0.55275 4.06357,-2.07919 2.80336,-1.41341 -1.86743,0.98658 -15.38166,8.05177 1.3008,-0.6733 1.54793,-0.65008 2.43154,-0.69117 4.00859,-0.17082 1.26218,0.72559 2.68347,1.00205 4.14216,1.16858 1.81808,0.0161 3.55796,-0.48675 5.32857,-0.79235 1.56075,-0.34244 2.76087,0.42449 3.93458,1.24349 0.96794,0.65036 2.00292,0.846 3.16511,0.6769 1.14932,-0.20107 2.31892,-0.24333 3.48232,-0.32715 0.49375,-0.11641 0.5855,0.25538 0.75924,0.60186 0,0 -6.66977,3.29773 -6.66977,3.29773 l 0,0 c 0.20513,0.152 0.13407,0.2077 -0.16367,0.18469 -1.16383,0.064 -2.31653,0.20665 -3.47391,0.32896 -1.27816,0.007 -2.44508,-0.387 -3.46377,-1.09535 -1.09799,-0.75007 -2.16115,-1.14229 -3.55052,-0.78526 -1.80587,0.33197 -3.61697,0.78999 -5.47744,0.60632 -1.48814,-0.22211 -2.89625,-0.60991 -4.24019,-1.24278 -1.2999,-0.31834 -2.47308,0.0113 -3.63325,0.60397 13.52536,-7.1587 0.15799,0.10769 -4.13212,2.03677 -1.49295,0.61517 -2.93782,0.88493 -4.58863,0.70992 -1.78328,-0.0678 -3.5733,-0.18793 -5.30719,-0.60051 -1.8136,-0.49721 -3.54728,-1.30519 -5.48519,-1.27698 -1.85652,-0.015 -3.74154,0.0328 -5.56425,-0.33755 -1.22665,-0.36239 -2.23631,-0.98634 -3.28776,-1.64963 -1.59233,-0.35131 -3.03692,0.49641 -4.41186,1.14688 -0.32664,0.16531 -1.30177,0.66884 -0.97991,0.49591 1.78829,-0.96083 7.17415,-3.81066 5.3795,-2.85975 -3.37394,1.78771 -6.69488,3.88001 -10.3774,5.16784 -1.86688,0.48937 -3.77648,0.61953 -5.71534,0.60781 -1.92246,0.0821 -3.846,0.2191 -5.72595,0.61791 -1.91652,0.36808 -3.86285,0.59703 -5.82454,0.61281 -1.84191,0.0829 -3.70903,0.20594 -5.42093,0.89021 -2.68633,1.20616 -1.42269,0.66023 4.74668,-2.58834 0.54727,-0.28818 -1.06068,0.62753 -1.60567,0.91931 -7.22804,3.86972 -4.68048,2.86751 -8.10138,4.15712 -1.99144,0.43109 -3.88812,0.18874 -5.23345,-1.35161 -2.08094,-2.94939 -2.57108,-6.56319 -4.00186,-9.77965 -0.87955,-2.3278 -0.98372,-2.69676 -1.99103,-4.98765 -0.52983,-1.20497 -1.44053,-3.46858 -2.39353,-4.50457 -0.0722,-0.0784 -0.2155,-0.0575 -0.32324,-0.0862 1.97667,-1.11688 3.87886,-2.3517 5.93001,-3.35065 0.26815,-0.13059 -0.35685,0.45222 -0.49021,0.70137 -0.20363,0.38045 -0.35634,0.78214 -0.5165,1.1795 -0.61552,1.52716 -1.05323,3.10818 -1.71139,4.62199 -1.19081,2.75144 -2.3513,5.52102 -3.69467,8.21317 0,0 -6.76111,3.03249 -6.76111,3.03249 z" />
<path
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3602"
d="m 143.92618,682.44467 c 2.65584,-1.19892 5.30323,-2.40662 8.05899,-3.41274 2.7316,-1.16963 3.66903,-1.78228 6.50206,-0.51167 2.51199,1.14187 4.74557,2.67666 6.87008,4.33182 1.65933,1.33716 2.9811,2.92373 4.84714,4.03366 2.56807,1.21945 3.88507,1.37668 6.62007,0.59879 2.56802,-0.88425 5.09072,-1.87112 7.71028,-2.62341 1.97244,-0.73518 4.0124,-1.17263 6.1269,-1.356 2.11832,-0.11812 4.21741,-0.0398 6.30855,-0.4049 2.51036,-0.62665 4.98747,-1.34077 7.54748,-1.78289 2.79399,-0.53281 4.52708,0.45813 6.48874,2.13139 1.36678,1.35604 2.61242,2.78483 4.6444,3.242 1.76594,0.17998 3.51497,-0.0995 5.27254,0.15077 2.30886,0.52709 4.37266,1.61836 6.63534,2.27377 2.30103,0.58513 4.30549,0.64262 6.56424,-0.0745 2.35354,-1.02973 4.85289,-1.74653 7.24083,-2.69399 1.51304,-0.65864 3.16475,-0.9207 4.79455,-1.2187 1.53542,-0.48955 3.11743,-0.81383 4.68524,-1.19804 1.80244,-0.41279 3.66971,-0.44993 5.517,-0.50125 1.8726,-0.0426 3.74597,-0.0358 5.619,-0.0361 0.25304,0.033 0.50607,0.066 0.75911,0.0991 0,0 -5.01472,3.24367 -5.01472,3.24367 l 0,0 c -0.23596,-0.0182 -0.47191,-0.0364 -0.70787,-0.0546 -1.86357,-0.004 -3.72755,-0.008 -5.59053,0.0423 -1.83234,0.0667 -3.67892,0.1552 -5.452,0.62047 -1.56252,0.40407 -3.14776,0.72549 -4.69959,1.16503 -1.6063,0.32579 -3.21935,0.62607 -4.71059,1.29041 -2.42219,0.875 -4.85297,1.72883 -7.26016,2.63924 -2.28771,0.55495 -4.53382,0.46438 -6.79976,-0.19359 -2.20723,-0.69475 -4.25698,-1.7839 -6.56813,-2.18165 -1.78492,-0.14067 -3.59069,0.15929 -5.35378,-0.21913 -2.01662,-0.66661 -3.35673,-2.04201 -4.76488,-3.46779 -1.93017,-1.59553 -3.50443,-2.26435 -6.15463,-1.7063 -2.55369,0.48675 -5.02755,1.23159 -7.56578,1.77625 -2.1074,0.28893 -4.22756,0.21669 -6.34717,0.39064 -2.07379,0.2407 -4.06569,0.74483 -6.02067,1.42331 -2.61286,0.78816 -5.13049,1.80468 -7.73624,2.6128 -2.81604,0.63034 -4.3925,0.28922 -6.93004,-0.98292 -1.86308,-1.14741 -3.19522,-2.74566 -4.86395,-4.10255 -2.08966,-1.61986 -4.29262,-3.12977 -6.79361,-4.18883 -0.3439,-0.12602 -0.67398,-0.2896 -1.03168,-0.37806 -1.81963,-0.45001 -3.53163,0.6603 -5.14605,1.22937 -2.76867,1.0536 -5.43273,2.29369 -8.13332,3.47822 0,0 4.83261,-3.48332 4.83261,-3.48332 z" />
<path
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
id="path3608"
d="m 131.58,629.5385 c 0.40641,-0.0886 0.8139,-0.17314 1.21923,-0.26576 1.90423,-0.43514 3.71046,-0.95078 5.48259,-1.73792 0.73544,-0.32666 2.85008,-1.46079 2.16725,-1.04997 -0.96359,0.57976 -2.00818,1.03892 -3.01227,1.55838 3.40539,-1.90834 6.82327,-3.79714 10.33938,-5.53513 0.99363,-0.49114 1.89689,-0.60017 2.95314,-0.35866 1.03645,0.71906 1.99576,1.38312 3.27775,1.66344 1.46699,0.28784 2.97675,0.15775 4.44974,0.36766 1.97805,0.32354 3.35054,1.22646 4.53208,2.67038 0.78786,1.25771 1.18897,2.47397 3.00563,2.353 1.47015,-0.41913 2.83438,-0.141 4.29168,0.13257 1.6649,0.57549 2.93104,0.83763 4.57762,0.0924 -10.41309,5.7597 -0.34556,-0.609 3.4424,-1.54194 0.82893,-0.20416 0.81752,-0.15054 1.61225,-0.10677 0.19826,0.0758 0.40881,0.1291 0.59477,0.22749 0.21674,0.11469 0.7783,0.57254 0.99681,0.70408 0.56573,0.34059 1.198,0.51578 1.84005,0.68972 -0.31066,0.72411 3.16713,-1.28849 2.28518,-0.85372 -7.31723,3.60712 -4.77403,2.79229 -3.09965,1.0761 1.44822,-1.72733 4.70695,-5.07497 6.55675,-3.20432 0.452,0.4571 0.58023,1.17021 0.7913,1.73333 0.53243,1.0816 1.88503,1.52918 3.10313,1.31014 0.21379,-0.12258 0.86305,-0.47798 0.64135,-0.36772 -1.52287,0.7574 -3.01006,1.57448 -4.54595,2.30967 -0.26195,0.12539 0.46236,-0.33969 0.71708,-0.47689 1.94471,-1.04751 3.84425,-2.17767 5.87719,-3.07508 0.50465,-0.22277 1.03222,0.71195 1.14416,0.85435 0.80817,1.4344 0.31293,3.24516 1.36034,4.56744 0.13252,-0.0107 0.28506,0.0326 0.39756,-0.0321 0.22043,-0.12691 0.78541,-0.60422 0.54566,-0.51091 -1.48391,0.57748 -2.75507,1.64228 -4.3249,1.98168 -0.55036,0.11899 0.67141,-0.83078 0.98562,-1.25972 0.34218,-0.46713 1.75442,-2.55791 2.07835,-3.03533 1.33337,-1.992 2.48138,-4.13555 4.21451,-5.87407 2.0196,-1.50323 1.74321,-1.34884 6.3167,-3.01285 0.30204,-0.1099 1.72461,1.93385 1.92649,2.21209 0.69469,1.26456 1.57995,2.19445 3.0635,2.63482 1.62446,0.20094 3.25489,0.36408 4.88414,0.56251 2.01631,0.22269 4.04901,0.25467 6.07732,0.28103 1.99626,0.0144 3.99263,0.0134 5.98894,0.0106 1.79648,-0.11631 3.55277,0.23974 5.33073,0.40091 2.27864,0.12128 4.56823,0.27357 6.80179,0.72023 1.42796,0.53866 2.79785,0.94207 4.346,0.91563 1.31361,-0.47903 2.7201,-0.55504 4.11506,-0.65344 1.69168,-0.1065 3.38767,-0.12628 5.08269,-0.13607 0.24535,-5.2e-4 0.49071,-8.7e-4 0.73606,-0.002 0,0 -4.97296,3.29738 -4.97296,3.29738 l 0,0 c -0.24422,5.2e-4 -0.48843,0.002 -0.73265,0.002 -1.68021,0.012 -3.36198,0.0341 -5.03736,0.16165 -1.41876,0.12737 -2.78703,0.41335 -4.18328,0.62723 -1.54198,-0.0684 -2.92246,-0.59022 -4.37738,-1.02441 -2.23175,-0.39326 -4.49537,-0.56207 -6.76275,-0.67534 -1.76413,-0.16646 -3.51533,-0.45866 -5.29797,-0.3524 -1.99449,-1.3e-4 -3.98911,0.006 -5.98339,-0.0262 -2.05002,-0.0354 -4.10467,-0.0698 -6.13976,-0.32161 -1.66272,-0.20978 -3.35834,-0.27922 -4.98423,-0.65377 -1.51597,-0.59001 -2.50182,-1.60106 -3.24368,-2.9411 -0.37417,-0.50308 -0.76822,-1.24851 -1.31275,-1.62868 -0.0914,-0.0638 -0.42067,-0.0477 -0.32503,-0.10606 2.97468,-1.81501 6.80494,-3.55818 4.35709,-2.43448 -1.92611,1.57949 -3.02428,3.83149 -4.3861,5.8001 -2.48313,3.66199 0.41088,-0.6146 -2.04479,3.04139 -0.29859,0.44454 -0.45189,1.00845 -0.90143,1.33045 -1.91103,1.36886 -4.00291,2.51783 -6.07896,3.66957 -0.72076,0.39986 -0.88686,0.16061 -1.47435,-0.12515 -0.9691,-1.3834 -0.72114,-3.03687 -1.33861,-4.54176 -0.0885,-0.0937 -0.13827,-0.23853 -0.26562,-0.28094 -0.12308,-0.041 -0.49773,0.12732 -0.38685,0.0637 1.51548,-0.87028 3.06162,-1.69659 4.6231,-2.49636 0.25877,-0.13254 -0.45529,0.35065 -0.70876,0.49148 -1.97572,1.09773 -3.9536,2.1942 -5.97423,3.22169 -0.23743,0.12072 -0.52082,0.14228 -0.78122,0.21342 -1.48375,-0.0651 -2.90806,-0.61387 -3.53834,-1.92262 -0.13674,-0.35473 -0.23054,-0.72335 -0.38448,-1.07218 -0.0372,-0.0843 -0.0715,-0.18674 -0.15842,-0.2311 -0.0574,-0.0293 -0.24421,0.0859 -0.1883,0.0542 5.15298,-2.91883 6.0182,-4.04173 4.41164,-2.18439 -1.97947,2.37925 -3.79146,2.74324 -7.30518,4.62297 -0.82616,0.44197 -1.65159,0.67112 -2.60685,0.49713 -0.70107,-0.22549 -1.3452,-0.46281 -1.96651,-0.84257 -0.26939,-0.16465 -0.57058,-0.43132 -0.8846,-0.54221 -0.14917,-0.0527 -0.31334,-0.0589 -0.47001,-0.0884 -0.862,0.0623 -1.58882,0.25866 -2.38442,0.58175 -0.30847,0.12526 -1.19756,0.56795 -0.90809,0.40939 1.56908,-0.85954 12.50342,-6.54807 -1.6137,0.81295 -1.67309,0.45034 -3.1701,0.17295 -4.79573,-0.34237 -1.44049,-0.25783 -2.79077,-0.27898 -4.24424,-0.0639 -1.88103,-0.27696 -2.44997,-1.33664 -3.27526,-2.77506 -1.10749,-1.32802 -2.44221,-2.07153 -4.2828,-2.28478 -1.50295,-0.13144 -3.0328,-0.0826 -4.50608,-0.4336 -1.21647,-0.35595 -2.15788,-1.03112 -3.24127,-1.61089 -0.67724,-0.0372 -0.70135,-0.0881 -1.44789,0.14337 -0.39951,0.12386 -1.51694,0.66417 -1.16478,0.45215 1.17473,-0.70725 2.42272,-1.30785 3.64462,-1.94515 1.26027,-0.65731 -5.32062,2.86371 -3.7197,2.0663 -5.38855,2.84032 -10.17803,5.75064 -16.31143,6.85681 0,0 4.88854,-3.40925 4.88854,-3.40925 z" />
<path
sodipodi:type="arc"
style="fill:#d0c9c4;fill-opacity:1;stroke:#666666;stroke-width:1.06500006000000003;stroke-miterlimit:4;stroke-dasharray:none"
id="path3637"
sodipodi:cx="446.76724"
sodipodi:cy="806.88806"
sodipodi:rx="10.129311"
sodipodi:ry="10.129311"
d="m 456.89655,806.88806 a 10.129311,10.129311 0 1 1 -20.25862,0 10.129311,10.129311 0 1 1 20.25862,0 z"
transform="matrix(0.79786056,0,0,0.79786056,-29.352526,165.93576)" />
<path
sodipodi:type="arc"
style="fill:#d0c9c4;fill-opacity:1;stroke:#b3b3b3;stroke-width:1.06500006000000003;stroke-miterlimit:4;stroke-dasharray:none"
id="path3639"
sodipodi:cx="432.6825"
sodipodi:cy="812.63739"
sodipodi:rx="3.348757"
sodipodi:ry="3.4642315"
d="m 436.03125,812.63739 a 3.348757,3.4642315 0 1 1 -6.69751,0 3.348757,3.4642315 0 1 1 6.69751,0 z"
transform="translate(-105.54412,-2.7589622)" />
<path
style="fill:#666666;fill-opacity:1;stroke:#b3b3b3;stroke-width:0.92901093px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 327.15554,804.5324 0,4.15222"
id="path3647"
sodipodi:nodetypes="cc" />
<flowRoot
xml:space="preserve"
id="flowRoot2837"
style="font-size:40px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
transform="translate(19.712531,534.11398)"><flowRegion
id="flowRegion2839"><rect
id="rect2841"
width="378.94736"
height="59.210526"
x="3.2894738"
y="354.60526" /></flowRegion><flowPara
id="flowPara2843" /></flowRoot> <text
xml:space="preserve"
style="font-size:40px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
x="157.23685"
y="390.78946"
id="text2845"
transform="translate(19.712531,534.11398)"><tspan
sodipodi:role="line"
id="tspan2847" /></text>
<text
xml:space="preserve"
style="font-size:491.34445190000002412px;font-style:normal;font-weight:normal;line-height:125%;fill:url(#linearGradient3654);fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans"
x="29.149523"
y="1197.3451"
id="text3643"
transform="scale(1.2794953,0.78155817)"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan3645"
x="29.149523"
y="1197.3451"
style="font-size:80.27507018999997968px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Arial;-inkscape-font-specification:Arial;fill-opacity:1;fill:url(#linearGradient3654)">µForum</tspan></text>
<path
sodipodi:type="star"
style="fill:url(#radialGradient3671);fill-opacity:1;stroke:none"
id="path3663"
sodipodi:sides="5"
sodipodi:cx="119.62617"
sodipodi:cy="153.97195"
sodipodi:r1="58.707661"
sodipodi:r2="13.366334"
sodipodi:arg1="0.24111768"
sodipodi:arg2="-0.07032258"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 176.63551,167.99065 -43.67605,-14.95788 -9.049,59.49031 0.72914,-46.16063 -59.374944,9.7774 44.126684,-13.57097 -27.646723,-53.44754 26.542653,37.77331 42.28832,-42.80979 -27.72242,36.91615 53.78234,26.98964 z"
transform="matrix(1.4489505,0,0,1.4094179,14.29205,492.45047)" />
<path
style="fill:url(#linearGradient3667);fill-opacity:1;stroke:#000000;stroke-width:1.26388943000000009px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 395.07143,542.23523 -161.4278,96.02682 c 39.86364,-7.02254 6.25927,1.13166 105.53238,-15.13393 l -137.07575,75.31075 11.13295,-30.72859 -36.20618,50.05181 64.26014,-8.23606 -29.90946,-4.68537 168.3403,-94.86433 -100.81192,13.03751 132.39039,-80.34077 -16.22505,-0.43784 z"
id="path3610"
sodipodi:nodetypes="cccccccccccc" />
</g>
</svg>

BIN
templates/images/unlock.gif View File

Before After
Width: 19  |  Height: 18  |  Size: 1.0 KiB

+ 489
- 0
templates/kopia main.css View File

@ -0,0 +1,489 @@
body {
font-family: Helvetica;
font-size: 11pt;
background-color: #E5E7E9;
}
#container {
width: 900px;
background-color: #CEE3F6;
margin: 0 auto;
text-align: center;
border: 2px solid navy;
border-collapse: collapse;
border-radius: 10px;
}
a, a:visited {
text-decoration: none;
}
img {
border: 0px;
}
a:hover {
color: navy;
text-decoration: underline;
}
a {
color: #000000;
}
#container #top {
width: 100%;
background-color: #CEE3F6;
height: 140px;
vertical-align: middle;
padding-top: 20px;
border-bottom: 1px solid #777777;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
#container #userpanel {
text-align: right;
font-size: 0.8em;
width: 100%;
}
#container #navi_bar
{
padding-left: 10px;
text-align: left;
width: 100%;
}
#container #top h1
{
margin: 0px;
position: relative;
top: 30%;
color: navy;
font-size: 36pt;
font-weight: bold;
}
#container #top h2
{
color: #005AE5;
font-size: 20px;
text-decoration: none;
font-weight: bold;
}
#container #footer
{
width: 100%;
background-color: navy;
font-size: 8pt;
color: #FFFFFF;
height: 18px;
line-height: 18px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
box-shadow: 0 8px 6px -6px black;
}
#container #footer a
{
color: #FFFFFF;
}
#contanier #footer a:visited
{
color: #FFFFFF;
}
#container #content {
text-align: left;
min-height: 200px;
padding: 10px;
}
#container #content h3 {
margin-left: 20px;
color: gray;
font-size: 1.5em;
}
#container #content table {
border: 1px solid;
border-collapse: collapse;
}
#container #content table td {
border: 1px solid;
border-color: orange;
border-collapse: collapse;
font-size: 10pt;
background-color: #ffffbd;
text-align: center;
}
#container #content table .heading {
background-color: orange;
color: #FFFFFF;
font-weight: bold;
}
#container #menu {
text-align: center;
margin: 0 auto;
width: 100%;
height: 50px;
background-color: #99CCFF;
background-image: url('images/button_beam.gif');
}
#container #menu ul {
list-style-type: none;
margin: 0px;
padding: 0px;
}
#container #menu li {
display: inline-block;
border-right: 1px #9A9A9A solid;
height: 37px;
width: 120px;
padding-top: 13px;
margin: auto -4px auto auto;
}
#container #menu li:hover {
}
#container #menu li a {
color: #FFFFFF;
font-weight: bold;
font-family: Verdana;
font-size: 14px;
font-weight: bold;
}
#container #menu li:last-child {
border: 0px;
}
.sect
{
color: #434354;
font-family: Verdana;
font-size: 10pt;
font-weight: bold;
text-decoration: none;
}
.navigation {
color: navy;
text-decoration: none;
font-size: 12px;
font-weight: bold;
}
.forum_table {
display: table;
width: 100%;
border-collapse: separate;
box-shadow: 0 8px 6px -6px black;
}
.fsmall
{
color: #434354;
font-size: 8pt;
text-decoration: none;
}
.row {
display: table-row;
width: 100%;
}
.row:last-child .tc1, .row:last-child .tc2, .row:last-child .tc3, .row:last-child .tc4
{
border-bottom: 1px solid #040074;
}
.rcol
{
display: table-caption;
border: 1px solid #040074;
border-collapse: collapse;
background-color: #e1f0ff;
padding: 3px;
vertical-align: middle;
border-top: 0px;
caption-side: bottom;
text-align: center;
font-style: italic;
}
.tc1, .tc2, .tc3, .tc4
{
display: table-cell;
background-color: #F0F8FF;
padding: 3px;
vertical-align: middle;
word-wrap: break-word;
}
.tc1
{
border-left: 1px solid #040074;
}
.tc2, .tc3
{
vertical-align: middle;
text-align: center;
}
.tc4 {
text-align: center;
vertical-align: middle;
width: 150px;
border-right: 1px solid #040074;
}
.hc1, .hc2, .hc3, .hc4
{
color: #FFFFFF;
font-weight: bold;
background-color: yellow;
vertical-align: middle;
display: table-cell;
padding-left: 15px;
background-image: url('images/category_beam.gif');
height: 30px;
border-top: 1px solid #040074;
word-wrap: break-word;
}
.hc1 {
border-top-left-radius: 10px;
border-left: 1px solid #040074;
}
.hc4 {
border-top-right-radius: 10px;
border-right: 1px solid #040074;
width: 150px;
}
.tab_desc {
text-align: center;
font-weight: bold;
color: blue;
background-image: url('images/td_beam_top.gif');
height: 19px;
}
.lc {
width: 30%;
text-align: right;
margin-right: 10px;
}
.rc {
width: 70%;
text-align: left;
margin-left: 10px;
}
.rc input[type="text"], input[type="password"], input[type="email"] {
width: 200px;
}
input[type="button"], input[type="reset"], input[type="submit"] {
border-radius: 5px;
background-color: #C7E2FB;
padding: 5px;
border: 1px solid #AACAE8;
min-width: 30px;
font-size: 12px;
color: #204E7A;
cursor: pointer;
}
input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover
{
background-color: #e3effb;
}
#signature {
width: 490px;
height: 60px;
resize: vertical;
}
#post {
width: 490px;
height: 180px;
resize: vertical;
}
#signature, #post, input[type="text"], input[type="password"], input[type="email"], select
{
border-radius: 5px;
border: 1px solid #C7E2FB;
min-height: 20px;
font-size: 12px;
background-color: #FFFFE8;
}
.error_form
{
margin: 0 auto;
text-align: center;
width: 90%;
border: 1px solid #FF0000;
background-color: #FFCC99;
padding: 10px;
color: #FF0000;
border-radius: 10px;
font-weight: bold;
}
.fadmin, .fmod
{
font-weight: bold;
}
.fmod
{
color: darkgreen;
}
.fadmin
{
color: orange;
}
.btn
{
width: 90px;
height: 30px;
color: #FFFFFF;
font-weight: bold;
text-align: center;
font-size: 1em;
background-image: url('images/button_beam.gif');
border-radius: 10px;
line-height: 30px;
box-shadow: 0 8px 6px -6px black;
}
.btn_small
{
width: 60px;
height: 20px;
color: #FFFFFF;
font-weight: bold;
text-align: center;
font-size: 0.8em;
background-image: url('images/button_beam.gif');
border-radius: 10px;
margin: 0 auto;
line-height: 20px;
margin-top: 3px;
box-shadow: 0 8px 6px -6px black;
}
.ut
{
padding: 0px;
border-left: 0px;
}
.tc1 .forum_table .tc1, .tc1 .forum_table .tc2, .tc1 .forum_table .tc3 {
border: 0px;
border-top: 1px solid lightgray;
}
.mod_pool
{
margin: 0 auto;
width: 90%;
background-color: #FFFF99;
text-align: center;
padding: 5px;
border: 1px solid orange;
border-radius: 10px;
}
hr {
border: 0;
border-bottom: 1px dashed #ccc;
background: #999;
width: 50%;
margin: 0;
margin-top: 5px;
}
.hcpost
{
height: 10px;
}
.f_hc4
{
text-align: right;
padding-right: 10px;
}
.post_3c
{
width: 120px;
}
.f_tc2
{
width: 120px;
vertical-align: top;
height: 150px;
text-align: center;
}
.topic_mod
{
width: 80px;
float: right;
}
.p_uinfo
{
width: 38%;
}
.post_content
{
vertical-align: top;
position: relative;
text-align: left;
max-width: 500px;
}
.row .hcpost a {
color: #FFFFFF;
}
.qpost
{
background-color: #DDDAC5;
width: 95%;
font-style: italic;
box-shadow: 7px 8px 6px -3px gray;
padding: 5px;
}
.cpost
{
background-color: #C5DDCC;
width: 95%;
font-family: Courier New;
box-shadow: 7px 8px 6px -3px gray;
padding: 5px;
}

+ 146
- 0
templates/kopia viewtopic.tpl.php View File

@ -0,0 +1,146 @@
<? require_once('./templates/overall_header.tpl.php'); ?>
<div id="content">
<? if ($this->TPL['topic_info']['forum_locked'] == false && $this->TPL['topic_info']['topic_locked'] == false) { ?>
<a href="index.php?mode=reply&amp;id=<?= $_GET['id']; ?>">
<div class="btn">
Reply
</div>
</a>
<? } else { ?>
<div class="btn">
Locked
</div>
<? } ?>
<br />
<?php
for ($i=0; $i<count($this->TPL['posts_list']); $i++)
{
echo '
<div class="forum_table">
<div class="row">
<div class="hc1 hcpost">&nbsp;</div>
<div class="hc2 hcpost">&nbsp;</div>
<div id="p'.$this->TPL['posts_list'][$i]['post_id'].'" class="hc4 hcpost f_hc4 post_3c">Post <a href="index.php?mode=viewtopic&amp;id='.$_GET['id'].'#p'.$this->TPL['posts_list'][$i]['post_id'].'">#'.($i+1).'</a></div>
</div>
<div class="row">
<div class="tc1 f_tc2" style="width: 120px">';
if ($this->TPL['posts_list'][$i]['nick'] != null)
echo '<a href="index.php?mode=viewprofile&amp;id='.$this->TPL['posts_list'][$i]['user_id'].'">'.$this->colorRank($this->TPL['posts_list'][$i]['nick'], $this->TPL['posts_list'][$i]['user_rank']).'</a>';
else
echo 'Anonymous';
echo '<br>';
if ($this->TPL['posts_list'][$i]['avatar'] != null)
echo '<img src="'.$this->TPL['posts_list'][$i]['avatar'].'" alt="user avatar">';
else
echo '<img src="templates/images/no_av.gif" alt="user avatar">';
echo '
</div>
<div class="tc3 post_content" >';
echo BBCode($this->TPL['posts_list'][$i]['content']);
if ($this->TPL['posts_list'][$i]['signature'] != null)
echo '
<br><br>
<hr>
<span class="fsmall">'.BBCode($this->TPL['posts_list'][$i]['signature']).'<br><br></span>';
echo '
</div>
<div class="tc4 post_3c f_tc2">
<span class="fsmall">Posted: <span style="font-weight: bold">'.$this->TPL['posts_list'][$i]['date'].'</span></span><br>
<a href="index.php?mode=quote&amp;id='.$_GET['id'].'&amp;q='.$this->TPL['posts_list'][$i]['post_id'].'">
<div class="btn_small">
Quote
</div>
</a>';
if ($this->TPL['my_id'] == $this->TPL['posts_list'][$i]['user_id'])
echo '
<a href="index.php?mode=editpost&amp;id='.$this->TPL['posts_list'][$i]['post_id'].'">
<div class="btn_small">
Edit
</div>
</a>';
echo '<br>';
if ($this->TPL['my_rank'] >= RANK_MOD)
echo '
<div class="mod_pool">
<span style="font-weight: bold">Mod options</span><br>
<a href="index.php?mode=editpost&amp;id='.$this->TPL['posts_list'][$i]['post_id'].'">
<div class="btn_small">
Edit
</div>
</a>
<a href="index.php?mode=moderate&amp;submode=deletepost&amp;id='.$this->TPL['posts_list'][$i]['post_id'].'">
<div class="btn_small" style="width: 35px">
X
</div>
</a>
</div>';
echo '
</div>
</div>
<div class="row">
<div class="tc1 post_3c tc2">
<span class="fsmall">Status: <img src="templates/images/'.(($this->TPL['posts_list'][$i]['user_IP']) ? 'online' : 'offline').'.gif" alt="user status"></span>
</div>
<div class="tc1 ut">
<div class="forum_table" style="box-shadow: none">
<div class="tc2 ">
<span class="fsmall">Posts: <span style="font-weight: bold">'.$this->TPL['posts_list'][$i]['user_post_count'].'</span></span>
</div>
<div class="tc2 p_uinfo">
<span class="fsmall">Joined: <span style="font-weight: bold">'.$this->TPL['posts_list'][$i]['regdate'].'</span></span>
</div>
<div class="tc3 p_uinfo">
<span class="fsmall">Last visit: <span style="font-weight: bold">'.(($this->TPL['posts_list'][$i]['lastvisit']!= null) ? $this->TPL['posts_list'][$i]['lastvisit'] : 'Never').'</span></span>
</div>
</div>
</div>
<div class="tc4 post_3c"><span class="fsmall">Rank: '.$this->getRankLevel($this->TPL['posts_list'][$i]['user_rank']).'</span></div>
</div>
</div>
<br>';
}
?>
<? if ($this->TPL['topic_info']['forum_locked'] == false && $this->TPL['topic_info']['topic_locked'] == false) { ?>
<a href="index.php?mode=reply&amp;id=<?= $_GET['id']; ?>">
<div class="btn">
Reply
</div>
</a>
<? } else { ?>
<div class="btn">
Locked
</div>
<? } ?>
<? if ($this->TPL['my_rank'] >= RANK_MOD) { ?>
<div class="forum_table topic_mod" style="">
<div class="row">
<div class="hc1 hc4 hcpost" style="padding: 0px; text-align: center">Actions</div>
</div>
<div class="row">
<div class="tc1 tc4">
<a href="index.php?mode=moderate&amp;submode=deletetopic&amp;id=<?= $_GET['id']; ?>">
<img src="templates/images/delete.gif" alt="delete">
</a>
<a href="index.php?mode=moderate&amp;submode=locktopic&amp;id=<?= $_GET['id']; ?>">
<img src="templates/images/<? if ($this->TPL['topic_info']['topic_locked']) echo 'un'; ?>lock.gif" alt="lock">
</a>
<a href="index.php?mode=moderate&amp;submode=movetopic&amp;id=<?= $_GET['id']; ?>">
<img src="templates/images/move.gif" alt="move">
</a>
</div>
</div>
</div>
<? } ?>
<div style="clear: both">&nbsp;</div>
</div>
<? require_once('./templates/overall_footer.tpl.php'); ?>

+ 54
- 0
templates/login_form.tpl.php View File

@ -0,0 +1,54 @@
<? require_once('./templates/overall_header.tpl.php'); ?>
<div id="content">
<script type="text/javascript" src="templates/scripts/chkcookie.js">
</script>
<script type="text/javascript">
create_cookie("checkcookie", "testvalue", 0);
</script>
<p id="js_msg" style="color: red; font-weight: bold">You must enable cookies if you want log in</p>
<? if ($this->TPL['error_msg'] != '') { ?>
<div class="error_form">
<?= $this->TPL['error_msg']; ?>
</div>
<? } ?>
<br><form action="<?= $_SERVER['REQUEST_URI']; ?>" method="post">
<div class="forum_table">
<div class="row">
<div class="hc1">Log in</div>
<div class="hc4">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 lc">
Nick:
</div>
<div class="tc4 rc">
<input type="text" maxlength="30" name="nick" id="nick" value="<?= $this->TPL['nick']; ?>" required>
</div>
</div>
<div class="row">
<div class="tc1 lc">
Password:
</div>
<div class="tc4 rc">
<input type="password" name="passwd" id="passwd" value="" required>
</div>
</div>
<div class="row">
<div class="tc1 lc">
&nbsp;
</div>
<div class="tc4 rc">
<input type="submit" value="Log in">
</div>
</div>
</div></form>
</div>
<script type="text/javascript">
if (read_cookie("checkcookie") == "testvalue")
document.getElementById('js_msg').style.display = 'none';
erase_cookie("checkcookie");
</script>
<? require_once('./templates/overall_footer.tpl.php'); ?>

+ 81
- 0
templates/main.css View File

@ -0,0 +1,81 @@
#container {
background-color: #CEE3F6;
border: 2px solid navy;
}
a:hover {
color: navy;
}
#container #top {
background-color: #CEE3F6;
height: 140px;
}
#container #top h1 {
top: 30%;
color: navy;
}
#container #footer {
background-color: navy;
}
#container #menu {
background-image: url('images/button_beam.gif');
}
.navigation {
color: navy;
}
.row:last-child .tc1, .row:last-child .tc2, .row:last-child .tc3, .row:last-child .tc4 {
border-bottom: 1px solid #040074;
}
.rcol {
border: 1px solid #040074;
}
.tc1 {
border-left: 1px solid #040074;
}
.tc4 {
border-right: 1px solid #040074;
}
.hc1, .hc2, .hc3, .hc4 {
background-image: url('images/category_beam.gif');
border-top: 1px solid #040074;
}
.hc1 {
border-left: 1px solid #040074;
}
.hc4 {
border-right: 1px solid #040074;
}
.tab_desc {
color: blue;
}
input[type="button"], input[type="reset"], input[type="submit"] {
background-color: #C7E2FB;
border: 1px solid #AACAE8;
color: #204E7A;
}
input[type="button"]:hover, input[type="reset"]:hover, input[type="submit"]:hover {
background-color: #e3effb;
}
.btn {
background-image: url('images/button_beam.gif');
}
.btn_small {
background-image: url('images/button_beam.gif');
}

+ 123
- 0
templates/main.tpl.php View File

@ -0,0 +1,123 @@
<? require_once('./templates/overall_header.tpl.php'); ?>
<script type="text/javascript">
function confirm_action(c_name, url)
{
if (confirm(c_name))
{
document.location = url;
}
}
</script>
<div id="content">
<?
$items = 0;
for ($i=0; $i<count($this->TPL['forums_list']); $i++)
{
if ($this->TPL['forums_list'][$i]['forum_id'] != null)
{
if ($i > 0)
{
if ($this->TPL['forums_list'][$i-1]['category_id'] != $this->TPL['forums_list'][$i]['category_id'])
echo '</div><br><div class="forum_table">
<div class="row">
<div class="hc1">'.$this->TPL['forums_list'][$i]['category_name'].'</div>
<div class="hc2" style="width: 80px">&nbsp;</div>
<div class="hc3" style="width: 80px">&nbsp;</div>
<div class="hc4">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 tab_desc">Forum name</div>
<div class="tc2 tab_desc" style="width: 80px">Topics</div>
<div class="tc3 tab_desc" style="width: 80px">Posts</div>
<div class="tc4 tab_desc">Last Post</div>
</div>';
}
else
{
echo '<div class="forum_table">
<div class="row">
<div class="hc1">'.$this->TPL['forums_list'][$i]['category_name'].'</div>
<div class="hc2" style="width: 80px">&nbsp;</div>
<div class="hc3" style="width: 80px">&nbsp;</div>
<div class="hc4">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 tab_desc">Forum name</div>
<div class="tc2 tab_desc" style="width: 80px">Topics</div>
<div class="tc3 tab_desc" style="width: 80px">Posts</div>
<div class="tc4 tab_desc">Last Post</div>
</div>';
}
echo '<div class="row">'."\n";
echo "\t\t\t".'<div class="tc1"><a href="index.php?mode=viewforum&amp;id='.$this->TPL['forums_list'][$i]['forum_id'].'" class="sect">'.$this->TPL['forums_list'][$i]['forum_name'].'</a><br><span class="fsmall">'.$this->TPL['forums_list'][$i]['forum_desc'].'</span></div>'."\n";
echo "\t\t\t".'<div class="tc2" style="width: 80px">'.$this->TPL['forums_list'][$i]['topic_count'].'</div>'."\n";
echo "\t\t\t".'<div class="tc3" style="width: 80px">'.$this->TPL['forums_list'][$i]['post_count'].'</div>'."\n";
if ($this->TPL['forums_list'][$i]['lastpost_post_id'] != null)
{
$lastpost = '<span class="fsmall"><span style="font-weight: bold">'.$this->TPL['forums_list'][$i]['lastpost_date'].'</span><br><a href="index.php?mode=viewtopic&amp;id='.$this->TPL['forums_list'][$i]['lastpost_topic_id'].'#p'.$this->TPL['forums_list'][$i]['lastpost_post_id'].'" style="font-weight: bold">Topic #'.$this->TPL['forums_list'][$i]['lastpost_topic_id'].'</a>: ';
if ($this->TPL['forums_list'][$i]['lastpost_user_id'] != null)
$lastpost .= '<a href="index.php?mode=viewprofile&amp;id='.$this->TPL['forums_list'][$i]['lastpost_user_id'].'">'.$this->colorRank($this->TPL['forums_list'][$i]['lastpost_nick'], $this->TPL['forums_list'][$i]['lastpost_user_rank']).'</a>';
else
$lastpost .= 'Anonymous';
$lastpost .= '</span>';
}
else
{
$lastpost = 'No posts';
}
echo "\t\t\t".'<div class="tc4">'.$lastpost.'</div>'."\n";
echo "\t\t".'</div>'."\n";
$items++;
}
}
if ($items > 0)
echo '</div>';
else
{
echo '<div class="forum_table">
<div class="row">
<div class="hc1 hc4">Forum message</div>
</div>
<div class="row">
<div class="tc1 tc4">No forums</div>
</div>
</div>';
}
?>
<br>
<div class="forum_table">
<div class="row">
<div class="hc1 hc4">Statistics</div>
</div>
<div class="row">
<div class="tc1 tc4" style="text-align: left">
Our users have written <span style="font-weight: bold"><?= $this->TPL['posts_count']; ?></span> posts.<br>
We have <span style="font-weight: bold"><?= $this->TPL['users_count']; ?></span> unique users.<br>
Last registered user: <a href="index.php?mode=viewprofile&amp;id=<?= $this->TPL['last_user']['user_id']; ?>" style="font-weight: bold"><?= $this->TPL['last_user']['nick']; ?></a><br>
Users ranks: <a href="index.php?mode=userlist&amp;rank=admin"><span class="fadmin">Admin</span></a> &bull; <a href="index.php?mode=userlist&amp;rank=mod"><span class="fmod">Mod</span></a> &bull; User<br>
This forum is browsing by <span style="font-weight: bold"><?= $this->TPL['logged_users_count']; ?></span> logged users(list):<br>
<?
if ($this->TPL['logged_users_count'] == 0) echo 'none.';
else
for ($i=0; $i<count($this->TPL['logged_users']); $i++)
{
echo '<a href="index.php?mode=viewprofile&amp;id='.$this->TPL['logged_users'][$i]['user_id'].'">'.$this->colorRank($this->TPL['logged_users'][$i]['nick'], $this->TPL['logged_users'][$i]['rank']).'</a>';
if ($i<count($this->TPL['logged_users'])-1)
echo ',&nbsp;';
}
?>
</div>
</div>
</div>
</div>
<? require_once('./templates/overall_footer.tpl.php'); ?>

+ 67
- 0
templates/move_topic.tpl.php View File

@ -0,0 +1,67 @@
<? require_once('./templates/overall_header.tpl.php'); ?>
<form action="<?= $_SERVER['REQUEST_URI']; ?>" method="post">
<div id="content">
<br>
<div class="forum_table">
<div class="row">
<div class="hc1">Move topic to another forum</div>
<div class="hc4">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 lc">
Topic title:
</div>
<div class="tc4 rc">
<span style="font-weight: bold"><?= $this->TPL['topic_info']['topic_title']; ?></span>
</div>
</div>
<div class="row">
<div class="tc1 lc">
Topic is in forum:
</div>
<div class="tc4 rc">
<span style="font-weight: bold"><?= $this->TPL['topic_info']['forum_name']; ?></span>
</div>
</div>
<div class="row">
<div class="tc1 lc">
Select a new forum:
</div>
<div class="tc4 rc">
<select name="forum_id">
<?
for ($i=0; $i<count($this->TPL['forums_list']); $i++)
{
$sel = ($this->TPL['forums_list'][$i]['forum_id'] == $this->TPL['topic_info']['forum_id']) ? 'selected="selected"' : '';
echo '<option value="'.$this->TPL['forums_list'][$i]['forum_id'].'" '.$sel.'>'.$this->TPL['forums_list'][$i]['name'].'</option>';
}
?>
</select>
</div>
</div>
<div class="row">
<div class="tc1 lc">
&nbsp;
</div>
<div class="tc4 rc">
<input type="hidden" name="confirmed" id="confirmed" value="true">
<input type="submit" value="Move" style="font-weight: bold">
<input type="submit" name="rejected" value="Cancel">
</div>
</div>
</div>
</div>
</form>
<? require_once('./templates/overall_footer.tpl.php'); ?>

+ 6
- 0
templates/overall_footer.tpl.php View File

@ -0,0 +1,6 @@
<div id="footer">
Powered by <span style="font-weight:bold">&micro;Forum &copy;</span> 2007-2015 <a href="http://www.pioder.pl" style="font-weight: bold">PioDer</a>
</div>
</div>
</body>
</html>

+ 56
- 0
templates/overall_header.tpl.php View File

@ -0,0 +1,56 @@
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?= $this->TPL['meta_title']; ?></title>
<meta name="author" content="Piotr Dergun" />
<meta name="generator" content="medit/1.2.0" />
<link rel="stylesheet" href="templates/styles.css" type="text/css" />
<link rel="stylesheet" href="templates/main.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="top">
<div style="width: 30%; float:left"><img src="templates/images/uf_logo.svg" height="130" alt="&micro;F logo"></div>
<div style="width: 70%; float: left">
<h1><?= $this->TPL['forum_name']; ?></h1>
<h2><?= $this->TPL['forum_desc']; ?></h2>
</div>
</div>
<div id="menu">
<ul>
<li><a href="index.php">Main Page</a></li>
<li><a href="index.php?mode=userlist">Userlist</a></li>
<? if ( $this->TPL['is_logged']) { ?>
<li><a href="index.php?mode=myprofile">Profile</a></li>
<li><a href="index.php?mode=logout">Log out</a></li>
<? } else { ?>
<li><a href="index.php?mode=register">Register</a></li>
<li><a href="index.php?mode=login">Log in</a></li>
<? } ?>
</ul>
</div>
<br>
<div id="userpanel">
<? if ( $this->TPL['is_logged']) { ?>
You are logged as: <span style="font-weight: bold"><?= $this->TPL['my_nick'] ?></span>
<? } else { ?>
Welcome Guest! You are not logged.
<? } ?><br>
Actual time: <span style="font-weight: bold"><?= $this->TPL['actual_time']; ?></span><br>
<? IF ($this->TPL['my_rank'] == RANK_ADMIN ) { ?>
<a href="index.php?mode=admin" style="font-weight: bold">Go to ACP &raquo;</a>
<? } ?>
</div>
<br>
<div id="navi_bar">
<?
for ($i=0; $i<count($this->TPL['nav']); $i++)
{
echo '<a href="'.$this->TPL['nav'][$i]['url'].'" class="navigation">'.$this->TPL['nav'][$i]['name'].'</a>';
if ($i < count($this->TPL['nav'])-1)
echo ' &raquo; ';
}
?>
</div>

+ 126
- 0
templates/posting.tpl.php View File

@ -0,0 +1,126 @@
<? require_once('./templates/overall_header.tpl.php'); ?>
<script type="text/javascript" src="templates/scripts/posting.js">
</script>
<div id="content">
<? if ($this->TPL['error_msg'] != '') { ?>
<div class="error_form">
<?= $this->TPL['error_msg']; ?>
</div>
<? } ?>
<? if (isset($this->TPL['preview'])) { ?>
<div class="forum_table">
<div class="row">
<div class="hc1 hc4">Post preview</div>
</div>
<div class="row">
<div class="tc1 post_content tc4" style="height: 150px">
<?= BBCode($this->TPL['preview']); ?>
</div>
</div>
</div>
<br>
<? } ?>
<br><form action="<?= $_SERVER['REQUEST_URI']; ?>" method="post">
<? if (isset($this->TPL['topic'])) { ?>
<div class="forum_table">
<div class="row">
<div class="hc1">Topic information</div>
<div class="hc4">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 lc">
Title:
</div>
<div class="tc4 rc">
<input type="text" maxlength="100" name="topic" id="topic" value="<?= $this->TPL['topic']; ?>" required pattern=".{3,}" required title="3 characters minimum" style="width: 490px">
</div>
</div>
</div>
<br>
<? } ?>
<div class="forum_table">
<div class="row">
<div class="hc1">Post information</div>
<div class="hc4">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 tc2">
Emoticons:
</div>
<div class="tc4 rc">
<p id="js_msg" style="color: red; font-weight: bold">
Turn on JavaScript to enable BBCode and emoticons buttons.
</p>
<div id="bbcode_buttons" style="display:none">
<input type="button" style="font-weight: bold" onClick="bbTag(0)" value="B">
<input type="button" style="font-style: italic"onClick="bbTag(2)" value="I">
<input type="button" style="text-decoration: underline"onClick="bbTag(4)" value="U">
<input type="button" style="text-decoration: line-through" onClick="bbTag(6)" value="S">
<input type="button" onClick="bbTag(8)" value="URL">
<input type="button" onClick="bbTag(10)" value="Center">
<input type="button" onClick="bbTag(12)" value="Quote">
<input type="button" onClick="bbTag(14)" value="Code">
<input type="button" onClick="bbTag(16)" value="List">
<input type="button" onClick="bbTag(18)" value="Color">
<input type="color" id="text_color">
</div>
</div>
</div>
<div class="row">
<div class="tc1 tc2">
<div id="emoticons_buttons" style="display: none">
<img src="images/smiles/smile.gif" onmouseover="this.style.cursor='hand';" onclick="insertSmile(':)')" alt=":)">&nbsp;
<img src="images/smiles/cry.png" onmouseover="this.style.cursor='hand';" onclick="insertSmile(';(')" alt=";(">&nbsp;
<img src="images/smiles/sad.gif" onmouseover="this.style.cursor='hand';" onclick="insertSmile(':(')" alt=":(">&nbsp;
<img src="images/smiles/curve.gif" onmouseover="this.style.cursor='hand';" onclick="insertSmile(':curve:')" alt=":/">&nbsp;
<br>
<img src="images/smiles/neutral.gif" onmouseover="this.style.cursor='hand';" onclick="insertSmile(':|')" alt=":|">&nbsp;
<img src="images/smiles/lol.gif" onmouseover="this.style.cursor='hand';" onclick="insertSmile(':lol:')" alt=":lol:">&nbsp;
<img src="images/smiles/wink.gif" onmouseover="this.style.cursor='hand';" onclick="insertSmile(';)')" alt=";)">&nbsp;
<img src="images/smiles/cool.gif" onmouseover="this.style.cursor='hand';" onclick="insertSmile(':cool:')" alt=":cool:">&nbsp;
<br>
<img src="images/smiles/exclaim.gif" onmouseover="this.style.cursor='hand';" onclick="insertSmile(':!:')" alt=":!:">&nbsp;
<img src="images/smiles/tongue.gif" onmouseover="this.style.cursor='hand';" onclick="insertSmile(':P')" alt=":P">&nbsp;
<img src="images/smiles/roll.gif" onmouseover="this.style.cursor='hand';" onclick="insertSmile(':roll:')" alt=":roll:">&nbsp;
<img src="images/smiles/big_smile.gif" onmouseover="this.style.cursor='hand';" onclick="insertSmile(':D')" alt=":>">&nbsp;
<br>
<img src="images/smiles/evil.gif" onmouseover="this.style.cursor='hand';" onclick="insertSmile(':evil:')" alt=":evil:">&nbsp;
<img src="images/smiles/yikes.gif" onmouseover="this.style.cursor='hand';" onclick="insertSmile(':o')" alt=":o">&nbsp;
<img src="images/smiles/mad.gif" onmouseover="this.style.cursor='hand';" onclick="insertSmile(':mad:')" alt=":mad:">&nbsp;
<img src="images/smiles/redface.gif" onmouseover="this.style.cursor='hand';" onclick="insertSmile(':redface:')" alt=":redface:">&nbsp;
</div>
</div>
<div class="tc4 rc">
<textarea name="post" id="post" maxlength="5000" required title="3 characters minimum"><?= $this->TPL['post']; ?></textarea>
</div>
</div>
<div class="row">
<div class="tc1 lc">
&nbsp;
</div>
<div class="tc4 rc">
<input type="reset" value="Reset">
<input type="submit" name="preview" value="Preview">
<input type="submit" value="Submit">
</div>
</div>
</div>
</form>
</div>
<script type="text/javascript">
document.getElementById('js_msg').style.display = 'none';
document.getElementById('bbcode_buttons').style.display = 'block';
document.getElementById('emoticons_buttons').style.display = 'block';
</script>
<? require_once('./templates/overall_footer.tpl.php'); ?>

+ 83
- 0
templates/register_form.tpl.php View File

@ -0,0 +1,83 @@
<? require_once('./templates/overall_header.tpl.php'); ?>
<script src="templates/scripts/nick.js" type="text/javascript"></script>
<script type="text/javascript">
function checkForm()
{
value = document.getElementById('passwd').value;
value2 = document.getElementById('passwd_confirm').value;
if (value != value2)
{
alert("Password do not match!");
return false;
}
if (document.getElementById('nick-inuse').style.display == 'inline')
{
return false;
}
return true;
}
</script>
<div id="content">
<? if ($this->TPL['error_msg'] != '') { ?>
<div class="error_form">
<?= $this->TPL['error_msg']; ?>
</div>
<? } ?>
<br><form action="<?= $_SERVER['REQUEST_URI']; ?>" method="post" onsubmit="return checkForm();">
<div class="forum_table">
<div class="row">
<div class="hc1">Register</div>
<div class="hc4">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 lc">
Nick:
</div>
<div class="tc4 rc">
<input type="text" maxlength="30" name="nick" id="nick" value="<?= $this->TPL['nick']; ?>" required pattern=".{3,}" title="3 characters minimum" onblur="checkNick()">
<span id="nick-inuse" style="display: none; color: red; font-weight: bold">Nick is in use. Type another one.</span>
<span id="nick-free" style="display: none; color: green; font-weight: bold">Nick is free.</span>
</div>
</div>
<div class="row">
<div class="tc1 lc">
Password:
</div>
<div class="tc4 rc">
<input type="password" name="passwd" id="passwd" value="" required pattern=".{8,}" title="8 characters minimum">
</div>
</div>
<div class="row">
<div class="tc1 lc">
Confirm password:
</div>
<div class="tc4 rc">
<input type="password" name="passwd_confirm" id="passwd_confirm" value="" required pattern=".{8,}" title="8 characters minimum">
</div>
</div>
<div class="row">
<div class="tc1 lc">
Email address:
</div>
<div class="tc4 rc">
<input type="email" name="email" id="email" value="<?= $this->TPL['email']; ?>" required>
</div>
</div>
<div class="row">
<div class="tc1 lc">
&nbsp;
</div>
<div class="tc4 rc">
<input type="submit" value="Create account">
</div>
</div>
</div></form>
</div>
<? require_once('./templates/overall_footer.tpl.php'); ?>

+ 33
- 0
templates/scripts/chkcookie.js View File

@ -0,0 +1,33 @@
function create_cookie(name, value, days)
{
if (days)
{
var date = new Date();
date.setTime(date.getTime()+(days*24*3600*1000));
var expires ="; expires="+date.toGMTString();
}
else
var expires = "";
document.cookie += name+"="+value+expires+"; path=/";
}
function read_cookie(name)
{
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for (var i=0; i< ca.length; i++)
{
var c = ca[i];
while (c.charAt(0) == ' ') c = c.substring(1, c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
}
return null;
}
function erase_cookie(name)
{
create_cookie(name, "", -1);
}

+ 62
- 0
templates/scripts/nick.js View File

@ -0,0 +1,62 @@
var ajax;
function init() {
initAjax();
}
function initAjax() {
try
{
ajax = new XMLHttpRequest();
}
catch(e) // IE <= 6
{
var XmlHttpVersions = [
'MSXML2.XMLHTTP.6.0',
'MSXML2.XMLHTTP.5.0',
'MSXML2.XMLHTTP.4.0',
'MSXML2.XMLHTTP.3.0',
'MSXML2.XMLHTTP',
'Microsoft.XMLHTTP'
];
for (var i=0; i < XmlHttpVersions.length && null === ajax; i++)
{
try
{
ajax = new ActiveXObject(XmlHttpVersions[i]);
} catch (e) {}
}
if (null === ajax)
{
throw new Error('AJAX Error');
}
}
return true;
}
function response() {
if (ajax.readyState != 4 || ajax.status != 200)
return;
if (ajax.responseText == 'true')
{
document.getElementById('nick-inuse').style.display = 'inline';
document.getElementById('nick-free').style.display = 'none';
}
else
{
document.getElementById('nick-inuse').style.display = 'none';
document.getElementById('nick-free').style.display = 'inline';
}
}
function checkNick() {
if (ajax == null)
init();
if (document.getElementById('nick').value == '') return 0;
ajax.onreadystatechange = response;
ajax.open('GET', 'index.php?mode=checknick&nick=' + document.getElementById('nick').value);
ajax.send(null);
}

+ 70
- 0
templates/scripts/posting.js View File

@ -0,0 +1,70 @@
var bbcode = ['[b]', '[/b]', '[i]', '[/i]', '[u]', '[/u]', '[s]', '[/s]', '[url]', '[/url]', '[center]', '[/center]', '[quote]', '[/quote]', '[code]', '[/code]'];
function insertTag(first, second)
{
postArea = document.getElementById('post');
if (document.selection) // IE
{
postArea.focus();
sel = document.selection.createRange();
sel.text = first + sel.text + second;
}
else if (postArea.selectionStart || postArea.selectionStart == '0')
{
var startPos = postArea.selectionStart;
var endPos = postArea.selectionEnd;
if (startPos == endPos)
{
if (first == bbcode[8])
{
var link = prompt('Type hyperlink address', 'http://');
if (startPos != 0)
{
postArea.value = postArea.value.substring(0, startPos) + '[url=' + link + '] ' + postArea.value.substring(startPos, endPos) + second + postArea.value.substring(endPos, postArea.value.length);
}
else
{
postArea.value += '[url=' + link + '][/url]';
}
}
else
{
postArea.value += ' ' + first + second;
}
}
else
{
postArea.value = postArea.value.substring(0, startPos) + first + postArea.value.substring(startPos, endPos) + second + postArea.value.substring(endPos, postArea.value.length);
}
}
else
{
postArea.value += ' ' + first + second;
}
}
function bbTag(item)
{
if(item < bbcode.length -1)
{
insertTag(bbcode[item], bbcode[item+1]);
}
else
{
switch(item)
{
case 16:
var firstItem = prompt('Type first item list');
document.getElementById('post').value += "[list]\n[*]"+firstItem+"\n[/list]";
break;
case 18:
var color = document.getElementById('text_color').value;//prompt('Type font color', 'black');
insertTag('[color='+color+']', '[/color]');
}
}
}
function insertSmile(smile)
{
document.getElementById('post').value += ' ' + smile;
}

+ 415
- 0
templates/styles.css View File

@ -0,0 +1,415 @@
body {
font-family: Helvetica;
font-size: 11pt;
background-color: #E5E7E9;
}
#container {
width: 900px;
margin: 0 auto;
text-align: center;
border-collapse: collapse;
border-radius: 10px;
}
a, a:visited {
text-decoration: none;
}
img {
border: 0px;
}
a:hover {
text-decoration: underline;
}
a {
color: #000000;
}
#container #top {
width: 100%;
vertical-align: middle;
padding-top: 20px;
border-bottom: 1px solid #777777;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
}
#container #userpanel {
text-align: right;
font-size: 0.8em;
width: 100%;
}
#container #navi_bar {
padding-left: 10px;
text-align: left;
width: 98%;
word-wrap: break-word;
max-width: 98%;
}
#container #top h1 {
margin: 0px;
position: relative;
font-size: 36pt;
font-weight: bold;
}
#container #top h2 {
color: #005AE5;
font-size: 20px;
text-decoration: none;
font-weight: bold;
}
#container #footer {
width: 100%;
font-size: 8pt;
color: #FFFFFF;
height: 18px;
line-height: 18px;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
box-shadow: 0 8px 6px -6px black;
}
#container #footer a {
color: #FFFFFF;
}
#contanier #footer a:visited {
color: #FFFFFF;
}
#container #content {
text-align: left;
min-height: 200px;
padding: 10px;
}
#container #content h3 {
margin-left: 20px;
color: gray;
font-size: 1.5em;
}
#container #menu {
text-align: center;
margin: 0 auto;
width: 100%;
height: 50px;
background-color: #99CCFF;
}
#container #menu ul {
list-style-type: none;
margin: 0px;
padding: 0px;
}
#container #menu li {
display: inline-block;
border-right: 1px #9A9A9A solid;
height: 37px;
width: 120px;
padding-top: 13px;
margin: auto -4px auto auto;
}
#container #menu li a {
color: #FFFFFF;
font-weight: bold;
font-family: Verdana;
font-size: 14px;
font-weight: bold;
}
#container #menu li:last-child {
border: 0px;
}
.sect {
color: #434354;
font-family: Verdana;
font-size: 10pt;
font-weight: bold;
text-decoration: none;
}
.navigation {
text-decoration: none;
font-size: 12px;
font-weight: bold;
}
.forum_table {
display: table;
width: 100%;
border-collapse: separate;
box-shadow: 0 8px 6px -6px black;
}
.fsmall {
color: #434354;
font-size: 8pt;
text-decoration: none;
}
.row {
display: table-row;
width: 100%;
}
.rcol {
display: table-caption;
border-collapse: collapse;
background-color: #e1f0ff;
padding: 3px;
vertical-align: middle;
border-top: 0px;
caption-side: bottom;
text-align: center;
font-style: italic;
}
.tc1, .tc2, .tc3, .tc4 {
display: table-cell;
background-color: #F0F8FF;
padding: 3px;
vertical-align: middle;
word-wrap: break-word;
}
.tc1 {
max-width: 150px;
}
.tc2, .tc3 {
vertical-align: middle;
text-align: center;
max-width: 150px;
}
.tc4 {
text-align: center;
vertical-align: middle;
width: 150px;
max-width: 150px;
}
.hc1, .hc2, .hc3, .hc4 {
color: #FFFFFF;
font-weight: bold;
background-color: yellow;
vertical-align: middle;
display: table-cell;
padding-left: 15px;
height: 30px;
word-wrap: break-word;
}
.hc1 {
border-top-left-radius: 10px;
max-width: 150px;
}
.hc4 {
border-top-right-radius: 10px;
width: 150px;
}
.tab_desc {
text-align: center;
font-weight: bold;
background-image: url('images/td_beam_top.gif');
height: 19px;
}
.lc {
width: 30%;
text-align: right;
margin-right: 10px;
}
.rc {
width: 70%;
text-align: left;
margin-left: 10px;
}
.rc input[type="text"], input[type="password"], input[type="email"] {
width: 200px;
}
input[type="button"], input[type="reset"], input[type="submit"] {
border-radius: 5px;
padding: 5px;
min-width: 30px;
font-size: 12px;
cursor: pointer;
}
#signature {
width: 490px;
height: 60px;
resize: vertical;
}
#post {
width: 490px;
height: 180px;
resize: vertical;
}
#signature, #post, input[type="text"], input[type="password"], input[type="email"], select {
border-radius: 5px;
border: 1px solid #C7E2FB;
min-height: 20px;
font-size: 12px;
background-color: #FFFFE8;
}
.error_form {
margin: 0 auto;
text-align: center;
width: 90%;
border: 1px solid #FF0000;
background-color: #FFCC99;
padding: 10px;
color: #FF0000;
border-radius: 10px;
font-weight: bold;
}
.fadmin, .fmod {
font-weight: bold;
}
.fmod {
color: darkgreen;
}
.fadmin {
color: orange;
}
.btn {
display: block;
width: 90px;
height: 30px;
color: #FFFFFF;
font-weight: bold;
text-align: center;
font-size: 1em;
border-radius: 10px;
line-height: 30px;
box-shadow: 0 8px 6px -6px black;
}
.btn:hover, .btn_small:hover {
color: #FFFFFF;
}
.btn_small {
display: block;
width: 60px;
height: 20px;
color: #FFFFFF;
font-weight: bold;
text-align: center;
font-size: 0.8em;
border-radius: 10px;
margin: 0 auto;
line-height: 20px;
margin-bottom: 5px;
box-shadow: 0 8px 6px -6px black;
}
.ut {
padding: 0px;
border-left: 0px;
}
.tc2 .forum_table .tc1, .tc2 .forum_table .tc2, .tc2 .forum_table .tc3 {
border-bottom: 0px !important;
border-top: 1px solid lightgray;
}
.mod_pool {
margin: 0 auto;
width: 90%;
background-color: #FFFF99;
text-align: center;
padding: 5px;
border: 1px solid orange;
border-radius: 10px;
}
hr {
border: 0;
border-bottom: 1px dashed #ccc;
background: #999;
width: 50%;
margin: 0;
margin-top: 5px;
}
.hcpost {
height: 10px;
}
.f_hc4 {
text-align: right;
padding-right: 10px;
}
.post_3c {
width: 120px;
}
.f_tc2 {
width: 120px;
vertical-align: top;
height: 150px;
text-align: center;
}
.topic_mod {
width: 80px;
float: right;
}
.p_uinfo {
width: 38%;
}
.post_content {
vertical-align: top;
position: relative;
text-align: left;
max-width: 500px;
}
.row .hcpost a {
color: #FFFFFF;
}
.qpost {
background-color: #DDDAC5;
width: 95%;
font-style: italic;
box-shadow: 7px 8px 6px -3px gray;
padding: 5px;
}
.cpost {
background-color: #C5DDCC;
width: 95%;
font-family: Courier New;
box-shadow: 7px 8px 6px -3px gray;
padding: 5px;
}

+ 65
- 0
templates/userlist.tpl.php View File

@ -0,0 +1,65 @@
<? require_once('./templates/overall_header.tpl.php'); ?>
<div id="content">
<br />
<div class="forum_table">
<div class="row">
<div class="hc1">Users list</div>
<div class="hc2" style="width: 180px">&nbsp;</div>
<div class="hc3" style="width: 180px">&nbsp;</div>
<div class="hc4" style="width: 100px">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 tab_desc">Username</div>
<div class="tc3 tab_desc" style="width: 180px">Joined</div>
<div class="tc3 tab_desc" style="width: 180px">Last visit</div>
<div class="tc4 tab_desc" style="width: 100px">Posts</div>
</div>
<?
for ($i=0; $i<count($this->TPL['users_list']); $i++)
{
echo '<div class="row">'."\n";
echo "\t\t\t".'<div class="tc1 tc3">
<a href="index.php?mode=viewprofile&amp;id='.$this->TPL['users_list'][$i]['user_id'].'">
'.$this->colorRank($this->TPL['users_list'][$i]['nick'], $this->TPL['users_list'][$i]['rank']).'
</a>
</div>'."\n";
echo "\t\t\t".'<div class="tc3">'.$this->TPL['users_list'][$i]['regdate'].'</div>'."\n";
echo "\t\t\t".'<div class="tc3">'.(($this->TPL['users_list'][$i]['lastvisit']!= null) ? $this->TPL['users_list'][$i]['lastvisit'] : 'Never').'</div>'."\n";
echo "\t\t\t".'<div class="tc4" style="width: 100px">'.$this->TPL['users_list'][$i]['post_count'].'</div>'."\n";
echo "\t\t".'</div>'."\n";
}
?>
</div>
<br>
<div class="forum_table">
<div class="row">
<div class="hc1 hc4 hcpost">Options</div>
</div>
<div class="row">
<div class="tc1 tc4">
<form action="<?= $_SERVER['REQUEST_URI']; ?>" method="post">
Sort users by:
<select name="sort_type">
<option value="regdate" <?= $this->TPL['regdate_selected']; ?>>Registration date</option>
<option value="lastvisit" <?= $this->TPL['lastvisit_selected']; ?>>Lastvisit</option>
<option value="nick" <?= $this->TPL['username_selected']; ?>>Username</option>
<option value="post_count" <?= $this->TPL['posts_selected']; ?>>Posts count</option>
</select>
&nbsp;&nbsp;&nbsp;
<input type="checkbox" name="sort_desc" value="Delete avatar" <?= $this->TPL['desc_checked']; ?> />Descending
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="Sort">
</form>
</div>
</div>
<div class="row">
<div class="tc1 tc4">Select only users with rank:
<a href="index.php?mode=userlist&amp;rank=admin"><?= $this->getRankLevel(RANK_ADMIN); ?></a> &bull;
<a href="index.php?mode=userlist&amp;rank=mod"><?= $this->getRankLevel(RANK_MOD); ?></a> &bull;
<a href="index.php?mode=userlist&amp;rank=user"><?= $this->getRankLevel(RANK_USER); ?></a></div>
</div>
</div>
</div>
<? require_once('./templates/overall_footer.tpl.php'); ?>

+ 74
- 0
templates/viewforum.tpl.php View File

@ -0,0 +1,74 @@
<? require_once('./templates/overall_header.tpl.php'); ?>
<div id="content">
<? if ($this->TPL['forum_info']['locked'] == false) { ?>
<a href="index.php?mode=newtopic&amp;id=<?= $_GET['id']; ?>" class="btn">New Topic</a>
<? } else { ?>
<div class="btn">
Locked
</div>
<? } ?>
<br />
<div class="forum_table">
<div class="row">
<div class="hc1"><?= $this->TPL['f_name']; ?></div>
<div class="hc2" style="width: 150px">&nbsp;</div>
<div class="hc3" style="width: 80px">&nbsp;</div>
<div class="hc4">&nbsp;</div>
</div>
<div class="row">
<div class="tc1 tab_desc">Topic name</div>
<div class="tc2 tab_desc" style="width: 150px">Author</div>
<div class="tc3 tab_desc" style="width: 80px">Replies</div>
<div class="tc4 tab_desc">Last Post</div>
</div>
<?
for ($i=0; $i<count($this->TPL['topics_list']); $i++)
{
echo '<div class="row">'."\n";
echo "\t\t\t".'<div class="tc1"><a href="index.php?mode=viewtopic&amp;id='.$this->TPL['topics_list'][$i]['topic_id'].'" class="sect">'.$this->TPL['topics_list'][$i]['topic_title'].'</a></div>'."\n";
echo "\t\t\t".'<div class="tc2" style="width: 150px">';
if ($this->TPL['topics_list'][$i]['user_id'] != null)
echo '<a href="index.php?mode=viewprofile&amp;id='.$this->TPL['topics_list'][$i]['user_id'].'">'.$this->colorRank($this->TPL['topics_list'][$i]['user_nick'], $this->TPL['topics_list'][$i]['user_rank']).'</a>';
else
echo 'Anonymous';
echo '</div>'."\n";
echo "\t\t\t".'<div class="tc3" style="width: 80px">'.($this->TPL['topics_list'][$i]['post_count']-1).'</div>'."\n";
if ($this->TPL['topics_list'][$i]['lastpost_post_id'] != null)
{
$lastpost = '<span class="fsmall"> <span style="font-weight: bold">'.$this->TPL['topics_list'][$i]['lastpost_date'].'</span><br><a href="index.php?mode=viewtopic&amp;id='.$this->TPL['topics_list'][$i]['topic_id'].'#p'.$this->TPL['topics_list'][$i]['lastpost_post_id'].'" style="font-weight: bold">Post #'.$this->TPL['topics_list'][$i]['lastpost_post_id'].'</a>: ';
if ($this->TPL['topics_list'][$i]['lastpost_user_id'] != null)
$lastpost .= '<a href="index.php?mode=viewprofile&amp;id='.$this->TPL['topics_list'][$i]['lastpost_user_id'].'">'.$this->colorRank($this->TPL['topics_list'][$i]['lastpost_user_nick'], $this->TPL['topics_list'][$i]['lastpost_user_rank']).'</a>';
else
$lastpost .= 'Anonymous';
$lastpost .= '</span>';
}
else
{
$lastpost = 'No posts.';
}
echo "\t\t\t".'<div class="tc4">'.$lastpost.'</div>'."\n";
echo "\t\t".'</div>'."\n";
}
?>
<?
if (count($this->TPL['topics_list']) == 0)
{
echo '<div class="rcol">No topics in this forum.</div>';
}
?>
</div>
<br>
<? if ($this->TPL['forum_info']['locked'] == false) { ?>
<a href="index.php?mode=newtopic&amp;id=<?= $_GET['id']; ?>" class="btn">New Topic</a>
<? } else { ?>
<div class="btn">
Locked
</div>
<? } ?>
</div>
<? require_once('./templates/overall_footer.tpl.php'); ?>

+ 65
- 0
templates/viewprofile.tpl.php View File

@ -0,0 +1,65 @@
<? require_once('./templates/overall_header.tpl.php'); ?>
<script src="templates/scripts/nick.js" type="text/javascript"></script>
<div id="content">
<br>
<div class="forum_table">
<div class="row">
<div class="hc1"><?= $this->TPL['user_info']['nick']; ?></div>
<div class="hc4 hcpost f_hc4">
<? if ($_GET['id'] == $this->TPL['logged_id']) {?>
<a href="index.php?mode=editprofile">Edit my profile &raquo;</a>
<? } else { ?> &nbsp; <? } ?>
</div>
</div>
<div class="row">
<div class="tc1 tc2">
<?
if ($this->TPL['user_info']['avatar'] != null)
echo '<img src="'.$this->TPL['user_info']['avatar'].'" alt="user avatar">';
else
echo '<img src="templates/images/no_av.gif" alt="user avatar">';
?>
</div>
<div class="tc4 rc">
Joined: <span style="font-weight: bold"><?= $this->TPL['user_info']['regdate']; ?></span><br>
Last visit: <span style="font-weight: bold"><?= (($this->TPL['user_info']['lastvisit']!= null) ? $this->TPL['user_info']['lastvisit'] : 'Never') ?></span><br>
Posts: <span style="font-weight: bold"><?= $this->TPL['user_info']['post_count']; ?></span>; <span style="font-weight: bold"><?= $this->TPL['post_ratio']; ?>%</span> of total.<br>
Location: <span style="font-weight: bold"><?= $this->TPL['user_info']['location']; ?></span><br>
</div>
</div>
<div class="row">
<div class="tc1 lc">
<a href="mailto:<?= $this->TPL['user_info']['email']; ?>" class="btn_small">Email</a>
</div>
<div class="tc4 rc">
Status: <img src="templates/images/<? echo (($this->TPL['user_info']['user_IP']) ? 'online' : 'offline'); ?>.gif" alt="user status"><br>
Rank: <span style="font-weight: bold"><?= $this->getRankLevel($this->TPL['user_info']['rank']); ?>
</div>
</div>
</div>
<br>
<? if ($this->TPL['user_info']['signature'] != null) { ?>
<div class="forum_table">
<div class="row">
<div class="hc1 hc4"><?= $this->TPL['user_info']['nick']; ?>'s signature</div>
</div>
<div class="row">
<div class="tc1 tc4" style="text-align: left; max-width: 870px">
<span class="fsmall"><?= BBCode($this->TPL['user_info']['signature']); ?></span>
</div>
</div>
</div>
<? } ?>
</div>
<? require_once('./templates/overall_footer.tpl.php'); ?>

+ 127
- 0
templates/viewtopic.tpl.php View File

@ -0,0 +1,127 @@
<? require_once('./templates/overall_header.tpl.php'); ?>
<div id="content">
<? if ($this->TPL['topic_info']['forum_locked'] == false && $this->TPL['topic_info']['topic_locked'] == false) { ?>
<a href="index.php?mode=reply&amp;id=<?= $_GET['id']; ?>" class="btn">Reply</a>
<? } else { ?>
<div class="btn">
Locked
</div>
<? } ?>
<br />
<?php
for ($i=0; $i<count($this->TPL['posts_list']); $i++)
{
echo '
<div class="forum_table">
<div class="row">
<div class="hc1 hcpost" style="width: 120px">&nbsp;</div>
<div class="hc2 hcpost">&nbsp;</div>
<div id="p'.$this->TPL['posts_list'][$i]['post_id'].'" class="hc4 hcpost f_hc4 post_3c">Post <a href="index.php?mode=viewtopic&amp;id='.$_GET['id'].'#p'.$this->TPL['posts_list'][$i]['post_id'].'">#'.($i+1).'</a></div>
</div>
<div class="row">
<div class="tc1 f_tc2" style="width: 120px">';
if ($this->TPL['posts_list'][$i]['nick'] != null)
echo '<a href="index.php?mode=viewprofile&amp;id='.$this->TPL['posts_list'][$i]['user_id'].'">'.$this->colorRank($this->TPL['posts_list'][$i]['nick'], $this->TPL['posts_list'][$i]['user_rank']).'</a>';
else
echo 'Anonymous';
echo '<br>';
if ($this->TPL['posts_list'][$i]['avatar'] != null)
echo '<img src="'.$this->TPL['posts_list'][$i]['avatar'].'" alt="user avatar">';
else
echo '<img src="templates/images/no_av.gif" alt="user avatar">';
echo '
</div>
<div class="tc3 post_content" >';
echo BBCode($this->TPL['posts_list'][$i]['content']);
if ($this->TPL['posts_list'][$i]['signature'] != null)
echo '
<br><br>
<hr>
<span class="fsmall">'.BBCode($this->TPL['posts_list'][$i]['signature']).'<br><br></span>';
echo '
</div>
<div class="tc4 post_3c f_tc2" style="width: 120px">
<span class="fsmall">Posted: <span style="font-weight: bold">'.$this->TPL['posts_list'][$i]['date'].'</span></span><br>
<a href="index.php?mode=quote&amp;id='.$_GET['id'].'&amp;q='.$this->TPL['posts_list'][$i]['post_id'].'" class="btn_small">Quote</a>';
if ($this->TPL['my_id'] == $this->TPL['posts_list'][$i]['user_id'] && $this->TPL['posts_list'][$i]['user_id'] != null)
echo '
<a href="index.php?mode=editpost&amp;id='.$this->TPL['posts_list'][$i]['post_id'].'" class="btn_small">Edit</a>';
echo '<br>';
if ($this->TPL['my_rank'] >= RANK_MOD)
{
echo '
<div class="mod_pool">
<span style="font-weight: bold" class="fsmall">Mod options<br><br></span>
<a href="index.php?mode=editpost&amp;id='.$this->TPL['posts_list'][$i]['post_id'].'" class="btn_small">Edit</a>';
if ($this->TPL['topic_info']['post_count'] > 1)
echo '
<a href="index.php?mode=moderate&amp;submode=deletepost&amp;id='.$this->TPL['posts_list'][$i]['post_id'].'" class="btn_small" style="width: 35px">X</a>';
echo '</div>';
}
echo '
</div>
</div>
<div class="row">
<div class="tc1 post_3c tc2">
<span class="fsmall">Status: <img src="templates/images/'.(($this->TPL['posts_list'][$i]['user_IP']) ? 'online' : 'offline').'.gif" alt="user status"></span>
</div>
<div class="tc2 ut">
<div class="forum_table" style="box-shadow: none">
<div class="tc2 ">
<span class="fsmall">Posts: <span style="font-weight: bold">'.(($this->TPL['posts_list'][$i]['user_post_count']!== null) ? $this->TPL['posts_list'][$i]['user_post_count'] : '0').'</span></span>
</div>
<div class="tc2 p_uinfo">
<span class="fsmall">Joined: <span style="font-weight: bold">'.(($this->TPL['posts_list'][$i]['regdate']!= null) ? $this->TPL['posts_list'][$i]['regdate'] : 'Never').'</span></span>
</div>
<div class="tc3 p_uinfo">
<span class="fsmall">Last visit: <span style="font-weight: bold">'.(($this->TPL['posts_list'][$i]['lastvisit']!= null) ? $this->TPL['posts_list'][$i]['lastvisit'] : 'Never').'</span></span>
</div>
</div>
</div>
<div class="tc4 post_3c"><span class="fsmall">Rank: '.$this->getRankLevel($this->TPL['posts_list'][$i]['user_rank']).'</span></div>
</div>
</div>
<br>';
}
?>
<? if ($this->TPL['topic_info']['forum_locked'] == false && $this->TPL['topic_info']['topic_locked'] == false) { ?>
<a href="index.php?mode=reply&amp;id=<?= $_GET['id']; ?>" class="btn">Reply</a>
<? } else { ?>
<div class="btn">
Locked
</div>
<? } ?>
<? if ($this->TPL['my_rank'] >= RANK_MOD) { ?>
<div class="forum_table topic_mod" style="">
<div class="row">
<div class="hc1 hc4 hcpost" style="padding: 0px; text-align: center">Actions</div>
</div>
<div class="row">
<div class="tc1 tc4">
<a href="index.php?mode=moderate&amp;submode=deletetopic&amp;id=<?= $_GET['id']; ?>">
<img src="templates/images/delete.gif" alt="delete">
</a>
<a href="index.php?mode=moderate&amp;submode=locktopic&amp;id=<?= $_GET['id']; ?>">
<img src="templates/images/<? if ($this->TPL['topic_info']['topic_locked']) echo 'un'; ?>lock.gif" alt="lock">
</a>
<a href="index.php?mode=moderate&amp;submode=movetopic&amp;id=<?= $_GET['id']; ?>">
<img src="templates/images/move.gif" alt="move">
</a>
</div>
</div>
</div>
<? } ?>
<div style="clear: both">&nbsp;</div>
</div>
<? require_once('./templates/overall_footer.tpl.php'); ?>

Loading…
Cancel
Save