diff --git a/admin/censorlist.php b/admin/censorlist.php index 4576255..013f59e 100644 --- a/admin/censorlist.php +++ b/admin/censorlist.php @@ -57,7 +57,7 @@ switch($_GET['mode']) for($i=0;$i 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'); diff --git a/admin/check_script.php b/admin/check_script.php index d619550..6db4626 100644 --- a/admin/check_script.php +++ b/admin/check_script.php @@ -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) diff --git a/admin/check_script_data.php b/admin/check_script_data.php index aafe8a4..d2bb7cc 100644 --- a/admin/check_script_data.php +++ b/admin/check_script_data.php @@ -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); diff --git a/admin/template/censorlist_add_edit_body.tpl b/admin/template/censorlist_add_edit_body.tpl index 2e04133..3b49842 100644 --- a/admin/template/censorlist_add_edit_body.tpl +++ b/admin/template/censorlist_add_edit_body.tpl @@ -24,6 +24,14 @@ + + + : + + + + +   diff --git a/admin/template/censorlist_word_add.tpl b/admin/template/censorlist_list_word.tpl similarity index 76% rename from admin/template/censorlist_word_add.tpl rename to admin/template/censorlist_list_word.tpl index c7d0fe6..dad71df 100644 --- a/admin/template/censorlist_word_add.tpl +++ b/admin/template/censorlist_list_word.tpl @@ -1,7 +1,10 @@ - + '; } - if ($_GET['content']=='lastposts') + $skin = array( + 'option_pages' => AddPages(), + 'lwith' => $lng['with'], + 'lpage' => $lng['page'], + 'lpages' => $count, + ); + + if ($_GET['content']=='posts') { - echo '
+ + + diff --git a/common.php b/common.php index 999721c..2a486dc 100644 --- a/common.php +++ b/common.php @@ -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) { diff --git a/config.php b/config.php index 0238d4b..6ab0c56 100644 --- a/config.php +++ b/config.php @@ -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); ?> diff --git a/includes/cache/cache_forums.php b/includes/cache/cache_forums.php index 71270dc..831d416 100644 --- a/includes/cache/cache_forums.php +++ b/includes/cache/cache_forums.php @@ -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 // diff --git a/includes/cache/cache_index.php b/includes/cache/cache_index.php index 762b327..c04d7fa 100644 --- a/includes/cache/cache_index.php +++ b/includes/cache/cache_index.php @@ -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"; diff --git a/includes/cache/cache_topic.php b/includes/cache/cache_topic.php index 5d5aa5f..5641df4 100644 --- a/includes/cache/cache_topic.php +++ b/includes/cache/cache_topic.php @@ -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 // diff --git a/includes/classes/class_user.php b/includes/classes/class_user.php index 35661cc..7e03c51 100644 --- a/includes/classes/class_user.php +++ b/includes/classes/class_user.php @@ -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; + } } ?> diff --git a/includes/classes/secure.php b/includes/classes/secure.php index c962291..e0d335a 100644 --- a/includes/classes/secure.php +++ b/includes/classes/secure.php @@ -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; diff --git a/includes/db.php b/includes/db.php index 87c614e..2b9d839 100644 --- a/includes/db.php +++ b/includes/db.php @@ -64,7 +64,6 @@ class DataBase function num_rows($query) { - // return $query->num_rows; if ($query===true || $query===false) { return 0; diff --git a/includes/misc_functions.php b/includes/misc_functions.php index 75a43bd..f21ef3f 100644 --- a/includes/misc_functions.php +++ b/includes/misc_functions.php @@ -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']; } diff --git a/lngs/Polish/admin.php b/lngs/Polish/admin.php index c6b81ce..6c4d2ca 100644 --- a/lngs/Polish/admin.php +++ b/lngs/Polish/admin.php @@ -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.
Powrót do cenzury słów.'; $lng['word_edited']='Słowo zostało wyedytowane.
Powrót do cenzury słów.'; $lng['edit_word']='Edytuj słowo'; +$lng['replace_to']='Zamień na'; // //on banlist... ------------------------------------------------------------ // diff --git a/lngs/Polish/main.php b/lngs/Polish/main.php index 47644b5..8d29e51 100644 --- a/lngs/Polish/main.php +++ b/lngs/Polish/main.php @@ -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...----------------------------------------------------------------- // diff --git a/posting.php b/posting.php index a92ada6..22ece46 100644 --- a/posting.php +++ b/posting.php @@ -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) diff --git a/search.php b/search.php index 0a24fac..2e3b68a 100644 --- a/search.php +++ b/search.php @@ -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 = '
> '.$lng['showlast30posts']; + $window_title = $lng['showlastposts']; + $navigator_title = '> '.$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 = '> '.$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') ? ''.$lng['sticky'].''.$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 '

'.$lng['nopost'].'!

'; + $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 diff --git a/skins/subPurple/images/Thumbs.db b/skins/subPurple/images/Thumbs.db index 324e190..ace8c2c 100644 Binary files a/skins/subPurple/images/Thumbs.db and b/skins/subPurple/images/Thumbs.db differ diff --git a/skins/subPurple/images/dsf_logo.gif b/skins/subPurple/images/dsf_logo.gif deleted file mode 100644 index f689922..0000000 Binary files a/skins/subPurple/images/dsf_logo.gif and /dev/null differ diff --git a/skins/subPurple/images/td_category.jpg b/skins/subPurple/images/td_category.jpg index 6a89ee1..9d7866a 100644 Binary files a/skins/subPurple/images/td_category.jpg and b/skins/subPurple/images/td_category.jpg differ diff --git a/skins/subPurple/images/td_category_left.gif b/skins/subPurple/images/td_category_left.gif index a267990..222b415 100644 Binary files a/skins/subPurple/images/td_category_left.gif and b/skins/subPurple/images/td_category_left.gif differ diff --git a/skins/subPurple/images/td_category_right.gif b/skins/subPurple/images/td_category_right.gif index e322829..4174b08 100644 Binary files a/skins/subPurple/images/td_category_right.gif and b/skins/subPurple/images/td_category_right.gif differ diff --git a/skins/subPurple/images/uf_logo.gif b/skins/subPurple/images/uf_logo.gif new file mode 100644 index 0000000..acc05be Binary files /dev/null and b/skins/subPurple/images/uf_logo.gif differ diff --git a/skins/subPurple/index_category_add.tpl b/skins/subPurple/index_category_add.tpl index e7a05ca..b353462 100644 --- a/skins/subPurple/index_category_add.tpl +++ b/skins/subPurple/index_category_add.tpl @@ -1,9 +1,9 @@  
- + - +
  
diff --git a/skins/subPurple/overall_header.tpl b/skins/subPurple/overall_header.tpl index 45bfd7c..699b2a2 100644 --- a/skins/subPurple/overall_header.tpl +++ b/skins/subPurple/overall_header.tpl @@ -6,7 +6,7 @@ -<? echo $skin['forumname']; ?> - <? echo $skin['mainpage']; ?> +<? echo $skin['forumname']; ?> • <? echo $skin['mainpage']; ?>