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.

37 lines
1.4 KiB

  1. <?php
  2. /**
  3. * @package uForum
  4. * @file includes/cache/cache_index.php
  5. * @version $Id$
  6. * @copyright 2009(c) PioDer <pioder@wp.pl>
  7. * @link http://pioder.gim2przemysl.int.pl/
  8. * @license GNU GPL v3
  9. **/
  10. if(!defined('IN_uF'))
  11. {
  12. die('Hacking attempt');
  13. }
  14. //
  15. //cache forums and posts - version v1.0 Alpha 2---------------------------------
  16. //
  17. //lastpost in forum cache
  18. //cache forums --don't modify!!!
  19. $cache_id=1;
  20. $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`";
  21. $query = DataBase::sql_query($sql,'CRITICAL','Could not obtain forum information.');
  22. while($result = DataBase::fetch($query))
  23. {
  24. $forum[$cache_id]['f_id'] = $result['f_id'];
  25. $forum[$cache_id]['name'] = $result['name'];
  26. $forum[$cache_id]['desc'] = $result['desc'];
  27. $forum[$cache_id]['c_id'] = $result['c_id'];
  28. $forum[$cache_id]['sort'] = $result['sort'];
  29. $forum[$cache_id]['lastpost'] = $result['lastpost'];
  30. $count_forum[$result['f_id']] = $result['amout'];
  31. $cache_id+=1;
  32. }
  33. $sql = "SELECT `u_id`,`nick`, `regdate` AS count FROM ".USERS_TABLE." ORDER BY `regdate` DESC";
  34. $query = DataBase::sql_query($sql,'GENERAL','Could not obtain amout of count users information');
  35. $lastuser = DataBase::fetch($query);
  36. $count_users = DataBase::num_rows($query) -1;
  37. ?>