/applications/forums/views/view.topic.php

https://github.com/MilkZoft/www · PHP · 238 lines · 238 code · 0 blank · 0 comment · 28 complexity · 3f9025ed43c26aee985e8603f51abd25 MD5 · raw file

  1. <?php if(!defined("_access")) die("Error: You don't have permission to access here...");?>
  2. <?php if(!SESSION("ZanUserID")) { ?>
  3. <div class="twitterButton">
  4. <?php $this->view("twitter", "twitter", array("action" => $URL, "redirect" => $URL)); ?>
  5. </div>
  6. <div class="clear"></div>
  7. <?php } ?>
  8. <div class="actions">
  9. <?php if(SESSION("ZanUserID") > 0) { ?>
  10. <p class="welcome"><?php print __("Welcome to this topic");?>, <a href="<?php print _webBase . _sh . _webLang . _sh . "users" . _sh . "editprofile" . _sh;?>" title="<?php print SESSION("ZanUser");?>"><?php print SESSION("ZanUser");?></a>. <?php print __("Feel free of reply to the topic");?>.</p>
  11. <div class="options">
  12. <ul>
  13. <li class="main"><?php print __("Options");?> <span class="little">&rsaquo;&rsaquo;</span></li>
  14. <li><a href="<?php print _webBase . _sh . _webLang . _sh . "forums" . _sh . segment(2) . _sh . segment(3) . _sh . "new";?>" title="<?php print __("Reply the topic");?>!"><?php print __("Reply");?>!</a></li>
  15. <li><a href="<?php print _webBase . _sh . _webLang . _sh . "forums" . _sh . segment(2);?>" title="<?php print __("Back to the forum");?>!"><?php print __("Back");?></a></li>
  16. <li><a href="<?php print _webBase . _sh . _webLang . _sh . "forums" . _sh;?>" title="<?php print __("Forums");?>!"><?php print __("Forums");?></a></li>
  17. <li><a href="<?php print _webBase . _sh . _webLang . _sh . "users" . _sh . "editprofile" . _sh;?>" title="<?php print __("Edit Profile");?>"><?php print __("Edit Profile");?></a></li>
  18. <li><a href="<?php print _webBase . _sh . _webLang . _sh . "users" . _sh . "logout" . _sh . "forums";?>" title="<?php print __("Logout");?>"><?php print __("Logout");?></a></li>
  19. </ul>
  20. </div>
  21. <?php } else { ?>
  22. <p class="welcome"><?php print __("Welcome to the forums of");?> <?php print _webName;?>, <?php print __("please login to enjoy the forums or register if you don't have an account");?>.</p>
  23. <div class="options">
  24. <ul>
  25. <li class="main"><?php print __("Options");?> <span class="little">&rsaquo;&rsaquo;</span></li>
  26. <li><a href="<?php print _webBase . _sh . _webLang . _sh . "forums" . _sh . segment(2);?>" title="<?php print __("Back to the forum");?>!"><?php print __("Back");?></a></li>
  27. <li><a href="<?php print _webBase . _sh . _webLang . _sh . "forums" . _sh;?>" title="<?php print __("Forums");?>!"><?php print __("Forums");?></a></li>
  28. <li><a class="signIn" href="<?php print _webBase . _sh . _webLang . _sh . "users" . _sh . "login" . _sh . "forums";?>" title="<?php print __("Login");?>"><?php print __("Login");?></a></li>
  29. <li><a class="signUp" href="<?php print _webBase . _sh . _webLang . _sh . "users" . _sh . "register" . _sh . "forums";?>" title="<?php print __("Sign up");?>"><?php print __("Sign up");?></a></li>
  30. </ul>
  31. </div>
  32. <?php } ?>
  33. </div>
  34. <div id="wrapper">
  35. <div class="pagination">
  36. <?php
  37. if(isset($pagination)) {
  38. print $pagination;
  39. }
  40. ?>
  41. </div>
  42. <div class="clear"></div>
  43. <table id="topic">
  44. <tbody>
  45. <tr>
  46. <td class="caption">
  47. <p class="titleTopic"><?php print $data["topic"][0]["Title"];?></p>
  48. </td>
  49. </tr>
  50. <tr>
  51. <td class="profile">
  52. <?php if($data["topic"][0]["Avatar"] !== "") { ?>
  53. <?php if($data["topic"][0]["Type"] === "Normal") { ?>
  54. <img src="<?php print _webURL . _sh . $data["topic"][0]["Avatar"];?>" title="<?php print $data["topic"][0]["Username"];?>" /><br />
  55. <?php } elseif($data["topic"][0]["Type"] === "Twitter") { ?>
  56. <img src="<?php print $data["topic"][0]["Avatar"];?>" title="<?php print $data["topic"][0]["Username"];?>" /><br />
  57. <?php } ?>
  58. <?php } else { ?>
  59. <img src="<?php print _webURL . _sh . "lib" . _sh . "files" . _sh . "images" . _sh . "users" . _sh . "default.png";?>" title="<?php print $data["topic"][0]["Username"];?>" /><br />
  60. <?php } ?>
  61. <div class="userinfo">
  62. <p><strong><a href="<?php print _webBase . _sh . _webLang . _sh . "users" . _sh . "profile" . _sh . $data["topic"][0]["ID_User"];?>" title="<?php print $data["topic"][0]["Username"];?>"><?php print $data["topic"][0]["Username"];?></a></strong></p>
  63. <p><?php print __($data["topic"][0]["Rank"]);?></p>
  64. <?php if($data["topic"][0]["Country"]) { ?>
  65. <p><?php print $data["topic"][0]["Country"];?></p>
  66. <? } ?>
  67. <?php if($data["topic"][0]["Website"]) { ?>
  68. <a href="<?php print $data["topic"][0]["Website"];?>" rel="external" title="<?php print $data["topic"][0]["Website"];?>"><?php print __("Website");?></a>
  69. <? } ?>
  70. </div>
  71. <div class="topicInfo2">
  72. <p><?php print $data["topic"][0]["Text_Date"];?></p>
  73. <p><?php print $data["topic"][0]["Hour"];?></p>
  74. </div>
  75. <!--<p class="dateTopic"><?php print $data["topic"][0]["Text_Date"];?><br /><?php print $data["topic"][0]["Hour"];?></p>-->
  76. <div class="clear"></div>
  77. </td>
  78. </tr>
  79. <?php if(SESSION("ZanUserID")) { ?>
  80. <tr class="actionsTopic">
  81. <td>
  82. <ul>
  83. <?php if(SESSION("ZanUserID") and (SESSION("ZanUserPrivilege") === "Super Admin" or SESSION("ZanUserID") === $data["topic"][0]["ID_User"])) { ?>
  84. <li><a href="<?php print $data["topic"][0]["replyURL"];?>" title="<?php print __("Reply");?>"><?php print __("Reply");?></a></li>
  85. <li><a title="<?php print __("Edit");?>" onclick="return confirm('<?php print __("Do you want to edit the topic?");?>');" href="<?php print $data["topic"][0]["editURL"];?>"><?php print __("Edit");?></a></li>
  86. <li><a title="<?php print __("Delete");?>" onclick="return confirm('<?php print __("Do you want to delete the topic?");?>');" href="<?php print $data["topic"][0]["deleteURL"];?>"><?php print __("Delete");?></a></li>
  87. <?php } elseif(SESSION("ZanUserID")) { ?>
  88. <li><a href="<?php print $data["topic"][0]["replyURL"];?>" title="<?php print __("Reply");?>"><?php print __("Reply");?></a></li>
  89. <?php } ?>
  90. </ul>
  91. </td>
  92. </tr>
  93. <?php } ?>
  94. <tr>
  95. <td class="topicContent">
  96. <div class="topicData">
  97. <p><?php print $data["topic"][0]["Content"];?></p>
  98. <?php if($data["topic"][0]["Sign"] !== "") { ?>
  99. <p class="sign"><?php print $data["topic"][0]["Sign"];?></p>
  100. <?php } ?>
  101. </div>
  102. </td>
  103. </tr>
  104. <?php $i = 0;
  105. if(is_array($data["replies"])) {
  106. foreach($data["replies"] as $reply) { ?>
  107. <tr class="space">
  108. <?php $i++; ?>
  109. </tr>
  110. <tr>
  111. <?php if($i === $count) { ?>
  112. <a name="bottom"></a>
  113. <?php } ?>
  114. <a name="<?php print $reply["ID_Post"];?>"></a>
  115. <td class="profile">
  116. <?php if($reply["Avatar"] !== "") { ?>
  117. <?php if($reply["Type"] === "Normal") { ?>
  118. <img src="<?php print _webURL . _sh . $reply["Avatar"];?>" title="<?php print $reply["Username"];?>" /><br />
  119. <?php } elseif($reply["Type"] === "Twitter") { ?>
  120. <img src="<?php print $reply["Avatar"];?>" title="<?php print $reply["Username"];?>" /><br />
  121. <?php } ?>
  122. <?php } else { ?>
  123. <img src="<?php print _webURL . _sh . "lib" . _sh . "files" . _sh . "images" . _sh . "users" . _sh . "default.png";?>" title="<?php print $reply["Username"];?>" /><br />
  124. <?php } ?>
  125. <div class="userinfo">
  126. <p><strong><a href="<?php print _webBase . _sh . _webLang . _sh . "users" . _sh . "profile" . _sh . $reply["ID_User"];?>" title="<?php print $reply["Username"];?>"><?php print $reply["Username"];?></a></strong></p>
  127. <p><?php print __($reply["Rank"]);?></p>
  128. <?php if($reply["Country"]) { ?>
  129. <p><?php print $reply["Country"];?></p>
  130. <? } ?>
  131. <?php if($reply["Website"]) { ?>
  132. <a href="<?php print $reply["Website"];?>" rel="external" title="<?php print $reply["Website"];?>"><?php print __("Website");?></a>
  133. <? } ?>
  134. </div>
  135. <div class="topicInfo2">
  136. <p><strong><?php print $reply["Title"];?></strong></p>
  137. <p><?php print $reply["Text_Date"];?></p>
  138. <p><?php print $reply["Hour"];?></p>
  139. </div>
  140. </td>
  141. </tr>
  142. <?php if(SESSION("ZanUserID")) { ?>
  143. <tr class="actionsTopic">
  144. <td>
  145. <ul>
  146. <?php if(SESSION("ZanUserID") and (SESSION("ZanUserPrivilege") === "Super Admin" or SESSION("ZanUserID") === $reply["ID_User"])) { ?>
  147. <li><a href="<?php print $data["topic"][0]["replyURL"];?>" title="<?php print __("Reply");?>"><?php print __("Reply");?></a></li>
  148. <li><a title="<?php print __("Edit");?>" onclick="return confirm('<?php print __("Do you want to edit the reply?");?>');" href="<?php print $reply["editURL"];?>"><?php print __("Edit");?></a></li>
  149. <li><a title="<?php print __("Delete");?>" onclick="return confirm('<?php print __("Do you want to delete the reply?");?>');" href="<?php print $reply["deleteURL"];?>"><?php print __("Delete");?></a></li>
  150. <?php } elseif(SESSION("ZanUserID")) { ?>
  151. <li><a href="<?php print $data["topic"][0]["replyURL"];?>" title="<?php print __("Reply");?>"><?php print __("Reply");?></a></li>
  152. <?php } ?>
  153. </ul>
  154. </td>
  155. </tr>
  156. <?php } ?>
  157. <tr>
  158. <td class="topicContent">
  159. <div class="topicData">
  160. <p><?php print $reply["Content"];?></p>
  161. <?php if($data["topic"][0]["Sign"] !== "") { ?>
  162. <p class="sign"><?php print $reply["Sign"];?></p>
  163. <?php } ?>
  164. </div>
  165. </td>
  166. </tr>
  167. <?php }
  168. } ?>
  169. </tbody>
  170. </table>
  171. </div>
  172. <div class="pagination2">
  173. <?php
  174. if(isset($pagination)) {
  175. print $pagination;
  176. }
  177. ?>
  178. </div>
  179. <div class="clear"></div>
  180. <div class="forumsFooter">
  181. <div class="privileges">
  182. <p class="footerTitle"><?php print __("Extra information");?>.</p>
  183. <img src="<?php print $avatar;?>" title="<?php print ((SESSION("ZanUser")) ? SESSION("ZanUser") : __("Sign up, please") . " :)");?>" alt="<?php print __("A user avatar");?>" />
  184. <?php if(SESSION("ZanUserID")) { ?>
  185. <?php if(SESSION("ZanUserPrivilege") === "Super Admin") { ?>
  186. <p class="<?php if(SESSION("ZanUserMethod")) { print "onlineUserInfo2"; } else { print "onlineUserInfo"; } ?>"><?php print __("Hi there!, ");?> <a href="<?php print _webBase . _sh . _webLang . _sh . "users" . _sh . "editprofile" . _sh;?>" title="<?php print SESSION("ZanUser");?>"><?php print SESSION("ZanUser");?></a>. <br /> <?php print __("Here are your statistics");?>: <br />
  187. <ul class="userStatistics">
  188. <li><strong><?php print __("Topics");?>:</strong> <?php print $stats[0]["Topics"];?></li>
  189. <li><strong><?php print __("Replies");?>:</strong> <?php print $stats[0]["Replies"];?></li>
  190. <li><strong><?php print __("Visits");?>:</strong> <?php print $stats[0]["Visits"];?></li>
  191. </ul>
  192. </p>
  193. <ul class="lsprivileges2">
  194. <li><?php print __("You can");?> <a href="<?php print _webBase . _sh . _webLang . _sh . _cpanel . _sh . _forums . _sh . "action" . _sh . "save";?>" title="<?php print __("Create Forums");?>"><?php print __("create");?></a> <?php print __("new forums");?>.</li>
  195. <li><?php print __("You can create new topics");?>.</li>
  196. <li><?php print __("You can reply to topics");?>.</li>
  197. <li><?php print __("You can send private messages");?>.</li>
  198. </ul>
  199. <?php } elseif(SESSION("ZanUserPrivilege") === "Member") { ?>
  200. <p class="<?php if(SESSION("ZanUserMethod")) { print "onlineUserInfo2"; } else { print "onlineUserInfo"; } ?>"><?php print __("Hi there!, ");?> <a href="<?php print _webBase . _sh . _webLang . _sh . "users" . _sh . "editprofile" . _sh;?>" title="<?php print SESSION("ZanUser");?>"><?php print SESSION("ZanUser");?></a>. <br /> <?php print __("Here are your statistics");?>: <br />
  201. <ul class="userStatistics">
  202. <li><strong><?php print __("Topics");?>:</strong> <?php print $stats[0]["Topics"];?></li>
  203. <li><strong><?php print __("Replies");?>:</strong> <?php print $stats[0]["Replies"];?></li>
  204. <li><strong><?php print __("Visits");?>:</strong> <?php print $stats[0]["Visits"];?></li>
  205. </ul>
  206. </p>
  207. <ul class="lsprivileges2">
  208. <li class="noprivilege"><?php print __("You can <strong>NOT</strong> create new forums");?>.</li>
  209. <li><?php print __("You can create new topics");?>.</li>
  210. <li><?php print __("You can reply to topics");?>.</li>
  211. <li><?php print __("You can send private messages");?>.</li>
  212. </ul>
  213. <?php } ?>
  214. <?php } else { ?>
  215. <p class="noUserInfo"><?php print __("Hi there!, you should");?> <a class="signIn" href="<?php print _webBase . _sh . _webLang . _sh . "users" . _sh . "login" . _sh . "forums";?>" title="<?php print __("Login");?>"><?php print __("login");?></a> <?php print __("to enjoy full access to the forums");?>.
  216. <br /><?php print __("If you don't have an account, you can create it");?> <a class="signUp" href="<?php print _webBase . _sh . _webLang . _sh . "users" . _sh . "register" . _sh . "forums";?>" title="<?php print __("Sign up");?>"><?php print __("here");?></a>.
  217. </p>
  218. <ul class="lsprivileges">
  219. <li class="noprivilege"><?php print __("You can <strong>NOT</strong> create new forums");?>.</li>
  220. <li class="noprivilege"><?php print __("You can <strong>NOT</strong> create new topics");?>.</li>
  221. <li class="noprivilege"><?php print __("You can <strong>NOT</strong> reply to topics");?>.</li>
  222. <li class="noprivilege"><?php print __("You can <strong>NOT</strong> send private messages");?>.</li>
  223. </ul>
  224. <?php } ?>
  225. </div>
  226. <div class="lastUsers">
  227. <p class="footerTitle"><?php print __("Last registered users");?>.</p>
  228. <ol>
  229. <?php foreach($users as $user) { ?>
  230. <li><a href="<?php print _webBase . _sh . _webLang . _sh . _users . _sh . "profile" . _sh . $user["ID_User"];?>" title="<?php print $user["Username"];?>"><?php print $user["Username"];?></a></li>
  231. <?php } ?>
  232. </ol>
  233. </div>
  234. <div class="clear"></div>
  235. </div>