Browse Source

+ Censorlist was extended - added replacement parametr

+ Fixed bug with DB Size in check_script.php
+ Deleted a lot of indexes in check_script_data.php
+ Deleted cache index and forum lastpost section in cache_index.php and cache_forum.php
+ Fixed other bugs in warnings
+ Fixed pagination in search.php
+ Replaced DSF logo to uForum logo
+ Moved differend elements in skin
+ Added "WHOIS" option in "Admin/Mod Pool" in view topic
+ Fixed bug in add warnings: couldn't add warn for admin/mod

git-svn-id: https://svn.pioder.pl/uf-svn/uF@29 72ec579a-5ced-4fa4-82f3-afba5d98df2f
master
pioder 15 years ago
parent
commit
b157d6653e
30 changed files with 227 additions and 127 deletions
  1. +11
    -4
      admin/censorlist.php
  2. +1
    -0
      admin/check_script.php
  3. +0
    -27
      admin/check_script_data.php
  4. +8
    -0
      admin/template/censorlist_add_edit_body.tpl
  5. +4
    -1
      admin/template/censorlist_list_word.tpl
  6. +4
    -2
      common.php
  7. +1
    -1
      config.php
  8. +0
    -16
      includes/cache/cache_forums.php
  9. +4
    -2
      includes/cache/cache_index.php
  10. +17
    -8
      includes/cache/cache_topic.php
  11. +27
    -0
      includes/classes/class_user.php
  12. +2
    -2
      includes/classes/secure.php
  13. +0
    -1
      includes/db.php
  14. +4
    -4
      includes/misc_functions.php
  15. +3
    -2
      lngs/Polish/admin.php
  16. +1
    -0
      lngs/Polish/main.php
  17. +3
    -1
      posting.php
  18. +83
    -30
      search.php
  19. BIN
      skins/subPurple/images/Thumbs.db
  20. BIN
      skins/subPurple/images/dsf_logo.gif
  21. BIN
      skins/subPurple/images/td_category.jpg
  22. BIN
      skins/subPurple/images/td_category_left.gif
  23. BIN
      skins/subPurple/images/td_category_right.gif
  24. BIN
      skins/subPurple/images/uf_logo.gif
  25. +2
    -2
      skins/subPurple/index_category_add.tpl
  26. +2
    -2
      skins/subPurple/overall_header.tpl
  27. +31
    -9
      skins/subPurple/search_end_body.tpl
  28. +7
    -8
      skins/subPurple/topic_post_body.tpl
  29. +5
    -5
      topic.php
  30. +7
    -0
      warns.php

+ 11
- 4
admin/censorlist.php View File

