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

/forum/templates/default/tpl_config.php

https://code.google.com/p/torrentpier/
PHP | 191 lines | 154 code | 23 blank | 14 comment | 5 complexity | 9a25202cf3b333cd63be28d4a2798081 MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php
  2. global $bb_cfg, $page_cfg, $template, $images, $lang;
  3. $width = $height = array();
  4. $template_name = basename(dirname(__FILE__));
  5. $_img = BB_ROOT . 'images/';
  6. $_main = BB_ROOT . basename(TEMPLATES_DIR) .'/'. $template_name .'/images/';
  7. $_lang = $_main . basename('lang_'. $bb_cfg['default_lang']) .'/';
  8. // post_buttons
  9. $images['icon_quote'] = $_lang .'icon_quote.gif';
  10. $images['icon_edit'] = $_lang .'icon_edit.gif';
  11. $images['icon_search'] = $_lang .'icon_search.gif';
  12. $images['icon_profile'] = $_lang .'icon_profile.gif';
  13. $images['icon_pm'] = $_lang .'icon_pm.gif';
  14. $images['icon_email'] = $_lang .'icon_email.gif';
  15. $images['icon_delpost'] = $_main .'icon_delete.gif';
  16. $images['icon_ip'] = $_lang .'icon_ip.gif';
  17. $images['icon_mod'] = $_main .'icon_mod.gif';
  18. $images['icon_www'] = $_lang .'icon_www.gif';
  19. $images['icon_icq'] = $_lang .'icon_icq_add.gif';
  20. // post_icons
  21. $images['icon_minipost'] = $_main .'icon_minipost.gif';
  22. $images['icon_gotopost'] = $_main .'icon_minipost.gif';
  23. $images['icon_minipost_new'] = $_main .'icon_minipost_new.gif';
  24. $images['icon_latest_reply'] = $_main .'icon_latest_reply.gif';
  25. $images['icon_newest_reply'] = $_main .'icon_newest_reply.gif';
  26. // forum_icons
  27. $images['forum'] = $_main .'folder_big.gif';
  28. $images['forum_new'] = $_main .'folder_new_big.gif';
  29. $images['forum_locked'] = $_main .'folder_locked_big.gif';
  30. // topic_icons
  31. $images['folder'] = $_main .'folder.gif';
  32. $images['folder_new'] = $_main .'folder_new.gif';
  33. $images['folder_hot'] = $_main .'folder_hot.gif';
  34. $images['folder_hot_new'] = $_main .'folder_new_hot.gif';
  35. $images['folder_locked'] = $_main .'folder_lock.gif';
  36. $images['folder_locked_new'] = $_main .'folder_lock_new.gif';
  37. $images['folder_sticky'] = $_main .'folder_sticky.gif';
  38. $images['folder_sticky_new'] = $_main .'folder_sticky_new.gif';
  39. $images['folder_announce'] = $_main .'folder_announce.gif';
  40. $images['folder_announce_new'] = $_main .'folder_announce_new.gif';
  41. $images['folder_dl'] = $_main .'folder_dl.gif';
  42. $images['folder_dl_new'] = $_main .'folder_dl_new.gif';
  43. $images['folder_dl_hot'] = $_main .'folder_dl_hot.gif';
  44. $images['folder_dl_hot_new'] = $_main .'folder_dl_hot_new.gif';
  45. // attach_icons
  46. $images['icon_clip'] = $_img .'icon_clip.gif';
  47. $images['icon_dn'] = $_img .'icon_dn.gif';
  48. // posting_icons
  49. $images['post_new'] = $_lang .'post.gif';
  50. $images['post_locked'] = $_lang .'reply-locked.gif';
  51. $images['reply_new'] = $_lang .'reply.gif';
  52. $images['reply_locked'] = $_lang .'reply-locked.gif';
  53. // pm_icons
  54. $images['pm_inbox'] = $_main .'msg_inbox.gif';
  55. $images['pm_outbox'] = $_main .'msg_outbox.gif';
  56. $images['pm_savebox'] = $_main .'msg_savebox.gif';
  57. $images['pm_sentbox'] = $_main .'msg_sentbox.gif';
  58. $images['pm_readmsg'] = $_main .'folder.gif';
  59. $images['pm_unreadmsg'] = $_main .'folder_new.gif';
  60. $images['pm_replymsg'] = $_lang .'reply.gif';
  61. $images['pm_postmsg'] = $_lang .'msg_newpost.gif';
  62. $images['pm_quotemsg'] = $_lang .'icon_quote.gif';
  63. $images['pm_editmsg'] = $_lang .'icon_edit.gif';
  64. $images['pm_new_msg'] = '';
  65. $images['pm_no_new_msg'] = '';
  66. // topic_mod_icons will be replaced with SELECT later...
  67. $images['topic_watch'] = '';
  68. $images['topic_un_watch'] = '';
  69. $images['topic_mod_lock'] = $_main .'topic_lock.gif';
  70. $images['topic_mod_unlock'] = $_main .'topic_unlock.gif';
  71. $images['topic_mod_split'] = $_main .'topic_split.gif';
  72. $images['topic_mod_move'] = $_main .'topic_move.gif';
  73. $images['topic_mod_delete'] = $_main .'topic_delete.gif';
  74. $images['topic_dl'] = $_main .'topic_dl.gif';
  75. $images['topic_normal'] = $_main .'topic_normal.gif';
  76. $images['voting_graphic'][0] = $_main .'voting_bar.gif';
  77. $images['voting_graphic'][1] = $_main .'voting_bar.gif';
  78. $images['voting_graphic'][2] = $_main .'voting_bar.gif';
  79. $images['voting_graphic'][3] = $_main .'voting_bar.gif';
  80. $images['voting_graphic'][4] = $_main .'voting_bar.gif';
  81. $images['progress_bar'] = $_main .'progress_bar.gif';
  82. $images['progress_bar_full'] = $_main .'progress_bar_full.gif';
  83. // Report
  84. $images['icon_report'] = $_main .'icon_report.gif';
  85. $images['icon_reported'] = $_main .'icon_reported.gif';
  86. $images['topic_mod_report'] = $_main .'topic_report.gif';
  87. $images['topic_mod_reported'] = $_main .'topic_reported.gif';
  88. // Report [END]
  89. // Vote graphic length defines the maximum length of a vote result graphic, ie. 100% = this length
  90. $bb_cfg['vote_graphic_length'] = 205;
  91. $bb_cfg['privmsg_graphic_length'] = 175;
  92. $bb_cfg['topic_left_column_witdh'] = 150;
  93. // Images auto-resize
  94. $bb_cfg['post_img_width_decr'] = 52; // decrement for posted images width (px)
  95. $bb_cfg['attach_img_width_decr'] = 130; // decrement for attach images width (px)
  96. $template->assign_vars(array(
  97. 'IMG' => $_main,
  98. 'TEXT_BUTTONS' => $bb_cfg['text_buttons'],
  99. 'POST_BTN_SPACER' => ($bb_cfg['text_buttons']) ? '&nbsp;' : '',
  100. 'TOPIC_ATTACH_ICON' => '<img src="images/icon_clip.gif" alt="" />',
  101. 'ATTACHMENT_ICON' => '<img src="images/icon_clip.gif" alt="" />',
  102. 'OPEN_MENU_IMG_ALT1' => '<img src="'. $_main .'menu_open_1.gif" class="menu-alt1" alt="" />',
  103. 'TOPIC_LEFT_COL_SPACER_WITDH' => $bb_cfg['topic_left_column_witdh'] - 8, // 8px padding
  104. // Images auto-resize
  105. 'POST_IMG_WIDTH_DECR_JS' => $bb_cfg['topic_left_column_witdh'] + $bb_cfg['post_img_width_decr'],
  106. 'ATTACH_IMG_WIDTH_DECR_JS' => $bb_cfg['topic_left_column_witdh'] + $bb_cfg['attach_img_width_decr'],
  107. 'MAGNET_LINKS' => $bb_cfg['magnet_links_enabled'],
  108. ));
  109. // post_buttons
  110. if (!empty($page_cfg['load_tpl_vars']) AND $vars = array_flip($page_cfg['load_tpl_vars']))
  111. {
  112. if (isset($vars['post_buttons']))
  113. {
  114. $template->assign_vars(array(
  115. 'QUOTE_IMG' => ($bb_cfg['text_buttons']) ? $lang['REPLY_WITH_QUOTE_TXTB'] : '<img src="'. $images['icon_quote'] .'" alt="Quote" title="'. $lang['REPLY_WITH_QUOTE'] .'" />',
  116. 'EDIT_POST_IMG' => ($bb_cfg['text_buttons']) ? $lang['EDIT_DELETE_POST_TXTB'] : '<img src="'. $images['icon_edit'] .'" alt="Edit" title="'. $lang['EDIT_POST'] .'" />',
  117. 'DELETE_POST_IMG' => ($bb_cfg['text_buttons']) ? $lang['DELETE_POST_TXTB'] : '<img src="'. $images['icon_delpost'] .'" alt="Delete" title="'. $lang['DELETE_POST'] .'" />',
  118. 'IP_POST_IMG' => ($bb_cfg['text_buttons']) ? $lang['VIEW_IP_TXTB'] : '<img src="'. $images['icon_ip'] .'" alt="IP" title="'. $lang['VIEW_IP'] .'" />',
  119. 'MOD_POST_IMG' => ($bb_cfg['text_buttons']) ? $lang['MODERATE_POST_TXTB'] : '<img src="'. $images['icon_mod'] .'" alt="Moderate" title="'. $lang['MODERATE_POST'] .'" />',
  120. 'QUOTE_URL' => BB_ROOT ."posting.php?mode=quote&amp;p=",
  121. 'EDIT_POST_URL' => BB_ROOT ."posting.php?mode=editpost&amp;p=",
  122. 'DELETE_POST_URL' => BB_ROOT ."posting.php?mode=delete&amp;p=",
  123. 'IP_POST_URL' => BB_ROOT ."modcp.php?mode=ip&amp;p=",
  124. 'PROFILE_IMG' => ($bb_cfg['text_buttons']) ? $lang['READ_PROFILE_TXTB'] : '<img src="'. $images['icon_profile'] .'" alt="Profile" title="'. $lang['READ_PROFILE'] .'" />',
  125. 'PM_IMG' => ($bb_cfg['text_buttons']) ? $lang['SEND_PM_TXTB'] : '<img src="'. $images['icon_pm'] .'" alt="PM" title="'. $lang['SEND_PRIVATE_MESSAGE'] .'" />',
  126. 'EMAIL_IMG' => ($bb_cfg['text_buttons']) ? $lang['SEND_EMAIL_TXTB'] : '<img src="'. $images['icon_email'] .'" alt="email" title="'. $lang['SEND_EMAIL'] .'" />',
  127. 'WWW_IMG' => ($bb_cfg['text_buttons']) ? $lang['VISIT_WEBSITE_TXTB'] : '<img src="'. $images['icon_www'] .'" alt="www" title="'. $lang['VISIT_WEBSITE'] .'" />',
  128. 'ICQ_IMG' => ($bb_cfg['text_buttons']) ? $lang['ICQ_TXTB'] : '<img src="'. $images['icon_icq'] .'" alt="ICQ" title="'. $lang['ICQ'] .'" />',
  129. 'EMAIL_URL' => BB_ROOT ."profile.php?mode=email&amp;u=",
  130. 'FORUM_URL' => BB_ROOT . FORUM_URL,
  131. 'ICQ_URL' => 'http://wwp.icq.com/scripts/search.dll?to=',
  132. 'PM_URL' => BB_ROOT . PM_URL,
  133. 'PROFILE_URL' => BB_ROOT . PROFILE_URL,
  134. ));
  135. }
  136. if (isset($vars['post_icons']))
  137. {
  138. $template->assign_vars(array(
  139. 'MINIPOST_IMG' => '<img src="'. $images['icon_minipost'] .'" class="icon1" alt="post" />',
  140. 'ICON_GOTOPOST' => '<img src="'. $images['icon_gotopost'] .'" class="icon1" alt="goto" title="'. $lang['GOTO_PAGE'] .'" />',
  141. 'MINIPOST_IMG_NEW' => '<img src="'. $images['icon_minipost_new'] .'" class="icon1" alt="new" />',
  142. 'ICON_LATEST_REPLY' => '<img src="'. $images['icon_latest_reply'] .'" class="icon2" alt="latest" title="'. $lang['VIEW_LATEST_POST'] .'" />',
  143. 'ICON_NEWEST_REPLY' => '<img src="'. $images['icon_newest_reply'] .'" class="icon2" alt="newest" title="'. $lang['VIEW_NEWEST_POST'] .'" />',
  144. ));
  145. }
  146. if (isset($vars['topic_icons']))
  147. {
  148. $template->assign_vars(array(
  149. 'MOVED' => TOPIC_MOVED,
  150. 'ANNOUNCE' => POST_ANNOUNCE,
  151. 'STICKY' => POST_STICKY,
  152. 'LOCKED' => TOPIC_LOCKED,
  153. 'L_MOVED' => $lang['TOPIC_MOVED'],
  154. 'L_ANNOUNCE' => $lang['TOPIC_ANNOUNCEMENT'],
  155. 'L_DL_TOPIC' => $lang['TOPIC_DL'],
  156. 'L_POLL' => $lang['TOPIC_POLL'],
  157. ));
  158. }
  159. if (isset($vars['pm_icons']))
  160. {
  161. $template->assign_vars(array(
  162. 'INBOX_IMG' => '<img src="'. $images['pm_inbox'] .'" class="pm_box_icon" alt="" />',
  163. 'OUTBOX_IMG' => '<img src="'. $images['pm_outbox'] .'" class="pm_box_icon" alt="" />',
  164. 'SENTBOX_IMG' => '<img src="'. $images['pm_sentbox'] .'" class="pm_box_icon" alt="" />',
  165. 'SAVEBOX_IMG' => '<img src="'. $images['pm_savebox'] .'" class="pm_box_icon" alt="" />',
  166. ));
  167. }
  168. }