PageRenderTime 45ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 1ms

/modules/forums/internals/showabos.php

http://avecms.googlecode.com/
PHP | 98 lines | 77 code | 12 blank | 9 comment | 19 complexity | 0de7b0c6c0f7e7b32de07637cc220bde MD5 | raw file
Possible License(s): GPL-3.0, BSD-3-Clause, BSD-2-Clause, Apache-2.0, LGPL-2.1
  1. <?php
  2. /*::::::::::::::::::::::::::::::::::::::::
  3. System name: cpengine
  4. Short Desc: Full Russian Security Power Pack
  5. Version: 2.0 (Service Pack 2)
  6. Authors: Arcanum (php@211.ru) & Censored!
  7. Date: March 18, 2008
  8. ::::::::::::::::::::::::::::::::::::::::*/
  9. if(!defined("MYABOS")) exit;
  10. if(UGROUP==2)
  11. {
  12. $this->msg($GLOBALS['mod']['config_vars']['ErrornoPerm']);
  13. }
  14. if (defined("UGROUP") && is_numeric(UGROUP) && UGROUP != 2)
  15. {
  16. $forum_id = (isset($_GET['forum_id']) && $_GET['forum_id'] != '' && is_numeric($_GET['forum_id'])) ? addslashes($_GET['forum_id']) : 't.forum_id';
  17. $query = "SELECT
  18. t.id,
  19. t.title,
  20. t.forum_id,
  21. t.views,
  22. t.type,
  23. t.posticon,
  24. r.rating,
  25. t.uid,
  26. f.title AS f_title,
  27. t.notification,
  28. t.replies,
  29. t.status,
  30. u.BenutzerName
  31. FROM
  32. " . PREFIX . "_modul_forum_topic AS t,
  33. " . PREFIX . "_modul_forum_forum AS f,
  34. " . PREFIX . "_modul_forum_userprofile AS u,
  35. " . PREFIX . "_modul_forum_rating AS r
  36. WHERE
  37. f.id = $forum_id AND
  38. t.forum_id = f.id AND
  39. r.topic_id = t.id AND
  40. u.BenutzerId = t.uid";
  41. $result = $GLOBALS['AVE_DB']->Query($query);
  42. $matches = array();
  43. while ($topic = $result->FetchAssocArray())
  44. {
  45. $notification = @explode(';', $topic['notification']);
  46. if (in_array(UID, $notification))
  47. {
  48. // forum zum thema
  49. $r_forum = $GLOBALS['AVE_DB']->Query("SELECT id, status FROM " . PREFIX . "_modul_forum_forum WHERE id = '".$topic['forum_id']."'");
  50. $rx = $r_forum->FetchRow();
  51. if ($topic['status'] == FORUM_STATUS_MOVED)
  52. {
  53. $topic['statusicon'] = $this->getIcon("thread_moved.gif", "moved");
  54. } else {
  55. if (UGROUP == 2 || ($topic['status'] == FORUM_STATUS_CLOSED) )
  56. {
  57. // nicht eingeloggt oder forum geschlossen
  58. $topic['statusicon'] = $this->getIcon("thread_lock.gif", "lock");
  59. } else {
  60. $this->setTopicIcon($topic, $rx);
  61. }
  62. }
  63. $topic['autorlink'] = "index.php?module=forums&amp;show=userprofile&amp;user_id=" . $topic['uid'];
  64. $topic['link'] = "index.php?module=forums&amp;show=showtopic&toid=".$topic['id']."&amp;fid=" . $topic['forum_id'];
  65. $topic['forumslink'] = "index.php?module=forums&amp;show=showforum&amp;fid=" . $topic['forum_id'];
  66. $topic['autor'] = $topic['BenutzerName'];
  67. $rating = explode(",", $topic['rating']);
  68. $topic['rating'] = (int) (array_sum($rating) / count($rating));
  69. $matches[] = $topic;
  70. }
  71. }
  72. $GLOBALS['AVE_Template']->assign("navigation", "<a class='forum_links_navi' href='index.php?module=forums'>"
  73. . $GLOBALS['mod']['config_vars']['PageNameForums'] . "</a>"
  74. . $GLOBALS['mod']['config_vars']['ForumSep']
  75. . "<a class='forum_links_navi' href='index.php?module=forums&amp;show=search_mask'>"
  76. . $GLOBALS['mod']['config_vars']['ForumsSearch']
  77. . "</a>"
  78. . $GLOBALS['mod']['config_vars']['ForumSep']
  79. . $GLOBALS['mod']['config_vars']['ShowAbos']
  80. );
  81. $GLOBALS['AVE_Template']->assign("matches", $matches);
  82. $tpl_out = $GLOBALS['AVE_Template']->fetch($GLOBALS['mod']['tpl_dir'] . 'result.tpl');
  83. define("MODULE_CONTENT", $tpl_out);
  84. define("MODULE_SITE", $GLOBALS['mod']['config_vars']['ShowLast24']);
  85. }
  86. ?>