@ -57,7 +57,7 @@ switch($_GET['mode'])
for($i=0;$i<count($item);$i++)
{
$word = $item[$i];
DataBase::sql_query("INSERT INTO ".CENSORLIST_TABLE." VALUES ('$last','$word')",GENERAL,'Could not add censored word.');
DataBase::sql_query("INSERT INTO ".CENSORLIST_TABLE." VALUES ('$last','$word','[censored]')",GENERAL,'Could not add censored word.');
$last = $last +1;
}
admin_message_forum($lng['words_added'],'censorlist.php');
@ -90,20 +90,23 @@ switch($_GET['mode'])
if (isset($_POST['word']))
{
$word = strip_tags($_POST['word']);
$replace = (strlen($_POST['replace']) > 0) ? $_POST['replace'] : '[censored]';
$sql = "SELECT `w_id` FROM ".CENSORLIST_TABLE." ORDER BY `w_id` DESC";
$last = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain last word id'));
$last = $last['w_id'];
$last= $last +1;
DataBase::sql_query("INSERT INTO ".CENSORLIST_TABLE." VALUES ('$last','$word')",GENERAL,'Could not add censored word.');
DataBase::sql_query("INSERT INTO ".CENSORLIST_TABLE." VALUES ('$last','$word','$replace')",GENERAL,'Could not add censored word.');
admin_message_forum($lng['word_added'],'censorlist.php');
}
else
{
$_POST['word']='';
$_POST['replace']='';
$skin = array(
'action'=>'censorlist.php?mode=addword',
'L.main_beam'=>$lng['add_word'],
'L.word_name'=>$lng['word_name'],
'L.replace_to'=>$lng['replace_to'],
'L.save'=>$lng['submit'],
'L.reset'=>$lng['reset'],
'L.censorlist'=>$lng['admin_censorlist']
@ -120,7 +123,8 @@ switch($_GET['mode'])
{
$word = strip_tags(trim($_POST['word']));
$wid = intval($_GET['w']);
DataBase::sql_query("UPDATE ".CENSORLIST_TABLE." SET `word`='$word' WHERE `w_id`='$wid'",GENERAL,'Could not update censored word.');
$replace = $_POST['replace'];
DataBase::sql_query("UPDATE ".CENSORLIST_TABLE." SET `word`='$word', `replace`='$replace' WHERE `w_id`='$wid'",GENERAL,'Could not update censored word.');
admin_message_forum($lng['word_edited'],'censorlist.php?mode=view');
}
else
@ -130,10 +134,12 @@ switch($_GET['mode'])
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain censorlist words');
$result = DataBase::fetch($query);
$_POST['word']=$result['word'];
$_POST['replace']=$result['replace'];
$skin = array(
'action'=>'censorlist.php?mode=edit&w='.$wid,
'L.main_beam'=>$lng['edit_word'],
'L.word_name'=>$lng['word_name'],
'L.replace_to'=>$lng['replace_to'],
'L.save'=>$lng['submit'],
'L.reset'=>$lng['reset'],
'L.censorlist'=>$lng['admin_censorlist']
@ -171,11 +177,12 @@ switch($_GET['mode'])
{
$skin = array(
'L.word_name'=>$item['word'],
'L.word_replacement'=>$item['replace'],
'w_id'=>$item['w_id'],
'L.delete'=>$lng['delete'],
'L.edit'=>$lng['edit'],
);
include('./template/censorlist_word_add.tpl');
include('./template/censorlist_list_word.tpl');
}
}
include('./template/overall_footer.tpl');

+ 1
- 0
admin/check_script.php View File

@ -66,6 +66,7 @@ function db_size()
while ($result = DataBase::fetch($query))
{
$db_size += $result['Index_length'];
$db_size += $result['Data_length'];
}
$db_size = $db_size / 1024;
if ($db_size >=1024)

+ 0
- 27
admin/check_script_data.php View File

@ -13,49 +13,22 @@ if ( !defined('IN_uF') )
}
//size files in md5
$size_md5['../common.php'] = '426f990b332ef8193a61cc90516c1245';
$size_md5['../eprofile.php'] = '1868f17c2c15b5eafdc3cce2f5ac97d5';
$size_md5['../forum.php'] = 'acf666483bc8723fae7feda6f6a9cb7a';
$size_md5['../groups.php'] = '6b493230205f780e1bc26945df7481e5';
$size_md5['../index.php'] = 'd71f5142463efcf6dc7be216cf4644b5';
$size_md5['../login.php'] = 'e275193bc089e9b3ca1aeef3c44be496';
$size_md5['../moderate.php'] = '6562c5c1f33db6e05a082a88cddab5ea';
$size_md5['../pms.php'] = 'f22e4747da1aa27e363d86d40ff442fe';
$size_md5['../posting.php'] = 'f5dffc111454b227fbcdf36178dfe6ac';
$size_md5['../search.php'] = '3016a447172f3045b65f5fc83e04b554';
$size_md5['../shoutbox.php'] = '102f0bb6efb3a6128a3c750dd16729be';
$size_md5['../quick_reply.php'] = '7a53928fa4dd31e82c6ef826f341daec';
$size_md5['../register.php'] = '14f2ebeab937ca128186e7ba876faef9';
$size_md5['../topic.php'] = 'b0bf8b3daf61246d13276dc8dcdfb87d';
$size_md5['../user.php'] = 'bf56a1b37b94243486b2034f8479c475';
$size_md5['../users.php'] = '7990ec44fcf3d7a0e5a2add28362213c';
$size_md5['../warns.php'] = '9570efef719d705326f0ff817ef084e6';
$size_md5['../includes/db.php'] = 'a376033f78e144f494bfc743c0be3330';
$size_md5['../includes/emailer.php'] = 'e37b08dd3015330dcbb5d6663667b8b8';
$size_md5['../includes/errors.php'] = '8232e119d8f59aa83050a741631803a6';
$size_md5['../includes/classes/class_forum.php'] = '87f7ee4fdb57bdfd52179947211b7ebb';
$size_md5['../includes/classes/class_mod.php'] = '4764f37856fc727f70b666b8d0c4ab7a';
$size_md5['../includes/classes/class_pms.php'] = '850af92f8d9903e7a4e0559a98ecc857';
$size_md5['../includes/misc_functions.php'] = '92c3d054835eff3d5a7f7ed731d2a3db';
$size_md5['../includes/classes/class_posting.php'] = '9c72e0c8882794b79d65f14776a0a974';
$size_md5['../includes/class_shoutbox.php'] = 'cd14821dab219ea06e2fd1a2df2e3582';
$size_md5['../includes/classes/class_topic.php'] = '48f7d3043bc03e6c48a6f0ebc0f258a8';
$size_md5['../includes/classes/class_user.php'] = '2d5951d1e3b31dfb7fd2dcc172df17fd';
$size_md5['../includes/constants.php'] = 'fc79250f8c5b804390e8da280b4cf06e';
$size_md5['../includes/msgs_delete.php'] = '571e0f7e2d992e738adff8b1bd43a521';
$size_md5['../includes/msgs_folder.php'] = 'd756d3d2b9dac72449a6a6926534558a';
$size_md5['../includes/msgs_view.php'] = '291d43c696d8c3704cdbe0a72ade5f6c';
$size_md5['../includes/msgs_write.php'] = 'b0b79da57b95837f14be95aaa4d54cf8';
$size_md5['../includes/classes/secure.php'] = 'a084f26f690dbc23a52e67027693f2b2';
$size_md5['../includes/sessions.php'] = 'e91068fff3d7fa1594dfdf3b4308433a';
$size_md5['../includes/sql_parse.php'] = '4a1590df1d5968d41b855005bb8b67bf';
$size_md5['../includes/admin/class_forum.php'] = 'e205ee2a5de471a70c1fd1b46033a75f';
$size_md5['../includes/admin/class_main.php'] = '65ae450c5536606c266f49f1c08321f2';
$size_md5['../includes/cache/cache_index.php'] = '88a839f2f6f1427879fc33ee4acf4f66';
$size_md5['../includes/cache/cache_forums.php'] = '6ef80bb237adf4b6f77d0700e1255907';
$size_md5['../includes/cache/cache_topic.php'] = '9a11883317fde3aef2e2432a58c86779';
$script_files = array_keys($size_md5);

+ 8
- 0
admin/template/censorlist_add_edit_body.tpl View File

@ -24,6 +24,14 @@
<input type="text" name="word" style="width: 200px" value="<?= $_POST['word']; ?>">
</td>
</tr>
<tr>
<td align="right" class="fitem">
<span class="fstandard"><b><?php echo $skin['L.replace_to']; ?>:</b></span>
</td>
<td class="fitem" >
<textarea name="replace" style="width: 400px; height: 100px"><?= $_POST['replace']; ?></textarea>
</td>
</tr>
<tr>
<td width="738" height="20" class="fitem" align="center" valign="top" colspan="2">
<input type="submit" class="fbutton" value="<?php echo $skin['L.save']; ?>" />&nbsp;

admin/template/censorlist_word_add.tpl → admin/template/censorlist_list_word.tpl View File

@ -1,7 +1,10 @@
<table class="maintable" width="<?= TABLES_WIDTH; ?>">
<tr>
<td width="668" height="7" class="fitem">
<td height="7" class="fitem">
<span class="fstandard"><?= $skin['L.word_name']; ?></span>
</td>
<td width="500" height="7" class="fitem">
<span class="fstandard"><?= $skin['L.word_replacement']; ?></span>
</td>
<td width="40" height="7" class="fitem" align="center">
<a href="censorlist.php?mode=edit&w=<?= $skin['w_id']; ?>" class="fstandard">

+ 4
- 2
common.php View File

@ -47,6 +47,8 @@ else
}
}
define('TABLES_WIDTH',$forum_config['tables_width']);
//check for banned user
if ($_SESSION['uid']>0)
{
@ -60,7 +62,7 @@ if ($_SESSION['uid']>0)
if (($db_ip==$ip) || ($db_uid==$uid))
{
include('./includes/misc_functions.php');
include('./lngs/'.DefaultLang().'/main.php');
include('./lngs/'.DefaultLang(true).'/main.php');
SessDelete($_SESSION['uid']);
$_SESSION['uid']='0';
message_forum($motive,'index.php', '10');
@ -80,7 +82,7 @@ $query = DataBase::sql_query($sql, GENERAL,'Could not obtain loged user informat
$userdata = DataBase::fetch($query);
define('RANK', $userdata['rank']);
define('TABLES_WIDTH',$forum_config['tables_width']);
//protect of database - add the backslashes
/*foreach ($_POST as $name => $value)
{

+ 1
- 1
config.php View File

@ -13,6 +13,6 @@ define('DB_USER','root');
define('DB_PASS','');
define('DB_NAME','uf');
define('DB_PREFIX','uf_');
define('VERSION','9.5.3');
define('VERSION','9.5.31');
define('UF_INSTALLED',true);
?>

+ 0
- 16
includes/cache/cache_forums.php View File

@ -23,22 +23,6 @@ $forum = array(
'name'=>$result['name'],
'lock'=>$result['lock']
);
/*$sql = "SELECT COUNT(*) as `p_id`, `t_id` FROM ".POSTS_TABLE." GROUP BY `t_id`";
$query = DataBase::sql_query($sql,GENERAL, 'Could not obtain amout of posts in forum');
while($result = DataBase::fetch($query))
{
$count_topic[$result['t_id']]=$result['p_id'];
}*/
/*$sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id WHERE `f_id`='$fid' ORDER BY `ptime`";
$query = DataBase::sql_query($sql,GENERAL, 'Could not obtain amout of posts in forum');
while($result = DataBase::fetch($query))
{
$lastpost[$result['t_id']]['tp_id']=$result['tp_id'];
$lastpost[$result['t_id']]['u_id']=$result['u_id'];
$lastpost[$result['t_id']]['time']=$result['ptime'];
$lastpost[$result['t_id']]['user_nick']=$result['nick'];
$lastpost[$result['t_id']]['user_rank']=$result['rank'];
} */
//
//generate output pages
//

+ 4
- 2
includes/cache/cache_index.php View File

@ -17,7 +17,9 @@ if(!defined('IN_uF'))
//lastpost in forum cache
//cache forums --don't modify!!!
$cache_id=1;
$sql = "SELECT ".FORUMS_TABLE.".*, COUNT(".POSTS_TABLE.".p_id) as amout, ".POSTS_TABLE.".f_id AS count FROM ".FORUMS_TABLE." LEFT JOIN ".POSTS_TABLE." ON ".FORUMS_TABLE.".f_id= ".POSTS_TABLE.".f_id GROUP BY `f_id` ORDER BY `c_id`, `sort`";
$sql = "SELECT ".FORUMS_TABLE.".*
FROM ".FORUMS_TABLE."
ORDER BY `c_id`, `sort`";
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain forum information.');
while($result = DataBase::fetch($query))
{
@ -27,7 +29,7 @@ while($result = DataBase::fetch($query))
$forum[$cache_id]['c_id'] = $result['c_id'];
$forum[$cache_id]['sort'] = $result['sort'];
$forum[$cache_id]['lastpost'] = $result['lastpost'];
$count_forum[$result['f_id']] = $result['amout'];
$count_forum[$result['f_id']] = $result['posts'];
$cache_id+=1;
}
$sql = "SELECT `u_id`,`nick`, `regdate` AS count FROM ".USERS_TABLE." ORDER BY `regdate` DESC";

+ 17
- 8
includes/cache/cache_topic.php View File

@ -18,16 +18,23 @@ if ($result['t_id']=='')
{
message_forum($lng['no_topic'], 'index.php');
}
$topic['name']=$result['topic_name'];
$topic['lock']=$result['topic_lock'];
$topic['sticky']=$result['sticky'];
$topic['f_id']=$result['f_id'];
$fid = $topic['f_id'];
$forum['name']=$result['name'];
$forum['lock']=$result['lock'];
$forum['moderate']=$result['moderate'];
$topic = array(
'name' => $result['topic_name'],
'lock' => $result['topic_lock'],
'sticky' => $result['sticky'],
'f_id' => $result['f_id']
);
$forum = array(
'name' => $result['name'],
'lock' => $result['lock'],
'moderate' => $result['moderate']
);
$fid = $topic['f_id'];
//user warnings level
$sql = "SELECT `u_id`,`value` FROM `".WARNINGS_TABLE."`";
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain user warns information');
$result = DataBase::num_rows($query);
@ -54,7 +61,9 @@ while($result = DataBase::fetch($query))
{
$user[$result['u_id']]['online']='1';
}
unset($sql, $query, $result);
//
//generate output pages
//

+ 27
- 0
includes/classes/class_user.php View File

@ -209,6 +209,7 @@ class User
function UserAddWarn($uid, $value, $motive)
{
global $lng;
$sql = "INSERT INTO `".WARNINGS_TABLE."` ( `w_id` , `u_id` , `value` , `motive` ) VALUES('','$uid','$value','$motive');";
DataBase::sql_query($sql,GENERAL,'Could not add new warn.');
if (User::UserLevelWarns($uid)==100)
@ -220,5 +221,31 @@ class User
DataBase::sql_query($sql,GENERAL,'Could not update add ban.');
}
}
function UserLevelWarns($uid)
{
$level =0;
$sql = "SELECT `u_id`,`value` FROM `".WARNINGS_TABLE."` WHERE `u_id`='$uid'";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user warns information');
$result = DataBase::num_rows($query);
while ($result = @DataBase::fetch($query))
{
if ($result['value']=='-')
{
$level = $level -1;
}
else
{
$level = $level +1;
}
}
//version 1.0 Alpha 2
//delete second query
if ($level>0)
{
$level = $level*10;
}
return $level;
}
}
?>

+ 2
- 2
includes/classes/secure.php View File

@ -33,8 +33,8 @@ class Secure
$sql = "SELECT * FROM ".CENSORLIST_TABLE.";";
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain censorlist information.');
while($word = DataBase::fetch($query))
{
$text = str_replace($word['word'],'[censored]', $text);
{
$text = str_replace($word['word'],$word['replace'], $text);
}
}
return $text;

+ 0
- 1
includes/db.php View File

@ -64,7 +64,6 @@ class DataBase
function num_rows($query)
{
// return $query->num_rows;
if ($query===true || $query===false)
{
return 0;

+ 4
- 4
includes/misc_functions.php View File

@ -138,7 +138,7 @@ function UserAgent($agent)
function GenerateTime($request_time)
{
global $lng;
if (date('d-m-Y',$request_time)== date('d-m-Y',time()))
if (date('d M Y',$request_time)== date('d M Y',time()))
{
$date = $lng['today'].', '.date('G:i', $request_time);
}
@ -150,7 +150,7 @@ function GenerateTime($request_time)
}
else
{
$date = date('d-m-Y, G:i',$request_time);
$date = date('d M Y, G:i',$request_time);
}
}
@ -284,12 +284,12 @@ function TotalPosts()
return($result);
}
function DefaultLang()
function DefaultLang($active = false)
{
global $forum_config;
global $userdata;
if ($_SESSION['uid']>0)
if ($_SESSION['uid']>0 && !$active)
{
return $userdata['lang'];
}

+ 3
- 2
lngs/Polish/admin.php View File

@ -120,8 +120,8 @@ $lng['files_is_good']='Wszystkie pliki są poprawne!';
$lng['files_not_good']='Nie wszystkie pliki są poprawne. Jest ich: ';
$lng['php_version']='Wersja PHP';
$lng['mysql_version']='Wersja serwera MySQL';
$lng['not_writable']='Katalog nie do zapisu!';
$lng['is_writable']='Katalog do zapisu';
$lng['not_writable']='Nie do zapisu!';
$lng['is_writable']='Do zapisu';
$lng['catalog']='Katalog';
$lng['db_size']='Wielkość bazy';
$lng['forum_size']='Wielkość plików forum';
@ -235,6 +235,7 @@ $lng['no_words']='Cenzura słów jest pusta';
$lng['word_deleted']='Słowo zostało usunięte. <br> Powrót do cenzury słów.';
$lng['word_edited']='Słowo zostało wyedytowane. <br> Powrót do cenzury słów.';
$lng['edit_word']='Edytuj słowo';
$lng['replace_to']='Zamień na';
//
//on banlist... ------------------------------------------------------------
//

+ 1
- 0
lngs/Polish/main.php View File

@ -191,6 +191,7 @@ $lng['warns']='Ostrzeżeń';
$lng['add']='Dodaj';
$lng['delete']='Odejmij';
$lng['warns_ban']='Zostałeś zbanowany, ponieważ Twój poziom ostrzeżeń wynosi 100%.';
$lng['cannot_add_warn_am']='Nie możesz dodać ostrzeżenia Administratorowi/Moderatorowi!';
//
//messages...-----------------------------------------------------------------
//

+ 3
- 1
posting.php View File

@ -34,13 +34,14 @@ if ($_SESSION['uid']<1)
{
message_forum($lng['youarenotlogd'],'login.php?mode=login');
}
foreach ($_POST as $name => $value)
/**foreach ($_POST as $name => $value)
{
if ($forum_config['use_censorlist'])
{
$_POST[$name] = Secure::UseCensorlist($value);
}
}
*/
$start = TimeGeneration();
//add skin variables
$skin = array(
@ -209,6 +210,7 @@ switch(trim($_GET['mode']))
setcookie('antiflood_time',(time() + $forum_config['time_antiflood']));
}
$_POST['textedit'] = Secure::TagsReplace($_POST['textedit']);
$id = Post::NewPost(intval($_GET['id']),$_POST['textedit'], $_SESSION['uid']);
$count =ceil(($id / 15 ));
if ($count >1)

+ 83
- 30
search.php View File

@ -29,7 +29,7 @@ $default_skin = ViewSkinName();
SessDelInvalid();
SessRegister();
SessDeleteOld();
$sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id ORDER BY `ptime`";
/*$sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id ORDER BY `ptime`";
$query = DataBase::sql_query($sql,GENERAL, 'Could not obtain amout of posts in forum');
while($result = DataBase::fetch($query))
{
@ -44,11 +44,12 @@ $query = DataBase::sql_query($sql,GENERAL, 'Could not obtain amout of posts in f
while($result = DataBase::fetch($query))
{
$count_topic[$result['t_id']]=$result['p_id'];
}
}*/
if (!isset($_GET['content']))
{
header('Location: search.php?content=posts');
}
//
//generate output pages
//
@ -60,24 +61,48 @@ else
{
$limiter = $forum_config['limit_ftid'];
}
if (isset($_GET['page'])&&($_GET['page']!=1))
if ($_GET['content'] == 'userposts' || $_GET['content'] == 'lastposts')
{
if (!is_numeric($_GET['page']))
if (isset($_GET['page'])&&($_GET['page']!=1))
{
die('Hacking attempt');
if (!is_numeric($_GET['page']))
{
die('Hacking attempt');
}
$value = ($_GET['page']-1)*$limiter;
$limit = 'LIMIT '.$value . ', '.$limiter;
$page = $_GET['page'];
}
else
{
$limit = 'LIMIT 0, '.$limiter;
$page=1;
}
$value = ($_GET['page']-1)*$limiter;
$limit = 'LIMIT '.$value . ', '.$limiter;
$page = $_GET['page'];
}
else
{
$limit = 'LIMIT 0, '.$limiter;
$page=1;
if (isset($_POST['page'])&&($_POST['page']!=1))
{
if (!is_numeric($_POST['page']))
{
die('Hacking attempt');
}
$value = ($_POST['page']-1)*$limiter;
$limit = 'LIMIT '.$value . ', '.$limiter;
$page = $_POST['page'];
}
else
{
$limit = 'LIMIT 0, '.$limiter;
$page=1;
}
}
//
//end generating pages
//
if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['content']=='userposts'))
{
$errors = true;
@ -88,10 +113,26 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
if ($_SESSION['uid']>0)
{
$time = time()-129600;
$sql = "SELECT ".TOPICS_TABLE.".*, ".USERS_TABLE.".* FROM ".TOPICS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".TOPICS_TABLE.".author = ".USERS_TABLE.".u_id WHERE lastpost_time>$time ORDER BY `sticky` DESC, `lastpost_time` DESC LIMIT 60;";
$sql = "SELECT COUNT(`t_id`) as `cnt` FROM ".TOPICS_TABLE." WHERE lastpost_time>$time";
$count = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain count amout of topics'));
$count = $count['cnt'];
$count = ceil($count / $limiter);
if ($count==0)
{
$count +=1;
}
if(isset($_GET['page']) && ($_GET['page']>$count))
{
message_forum($lng['invalidpage'],'index.php');
}
$sql = "SELECT ".TOPICS_TABLE.".*, ".USERS_TABLE.".*, ".TOPICS_TABLE.".posts AS posts
FROM ".TOPICS_TABLE."
LEFT JOIN ".USERS_TABLE." ON ".TOPICS_TABLE.".author = ".USERS_TABLE.".u_id
WHERE lastpost_time>$time
ORDER BY `sticky` DESC, `lastpost_time` DESC $limit";
$errors = false;
$window_title = $lng['showlast30posts'];
$navigator_title = '</a>&gt; <a href="'.$_SERVER['REQUEST_URI'].'" class="navigator">'.$lng['showlast30posts'];
$window_title = $lng['showlastposts'];
$navigator_title = '</a>&gt; <a href="'.$_SERVER['REQUEST_URI'].'" class="navigator">'.$lng['showlastposts'];
break;
}
else
@ -138,9 +179,13 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
{
$like_where .=' OR `text` LIKE \'%'.$keyword[$i].'%\'';
}
$sql = "SELECT COUNT(".TOPICS_TABLE.".t_id) as `count`, ".POSTS_TABLE.".* FROM ".TOPICS_TABLE." LEFT JOIN ".POSTS_TABLE." ON ".POSTS_TABLE.".t_id = ".TOPICS_TABLE.".t_id WHERE $like_where GROUP BY `t_id`";
$count = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain count amout of topics'));
$count = $count['count'];
$sql = "SELECT ".POSTS_TABLE.".t_id, ".POSTS_TABLE.".text
FROM ".TOPICS_TABLE."
LEFT JOIN ".POSTS_TABLE." ON ".POSTS_TABLE.".t_id = ".TOPICS_TABLE.".t_id
WHERE $like_where GROUP BY `t_id`";
echo $sql;
$count = DataBase::sql_query($sql,GENERAL,'Could not obtain count amout of topics');
$count = DataBase::num_rows($count);//$count['count'];
$count = ceil($count / $limiter);
if ($count==0)
{
@ -150,7 +195,13 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
{
message_forum($lng['invalidpage'],'index.php');
}
$sql = "SELECT ".TOPICS_TABLE.".*, ".USERS_TABLE.".*, ".POSTS_TABLE.".* FROM ".TOPICS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".TOPICS_TABLE.".author = ".USERS_TABLE.".u_id LEFT JOIN ".POSTS_TABLE." ON ".POSTS_TABLE.".t_id = ".TOPICS_TABLE.".t_id WHERE $like_where ORDER BY `sticky` DESC, `lastpost_time` DESC $limit;";
$sql = "SELECT ".TOPICS_TABLE.".*, ".USERS_TABLE.".*, ".POSTS_TABLE.".*, ".TOPICS_TABLE.".posts AS posts
FROM ".TOPICS_TABLE."
LEFT JOIN ".USERS_TABLE." ON ".TOPICS_TABLE.".author = ".USERS_TABLE.".u_id
LEFT JOIN ".POSTS_TABLE." ON ".POSTS_TABLE.".t_id = ".TOPICS_TABLE.".t_id
WHERE $like_where
ORDER BY `sticky` DESC, `lastpost_time` DESC $limit;";
$window_title = $lng['search_results'];
$navigator_title = '</a>&gt; <a href="'.$_SERVER['REQUEST_URI'].'" class="navigator">'.$lng['search_results'];
$errors = false;
@ -187,12 +238,13 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
{
if (!in_array($record['t_id'], $isset_topics))
{
$last_post = explode(':', $record['lastpost']);
$skin = array(
't_id'=>$record['t_id'],
'fname'=>($record['sticky']=='1') ? '<b>'.$lng['sticky'].'</b>'.$record['name'] : $record['name'],
'author'=>Topic::TopicAuthor($record['author']),
'new_post'=>Topic::LastPostImg(),
'tposts'=>$count_topic[$record['t_id']],
'tposts'=>$record['posts'],
'lastpost'=>Topic::LastPostInTopic($record['t_id'])
);
include('./skins/'.$default_skin.'/forum_forum_add.tpl');
@ -204,20 +256,21 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
{
echo '<tr><td width="'.TABLES_WIDTH.'" colspan="10" height="19" class="fitem"><p class="fstandard" align="center">'.$lng['nopost'].'!</p></td></tr>';
}
if ($_GET['content']=='lastposts')
$skin = array(
'option_pages' => AddPages(),
'lwith' => $lng['with'],
'lpage' => $lng['page'],
'lpages' => $count,
);
if ($_GET['content']=='posts')
{
echo '</table>';
$skin['keywords'] = $_POST['keywords'];
}
else
{
$skin = array(
'option_pages' => AddPages(),
'lwith' => $lng['with'],
'lpage' => $lng['page'],
'lpages' => $count,
);
include('./skins/'.$default_skin.'/search_end_body.tpl');
}
include('./skins/'.$default_skin.'/search_end_body.tpl');
}
}
else

BIN
skins/subPurple/images/Thumbs.db View File


BIN
skins/subPurple/images/dsf_logo.gif View File

Before After
Width: 246  |  Height: 130  |  Size: 9.4 KiB

BIN
skins/subPurple/images/td_category.jpg View File

Before After
Width: 1  |  Height: 17  |  Size: 697 B Width: 20  |  Height: 35  |  Size: 1.1 KiB

BIN
skins/subPurple/images/td_category_left.gif View File

Before After
Width: 17  |  Height: 17  |  Size: 985 B Width: 20  |  Height: 35  |  Size: 940 B

BIN
skins/subPurple/images/td_category_right.gif View File

Before After
Width: 17  |  Height: 17  |  Size: 664 B Width: 20  |  Height: 35  |  Size: 942 B

BIN
skins/subPurple/images/uf_logo.gif View File

Before After
Width: 246  |  Height: 130  |  Size: 7.7 KiB

+ 2
- 2
skins/subPurple/index_category_add.tpl View File

@ -1,9 +1,9 @@
<span class="fsmall">&nbsp;<br></span>
<table class="maintable" width="<?= TABLES_WIDTH; ?>" style="border-width: 0px">
<tr>
<td width="14" height="7" style="background-image: url('skins/subPurple/images/td_category_left.gif')" class="category">&nbsp;</td>
<td width="18" height="25" style="background-image: url('skins/subPurple/images/td_category_left.gif')" class="category">&nbsp;</td>
<td height="7"class="category" style="background-image: url('skins/subPurple/images/td_category.jpg')"><? echo $skin['category']; ?></td>
<td width="14" height="7" style="background-image: url('skins/subPurple/images/td_category_right.gif')" class="category"></td>
<td width="18" height="7" style="background-image: url('skins/subPurple/images/td_category_right.gif')" class="category"></td>
</tr>
</table>
<table class="maintable" width="<?= TABLES_WIDTH; ?>" style="border-top: 0px">

+ 2
- 2
skins/subPurple/overall_header.tpl View File

@ -6,7 +6,7 @@
<meta name="keywords" content="<? echo $skin['keywords']; ?>">
<meta name="description" content="<? echo $skin['description']; ?>">
<link rel="stylesheet" href="skins/subPurple/skin.css" type="text/css">
<title><? echo $skin['forumname']; ?> - <? echo $skin['mainpage']; ?></title>
<title><? echo $skin['forumname']; ?> &bull; <? echo $skin['mainpage']; ?></title>
</head>
<body class="body">
<script type="text/javascript" language="JavaScript">
@ -44,7 +44,7 @@ function unset_color(element)
<table class="maintable" width="<?= TABLES_WIDTH; ?>" style="border-width: 0px">
<tr>
<td>
<a href="index.php"><img border="0" src="skins/subPurple/images/dsf_logo.gif" alt="DSF logo"></a></td>
<a href="index.php"><img border="0" src="skins/subPurple/images/uf_logo.gif" alt="&micro;F logo"></a></td>
<td width="502" height="75" valign="top">
<p align="center"><span class="hforum"><? echo $skin['forumname']; ?></span><br><span class="fstandard"><i><?= $skin['forumdesc']; ?></i></span></p>
<p align="center">

+ 31
- 9
skins/subPurple/search_end_body.tpl View File

@ -1,9 +1,31 @@
</table>
<div style="width: 100%; text-align: right">
<span class="fsmall"><?=$skin['lpage']; ?>:
<select name="page" onchange="location='<?= $_SERVER['REQUEST_URI']; ?>&amp;page='+(this.value)">
<?= $skin['option_pages']; ?>
</select>
<?= $skin['lwith']; ?> <?= $skin['lpages']; ?>
</span>
</div>
</table>
<?php if ($_GET['content'] == 'userposts' || $_GET['content'] == 'lastposts')
{
?>
<div style="width: 100%; text-align: right">
<span class="fsmall"><?=$skin['lpage']; ?>:
<select name="page" onchange="location='<?= $_SERVER['REQUEST_URI']; ?>&amp;page='+(this.value)">
<?= $skin['option_pages']; ?>
</select>
<?= $skin['lwith']; ?> <?= $skin['lpages']; ?>
</span>
</div>
<?php
}
else
{
?>
<form action="<?= $_SERVER['REQUEST_URI']; ?>" method="post">
<input type="hidden" name="keywords" value="<?= $skin['keywords']; ?>">
<div style="width: 100%; text-align: right">
<span class="fsmall"><?=$skin['lpage']; ?>:
<select name="page" onchange="this.form.submit()">
<?= $skin['option_pages']; ?>
</select>
<?= $skin['lwith']; ?> <?= $skin['lpages']; ?>
</span>
</div>
</form>
<?php
}
?>

+ 7
- 8
skins/subPurple/topic_post_body.tpl View File

@ -4,7 +4,7 @@
<td width="17" style="background-image: url('skins/subPurple/images/td_beam_left.gif')"></td>
<td width="100" id="p<? echo $skin['tp_id']; ?>" height="14" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"></td>
<td width="<?= (TABLES_WIDTH -244); ?>" height="14" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><?= $skin['lpost']?></td>
<td width="110" height="15" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['lpinfo']; ?></td>
<td width="110" height="15" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['L.p_info']; ?></td>
<td width="17" style="background-image: url('skins/subPurple/images/td_beam_right.gif')"></td>
</tr>
<table class="maintable" width="<?= TABLES_WIDTH; ?>" style="border-top: 0px">
@ -17,11 +17,10 @@
<p align="left"><span class="fstandard"><? echo $skin['posttext']; ?></span><p class="fsmall" align="left"><? echo $skin['sig']; ?></p></p>
</td>
<td width="148" height="22" class="fitem" align="center" valign="top">
<span class="fsmall">Post <? echo $skin['lno']; ?> </span>
<span class="fsmall">Post <? echo $skin['L.no']; ?> </span>
<a href="#p<? echo $skin['tp_id']; ?>" class="fsmall"><b>#<? echo $skin['tp_id']; ?></b></a><br>
<span class="fsmall"><? echo $skin['ldate']; ?>: <b><? echo $skin['pdate']; ?></b></span><br>
<span class="fsmall"><?= $skin['warns_pool']; ?></span><br>
<span class="fsmall"><b><?= $skin['lstat']; ?>: </b></span><img src="images/<?= $skin['online']?>" alt="online">
<span class="fsmall"><? echo $skin['L.date']; ?>: <b><? echo $skin['pdate']; ?></b></span><br>
<span class="fsmall"><?= $skin['warns_pool']; ?></span>
</td>
</tr>
<tr>
@ -42,7 +41,7 @@
<span class="fsmall"><b><?= $skin['admin'];?></b><br></span>
<span class="fsmall"><?= $skin['L.IP']; ?></span>
<? echo $skin['mode_p_del']; ?>
<a href="http://localhost/DSF/warns.php?mode=add&id=<?= $skin['u_id']; ?>" class="fsmall" style="color: green"><?= $skin['add_warn']; ?></a><br>
<a href="warns.php?mode=add&id=<?= $skin['u_id']; ?>" class="fsmall" style="color: green"><?= $skin['add_warn']; ?></a><br>
<? if (RANK==2) { ?>
<a href="admin/admin_users.php?mode=edit&amp;id=<?= $skin['u_id']; ?>" class="fsmall" style="color: red"><?= $skin['edit_profile']; ?></a><br>
<a href="admin/banlist.php?mode=add&amp;submode=all&amp;ip=<?= $skin['IP']; ?>&amp;uid=<?= $skin['u_id']; ?>" class="fsmall" style="color: red"><?= $skin['ban']; ?></a><br>
@ -52,11 +51,11 @@
</tr>
<? } }?>
<tr>
<td width="116" height="1" class="fitem" align="center"><span class="fsmall"><? echo $skin['userrank']; ?></td>
<td width="116" height="1" class="fitem" align="center"><span class="fsmall"><?= $skin['lstat']; ?>: </span><img src="images/<?= $skin['online']?>" alt="online"></span></td>
<td width="105" height="1" class="fitem" align="center"><span class="fsmall"><? echo $skin['lposts']; ?>: <b><? echo $skin['posts']; ?></b></span></td>
<td width="153" height="1" class="fitem" align="center"><span class="fsmall"><? echo $skin['lregdate']; ?>: <b><? echo $skin['regdate']; ?></b></span></td>
<td width="228" height="1" class="fitem" align="center"><span class="fsmall"><? echo $skin['llastvisit']; ?>: <b><? echo $skin['lastvisit']; ?></b></span></td>
<td width="142" height="1" class="fitem" align="center"><span class="fsmall">&nbsp;</span></td>
<td width="142" height="1" class="fitem" align="center"><span class="fsmall"><? echo $skin['userrank']; ?></span></td>
</tr>
</table>
<span class="fverysmall">&nbsp;<br></span>

+ 5
- 5
topic.php View File

@ -87,7 +87,7 @@ while($item=DataBase::fetch($query))
'warns_pool' => $warn_pool,
'lstat'=>$lng['stat'],
'rowspan'=> ($_SESSION['uid']>0) ? ((RANK>0) ? '3' : '2') : '2',
'L.IP' => ($_SESSION['uid']>0) ? ((($forum_config['ip_post_for_mod'] && (RANK>0)) || (RANK==2) ) ? 'IP: '.$item['post_ip'].'<br>' : '') : '',
'L.IP' => ($_SESSION['uid']>0) ? ((($forum_config['ip_post_for_mod'] && (RANK>0)) || (RANK==2) ) ? 'IP: '.$item['post_ip'].' (<a href="http://whois.domaintools.com/'.$item['post_ip'].'" class="fsmall"><i>WHOIS</i></a>)<br>' : '') : '',
'IP'=>$item['post_ip'],
'admin'=>$lng['admin_mod_administration'],
'mode_p_del' => ($item['tp_id']!='1') ?
@ -100,9 +100,9 @@ while($item=DataBase::fetch($query))
'add_warn'=>$lng['add_warn'],
'online'=>($item['time']!=NULL) ? (($item['time']+1250)>time()) ? 'online.gif' : 'offline.gif' : 'offline.gif',
//labels
'lwarns'=>$lng['warns'],
'L.warns'=>$lng['warns'],
'lang'=>$default_lang,
'ldate'=>$lng['date'],
'L.date'=>$lng['date'],
'llastvisit'=>$lng['lulastvisit'],
'lregdate'=>$lng['regdate2'],
'lposts'=>$lng['posts'],
@ -110,8 +110,8 @@ while($item=DataBase::fetch($query))
'ua_system_desc'=>$lng['system'].' '.$ua[2],
'ua_browser'=>$ua[1],
'ua_browser_desc'=>$lng['browser'].' '.$ua[3],
'lno'=>$lng['no.'],
'lpinfo'=>$lng['postinfo'],
'L.no'=>$lng['no.'],
'L.p_info'=>$lng['postinfo'],
'lpost'=>$lng['post'],
'C.delete_post'=>$lng['c_delete_post']
);

+ 7
- 0
warns.php View File

@ -58,6 +58,13 @@ switch(trim($_GET['mode']))
{
if ((strpos($_POST['value'],'+')!==false) or (strpos($_POST['value'],'-')!==false))
{
if ($_POST['value'] == '+')
{
if (User::UserInformation($_GET['id'],'rank')>0)
{
message_forum($lng['cannot_add_warn_am'],'warns.php?mode=view&amp;id='.$_GET['id']);
}
}
$_POST['textedit'] = Secure::TagsReplace($_POST['textedit']);
User::UserAddWarn($_GET['id'],$_POST['value'] ,addslashes(strip_tags($_POST['textedit'])));
$stop = TimeGeneration();

Loading…
Cancel
Save