A lightweight forum engine written in PHP. Repository is now obsolete and read-only. http://www.pioder.pl/uforum.html
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

99 lines
2.4 KiB

<?php
/**
* @package uForum
* @file includes/admin/class_main.php
* @version $Id$
* @copyright 2009(c) PioDer <[email protected]>
* @link http://pioder.gim2przemysl.int.pl/
* @license GNU GPL v3
**/
if ( !defined('IN_uF') )
{
die('Hacking attempt');
}
class Admin_Over
{
function ListPages($page, $count = 50)//for edit profile, not used in limit!
{
$content = '';
for ($i=1;$i<=$count;$i++)
{
if ($i==$page)
{
$content .= '<option value="'.$i.'" selected="selected">'.$i.'</option>';
}
else
{
$content .= '<option value="'.$i.'">'.$i.'</option>';
}
}
return $content;
unset($content);
}
function ListDir($dir, $selection)
{
$result='';
$rep=opendir('./../'.$dir);
while ($file = readdir($rep))
{
if($file != '..' && $file !='.' && $file !='' && $file[0] != '.')
{
if (is_dir('./../'.$dir.'/'.$file)){
if ($file==$selection)
{
$result .='<option value="'.$file.'" selected="selected">'.$file.'</option>';
}
else
{
$result .='<option value="'.$file.'">'.$file.'</option>';
}
}
}
}
return $result;
unset($rep, $file, $result);
}
function DefaultLang()
{
global $forum_config;
if ($_SESSION['uid']>0)
{
return User::UserInformation($_SESSION['uid'],'lang');
}
else
{
return $forum_config['defaultlang'];
}
}
function TotalTopics()
{
$sql = "SELECT `t_id` FROM ".TOPICS_TABLE.";";
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain total posts information');
$result = DataBase::num_rows($query);
return($result);
}
function TotalPosts()
{
$sql = "SELECT `p_id` FROM ".POSTS_TABLE.";";
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain total posts information');
$result = DataBase::num_rows($query);
return($result);
}
function GenerateHeader()
{
global $default_skin;
global $lng;
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" href="skins/'.$default_skin.'/images/favicon.ico">
<link rel="favicon" href="template/images/favicon.ico">
<link rel="stylesheet" href="template/skin.css" type="text/css">
<title>DSF Administration</title>
</head>
<body class="body">';
}
}
?>