Index: branches/5.0.x/themes/advanced/in-bulletin/topics/topic_detail.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/topic_detail.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/topic_detail.tpl (revision 12744)
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [ ]
+
+ - ( )
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="10" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/modify_post.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/modify_post.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/modify_post.tpl (revision 12744)
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+ elements/html_head
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/search_results.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/search_results.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/search_results.tpl (revision 12744)
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ : | : 0
+
+
+ : 05/17/2006
+
+
+
+ img/s.gif" width="1" height="4" alt="" />
+ img/grey_pix.gif" width="100%" height="1" alt="" />
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/new_topic_reply.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/new_topic_reply.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/new_topic_reply.tpl (revision 12744)
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/modify_topic.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/modify_topic.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/modify_topic.tpl (revision 12744)
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/.smsignore
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/.smsignore (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/.smsignore (revision 12744)
@@ -0,0 +1 @@
+topic_detail\.tpl
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/modify_pending_confirm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/modify_pending_confirm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/modify_pending_confirm.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/modify_confirm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/modify_confirm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/modify_confirm.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/new_topic.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/new_topic.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/new_topic.tpl (revision 12744)
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/add_pending_confirm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/add_pending_confirm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/add_pending_confirm.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/add_confirm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/add_confirm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/add_confirm.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/module_info.xml
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/module_info.xml (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/module_info.xml (revision 12744)
@@ -0,0 +1,5 @@
+
+
+ in-bulletin/designs/section
+ in-bulletin/designs/post_list
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/designs/.smsignore
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/designs/.smsignore (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/designs/.smsignore (revision 12744)
@@ -0,0 +1 @@
+.*\.tpl
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/designs/section.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/designs/section.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/designs/section.tpl (revision 12744)
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+ img/s.gif" width="1" height="4" alt="" />
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+ img/forums_new_post.gif" width="20" height="23" alt="" />
+
+
+
+
+
+ img/forums_no_new_post.gif" width="21" height="24" alt="" />
+
+
+
+
+
+ img/forums_locked.gif" width="25" height="23" alt="" />
+
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/view_message.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/view_message.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/view_message.tpl (revision 12744)
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [ "> ]
+
+
+ [ " onclick="return confirm(' ');"> ]
+
+
+
+
+ :
+
+
+
+
+
+
+ :
+ :
+
+
+
+
+
+
+
+ [ "> ]
+
+
+ [ " onclick="return confirm(' ');"> ]
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/private_messages.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/private_messages.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/private_messages.tpl (revision 12744)
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/new_message.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/new_message.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/new_message.tpl (revision 12744)
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/add_confirm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/add_confirm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/add_confirm.tpl (revision 12744)
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/my_account/my_preferences.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/my_account/my_preferences.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/my_account/my_preferences.tpl (revision 12744)
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/my_account/my_items.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/my_account/my_items.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/my_account/my_items.elm.tpl (revision 12744)
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/my_account/preferences_tab.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/my_account/preferences_tab.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/my_account/preferences_tab.elm.tpl (revision 12744)
@@ -0,0 +1 @@
+
Index: branches/5.0.x/themes/advanced/in-bulletin/my_account/my_topics.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/my_account/my_topics.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/my_account/my_topics.tpl (revision 12744)
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/img/icon_post_1.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/toolbar/code_icon.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/toolbar/image_icon.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/toolbar/bold_icon.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/toolbar/italic_icon.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/toolbar/underline_icon.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/toolbar/link_icon.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/ic_pm_list46.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/ic_mytopics46.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/bottom_left_corner.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/bottom_right_corner.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/top_left_corner.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/left_border.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/icons/btn_modify.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/icons/btn_no_icon.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/icons/btn_add_favorites.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/icons/btn_remove_favorites.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/icons/btn_reply.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/top_border.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/bottom_border.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/menu_topics.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/small_buttons/bottom_left_corner.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/small_buttons/bottom_right_corner.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/small_buttons/top_left_corner.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/small_buttons/icons/btn_sm_modify.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/small_buttons/icons/btn_sm_delete.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/small_buttons/icons/btn_threaded.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/small_buttons/icons/btn_sm_quoted.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/small_buttons/top_border.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/small_buttons/bottom_border.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/inc/styles.css
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/inc/styles.css (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/inc/styles.css (revision 12744)
@@ -0,0 +1,149 @@
+.bbcode {
+ border: 1px solid #888888;
+ background-color: #EEEEEE;
+ padding: 10px;
+}
+
+.forums-header TD
+ {
+ padding:6px;
+ color:#21619e;
+ }
+
+.forums-icon-cell
+ {
+ width:20px;
+ padding-right:10px;
+ vertical-align:top;
+ }
+
+.forums-subheaders
+ {
+ background:#f4f4f4;
+ font-weight:bold;
+ padding:5px 15px;
+ font-size:12px;
+ }
+
+
+.forums-subheaders A
+ {
+ color:#000000;
+ text-decoration: underline;
+ }
+
+.forums-subheaders A:hover
+ {
+ color: #666666;
+ text-decoration: underline;
+ }
+
+.forums-cells
+ {
+ vertical-align: middle;
+ padding:10px;
+ }
+
+.post-background-1
+ {
+ background:#f4f4f4;
+ padding:8px;
+ }
+
+.post-background-2
+ {
+ background:#FFFFFF;
+ padding:8px;
+ }
+
+.post-icon-padding-right
+ {
+ padding-right:10px;
+ }
+
+.topic-prewiew-padding-cell TD
+ {
+ padding: 13px;
+ }
+
+.post-control {
+ padding: 0px !important;
+ vertical-align: top;
+}
+
+
+.no-padding TD
+ {
+ padding:0px;
+ }
+
+
+.forums-icon-description TD
+ {
+ padding:10px;
+ vertical-align:middle;
+ }
+
+.topics-icon-padding
+ {
+ width:14px;
+ padding-right:10px;
+ }
+
+.new-private-message {
+ font-weight: bold;
+}
+
+
+
+.quoted-reply {
+ border: 1px dashed #333;
+}
+
+.quoted-reply td {
+ padding: 5px;
+}
+
+/* --- Topic Button Styles --- */
+.big-button-left-border {
+ background: #EFEFEF url('../img/big_buttons/left_border.gif') repeat-y top left;
+}
+
+.big-button-bottom td {
+ background: #EFEFEF url('../img/big_buttons/bottom_border.gif') repeat-x top left;
+}
+
+.big-button-text {
+ background: #EFEFEF url('../img/big_buttons/top_border.gif') repeat-x top left;
+ font: bold 11px Arial, sans-serif;
+ letter-spacing: 0px;
+ color: #1F569A;
+ padding-top: 14px;
+}
+
+.big-button-text a, .big-button-text a:hover {
+ text-decoration: none;
+}
+
+/* --- Post Button Styles --- */
+.small-button-bottom td {
+ background: #efefef url('../img/small_buttons/bottom_border.gif') repeat-x top left
+}
+
+.small-button-text {
+ background: url('../img/small_buttons/top_border.gif') repeat-x top left;
+ font: 10px Arial, sans-serif;
+ color: #153C6A;
+ padding-top: 15px;
+ vertical-align: bottom;
+ height: 27px;
+}
+
+.small-button-text a {
+ color: #153C6A;
+ text-decoration: none;
+}
+
+.small-button-text a:hover {
+ text-decoration: none;
+}
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/inc/script.js
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/inc/script.js (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/inc/script.js (revision 12744)
@@ -0,0 +1,79 @@
+// apply tagOpen/tagClose to selection in textarea,
+// use sampleText instead of selection if there is none
+function insertTags(tagOpen, tagClose, sampleText, textarea_id) {
+ var txtarea = document.getElementById(textarea_id);
+
+ var selText, isSample = false;
+
+ if (document.selection && document.selection.createRange) { // IE/Opera
+ //save window scroll position
+ if (document.documentElement && document.documentElement.scrollTop) {
+ var winScroll = document.documentElement.scrollTop;
+ }
+ else if (document.body) {
+ var winScroll = document.body.scrollTop;
+ }
+
+ //get current selection
+ txtarea.focus();
+ var range = document.selection.createRange();
+ selText = range.text;
+
+ //insert tags
+ checkSelectedText();
+ range.text = tagOpen + selText + tagClose;
+ //mark sample text as selected
+ if (isSample && range.moveStart) {
+ if (window.opera) {
+ tagClose = tagClose.replace(/\n/g,'');
+ }
+ range.moveStart('character', - tagClose.length - selText.length);
+ range.moveEnd('character', - tagClose.length);
+ }
+ range.select();
+
+ //restore window scroll position
+ if (document.documentElement && document.documentElement.scrollTop) {
+ document.documentElement.scrollTop = winScroll;
+ }
+ else if (document.body) {
+ document.body.scrollTop = winScroll;
+ }
+ } else if (txtarea.selectionStart || txtarea.selectionStart == '0') { // Mozilla
+ //save textarea scroll position
+ var textScroll = txtarea.scrollTop;
+
+ //get current selection
+ txtarea.focus();
+ var startPos = txtarea.selectionStart;
+ var endPos = txtarea.selectionEnd;
+ selText = txtarea.value.substring(startPos, endPos);
+
+ //insert tags
+ checkSelectedText();
+ txtarea.value = txtarea.value.substring(0, startPos)
+ + tagOpen + selText + tagClose
+ + txtarea.value.substring(endPos, txtarea.value.length);
+ //set new selection
+ if (isSample) {
+ txtarea.selectionStart = startPos + tagOpen.length;
+ txtarea.selectionEnd = startPos + tagOpen.length + selText.length;
+ } else {
+ txtarea.selectionStart = startPos + tagOpen.length + selText.length + tagClose.length;
+ txtarea.selectionEnd = txtarea.selectionStart;
+ }
+ //restore textarea scroll position
+ txtarea.scrollTop = textScroll;
+ }
+
+ function checkSelectedText(){
+ if (!selText) {
+ selText = sampleText;
+ isSample = true;
+ } else if (selText.charAt(selText.length - 1) == ' ') { //exclude ending space char
+ selText = selText.substring(0, selText.length - 1);
+ tagClose += ' '
+ }
+ }
+
+}
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/topics.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/topics.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/topics.elm.tpl (revision 12744)
@@ -0,0 +1,143 @@
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+ img/topics_icon.gif" width="14" height="12" alt="" />
+
+
+
+
+
+
+ ">
+
+ img/icon_hot.gif" alt=" "/>
+ img/icon_new.gif" alt=" "/>
+ img/icon_popular.gif" alt=" "/>
+ img/icon_pick.gif" alt=" "/>
+ img/icon_favorite.gif" alt=" "/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ img/topics_icon.gif" width="14" height="12" alt="" />
+ " class="text-title">
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+ ">
+
+ img/icon_hot.gif" alt=" "/>
+ img/icon_new.gif" alt=" "/>
+ img/icon_popular.gif" alt=" "/>
+ img/icon_pick.gif" alt=" "/>
+ img/icon_favorite.gif" alt=" "/>
+
+
+
+ ( : )
+
+
+
+ :
+
+
+
+
+
+ img/ic_details.gif" width="14" height="13" alt="" /> ">
+
+
+
+
+ | img/ic_edit.gif" width="11" height="10" alt="" /> ">
+
+
+
+
+
+ | img/ic_delete.gif" width="11" height="10" alt="" /> " onclick="return confirm(' ');">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ img/big_buttons/top_left_corner.gif" width="11" height="16" alt="" />
+
+
+ ">
+
+
+ "> img/big_buttons/icons/ .gif" alt="">
+
+
+
+
+
+ img/big_buttons/bottom_left_corner.gif" width="11" height="10" alt="" />
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+ img/big_buttons/bottom_right_corner.gif" width="11" height="10" alt="" />
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/html_head.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/html_head.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/html_head.elm.tpl (revision 12744)
@@ -0,0 +1,6 @@
+ inc/styles.css" type="text/css" />
+inc/script.js">
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/private_messages.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/private_messages.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/private_messages.elm.tpl (revision 12744)
@@ -0,0 +1,106 @@
+
+ active-tab inactive-tab">
+ ">
+
+
+
+
+
+
+
+ ">
+
+
+
+
+
+
+
+
+
+
+
+ img/small_buttons/top_left_corner.gif" width="5" height="27" alt="" />
+
+
+ " >
+
+
+ "> img/small_buttons/icons/ .gif">
+
+
+
+
+ img/small_buttons/bottom_left_corner.gif" width="5" height="5" alt="" />
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+ img/small_buttons/bottom_right_corner.gif" width="5" height="5" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+ " />
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+ ">
+
+ ( )
+
+
+ ">
+
+ ( )
+
+
+
+
+ ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/add_poll_comment.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/add_poll_comment.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/add_poll_comment.elm.tpl (revision 12744)
@@ -0,0 +1,48 @@
+
+
+
+ ">
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/poll_comments.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/poll_comments.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/poll_comments.elm.tpl (revision 12744)
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
?height=640&width=480" title="
" class="thickbox">
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/search_results.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/search_results.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/search_results.elm.tpl (revision 12744)
@@ -0,0 +1,53 @@
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+
+ : | : 0
+
+
+ : 05/17/2006
+
+
+
+ img/s.gif" width="1" height="4" alt="" />
+ img/grey_pix.gif" width="100%" height="1" alt="" />
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+ img/s.gif" width="1" height="5" alt="" />
+ "> ...
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/related_items.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/related_items.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/related_items.elm.tpl (revision 12744)
@@ -0,0 +1,7 @@
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/contact_user.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/contact_user.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/contact_user.elm.tpl (revision 12744)
@@ -0,0 +1,8 @@
+
+
+
+
+ ">
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/category_topics.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/category_topics.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/category_topics.elm.tpl (revision 12744)
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/my_favorites.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/my_favorites.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/my_favorites.elm.tpl (revision 12744)
@@ -0,0 +1,33 @@
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/side_boxes/poll_results.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/side_boxes/poll_results.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/side_boxes/poll_results.elm.tpl (revision 12744)
@@ -0,0 +1,8 @@
+
+
+ –
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/side_boxes/action_box.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/side_boxes/action_box.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/side_boxes/action_box.elm.tpl (revision 12744)
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ ">
+
+
+
+
+
+
+
+
+
+
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/side_boxes/polls.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/side_boxes/polls.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/side_boxes/polls.elm.tpl (revision 12744)
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+ " onclick="getElementById('selected_opt_ ').value=' ';getElementById('vote_button').disabled=false;">
+
+
+
+
+
+
+
+
+
+
+ " class="thickbox" title=" ">
+ " border="0" alt=" ">
+
+
+
" style="text-align:left; margin-top:10px; margin-bottom:10px">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ " name="selected_opt_ "/>
+ , getElementById('selected_opt_ ').value); return false;" value=" "/>
+
+
+
+
+
+
+
+
+
+ " title=" " class="thickbox"/>
+
+
" title="
" class="thickbox"/>
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/.smsignore
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/.smsignore (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/.smsignore (revision 12744)
@@ -0,0 +1 @@
+.*\.xml\.tpl
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/forms.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/forms.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/forms.elm.tpl (revision 12744)
@@ -0,0 +1,32 @@
+
+ ">
+
+
+ '); return false;">
+ img/toolbar/bold_icon.png" border="0"/>
+
+ '); return false;">
+ img/toolbar/italic_icon.png" border="0"/>
+
+ '); return false;">
+ img/toolbar/underline_icon.png" border="0"/>
+
+ '); return false;">
+ img/toolbar/link_icon.png" border="0"/>
+
+ '); return false;">
+ img/toolbar/image_icon.png" border="0"/>
+
+ '); return false;">
+ img/toolbar/code_icon.png" border="0"/>
+
+
+
+
+
+
+ " name=" " id=" " cols=" " rows=" " style=" ">
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/posts.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/posts.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/posts.elm.tpl (revision 12744)
@@ -0,0 +1,150 @@
+
+ " />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ img/small_buttons/top_left_corner.gif" width="5" height="27" alt="" />
+
+
+
+ " onclick="return confirm(' ');" >
+
+
+ " onclick="return confirm(' ');" > img/small_buttons/icons/ .gif">
+
+
+
+
+ img/small_buttons/bottom_left_corner.gif" width="5" height="5" alt="" />
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+ img/small_buttons/bottom_right_corner.gif" width="5" height="5" alt="" />
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+ " valign="top">
+
+
+
+ img/icon_post_1.gif" width="21" height="24" alt="" />
+
+
+
+ ">
+
+
+
+
+
+
+ :
+ :
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+ " valign="top">
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ------------------------------------------------------------------------------
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/categories.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/categories.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/categories.elm.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+ img/forums_dir.gif" width="20" height="24" alt="" />
+
+
+ ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: branches/5.0.x/in-bulletin/install/prerequisites.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/prerequisites.php (revision 0)
+++ branches/5.0.x/in-bulletin/install/prerequisites.php (revision 12744)
@@ -0,0 +1,80 @@
+_toolkit =& $instance;
+ }
+
+ /**
+ * Checks minimal version, that could be upgradeable
+ *
+ * @param string $mode when called mode {install, standalone, upgrade)
+ */
+ function CheckPrerequisites($versions, $mode)
+ {
+ $errors = Array ();
+
+ if ($mode == 'standalone') {
+ if (!$this->Application->isModuleEnabled('In-Portal')) {
+ $errors[] = 'Please install or enable "In-Portal" module first';
+ }
+ }
+
+ if ($mode == 'upgrade') {
+ $sql = 'SELECT Version
+ FROM ' . TABLE_PREFIX . 'Modules
+ WHERE Name = "In-Portal"';
+ $inportal_version = $this->Conn->GetOne($sql);
+
+ if ($inportal_version === false) {
+ // only, when In-Portal was installed
+ return $errors;
+ }
+
+ $min_version = '4.3.1';
+
+ $current_version = $this->_toolkit->ConvertModuleVersion($inportal_version);
+ $needed_version = $this->_toolkit->ConvertModuleVersion($min_version);
+ if ($current_version < $needed_version) {
+ $errors[] = 'Please upgrade "In-Portal" to version ' . $min_version;
+ }
+ }
+
+ return $errors;
+ }
+ }
+
+?>
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/.htaccess
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/.htaccess (revision 0)
+++ branches/5.0.x/in-bulletin/install/.htaccess (revision 12744)
@@ -0,0 +1 @@
+deny from all
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/module_info.xml
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/module_info.xml (revision 0)
+++ branches/5.0.x/in-bulletin/install/module_info.xml (revision 12744)
@@ -0,0 +1,6 @@
+
+
+ In-Bulletin
+ Discussion Forum
+ in-bulletin/install/img/icon_discussion_forum.gif
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/install_data.sql
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/install_data.sql (revision 0)
+++ branches/5.0.x/in-bulletin/install/install_data.sql (revision 12744)
@@ -0,0 +1,285 @@
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'asc=la_common_Ascending,desc=la_common_Descending', 10.01, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'TopicText=la_opt_TopicText,Posts=la_opt_NumberOfPosts,CreatedOn=la_opt_CreatedOn,LastPostDate=la_opt_LastUpdated,Views=la_opt_TopicViews,CachedRating=la_opt_Rating,LastPoser=la_opt_LastPoster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) ', 10.01, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '', 'TopicText=la_opt_TopicText,Posts=la_opt_NumberOfPosts,CreatedOn=la_opt_CreatedOn,LastPostDate=la_opt_LastUpdated,Views=la_opt_TopicViews,CachedRating=la_opt_Rating,LastPoser=la_opt_LastPoster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) ', 10.02, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_NewDays', 'la_Text_Topics', 'la_topic_newdays_prompt', 'text', '', '', 10.05, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '', 'asc=la_common_Ascending,desc=la_common_Descending', 10.02, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics', 'la_Text_Topics', 'la_topic_perpage_prompt', 'text', '', '', 10.03, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MinPopRating', 'la_Text_Topics', 'la_fld_Topic_MinPopRating', 'text', '', '', 10.06, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MaxHotNumber', 'la_Text_Topics', 'la_fld_Topic_MaxHotNumber', 'text', '', '', 10.08, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_EditorPicksAbove', 'la_Text_Topics', 'la_topic_editorpicksabove_prompt', 'checkbox', '', '', 10.09, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Postings', 'la_posts_subheading', 'la_posts_perpage_prompt', 'text', '', '', 20.01, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Posts_NewDays', 'la_posts_subheading', 'la_posts_newdays_prompt', 'text', '', '', 20.02, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MinPopVotes', 'la_Text_Topics', 'la_fld_Topic_MinPopVotes', 'text', '', '', 10.07, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics_Short', 'la_Text_Topics', 'la_topic_perpage_short_prompt', 'text', '', '', 10.04, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Value', 'la_Text_Topics', 'la_prompt_DupReviews', 'text', '', 'style="width: 50px;"', 10.1, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Interval', 'la_Text_Topics', 'la_prompt_DupReviews', 'select', '', '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year', 10.1, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Value', 'la_Text_Topics', 'la_prompt_DupRating', 'text', '', 'style="width: 50px;"', 10.11, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Interval', 'la_Text_Topics', 'la_prompt_DupRating', 'select', '', '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year', 10.11, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('AutoTopicLockPosts', 'la_Text_Topics', 'la_prompt_PostsToLock', 'text', NULL, NULL, 10.12, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_TopicReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL, NULL, 30.01, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('bb_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 40.01, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 40.02, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_MaxImageCount', 'la_section_ImageSettings', 'la_config_MaxImageCount', 'text', '', '', 50.01, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_ThumbnailImageWidth', 'la_section_ImageSettings', 'la_config_ThumbnailImageWidth', 'text', '', '', 50.02, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_ThumbnailImageHeight', 'la_section_ImageSettings', 'la_config_ThumbnailImageHeight', 'text', '', '', 50.03, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_FullImageWidth', 'la_section_ImageSettings', 'la_config_FullImageWidth', 'text', '', '', 50.04, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_FullImageHeight', 'la_section_ImageSettings', 'la_config_FullImageHeight', 'text', '', '', 50.05, 0, 0);
+
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_topics', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_topics', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_topics', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_topics', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_topics', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_PrivateMessages', 'la_text_PrivateMessages', 'la_text_PrivateMessages_PerPage', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('poll_CommentDelay_Value', 'la_Text_Polls', 'la_prompt_DupPollComments', 'text', '', 'style="width: 50px;"', 60.1, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('poll_CommentDelay_Interval', 'la_Text_Polls', 'la_prompt_DupPollComments', 'select', '', '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year', 60.2, 2, 1);
+
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_Postings', '25', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_Topics', '5', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Posting_SortOrder', 'CreatedOn asc, PostingText', 'inportal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Posts_NewDays', '5', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Bulletin_TopCount', '2', 'inportal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Bulletin_CatNewDays', '10', 'inportal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Bulletin_Pick_First', '1', 'inportal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_SortOrder', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_SortField', 'LastPostDate', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_SortOrder2', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_SortField2', 'Posts', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_NewDays', '6', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_MinPopRating', '3', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_MaxHotNumber', '3', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_EditorPicksAbove', '1', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_MinPopVotes', '8', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Root', '{TopicCatId}', 'In-Portal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Post_Sortfield', DEFAULT, 'In-Bulletin', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Post_SortOrder', DEFAULT, 'In-Bulletin', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'BBTags', 'b:;i:;u:;ul:type|align;font:color|face|size;url:href;img:src|border', 'In-Portal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Post_Background1', '#cccccc', 'In-Portal', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Post_Background2', '#bbbbbb', 'In-Portal', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Background1', '#FAEBD7', 'In-Portal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Background2', '#F5F5DC', 'In-Portal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'AutoTopicLockPosts', '0', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_CategoryTemplate', '/in-bulletin/designs/section', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_ItemTemplate', 'in-bulletin/designs/detail', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Highlight_OpenTag', '', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Highlight_CloseTag', ' ', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_Topics_Short', '3', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'topic_RatingDelay_Interval', '3600', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'topic_RatingDelay_Value', '1', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'topic_ReviewDelay_Interval', '60', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'topic_ReviewDelay_Value', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Increase_topics', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_MaxImageCount', 5, 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_ThumbnailImageWidth', 120, 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_ThumbnailImageHeight', 120, 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_FullImageWidth', 450, 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_FullImageHeight', 450, 'In-Bulletin', 'in-bulletin:configuration_output');
+
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Keyword_topics', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Pop_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Rating_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Increase_posts', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Keyword_posts', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Pop_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Rating_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_ShowMultiple_topics', '0', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_PrivateMessages', '20', 'In-Bulletin', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_TopicReviews', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'poll_CommentDelay_Interval', '60', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'poll_CommentDelay_Value', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+
+INSERT INTO Emoticon VALUES (1, 'Happy Smile', ':)', 1, '');
+INSERT INTO Emoticon VALUES (2, 'Big Grin', ':grin:', 1, '');
+INSERT INTO Emoticon VALUES (3, 'Wink', ';)', 1, '');
+INSERT INTO Emoticon VALUES (4, 'Scared', ':scared:', 1, '');
+INSERT INTO Emoticon VALUES (5, 'Teasing', ':eek:', 1, '');
+INSERT INTO Emoticon VALUES (6, 'Cool', ':cool:', 1, '');
+INSERT INTO Emoticon VALUES (7, 'Angry', ':@', 1, '');
+INSERT INTO Emoticon VALUES (8, 'Squint', ':squint:', 1, '');
+INSERT INTO Emoticon VALUES (9, 'Oops', ':o', 1, '');
+INSERT INTO Emoticon VALUES (10, 'Sad', ':(', 1, '');
+INSERT INTO Emoticon VALUES (11, 'Cry', ':cry:', 1, '');
+INSERT INTO Emoticon VALUES (12, 'Smirk', ';]', 1, '');
+INSERT INTO Emoticon VALUES (13, 'Happy sleep', ':sleep:', 1, '');
+INSERT INTO Emoticon VALUES (14, 'Very angry', ':x', 1, '');
+INSERT INTO Emoticon VALUES (15, 'Geek', ':geek:', 1, '');
+INSERT INTO Emoticon VALUES (16, 'Upset', ';(', 1, '');
+INSERT INTO Emoticon VALUES (17, 'LOL', ':lol:', 1, '');
+INSERT INTO Emoticon VALUES (18, 'Yawn', ':O', 1, '');
+INSERT INTO Emoticon VALUES (19, 'Thinking', ':hm:', 1, '');
+INSERT INTO Emoticon VALUES (20, 'Secret', ':|', 1, '');
+
+UPDATE Emoticon SET EmotionImage = CONCAT('0_',EmoticonId,'.gif');
+
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add.pending', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add.pending', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify.pending', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify.pending', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.APPROVE', NULL, 1, 0, NULL, 'In-Bulletin', 'la_event_topic.approve', 0);
+INSERT INTO Events VALUES(DEFAULT, 'POST.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_post.add', 1);
+INSERT INTO Events VALUES(DEFAULT, 'POST.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_post.modify', 1);
+INSERT INTO Events VALUES(DEFAULT, 'POST.ADD', NULL, 1, 0, NULL, 'In-Bulletin', 'la_event_post.add', 0);
+INSERT INTO Events VALUES(DEFAULT, 'PM.ADD', NULL, 1, 0, NULL, 'In-Bulletin', 'la_event_pm.add', 0);
+
+INSERT INTO ItemTypes VALUES (3, 'In-Bulletin', 'bb', 'Topic', 'TopicText', 'OwnerId', 'Views', 'CachedRating', 'la_ItemTab_Topics', 1, '', 'clsTopic', 'Topic');
+INSERT INTO ItemTypes VALUES (30, 'In-Bulletin', 'posting', 'Posting', 'Subject', 'CreatedById', NULL, NULL, 'la_ItemTab_Posts', 0, '', '', 'Post');
+
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.VIEW', 'lu_PermName_Topic.View_desc', 'lu_PermName_Topic.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.ADD', 'lu_PermName_Topic.Add_desc', 'lu_PermName_Topic.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.ADD.PENDING', 'lu_PermName_Topic.Add.Pending_desc', 'lu_PermName_Topic.Add.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.DELETE', 'lu_PermName_Topic.Delete_desc', 'lu_PermName_Topic.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.MODIFY', 'lu_PermName_Topic.Modify_desc', 'lu_PermName_Topic.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.DELETE', 'lu_PermName_Topic.Reply.Delete_desc', 'lu_PermName_Topic.Reply.Delete_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 'lu_PermName_Topic.Reply.View_desc', 'lu_PermName_Topic.Reply.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 'lu_PermName_Topic.Reply.Add_desc', 'lu_PermName_Topic.Reply.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.MODIFY', 'lu_PermName_Topic.Reply.Modify_desc', 'lu_PermName_Topic.Reply.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.RATE', 'lu_PermName_Topic.Rate_desc', 'lu_PermName_Topic.Rate_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REVIEW', 'lu_PermName_Topic.Review_desc', 'lu_PermName_Topic.Review_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.MODIFY', 'lu_PermName_Topic.Reply.Owner.Modify_desc', 'lu_PermName_Topic.Reply.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.DELETE', 'lu_PermName_Topic.Reply.Owner.Delete_desc', 'lu_PermName_Topic.Reply.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.OWNER.DELETE', 'lu_PermName_Topic.Owner.Delete_desc', 'lu_PermName_Topic.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.MODIFY.PENDING', 'lu_PermName_Topic.Modify.Pending_desc', 'lu_PermName_Topic.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY.PENDING', 'lu_PermName_Topic.Owner.Modify.Pending_desc', 'lu_PermName_Topic.Owner.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY', 'lu_PermName_Topic.Owner.Modify_desc', 'lu_PermName_Topic.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.LOCK', 'lu_PermName_Topic.Lock_desc', 'lu_PermName_Topic.Lock_error', 'In-Bulletin');
+
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT count(*) FROM <%prefix%>Topic WHERE Status=1', NULL, 'la_prompt_ActiveTopics', 0, 1);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS TotalTopics FROM <%prefix%>Topic', NULL, 'la_prompt_TopicsTotal', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS ActiveTopics FROM <%prefix%>Topic WHERE Status = 1', NULL, 'la_prompt_TopicsActive', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS PendingTopics FROM <%prefix%>Topic WHERE Status = 2', NULL, 'la_prompt_TopicsPending', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS DisabledTopics FROM <%prefix%>Topic WHERE Status = 0', NULL, 'la_prompt_TopicsDisabled', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS NewTopics FROM <%prefix%>Topic WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Topic_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewTopics', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>Topic WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickTopics', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS HotTopics FROM <%prefix%>Topic WHERE (HotItem = 1) OR (Posts >= <%m:config name="Topic_MaxHotNumber"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotTopics', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS PopularTopics FROM <%prefix%>Topic WHERE (PopItem = 1) OR ( (CachedRating >= <%topic:hit_count type="top"%>) AND <%topic:hit_count type="top"%> AND (PopItem = 2) )', NULL, 'la_prompt_PopularTopics', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Topic WHERE CachedRating > 0', NULL, 'la_prompt_TopicAverageRating', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT MAX(Views) AS MaxTopicHits FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicHits', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT MAX(CachedVotesQty) AS MaxTopicVotes FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicVotes', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_TopicReviews', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS TotalPosts FROM <%prefix%>Posting', NULL, 'la_prompt_PostsTotal', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostDate', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostTime', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostDate', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostTime', 0, 2);
+
+INSERT INTO SearchConfig VALUES ('Topic', 'NotifyOwnerOnChanges', 0, 1, 'lu_fielddesc_topic_notifyowneronchanges', 'lu_field_notifyowneronchanges', 'In-Bulletin', 'la_text_topic', 1, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicId', 0, 1, 'lu_fielddesc_topic_topicid', 'lu_field_topicid', 'In-Bulletin', 'la_text_topic', 0, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Priority', 0, 1, 'lu_fielddesc_topic_priority', 'lu_field_priority', 'In-Bulletin', 'la_text_topic', 8, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OwnerId', 0, 1, 'lu_fielddesc_topic_ownerid', 'lu_field_ownerid', 'In-Bulletin', 'la_text_topic', 9, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Modified', 0, 1, 'lu_fielddesc_topic_modified', 'lu_field_modified', 'In-Bulletin', 'la_text_topic', 2, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicText', 1, 1, 'lu_fielddesc_topic_topictext', 'lu_field_topictext', 'In-Bulletin', 'la_text_topic', 3, DEFAULT, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Posts', 0, 1, 'lu_fielddesc_topic_posts', 'lu_field_posts', 'In-Bulletin', 'la_text_topic', 4, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Views', 0, 1, 'lu_fielddesc_topic_views', 'lu_field_views', 'In-Bulletin', 'la_text_topic', 5, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'EditorsPick', 0, 1, 'lu_fielddesc_topic_editorspick', 'lu_field_editorspick', 'In-Bulletin', 'la_text_topic', 6, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Status', 0, 1, 'lu_fielddesc_topic_status', 'lu_field_status', 'In-Bulletin', 'la_text_topic', 7, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ModifiedById', 0, 1, 'lu_fielddesc_topic_modifiedbyid', 'lu_field_modifiedbyid', 'In-Bulletin', 'la_text_topic', 10, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ResourceId', 0, 1, 'lu_fielddesc_topic_resourceid', 'lu_field_resourceid', 'In-Bulletin', 'la_text_topic', 11, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicType', 0, 1, 'lu_fielddesc_topic_topictype', 'lu_field_topictype', 'In-Bulletin', 'la_text_topic', 12, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CreatedOn', 0, 1, 'lu_fielddesc_topic_createdon', 'lu_field_createdon', 'In-Bulletin', 'la_text_topic', 13, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedReviewsQty', 0, 1, 'lu_fielddesc_topic_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Bulletin', 'la_text_topic', 14, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedRating', 0, 1, 'lu_fielddesc_topic_cachedrating', 'lu_field_cachedrating', 'In-Bulletin', 'la_text_topic', 15, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedVotesQty', 0, 1, 'lu_fielddesc_topic_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Bulletin', 'la_text_topic', 16, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'NewItem', 0, 1, 'lu_fielddesc_topic_newitem', 'lu_field_newitem', 'In-Bulletin', 'la_text_topic', 17, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PopItem', 0, 1, 'lu_fielddesc_topic_popitem', 'lu_field_popitem', 'In-Bulletin', 'la_text_topic', 18, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'HotItem', 0, 1, 'lu_fielddesc_topic_hotitem', 'lu_field_hotitem', 'In-Bulletin', 'la_text_topic', 19, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PostedBy', 0, 1, 'lu_fielddesc_topic_postedby', 'lu_field_postedby', 'In-Bulletin', 'la_text_topic', 20, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OrgId', 0, 1, 'lu_fielddesc_topic_orgid', 'lu_field_orgid', 'In-Bulletin', 'la_text_topic', 21, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'LastPostId', 0, 1, 'lu_fielddesc_topic_lastpostid', 'lu_field_lastpostid', 'In-Bulletin', 'la_text_topic', 22, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY.PENDING', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.ADD.PENDING', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.RATE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REVIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.DELETE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.RATE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REVIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.ADD.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.RATE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REVIEW', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.LOCK', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:topics.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:setting_folder.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_output.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_output.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_search.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_search.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_censorship.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_censorship.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_censorship.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_censorship.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_emoticon.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_emoticon.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_emoticon.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_email.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_email.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_custom.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_custom.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_custom.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_custom.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:polls.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:polls.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:polls.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:polls.delete', 11, 1, 1, 0);
+
+#INSERT INTO ImportScripts VALUES (DEFAULT, 'In-Bulletin', 'phpbb', 'phpbb_import', 'phpBB 2.x', 'phpBB', 'user_regular,init_cat', 1, 'db');
+
+INSERT INTO CustomField VALUES (DEFAULT, 1, 'bb_ItemTemplate', 'la_fld_cust_bb_ItemTemplate', 0, 'la_title_SystemCF', 'la_fld_cust_bb_ItemTemplate', 'text', NULL, '', 0, 0, 1, 0);
+
+INSERT INTO Modules VALUES ('In-Bulletin', 'in-bulletin/', 'bb', DEFAULT, 1, 3, 'in-bulletin/', {TopicCatId}, NULL);
Index: branches/5.0.x/in-bulletin/install/install_order.txt
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/install_order.txt (revision 0)
+++ branches/5.0.x/in-bulletin/install/install_order.txt (revision 12744)
@@ -0,0 +1 @@
+104
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/english.lang
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/english.lang (revision 0)
+++ branches/5.0.x/in-bulletin/install/english.lang (revision 12744)
@@ -0,0 +1,255 @@
+
+ m/d/Y g:i A m/d/Y g:i:s A . , utf-8 http://docs.in-portal.org/eng/index.php 2
+
+ Q2Vuc29yZWQgV29yZA==
+ VXNlcg==
+ S2V5IFN0cm9rZQ==
+ TGFzdCBQb3N0IE9u
+ RGF0ZS9UaW1l
+ RGF5cyBBY3RpdmU=
+ Q29tbWVudA==
+ UG9zdGVy
+ UmVwbGllcw==
+ UmVwbGFjZW1lbnQ=
+ VG9waWM=
+ Vmlld3M=
+ Vm90ZXM=
+ UG9zdCBBZGRlZA==
+ UG9zdCBNb2RpZmllZA==
+ VG9waWMgQWRkZWQ=
+ QWRkIFBlbmRpbmcgVG9waWM=
+ QXBwcm92ZSBUb3BpYw==
+ TW9kaWZ5IFRvcGlj
+ VG9waWMgTW9kaWZpY2F0aW9ucyBQZW5kaW5n
+ QWxsb3cgQ29tbWVudHM=
+ QWxsb3cgTXVsdGlwbGUgVm90aW5ncw==
+ Q2Vuc29yZWQgV29yZA==
+ VG9waWNzIEl0ZW0gVGVtcGxhdGU=
+ RW5kIERhdGU=
+ SW1hZ2U=
+ S2V5IFN0cm9rZQ==
+ QW5zd2Vy
+ Q29tbWVudA==
+ R3Vlc3QgRW1haWw=
+ R3Vlc3QgTmFtZQ==
+ UG9zdGVkIEJ5
+ UXVlc3Rpb24=
+ UmVwbGFjZW1lbnQ=
+ UmVxdWlyZSBMb2dpbg==
+ VG9waWMgTG9ja2Vk
+ TWF4aW11bSBudW1iZXIgb2YgSE9UIHRvcGljcw==
+ TWluaW11bSByYXRpbmcgdG8gY29uc2lkZXIgdG9waWMgUE9Q
+ TWluaW11bSBudW1iZXIgb2YgcG9zdHMgdG8gY29uc2lkZXIgdG9waWMgUE9Q
+ Vmlld3M=
+ SW4tQnVsbGV0aW4=
+ VG9waWNz
+ TGFzdCBQb3N0ZXI=
+ TGFzdCBVcGRhdGVk
+ TnVtYmVyIG9mIFBvc3Rz
+ VG9waWMgVGV4dA==
+ VG9waWMgVmlld3M=
+ TmV3IHBvc3RzIChkYXlzKQ==
+ TnVtYmVyIG9mIHBvc3RzIHBlciBwYWdl
+ UG9zdHM=
+ QWN0aXZlIFRvcGljcw==
+ QWxsb3cgRHVwbGljYXRlIENvbW1lbnRz
+ RWRpdG9yIFBpY2sgVG9waWNz
+ SG90IFRvcGljcw==
+ TGFzdCBVcGRhdGVkIFBvc3QgRGF0ZQ==
+ TGFzdCBVcGRhdGVkIFBvc3QgVGltZQ==
+ TGFzdCBVcGRhdGVkIFRvcGljIERhdGU=
+ TGFzdCBVcGRhdGVkIFRvcGljIFRpbWU=
+ VG9waWMgTWF4aW11bSBIaXRz
+ VG9waWMgTWF4aW11bSBWb3Rlcw==
+ TmV3ZXN0IFBvc3QgRGF0ZQ==
+ TmV3ZXN0IFBvc3QgVGltZQ==
+ TmV3ZXN0IFRvcGljIERhdGU=
+ TmV3ZXN0IFRvcGljIFRpbWU=
+ TmV3IFRvcGljcw==
+ UG9wdWxhciBUb3BpY3M=
+ UG9zdHMgdG8gbG9jaw==
+ VG90YWwgUG9zdHM=
+ VG9waWNzIEF2ZXJhZ2UgUmF0aW5n
+ VG90YWwgVG9waWMgQ29tbWVudHM=
+ QWN0aXZlIFRvcGljcw==
+ RGlzYWJsZWQgVG9waWNz
+ UGVuZGluZyBUb3BpY3M=
+ VG90YWwgVG9waWNz
+ VG90YWwgVXNlcnMgd2l0aCBUb3BpY3M=
+ VG9waWM=
+ Q2Vuc29yc2hpcA==
+ U21pbGV5cw==
+ QW5zd2Vycw==
+ VXNlciBDb21tZW50cw==
+ VG9waWNz
+ UG9sbCBTZXR0aW5ncw==
+ VG9waWM=
+ VG9waWNz
+ QWRkaW5nIENlbnNvcnNoaXA=
+ QWRkaW5nIFNtaWxleQ==
+ QWRkaW5nIFRvcGlj
+ QWRkaW5nIEFuc3dlcg==
+ QWRkaW5nIENvbW1lbnQ=
+ QWRkaW5nIFBvbGw=
+ RWRpdGluZyBDZW5zb3JzaGlw
+ RWRpdGluZyBTbWlsZXk=
+ RWRpdGluZyBUb3BpYw==
+ RWRpdGluZyBBbnN3ZXI=
+ RWRpdGluZyBDb21tZW50
+ RWRpdGluZyBQb2xs
+ VG9waWNz
+ TmV3IFBvbGw=
+ TmV3IFRvcGlj
+ UG9sbCBBbnN3ZXJz
+ VXNlciBDb21tZW50cw==
+ UG9sbHM=
+ VG9waWNz
+ TmV3IFBvbGw=
+ TmV3IFRvcGlj
+ TmV3IEFuc3dlcg==
+ TmV3IENvbW1lbnQ=
+ UmVzZXQgVm90ZXM=
+ RGlzcGxheSBlZGl0b3IgcGlja3MgYWJvdmUgcmVndWxhciB0b3BpY3M=
+ TmV3IFRvcGljcyAoRGF5cyk=
+ TnVtYmVyIG9mIHRvcGljcyBwZXIgcGFnZQ==
+ VG9waWNzIFBlciBQYWdlIChTaG9ydGxpc3Qp
+ QW5kIHRoZW4gYnk=
+ U29ydCB0b3BpY3MgYnk=
+ RGVsZXRlIFBvc3Q=
+ TG9jayBUb3BpYw==
+ TW9kaWZ5IFBvc3Q=
+ TmV3IFByaXZhdGUgTWVzc2FnZQ==
+ TmV3IHRvcGlj
+ UmF0ZSBUb3BpYw==
+ UmVwbHk=
+ UmVwbHkgUXVvdGVk
+ U2VuZCBQcml2YXRlIE1lc3NhZ2U=
+ VW5sb2NrIFRvcGlj
+ Vm90ZQ==
+ QXV0aG9y
+ RGF0ZQ==
+ Rm9ydW1z
+ RnJvbQ==
+ TGFzdCBQb3N0
+ UG9zdGVy
+ UG9zdHM=
+ UmVwbGllcw==
+ U3ViamVjdA==
+ VG8=
+ VG9waWNz
+ QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSB0aGUgcG9zdD8NClRoaXMgYWN0aW9uIGNhbm5vdCBiZSB1bmRvbmUu
+ QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSB0aGUgcHJpdmF0ZSBtZXNzYWdlPyBUaGlzIGFjdGlvbiBjYW5ub3QgYmUgdW5kb25lLg==
+ QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSB0aGUgdG9waWM/IFRoaXMgYWN0aW9uIGNhbm5vdCBiZSB1bmRvbmUu
+ TWFuYWdlIHlvdXIgVG9waWNzIGhlcmU=
+ TGFzdCBQb3N0IElE
+ UG9zdGVkIEJ5
+ VG9waWMgUG9zdHM=
+ VG9waWMgSUQ=
+ VG9waWMgVGV4dA==
+ VG9waWMgVHlwZQ==
+ QXV0aG9y
+ RElzYWJsZSBCQiBjb2Rlcw==
+ RGlzYWJsZSBzbWlsZXlz
+ RW5hYmxlIEJCIENvZGVz
+ RW5hYmxlIFNtaWxleXM=
+ RnJvbQ==
+ TWVzc2FnZQ==
+ U2lnbmF0dXJl
+ Tm90aWZ5IGFib3V0IFByaXZhdGUgTWVzc2FnZXM=
+ Tm90aWZ5IG1lIGFib3V0IHJlcGxpZXM=
+ UG9zdHMgcGVyIHBhZ2U=
+ U2hvdyBTaWduYXR1cmVz
+ U2hvdyBzaWduYXR1cmU=
+ U3ViamVjdA==
+ VG8=
+ VG9waWNzIHBlciBwYWdl
+ U2VudA==
+ Rm9ydW1z
+ Rm9ydW0gaXMgbG9ja2VkIGZvciBwb3N0aW5n
+ TG9ja2VkIFRvcGlj
+ RGF0ZQ==
+ TXkgVG9waWNz
+ TmV3IFRvcGlj
+ VGhlIHN5c3RlbSBhZG1pbmlzdHJhdG9yIG11c3QgYXBwcm92ZSB5b3VyIHRvcGljIGJlZm9yZSBpdCBpcyBwdWJsaWNseSBhdmFpbGFibGUu
+ VGhlIFRvcGljIHlvdSBoYXZlIGNyZWF0ZWQgaGFzIGJlZW4gYWRkZWQgdG8gdGhlIHN5c3RlbQ==
+ Rm9ydW0gaGFzIG5ldyBwb3N0cw==
+ Tm8gbWVzc2FnZXM=
+ bm8gc3ViamVjdA==
+ Tm8gVG9waWNz
+ Rm9ydW0gaGFzIG5vIG5ldyBwb3N0cw==
+ UmVhZA==
+ UmVwbGllZA==
+ U2VudA==
+ VW5yZWFk
+ Vmlld2Vk
+ QWRkIFBlbmRpbmcgVG9waWM=
+ QWRkIFRvcGlj
+ RGVsZXRlIFRvcGlj
+ TG9jay9VbmxvY2sgVG9waWNz
+ TW9kaWZ5IFRvcGljIFBlbmRpbmc=
+ TW9kaWZ5IFRvcGlj
+ VG9waWMgT3duZXIgRGVsZXRl
+ T3duZXIgTW9kaWZ5IFRvcGljIFBlbmRpbmc=
+ VG9waWMgT3duZXIgTW9kaWZ5
+ UmF0ZSBUb3BpYw==
+ QWRkIFRvcGljIFJlcGx5
+ RGVsZXRlIFRvcGlj
+ UmVwbHkgVG9waWMgTW9kaWZ5
+ UG9zdCBPd25lciBEZWxldGU=
+ UG9zdCBPd25lciBNb2RpZnk=
+ VmlldyBUb3BpYyBSZXBseQ==
+ Q29tbWVudCBUb3BpYw==
+ VmlldyBUb3BpYw==
+ UG9zdGVk
+ cG9zdHM=
+ UHJpdmF0ZSBNZXNzYWdlcw==
+ Rm9ydW1z
+ QWxyZWFkeSB2b3RlZCE=
+ UGxlYXNlIGxvZ2luIHRvIHZvdGUh
+ VGhhbmsgeW91IGZvciB1cGRhdGluZyB5b3VyIHRvcGljLg==
+ VGhhbmsgeW91IGZvciB1cGRhdGluZyB5b3VyIHRvcGljLiBZb3VyIG1vZGlmaWNhdGlvbnMgYXJlIHBlbmRpbmcgZm9yIGFkbWluaXN0cmF0aXZlIGFwcHJvdmFsLg==
+ TXkgVG9waWNz
+ Tm8gcGVybWlzc2lvbnMgdG8gbW9kaWZ5IHRoaXMgdG9waWM=
+ Tm8gcGVybWlzc2lvbnMgdG8gc3VibWl0IGEgbmV3IHRvcGljIGludG8gdGhlIGN1cnJlbnQgY2F0ZWdvcnku
+ Tm8gcGVybWlzc2lvbnMgdG8gcmVwbHkgaW4gdGhpcyB0b3BpYw==
+ Tm8gcGVybWlzc2lvbnMgdG8gbW9kaWZ5IHRoaXMgcG9zdC4=
+ Tm8gcGVybWlzc2lvbnMgdG8gdmlldyByZXBsaWVzIGZvciB0aGlzIHRvcGljLg==
+ QWRkaW5nIENvbW1lbnQ=
+ UHJpdmF0ZSBNZXNzYWdlIFNlbnQ=
+ TmV3IFRvcGljIEFkZGVk
+ TmV3IFRvcGljIFBlbmRpbmc=
+ RmF2b3JpdGUgVG9waWNz
+ VG9waWMgTW9kaWZpY2F0aW9uIENvbmZpcm1hdGlvbg==
+ VG9waWMgUGVuZGluZyBNb2RpZmljYXRpb24gQ29uZmlybWF0aW9u
+ TmV3IFByaXZhdGUgTWVzc2FnZQ==
+ TmV3IFRvcGlj
+ UG9zdCBSZXBseQ==
+ UG9sbHM=
+ UHJpdmF0ZSBNZXNzYWdlIERldGFpbHM=
+ UHJpdmF0ZSBNZXNzYWdlcw==
+ TW9kaWZ5IFBvc3Q=
+ VG9waWMgUG9zdHM=
+ VG9waWNz
+ VG9waWMgU2VhcmNoIFJlc3VsdHM=
+ VmlldyBDb21tZW50cw==
+ VG9waWNz
+ TGFzdCB1cGRhdGVk
+ VG90YWwgdG9waWNz
+
+
+ U3ViamVjdDogTmV3IFByaXZhdGUgTWVzc2FnZQoKWW91IGhhdmUgYSBuZXcgcHJpdmF0ZSBtZXNzYWdlIGhhcyBhcnJpdmVkLg==
+ U3ViamVjdDogTmV3IFRvcGljIFJlcGx5IGhhcyBiZWVuIGFkZGVkCgpOZXcgcmVwbHkgaGFzIGJlZW4gYWRkZWQgdG8gb25lIG9mIHlvdXIgdG9waWNzOiA8YSBocmVmPSI8aW5wMjpiYl9Ub3BpY0xpbmsgdGVtcGxhdGU9Il9fZGVmYXVsdF9fIi8+Ij48aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz48L2E+
+ U3ViamVjdDogTmV3IFRvcGljIFJlcGx5IGhhcyBiZWVuIEFkZGVkCgpOZXcgcmVwbHkgaGFzIGJlZW4gYWRkZWQgdG8gdGhlIFRvcGljOiAgPGEgaHJlZj0iPGlucDI6YmJfVG9waWNMaW5rIHRlbXBsYXRlPSJfX2RlZmF1bHRfXyIvPiI+PGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+PC9hPg==
+ U3ViamVjdDogUG9zdCBoYXMgYmVlbiBNb2RpZmllZAoKQSBwb3N0IGhhcyBiZWVuIG1vZGlmaWVkLg==
+ U3ViamVjdDogTmV3IFRvcGljICI8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4iIGhhcyBiZWVuIHN1Ym1pdHRlZAoKTmV3IFRvcGljIGhhcyBiZWVuIHN1Ym1pdHRlZCBvbiA8aW5wMjptX0Jhc2VVcmwvPjxicj48YnI+DQoNClRvcGljOiA8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4=
+ U3ViamVjdDogTmV3IFRvcGljICI8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4iIGhhcyBiZWVuIHN1Ym1pdHRlZAoKTmV3IFRvcGljIGhhcyBiZWVuIHN1Ym1pdHRlZCBvbiA8aW5wMjptX0Jhc2VVcmwvPjxicj48YnI+DQoNClRvcGljOiA8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4=
+ U3ViamVjdDogTmV3IHRvcGljICI8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4iIGlzIHBlbmRpbmcKCllvdXIgdG9waWMgaXMgcmVjZWl2ZWQgYW5kIHBlbmRpbmcgZm9yIGFkbWluaXN0cmF0aXZlIGFwcHJvdmFsPGJyPjxicj4NCg0KVG9waWM6IDxpbnAyOmJiX0ZpZWxkIG5hbWU9IlRvcGljVGV4dCIvPg==
+ U3ViamVjdDogTmV3IFRvcGljICI8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4iIGlzIHBlbmRpbmcKCk5ldyB0b3BpYyBoYXMgYmVlbiBzdWJtaXR0ZWQgYW5kIHBlbmRpbmcgZm9yIHlvdXIgYXBwcm92YWwuPGJyPjxicj4NCg0KVG9waWM6IDxpbnAyOmJiX0ZpZWxkIG5hbWU9IlRvcGljVGV4dCIvPg==
+ U3ViamVjdDogVG9waWMgIjxpbnAyOmJiX0ZpZWxkIG5hbWU9IlRvcGljVGV4dCIvPiIgaXMgYXBwcm92ZWQKCllvdXIgdG9waWMgaGFzIGJlZW4gYXBwcm92ZWQgb24gPGlucDI6bV9CYXNlVXJsLz48YnI+PGJyPg0KDQpUb3BpYzogPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+
+ U3ViamVjdDogVG9waWMgVXBkYXRlZCAiPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+IgoKWW91ciB0b3BpYyBoYXMgYmVlbiB1cGRhdGVkLjxicj48YnI+DQoNClRvcGljOiA8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4NCg0K
+ U3ViamVjdDogVG9waWMgVXBkYXRlZCBUb3BpYyAiPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+IgoKVXNlciB1cGRhdGVkIHRoZSB0b3BpYy48YnI+PGJyPg0KDQpUb3BpYzogPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+
+ U3ViamVjdDogVG9waWMgTW9kaWZpY2F0aW9ucyAiPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+IiBwZW5kaW5nCgpUb3BpYyBtb2RpZmljYXRpb25zIGFyZSBwZW5kaW5nIGZvciBhZG1pbmlzdHJhdGl2ZSBhcHByb3ZhbC48YnI+PGJyPg0KDQpUb3BpYzogPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+
+ U3ViamVjdDogVG9waWMgTW9kaWZpY2F0aW9ucyAiPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+IiBwZW5kaW5nCgpVc2VyIHN1Ym1pdHRlZCB0byB0b3BpYyBtb2RpZmljYXRpb25zIGFuZCBwZW5kaW5nIGZvciBhcHByb3ZhbC48YnI+PGJyPg0KDQpUb3BpYzogPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/install_schema.sql
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/install_schema.sql (revision 0)
+++ branches/5.0.x/in-bulletin/install/install_schema.sql (revision 12744)
@@ -0,0 +1,198 @@
+CREATE TABLE Posting (
+ PostingId int(11) NOT NULL AUTO_INCREMENT,
+ IPAddress varchar(255) NOT NULL DEFAULT '',
+ PosterAlias varchar(255) NOT NULL DEFAULT '',
+ Pending tinyint(4) NOT NULL DEFAULT '0',
+ `Subject` varchar(255) DEFAULT NULL,
+ PostingText text,
+ GraphicsUrl varchar(255) DEFAULT NULL,
+ CreatedOn int(11) DEFAULT NULL,
+ Modified int(11) DEFAULT NULL,
+ ModifiedById int(11) DEFAULT NULL,
+ CreatedById int(11) DEFAULT NULL,
+ TopicId int(11) NOT NULL DEFAULT '0',
+ ResourceId int(11) NOT NULL DEFAULT '0',
+ ReplyTo int(11) NOT NULL DEFAULT '0',
+ `Options` int(11) NOT NULL DEFAULT '0',
+ PRIMARY KEY (PostingId),
+ KEY TopicId (TopicId),
+ KEY Pending (Pending),
+ KEY CreatedById (CreatedById),
+ KEY CreatedOn (CreatedOn),
+ KEY ModifiedOn (Modified),
+ KEY ModifiedById (ModifiedById)
+);
+
+CREATE TABLE Topic (
+ TopicId int(11) NOT NULL AUTO_INCREMENT,
+ NotifyOwnerOnChanges tinyint(4) NOT NULL DEFAULT '0',
+ Modified int(11) DEFAULT NULL,
+ TopicText varchar(255) NOT NULL DEFAULT '',
+ AutomaticFilename tinyint(3) unsigned NOT NULL DEFAULT '1',
+ Posts int(11) NOT NULL DEFAULT '0',
+ Views double(20,6) NOT NULL DEFAULT '0.000000',
+ EditorsPick tinyint(4) NOT NULL DEFAULT '0',
+ `Status` tinyint(4) unsigned NOT NULL DEFAULT '2',
+ Priority int(11) NOT NULL DEFAULT '0',
+ OwnerId int(11) NOT NULL DEFAULT '-1',
+ ModifiedById int(11) NOT NULL DEFAULT '0',
+ ResourceId int(11) DEFAULT NULL,
+ TopicType int(11) NOT NULL DEFAULT '1',
+ CreatedOn int(11) DEFAULT NULL,
+ CachedReviewsQty int(11) NOT NULL DEFAULT '0',
+ CachedRating varchar(10) NOT NULL DEFAULT '0',
+ CachedVotesQty int(11) NOT NULL DEFAULT '0',
+ NewItem tinyint(4) NOT NULL DEFAULT '2',
+ PopItem tinyint(4) NOT NULL DEFAULT '2',
+ HotItem tinyint(4) NOT NULL DEFAULT '2',
+ PostedBy varchar(255) NOT NULL DEFAULT '',
+ OrgId int(11) DEFAULT NULL,
+ LastPostId int(11) NOT NULL DEFAULT '0',
+ LastPostDate int(11) DEFAULT NULL,
+ TodayDate date DEFAULT NULL,
+ TodayPosts int(11) NOT NULL DEFAULT '0',
+ MetaKeywords varchar(255) DEFAULT NULL,
+ MetaDescription text,
+ PRIMARY KEY (TopicId),
+ UNIQUE KEY ResourceId (ResourceId),
+ KEY OwnerId (OwnerId),
+ KEY ModifiedById (ModifiedById),
+ KEY Posts (Posts),
+ KEY Modified (Modified),
+ KEY Views (Views),
+ KEY EditorsPick (EditorsPick),
+ KEY `Status` (`Status`),
+ KEY Priority (Priority),
+ KEY CreatedOn (CreatedOn),
+ KEY NewItem (NewItem),
+ KEY PopItem (PopItem),
+ KEY HotItem (HotItem),
+ KEY LastPostId (LastPostId)
+);
+
+CREATE TABLE Censorship (
+ CensorshipId int(11) NOT NULL auto_increment,
+ BadWord varchar(80) NOT NULL default '',
+ Replacement varchar(80) NOT NULL default '',
+ PRIMARY KEY (CensorshipId)
+);
+
+CREATE TABLE Emoticon (
+ EmoticonId int(11) NOT NULL AUTO_INCREMENT,
+ `Name` varchar(20) NOT NULL DEFAULT '',
+ KeyStroke varchar(20) NOT NULL DEFAULT '',
+ Enabled int(11) NOT NULL DEFAULT '1',
+ EmotionImage varchar(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (EmoticonId),
+ KEY Enabled (Enabled),
+ KEY EmotionImage (EmotionImage)
+);
+
+CREATE TABLE PrivateMessageBody (
+ PMBodyId int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `Subject` varchar(255) NOT NULL DEFAULT '',
+ Body text,
+ `Options` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ ReferenceCount smallint(5) unsigned NOT NULL DEFAULT '2',
+ PRIMARY KEY (PMBodyId),
+ KEY ReferenceCount (ReferenceCount)
+);
+
+CREATE TABLE PrivateMessages (
+ PmId int(11) unsigned NOT NULL AUTO_INCREMENT,
+ FromId int(11) unsigned DEFAULT NULL,
+ ToId int(11) unsigned DEFAULT NULL,
+ FolderId tinyint(3) NOT NULL DEFAULT '-1',
+ `Status` tinyint(1) unsigned NOT NULL DEFAULT '0',
+ PMBodyId int(11) unsigned NOT NULL DEFAULT '0',
+ CreatedOn int(11) unsigned DEFAULT NULL,
+ PRIMARY KEY (PmId),
+ KEY FromId (FromId),
+ KEY CreatedOn (CreatedOn),
+ KEY ToId (ToId),
+ KEY FolderId (FolderId)
+);
+
+CREATE TABLE TopicCustomData (
+ CustomDataId int(11) NOT NULL auto_increment,
+ ResourceId int(10) unsigned NOT NULL default '0',
+ KEY ResourceId (ResourceId),
+ PRIMARY KEY (CustomDataId)
+);
+
+CREATE TABLE Polls (
+ PollId int(11) NOT NULL AUTO_INCREMENT,
+ `Name` varchar(255) NOT NULL DEFAULT '',
+ l1_Question text,
+ l2_Question text,
+ l3_Question text,
+ l4_Question text,
+ l5_Question text,
+ Image varchar(255) NOT NULL DEFAULT '',
+ CreatedOn int(11) unsigned DEFAULT NULL,
+ StartDate int(11) unsigned DEFAULT NULL,
+ EndDate int(11) unsigned DEFAULT NULL,
+ Priority tinyint(4) NOT NULL DEFAULT '0',
+ RequireLogin tinyint(4) NOT NULL DEFAULT '0',
+ AllowMultipleVotings tinyint(4) NOT NULL DEFAULT '1',
+ AllowComments tinyint(4) NOT NULL DEFAULT '1',
+ `Status` tinyint(4) NOT NULL DEFAULT '1',
+ CachedVotesQty int(11) NOT NULL DEFAULT '0',
+ PRIMARY KEY (PollId),
+ KEY `Status` (`Status`),
+ KEY Priority (Priority),
+ KEY StartDate (StartDate),
+ KEY EndDate (EndDate)
+);
+
+CREATE TABLE PollsAnswers (
+ AnswerId int(11) NOT NULL AUTO_INCREMENT,
+ PollId int(11) NOT NULL DEFAULT '0',
+ l1_Answer text,
+ l2_Answer text,
+ l3_Answer text,
+ l4_Answer text,
+ l5_Answer text,
+ VotesQty int(11) NOT NULL DEFAULT '0',
+ Priority int(11) NOT NULL DEFAULT '0',
+ `Status` tinyint(4) NOT NULL DEFAULT '1',
+ PRIMARY KEY (AnswerId),
+ KEY `Status` (`Status`),
+ KEY Priority (Priority),
+ KEY VoteCount (VotesQty),
+ KEY PollId (PollId)
+);
+
+CREATE TABLE PollsComments (
+ CommentId int(11) NOT NULL AUTO_INCREMENT,
+ PollId int(11) NOT NULL DEFAULT '0',
+ AnswerId int(11) DEFAULT NULL,
+ CreatedById int(11) NOT NULL DEFAULT '-2',
+ GuestName varchar(255) NOT NULL DEFAULT '',
+ GuestEmail varchar(255) NOT NULL DEFAULT '',
+ CommentBody text,
+ CreatedOn int(11) DEFAULT NULL,
+ UserIP varchar(255) NOT NULL DEFAULT '',
+ Priority int(11) NOT NULL DEFAULT '0',
+ `Status` tinyint(4) NOT NULL DEFAULT '1',
+ PRIMARY KEY (CommentId),
+ KEY `Status` (`Status`),
+ KEY Priority (Priority),
+ KEY CreatedOn (CreatedOn),
+ KEY AnswerId (AnswerId),
+ KEY PollId (PollId),
+ KEY CreatedById (CreatedById)
+);
+
+CREATE TABLE PollsStatistics (
+ StatisticsId int(11) NOT NULL AUTO_INCREMENT,
+ PollId int(11) NOT NULL DEFAULT '0',
+ AnswerId int(11) NOT NULL DEFAULT '0',
+ CreatedById int(11) NOT NULL DEFAULT '-2',
+ UserIP varchar(255) NOT NULL DEFAULT '',
+ AnswerDate int(10) unsigned DEFAULT NULL,
+ PRIMARY KEY (StatisticsId),
+ KEY AnswerId (AnswerId,PollId),
+ KEY CreatedById (CreatedById),
+ KEY UserIP (UserIP)
+);
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/remove_schema.sql
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/remove_schema.sql (revision 0)
+++ branches/5.0.x/in-bulletin/install/remove_schema.sql (revision 12744)
@@ -0,0 +1,11 @@
+DROP TABLE Posting;
+DROP TABLE Topic;
+DROP TABLE Censorship;
+DROP TABLE Emoticon;
+DROP TABLE PrivateMessageBody;
+DROP TABLE PrivateMessages;
+DROP TABLE TopicCustomData;
+DROP TABLE Polls;
+DROP TABLE PollsAnswers;
+DROP TABLE PollsComments;
+DROP TABLE PollsStatistics;
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/img/.htaccess
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/img/.htaccess (revision 0)
+++ branches/5.0.x/in-bulletin/install/img/.htaccess (revision 12744)
@@ -0,0 +1 @@
+allow from all
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/img/icon_discussion_forum.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/install/upgrades.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/upgrades.php (revision 0)
+++ branches/5.0.x/in-bulletin/install/upgrades.php (revision 12744)
@@ -0,0 +1,96 @@
+_toolkit =& $instance;
+ }
+
+ /**
+ * Changes table structure, where multilingual fields of TEXT type are present
+ *
+ * @param string $mode when called mode {before, after)
+ */
+ function Upgrade_5_0_0($mode)
+ {
+ if ($mode == 'after') {
+ $root_category = $this->Application->findModule('Name', 'In-Bulletin', 'RootCat');
+
+ $sql = 'UPDATE ' . $this->Application->getUnitOption('c', 'TableName') . '
+ SET UseMenuIconUrl = 1, MenuIconUrl = "in-bulletin/img/menu_topics.gif"
+ WHERE ' . $this->Application->getUnitOption('c', 'IDField') . ' = ' . $root_category;
+ $this->Conn->Query($sql);
+
+ $this->_updateDetailTemplate('bb', 'inbulletin/post_list', 'in-bulletin/designs/detail');
+ }
+ }
+
+ /**
+ * Replaces deprecated detail template design with new one
+ *
+ * @param string $prefix
+ * @param string $from_template
+ * @param string $to_template
+ */
+ function _updateDetailTemplate($prefix, $from_template, $to_template)
+ {
+ $sql = 'SELECT CustomFieldId
+ FROM ' . TABLE_PREFIX . 'CustomField
+ WHERE FieldName = "' . $prefix . '_ItemTemplate"';
+ $custom_field_id = $this->Conn->GetOne($sql);
+
+ $ml_formatter =& $this->Application->recallObject('kMultiLanguage');
+ /* @var $ml_formatter kMultiLanguage */
+
+ $field = $ml_formatter->LangFieldName('cust_' . $custom_field_id, true);
+
+ $sql = 'UPDATE ' . TABLE_PREFIX . 'CategoryCustomData
+ SET ' . $field . ' = "' . $to_template . '"
+ WHERE ' . $field . ' = "' . $from_template . '"';
+ $this->Conn->Query($sql);
+ }
+
+ /**
+ * Update to 5.0.1, update details template
+ *
+ * @param string $mode when called mode {before, after)
+ */
+ function Upgrade_5_0_1($mode)
+ {
+ if ($mode == 'after') {
+ $this->_updateDetailTemplate('bb', 'in-bulletin/designs/detail', 'in-bulletin/topics/topic_detail');
+ }
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/upgrades.sql
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/upgrades.sql (revision 0)
+++ branches/5.0.x/in-bulletin/install/upgrades.sql (revision 12744)
@@ -0,0 +1,164 @@
+# ===== v 4.3.9 =====
+ALTER TABLE Emoticon
+ ADD EmotionImage VARCHAR(255) NOT NULL,
+ ADD INDEX (EmotionImage),
+ DROP ImageId;
+
+UPDATE Emoticon SET EmotionImage = CONCAT('0_',EmoticonId,'.gif') WHERE EmoticonId < 21;
+
+# ===== v 5.0.0 =====
+CREATE TABLE Polls (
+ PollId int(11) NOT NULL auto_increment,
+ `Name` varchar(255) NOT NULL default '',
+ l1_Question text,
+ l2_Question text,
+ l3_Question text,
+ l4_Question text,
+ l5_Question text,
+ Image varchar(255) NOT NULL default '',
+ CreatedOn int(11) unsigned NOT NULL,
+ StartDate int(11) unsigned NOT NULL,
+ EndDate int(11) unsigned default NULL,
+ Priority tinyint(4) NOT NULL default '0',
+ RequireLogin tinyint(4) NOT NULL default '0',
+ AllowMultipleVotings tinyint(4) NOT NULL default '1',
+ AllowComments tinyint(4) NOT NULL default '1',
+ `Status` tinyint(4) NOT NULL default '1',
+ CachedVotesQty int(11) NOT NULL,
+ PRIMARY KEY (PollId),
+ KEY `Status` (`Status`),
+ KEY Priority (Priority),
+ KEY StartDate (StartDate),
+ KEY EndDate (EndDate)
+);
+
+CREATE TABLE PollsAnswers (
+ AnswerId int(11) NOT NULL auto_increment,
+ PollId int(11) NOT NULL,
+ l1_Answer text,
+ l2_Answer text,
+ l3_Answer text,
+ l4_Answer text,
+ l5_Answer text,
+ VotesQty int(11) NOT NULL,
+ Priority int(11) NOT NULL default '0',
+ Status tinyint(4) NOT NULL default '1',
+ PRIMARY KEY (AnswerId),
+ KEY Status (Status),
+ KEY Priority (Priority),
+ KEY VoteCount (VotesQty),
+ KEY PollId (PollId)
+);
+
+CREATE TABLE PollsComments (
+ CommentId int(11) NOT NULL auto_increment,
+ PollId int(11) NOT NULL,
+ AnswerId int(11) default NULL,
+ CreatedById int(11) NOT NULL default '-2',
+ GuestName varchar(255) NOT NULL,
+ GuestEmail varchar(255) NOT NULL,
+ CommentBody text,
+ CreatedOn int(11) NOT NULL,
+ UserIP varchar(255) NOT NULL,
+ Priority int(11) NOT NULL,
+ `Status` tinyint(4) NOT NULL default '1',
+ PRIMARY KEY (CommentId),
+ KEY `Status` (`Status`),
+ KEY Priority (Priority),
+ KEY CreatedOn (CreatedOn),
+ KEY AnswerId (AnswerId),
+ KEY PollId (PollId),
+ KEY CreatedById (CreatedById)
+);
+
+CREATE TABLE PollsStatistics (
+ StatisticsId int(11) NOT NULL auto_increment,
+ PollId int(11) NOT NULL default '0',
+ AnswerId int(11) NOT NULL default '0',
+ CreatedById int(11) NOT NULL default '-2',
+ UserIP varchar(255) NOT NULL,
+ AnswerDate int(10) unsigned default NULL,
+ PRIMARY KEY (StatisticsId),
+ KEY AnswerId (AnswerId,PollId),
+ KEY CreatedById (CreatedById),
+ KEY UserIP (UserIP)
+);
+
+INSERT INTO ConfigurationAdmin VALUES ('poll_CommentDelay_Value', 'la_Text_Polls', 'la_prompt_DupPollComments', 'text', '', '', 60.1, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('poll_CommentDelay_Interval', 'la_Text_Polls', 'la_prompt_DupPollComments', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 60.2, 2, 1);
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'poll_CommentDelay_Interval', '60', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'poll_CommentDelay_Value', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+
+UPDATE Category SET Template = '/in-bulletin/designs/section' WHERE Template = 'inbulletin/index';
+UPDATE Category SET CachedTemplate = '/in-bulletin/designs/section' WHERE CachedTemplate = 'inbulletin/index';
+
+UPDATE ConfigurationValues SET VariableValue = '/in-bulletin/designs/section' WHERE VariableName = 'bb_CategoryTemplate';
+UPDATE ConfigurationValues SET VariableValue = 'in-bulletin/designs/detail' WHERE VariableName = 'bb_ItemTemplate';
+
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:topics.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:setting_folder.view', 11, 1, 1, 0);
+DELETE FROM Permissions WHERE Permission LIKE 'in-bulletin:inbulletin_general.%';
+
+UPDATE Phrase SET Module = 'In-Bulletin' WHERE ((Phrase LIKE '%Topic%' OR Phrase LIKE '%Post%' OR Phrase LIKE '%Forum%' OR Phrase LIKE '%Censor%' OR Phrase LIKE '%Smiley%' OR Phrase = 'la_title_In-Bulletin') AND (Module = 'Core'));
+
+# ===== v 5.0.1 =====
+UPDATE ConfigurationValues SET VariableValue = 'in-bulletin/topics/topic_detail' WHERE VariableName = 'bb_ItemTemplate';
+
+UPDATE ConfigurationAdmin
+SET ValueList = 'TopicText=la_opt_TopicText,Posts=la_opt_NumberOfPosts,CreatedOn=la_opt_CreatedOn,LastPostDate=la_opt_LastUpdated,Views=la_opt_TopicViews,CachedRating=la_opt_Rating,LastPoser=la_opt_LastPoster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) '
+WHERE VariableName IN ('Topic_SortField', 'Topic_SortField2');
+
+UPDATE ConfigurationAdmin
+SET ValueList = 'ASC=la_common_Ascending,DESC=la_common_Descending'
+WHERE VariableName IN ('Topic_SortOrder', 'Topic_SortOrder2');
+
+UPDATE ConfigurationAdmin SET ValueList = '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year' WHERE VariableName = 'topic_ReviewDelay_Interval';
+UPDATE ConfigurationAdmin SET ValueList = '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year' WHERE VariableName = 'topic_RatingDelay_Interval';
+UPDATE ConfigurationAdmin SET ValueList = '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year' WHERE VariableName = 'poll_CommentDelay_Interval';
+
+UPDATE CustomField SET FieldLabel = 'la_fld_cust_bb_ItemTemplate', Prompt = 'la_fld_cust_bb_ItemTemplate' WHERE FieldName = 'bb_ItemTemplate';
+
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add.pending', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add.pending', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify.pending', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify.pending', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.APPROVE', NULL, 1, 0, NULL, 'In-Bulletin', 'la_event_topic.approve', 0);
+
+UPDATE ConfigurationAdmin SET ValueList = 'style="width: 50px;"' WHERE VariableName IN ('topic_ReviewDelay_Value', 'topic_RatingDelay_Value', 'poll_CommentDelay_Value');
+
+# ===== v 5.0.2-B1 =====
+ALTER TABLE PrivateMessageBody CHANGE Body Body text NULL;
+
+ALTER TABLE Emoticon CHANGE EmotionImage EmotionImage VARCHAR(255) NOT NULL DEFAULT '';
+
+ALTER TABLE Polls
+ CHANGE CreatedOn CreatedOn INT(11) UNSIGNED NULL DEFAULT NULL ,
+ CHANGE StartDate StartDate INT(11) UNSIGNED NULL DEFAULT NULL ,
+ CHANGE CachedVotesQty CachedVotesQty INT(11) NOT NULL DEFAULT '0';
+
+ALTER TABLE PollsAnswers
+ CHANGE PollId PollId INT(11) NOT NULL DEFAULT '0',
+ CHANGE VotesQty VotesQty INT(11) NOT NULL DEFAULT '0';
+
+ALTER TABLE PollsComments
+ CHANGE PollId PollId INT(11) NOT NULL DEFAULT '0',
+ CHANGE GuestName GuestName VARCHAR(255) NOT NULL DEFAULT '',
+ CHANGE GuestEmail GuestEmail VARCHAR(255) NOT NULL DEFAULT '',
+ CHANGE CreatedOn CreatedOn INT(11) NULL DEFAULT NULL ,
+ CHANGE UserIP UserIP VARCHAR(255) NOT NULL DEFAULT '',
+ CHANGE Priority Priority INT(11) NOT NULL DEFAULT '0';
+
+ALTER TABLE PollsStatistics CHANGE UserIP UserIP VARCHAR(255) NOT NULL DEFAULT '';
+
+ALTER TABLE Posting
+ CHANGE CreatedOn CreatedOn INT(11) NULL DEFAULT NULL,
+ CHANGE Modified Modified INT(11) NULL DEFAULT NULL;
+
+ALTER TABLE PrivateMessages CHANGE CreatedOn CreatedOn INT(11) UNSIGNED NULL DEFAULT NULL;
+
+ALTER TABLE Topic
+ CHANGE Modified Modified INT(11) NULL DEFAULT NULL,
+ CHANGE CreatedOn CreatedOn INT(11) NULL DEFAULT NULL;
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/constants.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/constants.php (revision 0)
+++ branches/5.0.x/in-bulletin/constants.php (revision 12744)
@@ -0,0 +1,23 @@
+toolkit;
+ /* @var $toolkit kInstallToolkit */
+ }
+
+ $application =& kApplication::Instance();
+ $application->Init();
+
+ if ($application->RecallVar('user_id') != -1) {
+ die('restricted access!');
+ }
+
+ $category =& $toolkit->createModuleCategory('Forums', 'Discussion Forums', '/in-bulletin/designs/section', 'in-bulletin/img/menu_topics.gif');
+
+ $toolkit->RunSQL('/' . $module_folder . '/install/install_schema.sql');
+ $toolkit->RunSQL('/' . $module_folder . '/install/install_data.sql', '{TopicCatId}', $category->GetID());
+ $toolkit->ImportLanguage('/' . $module_folder . '/install/english');
+
+ $toolkit->SetModuleRootCategory($module_folder, $category->GetID());
+
+// $toolkit->linkCustomFields($module_folder, 'bb', 3); // to create Custom Fields for Topics
+ $toolkit->linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field
+ $toolkit->setModuleItemTemplate($category, 'bb', 'in-bulletin/topics/topic_detail');
+
+ $toolkit->finalizeModuleInstall($module_folder, true);
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/relations_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/relations_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/relations_edit.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/topics_reviews.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/topics_reviews.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/topics_reviews.tpl (revision 12744)
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/topics_images.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/topics_images.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/topics_images.tpl (revision 12744)
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/topics_relations.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/topics_relations.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/topics_relations.tpl (revision 12744)
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+
+
+
+
+ ">
+ ">
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/topics_categories.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/topics_categories.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/topics_categories.tpl (revision 12744)
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/images_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/images_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/images_edit.tpl (revision 12744)
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/topics_custom.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/topics_custom.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/topics_custom.tpl (revision 12744)
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/review_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/review_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/review_edit.tpl (revision 12744)
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/topics_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/topics_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/topics_edit.tpl (revision 12744)
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/emoticons/emoticon_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/emoticons/emoticon_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/emoticons/emoticon_edit.tpl (revision 12744)
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: branches/5.0.x/in-bulletin/admin_templates/emoticons/emoticon_list.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/emoticons/emoticon_list.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/emoticons/emoticon_list.tpl (revision 12744)
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/catalog_tab.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/catalog_tab.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/catalog_tab.tpl (revision 12744)
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
" view_template="in-bulletin/catalog_tab" edit_template="in-bulletin/topics/topics_edit" category_id="-1" dep_buttons="new_topic" class="catalog-tab">
+
+
+
+
+ $Catalog.setItemCount(' ', ' ');
+
+
+
+
+
+
+
+
+
+
+ $Catalog.setItemCount(' ', ' ');
+ $Catalog.setCurrentCategory(' ', );
+ $Catalog.saveSearch(' ', ' ', ' ');
+
+
+
+
+ Grids[' '].AddAlternativeGrid(' ', true);
+
+ Grids[' '].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','sep3','cut','copy','move_up','move_down','sep6'));
+ $Catalog.reflectPasteButton( );
+ $Catalog.setViewMenu(' ');
+
+ Grids[' '].DblClick = function() {return false};
+
+ #separator#
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/category_properties.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/category_properties.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/category_properties.tpl (revision 12744)
@@ -0,0 +1,2 @@
+
+
Index: branches/5.0.x/in-bulletin/admin_templates/censorship/censorship_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/censorship/censorship_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/censorship/censorship_edit.tpl (revision 12744)
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/censorship/censorship_list.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/censorship/censorship_list.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/censorship/censorship_list.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/user_item_tab.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/user_item_tab.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/user_item_tab.tpl (revision 12744)
@@ -0,0 +1,34 @@
+
+
+
+
+
" view_template="in-bulletin/user_item_tab" edit_template="in-bulletin/topics/topics_edit" dep_buttons="new_topic" category_id="-1" class="catalog-tab">
+
+
+
+
+
+
+
+
+
+
+
+ $Catalog.setItemCount(' ', ' ');
+ $Catalog.setCurrentCategory(' ', );
+ $Catalog.saveSearch(' ', ' ', ' ');
+
+
+
+ Grids[' '].SetDependantToolbarButtons( new Array('edit','delete'));
+ $Catalog.setViewMenu(' ');
+ #separator#
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/img/logo_bg.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/itemicons/icon16_topics.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/itemicons/icon16_topic_new.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/itemicons/icon16_topic_disabled.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/itemicons/icon16_topic_pending.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/itemicons/icon16_topic.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/icons/icon24_conf_censorship.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/icons/icon24_polls.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/icons/icon24_conf_topics.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/icons/icon24_topics.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/icons/icon24_conf_smileys.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/toolbar/tool_new_topic.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/toolbar/tool_new_topic_f3.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/toolbar/tool_new_topic_f2.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/polls/comment_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/polls/comment_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/polls/comment_edit.tpl (revision 12744)
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit_answers.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit_answers.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit_answers.tpl (revision 12744)
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/polls/answer_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/polls/answer_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/polls/answer_edit.tpl (revision 12744)
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/polls/poll_list.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/polls/poll_list.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/polls/poll_list.tpl (revision 12744)
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit_comments.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit_comments.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit_comments.tpl (revision 12744)
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit.tpl (revision 12744)
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/topics/topics_tag_processor.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/topics/topics_tag_processor.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/topics/topics_tag_processor.php (revision 12744)
@@ -0,0 +1,79 @@
+ItemLink($params, 'topic');
+ }
+
+ function ListTopics($params)
+ {
+ return $this->PrintList2($params);
+ }
+
+ function PostingLink($params)
+ {
+ $item_id = getArrayValue($params, 'posting_id');
+ if (!$item_id) {
+ $item_id = $this->Application->GetVar($this->Prefix.'_post_id');
+ }
+ $params[$this->Prefix.'_post_id'] = $item_id;
+ return $this->TopicLink($params);
+ }
+
+ function PostingDeleteLink($params)
+ {
+ $params['Action'] = 'bb_post_delete';
+ return $this->PostingLink($params);
+ }
+
+ /**
+ * Returns topic replies count
+ *
+ * @param Array $params
+ * @return int
+ */
+ function TopicReplies($params)
+ {
+ $object =& $this->getObject($params);
+
+ // -1 - don't count post created together with topic
+ return $object->GetDBField('Posts') ? $object->GetDBField('Posts') - 1 : 0;
+ }
+
+ /**
+ * Returns topic lock statis
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function IsLocked($params)
+ {
+ $object =& $this->getObject($params);
+
+ return $object->GetDBField('TopicType') == 0;
+ }
+
+ function LockToggleLink($params)
+ {
+ $params[$this->Prefix.'_event'] = 'OnTopicLockToggle';
+ $params['pass'] = 'm,'.$this->Prefix;
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/topics/topics_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/topics/topics_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/topics/topics_config.php (revision 12744)
@@ -0,0 +1,407 @@
+ 'bb',
+ 'ItemClass' => Array('class' => 'kCatDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kCatDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'TopicsEventHandler', 'file' => 'topics_event_handler.php', 'require_classes' => Array('kCatDBEventHandler'), 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'TopicsTagProcessor', 'file' => 'topics_tag_processor.php', 'require_classes' => Array('kCatDBTagProcessor'), 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'ConfigPriority' => 0,
+
+ 'RewritePriority' => 103,
+ 'RewriteListener' => 'ModRewriteHelper:CategoryItemRewriteListener',
+
+ 'Hooks' => Array (
+ Array (
+ 'Mode' => hBEFORE,
+ 'Conditional' => false,
+ 'HookToPrefix' => '',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnAfterConfigRead'),
+ 'DoPrefix' => 'cdata',
+ 'DoSpecial' => '*',
+ 'DoEvent' => 'OnDefineCustomFields',
+ ),
+ ),
+
+ 'CatalogItem' => true,
+ 'AdminTemplatePath' => 'topics',
+ 'AdminTemplatePrefix' => 'topics_',
+ 'SearchConfigPostfix' => 'topics',
+
+ 'IDField' => 'TopicId',
+ 'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events
+
+ 'TitleField' => 'TopicText', // field, used in bluebar when editing existing item
+ 'TitlePhrase' => 'la_Text_Topic', // phrase used to specify item type in relationship list
+ 'OwnerField' => 'OwnerId', // usually it is CreatedById
+
+ 'TitlePresets' => Array(
+ 'default' => Array( 'new_status_labels' => Array('bb' => '!la_title_AddingTopic!'),
+ 'edit_status_labels' => Array('bb' => '!la_title_EditingTopic!'),
+ 'new_titlefield' => Array('bb' => '!la_title_NewTopic!'),
+ ),
+
+ 'topics_edit' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_General!"),
+ 'topics_categories' => Array('prefixes' => Array('bb','bb-ci_List'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Categories!"),
+ 'topics_relations' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Relations!"),
+ 'topics_images' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Images!"),
+ 'topics_reviews' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Reviews!"),
+ 'topics_custom' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Custom!"),
+
+ 'images_edit' => Array( 'prefixes' => Array('bb', 'bb-img'),
+ 'new_status_labels' => Array('bb-img'=>'!la_title_Adding_Image!'),
+ 'edit_status_labels' => Array('bb-img'=>'!la_title_Editing_Image!'),
+ 'new_titlefield' => Array('bb-img'=>'!la_title_New_Image!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-img_status# '#bb-img_titlefield#'",
+ ),
+
+ 'reviews_edit' => Array( 'prefixes' => Array('bb', 'bb-rev'),
+ 'new_status_labels' => Array('bb-rev'=>"!la_title_Adding_Review! '!la_title_New_Review!'"),
+ 'edit_status_labels' => Array('bb-rev'=>'!la_title_Editing_Review!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-rev_status#",
+ ),
+
+ 'relations_edit' => Array( 'prefixes' => Array('bb', 'bb-rel'),
+ 'new_status_labels' => Array('bb-rel'=>"!la_title_Adding_Relationship! '!la_title_New_Relationship!'"),
+ 'edit_status_labels' => Array('bb-rel'=>'!la_title_Editing_Relationship!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-rel_status#",
+ ),
+
+ 'tree_in-bulletin' => Array('format' => '!la_Text_Version! '.$this->Application->findModule('Name', 'In-Bulletin', 'Version')),
+ ),
+
+ 'EditTabPresets' => Array (
+ 'Default' => Array (
+ 'general' => Array ('title' => 'la_tab_General', 't' => 'in-bulletin/topics/topics_edit', 'priority' => 1),
+ 'categories' => Array ('title' => 'la_tab_Categories', 't' => 'in-bulletin/topics/topics_categories', 'priority' => 2),
+ 'relations' => Array ('title' => 'la_tab_Relations', 't' => 'in-bulletin/topics/topics_relations', 'priority' => 3),
+ 'images' => Array ('title' => 'la_tab_Images', 't' => 'in-bulletin/topics/topics_images', 'priority' => 4),
+ 'reviews' => Array ('title' => 'la_tab_Reviews', 't' => 'in-bulletin/topics/topics_reviews', 'priority' => 5),
+ 'custom' => Array ('title' => 'la_tab_Custom', 't' => 'in-bulletin/topics/topics_custom', 'priority' => 6),
+ ),
+ ),
+
+ 'PermItemPrefix' => 'TOPIC',
+
+ 'PermTabText' => 'In-Bulletin',
+ 'PermSection' => Array('main' => 'CATEGORY:in-bulletin:topics_list', 'search' => 'in-bulletin:configuration_search', 'email' => 'in-bulletin:configuration_email', 'custom' => 'in-bulletin:configuration_custom'),
+
+ 'Sections' => Array(
+ /*'in-bulletin' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'settings_in-bulletin',
+ 'label' => 'la_title_In-Bulletin',
+ 'url' => Array('t' => 'index', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 3.3,
+ 'container' => true,
+ 'type' => stTREE,
+ ),*/
+
+ 'in-bulletin:topics' => Array(
+ 'parent' => 'in-portal:site',
+ 'icon' => 'topics',
+ 'label' => 'la_tab_Topics',
+ 'url' => Array('t' => 'catalog/advanced_view', 'anchor' => 'tab-bb.showall', 'pass' => 'm'),
+ 'onclick' => 'setCatalogTab(\'bb.showall\')',
+ 'permissions' => Array('view'),
+ 'priority' => 3.4,
+ 'type' => stTREE,
+ ),
+
+ // topic settings
+ 'in-bulletin:setting_folder' => Array (
+ 'parent' => 'in-portal:system',
+ 'icon' => 'conf_topics',
+ 'label' => 'la_title_In-Bulletin',
+ 'url' => Array ('t' => 'index', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array ('view'),
+ 'priority' => 3.5,
+ 'container' => true,
+ 'type' => stTREE,
+ ),
+
+ /*'in-bulletin:inbulletin_general' => Array(
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'core:settings_general',
+ 'label' => 'la_tab_GeneralSettings',
+ 'url' => Array('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 2.9,
+ 'type' => stTREE,
+ ),*/
+
+ 'in-bulletin:configuration_output' => Array(
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'core:conf_output',
+ 'label' => 'la_tab_ConfigOutput',
+ 'url' => Array('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_search' => Array(
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'core:conf_search',
+ 'label' => 'la_tab_ConfigSearch',
+ 'url' => Array('t' => 'config/config_search', 'module_key' => 'topics', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+
+ 'in-bulletin:configuration_email' => Array(
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'core:conf_email',
+ 'label' => 'la_tab_ConfigE-mail',
+ 'url' => Array('t' => 'config/config_email', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_custom' => Array(
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'core:conf_customfields',
+ 'label' => 'la_tab_ConfigCustom',
+ 'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 3, 'pass_section' => true, 'pass' => 'm,cf'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 6,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_new'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_hot'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_pop'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_pick'), 'type' => WHERE_FILTER),
+ ),
+ 'Filters' => Array(
+ 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
+ 'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ),
+ 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
+ 's1' => Array(),
+ 'show_new' => Array('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ),
+ 'show_hot' => Array('label' => 'la_Text_Hot', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ),
+ 'show_pop' => Array('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ),
+ 'show_pick' => Array('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '%1$s.`EditorsPick` != 1' ),
+ )
+ ),
+
+ 'CatalogSelectorName' => 'topiclist',
+
+ 'ItemPropertyMappings' => Array(
+ 'NewDays' => 'Topic_NewDays', // number of days item to be NEW
+ 'MinPopVotes' => 'Topic_MinPopVotes', // minimum number of votes for an item to be POP
+ 'MinPopRating' => 'Topic_MinPopRating', // minimum rating for an item to be POP
+ 'MaxHotNumber' => 'Topic_MaxHotNumber', // maximum number of HOT items
+
+ 'HotLimit' => 'Topic_HotLimit', // variable name in inp_Cache table
+ 'ClickField' => 'Views', // item click count is stored here (in item table)
+ ),
+
+ 'ItemType' => 3, // this is used when relation to product is added from in-portal and via-versa
+
+ 'ViewMenuPhrase' => 'la_title_Topics',
+ 'CatalogTabIcon' => 'in-bulletin:icon16_topics.png',
+ 'UsePendingEditing' => true, // item editing is controlled by TOPIC.ADD/EDIT, TOPIC.ADD/EDIT.PENDING permissions
+
+ 'StatisticsInfo' => Array(
+ 'pending' => Array(
+ 'icon' => 'icon16_topic_pending.gif',
+ 'label' => 'la_Text_Topics',
+ 'js_url' => '#url#',
+ 'url' => Array('t' => 'catalog/advanced_view', 'SetTab' => 'bb', 'pass' => 'm,bb.showall', 'bb.showall_event' => 'OnSetFilterPattern', 'bb.showall_filters' => 'show_active=0,show_pending=1,show_disabled=0,show_new=1,show_hot=1,show_pop=1,show_pick=1'),
+ 'status' => STATUS_PENDING,
+ ),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'Topic',
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.OwnerId = -1, "root", IF (%1$s.OwnerId = -2, "Guest", "n/a")), u.Login)',
+ 'CategoryId' => TABLE_PREFIX.'%3$sCategoryItems.CategoryId',
+ 'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename',
+ 'PrimaryCat' => TABLE_PREFIX.'%3$sCategoryItems.PrimaryCat',
+ 'ParentPath' => TABLE_PREFIX.'Category.ParentPath',
+
+ 'SameImages' => 'img.SameImages',
+ 'LocalThumb' => 'img.LocalThumb',
+ 'ThumbPath' => 'img.ThumbPath',
+ 'ThumbUrl' => 'img.ThumbUrl',
+ 'LocalImage' => 'img.LocalImage',
+ 'LocalPath' => 'img.LocalPath',
+ 'FullUrl' => 'img.Url',
+
+ 'LastPoster' => 'IF (ISNULL(last_post.PosterAlias), "Guest", last_post.PosterAlias)',
+ 'LastPosterId' => 'last_post.CreatedById',
+ ),
+ ),
+
+ 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId
+ LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'Images img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1
+ LEFT JOIN '.TABLE_PREFIX.'PermCache perm ON perm.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.OwnerId = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'Posting last_post ON last_post.PostingId = %1$s.LastPostId
+ LEFT JOIN '.TABLE_PREFIX.'%3$sTopicCustomData cust ON %1$s.ResourceId = cust.ResourceId',
+ ), // key - special, value - list select sql
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('TopicText' => 'asc'),
+ )
+ ),
+ 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId
+ LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'Images img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.OwnerId = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'Posting last_post ON last_post.PostingId = %1$s.LastPostId
+ LEFT JOIN '.TABLE_PREFIX.'%3$sTopicCustomData cust ON %1$s.ResourceId = cust.ResourceId'),
+
+ 'SubItems' => Array('bb-rev', 'bb-ci', 'bb-rel', 'bb-img', 'bb-cdata', 'bb-fav', 'bb-post'),
+
+ 'Fields' => Array (
+ 'TopicId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,),
+ 'NotifyOwnerOnChanges' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'lu_No', 1 => 'lu_Yes'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
+ 'Modified' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'),
+ 'TopicText' => Array('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'AutomaticFilename' => Array('type' => 'int', 'not_null' => 1, 'default' => 1),
+ 'Posts' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Views' => Array('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%d', 'not_null' => 1, 'default' => 0),
+ 'EditorsPick' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
+ 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
+ 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'OwnerId' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'required' => 1, 'default' => -1),
+ 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => 0),
+ 'ResourceId' => Array('type' => 'int', 'default' => null),
+ 'TopicType' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_Yes', 1 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1),
+ 'CreatedOn' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'),
+ 'CachedReviewsQty' => Array('type' => 'int' ,'not_null' => 1, 'default' => 0),
+ 'CachedRating' => Array('type' => 'string', 'not_null' => 1, 'default' => 0),
+ 'CachedVotesQty' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'PostedBy' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'OrgId' => Array('type' => 'int', 'default' => null),
+ 'LastPostId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'LastPostDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null),
+ 'TodayDate' => Array('type' => 'string', 'default' => null),
+ 'TodayPosts' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'MetaKeywords' => Array('type' => 'string', 'default' => null),
+ 'MetaDescription' => Array('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null),
+ ),
+
+ 'VirtualFields' => Array (
+ 'UserName' => Array ('type'=>'string', 'default' => ''),
+ 'CategoryId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => 0),
+ 'Filename' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'CachedNavbar' => Array ('type' => 'string', 'default' => ''),
+
+ 'LastPoster' => Array ('type' => 'string', 'default' => ''),
+ 'LastPosterId' => Array ('type' => 'int', 'default' => -2),
+ 'PostingText' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'required' => 1, 'using_fck' => 1, 'allow_html' => 1, 'default' => ''),
+ 'DisableBBCodes' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'DisableSmileys' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'ShowSignatures' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 1),
+
+ // for primary image
+ 'SameImages' => Array('type' => 'string', 'default' => ''),
+ 'LocalThumb' => Array('type' => 'string', 'default' => ''),
+ 'ThumbPath' => Array('type' => 'string', 'default' => ''),
+ 'ThumbUrl' => Array('type' => 'string', 'default' => ''),
+ 'LocalImage' => Array('type' => 'string', 'default' => ''),
+ 'LocalPath' => Array('type' => 'string', 'default' => ''),
+ 'FullUrl' => Array('type' => 'string', 'default' => ''),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array(
+ 'default' => 'icon16_topic.png',
+ 0 => 'icon16_topic_disabled.png',
+ 1 => 'icon16_topic.png',
+ 2 => 'icon16_topic_pending.png',
+ 'NEW' => 'icon16_topic_new.png',
+ ),
+ 'Fields' => Array(
+ 'TopicId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
+ 'TopicText' => Array('title' => 'la_col_TopicText', 'data_block' => 'grid_catitem_td', 'filter_block' => 'grid_like_filter', 'width' => 300, 'first_chars' => 290, ),
+ 'UserName' => Array('title' => 'la_col_PostedBy', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
+ 'CreatedOn' => Array('title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'Status' => Array('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 70, ),
+ 'LastPostDate' => Array('title' => 'la_col_LastPostOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'Posts' => Array('title' => 'la_col_Posts', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
+ 'Views' => Array('title' => 'la_col_Views', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
+ ),
+ ),
+
+ 'Radio' => Array(
+ 'Icons' => Array(
+ 'default' => 'icon16_topic.png',
+ 0 => 'icon16_topic_disabled.png',
+ 1 => 'icon16_topic.png',
+ 2 => 'icon16_topic_pending.png',
+ 'NEW' => 'icon16_topic_new.png', ),
+ 'Selector' => 'radio',
+ 'Fields' => Array(
+ 'TopicId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
+ 'TopicText' => Array('title' => 'la_col_TopicText', 'data_block' => 'grid_catitem_td', 'filter_block' => 'grid_like_filter', 'width' => 300, 'first_chars' => 290, ),
+ 'UserName' => Array('title' => 'la_col_PostedBy', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
+ 'CreatedOn' => Array('title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'Status' => Array('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 70, ),
+ 'LastPostDate' => Array('title' => 'la_col_LastPostOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'Posts' => Array('title' => 'la_col_Posts', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
+ 'Views' => Array('title' => 'la_col_Views', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
+ ),
+ ),
+ ),
+
+ 'ConfigMapping' => Array(
+ 'PerPage' => 'Perpage_Topics',
+ 'ShortListPerPage' => 'Perpage_Topics_Short',
+ 'ForceEditorPick' => 'Topic_EditorPicksAbove',
+ 'DefaultSorting1Field' => 'Topic_SortField',
+ 'DefaultSorting2Field' => 'Topic_SortField2',
+ 'DefaultSorting1Dir' => 'Topic_SortOrder',
+ 'DefaultSorting2Dir' => 'Topic_SortOrder2',
+
+ 'RatingDelayValue' => 'topic_RatingDelay_Value',
+ 'RatingDelayInterval' => 'topic_RatingDelay_Interval',
+ ),
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/topics/topics_event_handler.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/topics/topics_event_handler.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/topics/topics_event_handler.php (revision 12744)
@@ -0,0 +1,210 @@
+Name == 'OnTopicLockToggle') {
+ $object =& $event->getObject();
+ /* @var $object kCatDBItem */
+
+ if (!$object->isLoaded()) {
+ $event->status = erPERM_FAIL;
+ return false;
+ }
+
+ $category_id = $object->GetDBField('CategoryId');
+ $perm_status = $this->Application->CheckPermission('TOPIC.LOCK', 0, $category_id);
+
+ if (!$perm_status) {
+ $event->status = erPERM_FAIL;
+ }
+
+ return $perm_status;
+ }
+
+ return parent::CheckPermission($event);
+ }
+
+ /**
+ * Lock or unlock topic
+ *
+ * @param kEvent $event
+ */
+ function OnToggleLock(&$event)
+ {
+ $object =& $event->getObject();
+
+ $new_type = $object->GetDBField('TopicType') ? 0 : 1;
+ $object->SetDBField('TopicType', $new_type);
+ $object->Update();
+ }
+
+ /**
+ * Cache topic owner
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ parent::OnBeforeItemUpdate($event);
+
+ $this->cacheItemOwner($event, 'OwnerId', 'PostedBy');
+ }
+
+ /**
+ * Cache topic owner
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ parent::OnBeforeItemCreate($event);
+
+ $this->cacheItemOwner($event, 'OwnerId', 'PostedBy');
+
+ $object =& $event->getObject();
+ /* @var $object kCatDBItem */
+
+ if (!$object->GetDBField('TodayDate')) {
+ $object->SetDBField('TodayDate', adodb_date('Y-m-d'));
+ }
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $object->SetDBField('TopicText', $post_helper->CensorText( $object->GetDBField('TopicText') ));
+ }
+
+ /**
+ * Creates 1st post when topic is created
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ parent::OnAfterItemCreate($event);
+
+ if ($event->Special == '-item') {
+ // don't create first post when cloning
+ return ;
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $post =& $this->Application->recallObject($event->Prefix.'-post', null, Array ('skip_autoload' => true));
+ /* @var $post kDBItem */
+
+ $post->SetDBField('Pending', $object->GetDBField('Status') == STATUS_ACTIVE ? 0 : 1);
+ $post->SetDBField('Subject', '');
+ $post->SetDBField('PostingText', $object->GetDBField('PostingText'));
+
+ $post->SetDBField('ShowSignatures', $object->GetDBField('ShowSignatures'));
+ $post->SetDBField('DisableSmileys', $object->GetDBField('DisableSmileys'));
+ $post->SetDBField('DisableBBCodes', $object->GetDBField('DisableBBCodes'));
+
+ $post->Create();
+
+ // need to update category topic count here
+ }
+
+ /**
+ * Approves 1st post when topic got approved
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ if (!$this->Application->isAdminUser) {
+ return ;
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kCatDBItem */
+
+ if ($object->GetDBField('Posts') == 1) {
+ $post =& $this->Application->recallObject($event->Prefix.'-post', null, Array('skip_autoload' => true));
+ /* @var $post kDBItem */
+
+ $main_status = $object->GetDBField('Status');
+ $post->Load($object->GetDBField('LastPostId'));
+ if ($post->isLoaded()) {
+ $post->SetDBField('Pending', $main_status == STATUS_ACTIVE ? 0 : 1);
+ $post->Update();
+ }
+ }
+ }
+
+ /**
+ * Makes first post body field non-requered when topic has posts already
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ parent::OnAfterItemLoad($event);
+
+ $object =& $event->getObject();
+ /* @var $object kCatDBItem */
+
+ if ($object->GetDBField('Posts') > 0 || !$this->Application->isAdminUser) {
+ $object->setRequired('PostingText', false);
+ }
+ }
+
+ /**
+ * Locks or unlocks topic
+ *
+ * @param kEvent $event
+ */
+ function OnTopicLockToggle(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kCatDBItem */
+
+ $topic_type = $object->GetDBField('TopicType');
+ $object->SetDBField('TopicType', $topic_type == 1 ? 0 : 1);
+ $object->Update();
+ }
+
+ /**
+ * Sets default values to posting options based on persistent session
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ parent::OnAfterConfigRead($event);
+
+ $fields = $this->Application->getUnitOption($event->Prefix, 'Fields');
+ $fields['NotifyOwnerOnChanges']['default'] = (int)$this->Application->RecallPersistentVar('owner_notify');
+ $this->Application->setUnitOption($event->Prefix, 'Fields', $fields);
+
+ $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields');
+ $virtual_fields['DisableBBCodes']['default'] = (int)!$this->Application->RecallPersistentVar('bbcode');
+ $virtual_fields['DisableSmileys']['default'] = (int)!$this->Application->RecallPersistentVar('smileys');
+ $virtual_fields['ShowSignatures']['default'] = (int)$this->Application->RecallPersistentVar('show_sig');
+ $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields);
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/.htaccess
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/.htaccess (revision 0)
+++ branches/5.0.x/in-bulletin/units/.htaccess (revision 12744)
@@ -0,0 +1 @@
+deny from all
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/poll_answers/poll_answers_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/poll_answers/poll_answers_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/poll_answers/poll_answers_config.php (revision 12744)
@@ -0,0 +1,85 @@
+ 'poll-answer',
+
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array ('class' => 'kDBEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event'
+ ),
+ 'IDField' => 'AnswerId',
+ 'TableName' => TABLE_PREFIX . 'PollsAnswers',
+
+ 'ParentPrefix' => 'poll',
+ 'ForeignKey' => 'PollId',
+ 'ParentTableKey' => 'PollId',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'StatusField' => Array('Status'),
+
+ // key - special, value - list select sql
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ ',
+ ),
+
+ 'ItemSQLs' => Array ('' => 'SELECT * FROM %s'),
+
+ 'ListSortings' => Array (
+ '' => Array(
+ 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('Answer' => 'ASC'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'AnswerId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'PollId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Answer' => Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'not_null' => 1, 'using_fck' => 1, 'default' => '', 'required' => 1),
+ 'VotesQty' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Active', 0 => 'la_opt_Disabled'), 'use_phrases' => 1, 'required' => 1, 'not_null' => 1, 'default' => 1),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 0 => 'icon16_disabled.png',
+ 1 => 'icon16_item.png',
+ 2 => 'icon16_pending.png',
+ 'module' => 'core',
+ ),
+ 'Fields' => Array (
+ 'AnswerId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
+ 'Answer' => Array ('title' => 'la_col_Name', 'data_block' => 'grid_priority_td', 'filter_block' => 'grid_like_filter', 'width' => 300, ),
+ 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
+ 'VotesQty' => Array ('title' => 'la_col_VoteCount', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
+
+ ),
+ ),
+ ),
+
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/emoticons/emoticon_eh.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/emoticons/emoticon_eh.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/emoticons/emoticon_eh.php (revision 12744)
@@ -0,0 +1,37 @@
+getObject();
+
+ $emoticon_file = $object->GetField('EmotionImage', 'full_path');
+ if ($emoticon_file) {
+ @unlink($emoticon_file);
+ }
+ }
+
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/emoticons/emoticons_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/emoticons/emoticons_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/emoticons/emoticons_config.php (revision 12744)
@@ -0,0 +1,102 @@
+ 'emoticon',
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array ('class' => 'EmoticonEventHandler', 'file' => 'emoticon_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'IDField' => 'EmoticonId',
+
+ 'TableName' => TABLE_PREFIX.'Emoticon',
+
+ 'TitleField' => 'Name',
+
+ 'TitlePresets' => Array (
+ 'default' => Array (
+ 'new_status_labels' => Array ('emoticon' => '!la_title_AddingSmiley!'),
+ 'edit_status_labels' => Array ('emoticon' => '!la_title_EditingSmiley!'),
+ ),
+
+ 'emoticon_list' => Array ('prefixes' => Array ('emoticon_List'), 'format' => "!la_tab_ConfigSmileys!"),
+ 'emoticon_edit' => Array ('prefixes' => Array ('emoticon'), 'format' => "#emoticon_status# '#emoticon_titlefield#'"),
+ ),
+
+ 'PermSection' => Array('main' => 'in-bulletin:configuration_emoticon'),
+
+ 'Sections' => Array (
+ 'in-bulletin:configuration_emoticon' => Array (
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'conf_smileys',
+ 'label' => 'la_tab_ConfigSmileys',
+ 'url' => Array('t' => 'in-bulletin/emoticons/emoticon_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s FROM %1$s',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array (
+ 'Sorting' => Array ('Name' => 'desc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'EmoticonId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Name' => Array ('type' => 'string', 'max_len' => 20, 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'KeyStroke' => Array ('type' => 'string', 'max_len' => 20, 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'Enabled' => Array ('type' => 'int', 'not_null' => 1, 'default' => 1),
+ 'EmotionImage' => Array (
+ 'type' => 'string', 'max_len' => 255,
+ 'formatter' => 'kUploadFormatter', 'allowed_types' => Array ('image/jpeg', 'image/jpg', 'image/gif', 'image/png', 'image/pjpeg'),
+ 'upload_dir' => SMILEYS_PATH,
+ 'not_null' => 1, 'required' => 1, 'default' => '',
+ ),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 0 => 'icon16_disabled.png',
+ 1 => 'icon16_item.png',
+ 'module' => 'core',
+ ),
+ 'Fields' => Array (
+ 'EmoticonId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50, ),
+ 'Name' => Array ('title' => 'la_col_Name', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
+ 'KeyStroke' => Array ('title' => 'la_col_KeyStroke', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
+ 'EmotionImage' => Array ('title' => 'la_col_Image', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
+ ),
+ ),
+ ),
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/private_messages/private_messages_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/private_messages/private_messages_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/private_messages/private_messages_config.php (revision 12744)
@@ -0,0 +1,109 @@
+ 'private-message',
+ 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'PrivateMessageEventHandler', 'file' => 'private_message_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'PrivateMessageTagProcessor', 'file' => 'private_message_tp.php', 'build_event' => 'OnBuild'),
+
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'IDField' => 'PmId',
+ 'StatusField' => Array ('Status'),
+ 'TitleField' => 'Subject',
+
+ 'PermSection' => Array('main' => 'in-bulletin:private_messages',),
+
+ 'TableName' => TABLE_PREFIX.'PrivateMessages',
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'Subject' => 'pmb.Subject',
+ 'Body' => 'pmb.Body',
+ ),
+ ),
+
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'%3$sPrivateMessageBody pmb ON pmb.PMBodyId = %1$s.PMBodyId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser from_user ON from_user.PortalUserId = %1$s.FromId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser to_user ON to_user.PortalUserId = %1$s.ToId',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array(
+ 'ForcedSorting' => Array('CreatedOn' => 'desc'),
+ ),
+ ),
+
+ 'ItemSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'%3$sPrivateMessageBody pmb ON pmb.PMBodyId = %1$s.PMBodyId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser from_user ON from_user.PortalUserId = %1$s.FromId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser to_user ON to_user.PortalUserId = %1$s.ToId',
+ ),
+
+ 'SubItems' => Array('private-message-body'),
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'Subject' => 'pmb.Subject',
+ 'Body' => 'pmb.Body',
+ 'Options' => 'pmb.Options',
+
+ 'FromName' => 'IF (ISNULL(from_user.Login), IF (%1$s.FromId = -1, "root", IF (%1$s.FromId = -2, "Guest", "n/a")), from_user.Login)',
+ 'ToName' => 'IF (ISNULL(to_user.Login), IF (%1$s.ToId = -1, "root", IF (%1$s.ToId = -2, "Guest", "n/a")), to_user.Login)',
+
+ 'FromFullName' => 'TRIM(CONCAT(from_user.FirstName, " ", from_user.LastName))',
+ 'ToFullName' => 'TRIM(CONCAT(to_user.FirstName, " ", to_user.LastName))',
+ ),
+ ),
+
+ 'Fields' => Array (
+ 'PmId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'FromId' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!lu_error_UserNotFound!'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'required' => 1, 'default' => null),
+ 'ToId' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!lu_error_UserNotFound!'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'required' => 1, 'default' => null),
+ 'FolderId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'lu_Inbox', 1 => 'lu_Sent'), 'use_phrases' => 1, 'not_null' => 1, 'default' => PM_FOLDER_SENT),
+ 'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'lu_opt_MessageUnread', 1 => 'lu_opt_MessageViewed', 2 => 'lu_opt_MessageRead', 3 => 'lu_opt_MessageReplied', 4 => 'lu_opt_MessageSent'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
+ 'PMBodyId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
+ ),
+
+ 'VirtualFields' => Array (
+ 'FromName' => Array ('type' => 'string', 'default' => ''),
+ 'ToName' => Array ('type' => 'string', 'default' => ''),
+ 'Subject' => Array ('type' => 'string', 'default' => ''),
+ 'Body' => Array ('type' => 'string', 'required' => 1, 'default' => ''),
+ 'Options' => Array ('type' => 'string', 'default' => 0),
+
+ 'DisableBBCodes' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'DisableSmileys' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'ShowSignatures' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 1),
+ ),
+
+
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/private_messages/private_message_tp.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/private_messages/private_message_tp.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/private_messages/private_message_tp.php (revision 12744)
@@ -0,0 +1,164 @@
+getObject();
+ /* @var $object kDBItem */
+
+ return $object->GetDBField('Status') < PM_STATUS_READ;
+ }
+
+ /**
+ * Allows to check what folder is currently active
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function FolderSelected($params)
+ {
+ $folder_mapping = Array ('inbox' => PM_FOLDER_INBOX, 'sent' => PM_FOLDER_SENT);
+
+ return (int)$this->Application->GetVar('folder_id') == $folder_mapping[ strtolower($params['folder']) ];
+ }
+
+ /**
+ * Creates link to specific private message folder
+ *
+ * @param Array $params
+ * @return string
+ */
+ function FolderLink($params)
+ {
+ $folder_mapping = Array ('inbox' => PM_FOLDER_INBOX, 'sent' => PM_FOLDER_SENT);
+ $params['folder_id'] = $folder_mapping[ strtolower($params['folder']) ];
+ unset($params['folder']);
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ function MessageSubject($params)
+ {
+ $object =& $this->getObject();
+ /* @var $object kDBItem */
+
+ $params['field'] = 'Subject';
+ $value = $this->Field($params);
+
+ if (!$value && isset($params['empty_title'])) {
+ return '['.$this->Application->Phrase($params['empty_title']).']';
+ }
+
+ return $value;
+ }
+
+ function MessageBody($params)
+ {
+ $object =& $this->getObject($params);
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ // 2. parse post body
+ $sub_blocks = Array (
+ 'smileys' => $params['smiley_render_as'],
+ 'bbcode' => $params['bbcode_render_as'],
+ );
+
+ return $post_helper->parsePostBody($object->GetDBField('Body'), $object->GetDBField('Options'), $sub_blocks);
+ }
+
+ function DeleteLink($params)
+ {
+ $params['pass'] = 'm,'.$this->getPrefixSpecial();
+ $params[$this->getPrefixSpecial().'_event'] = 'OnDelete';
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ function ReplyLink($params)
+ {
+ $params['reply_to'] = $this->Application->GetVar($this->getPrefixSpecial().'_id');
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ /**
+ * User can reply message only in case, when it is not it's own message
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function CanReplyMessage($params)
+ {
+ $object =& $this->getObject();
+ /* @var $object kDBItem */
+
+ return $object->GetDBField('FromId') != $this->Application->RecallVar('user_id');
+ }
+
+ /**
+ * Marks private message as read
+ *
+ * @param Array $params
+ */
+ function MarkAsRead($params)
+ {
+ $object =& $this->getObject();
+ /* @var $object kDBItem */
+
+ if ($object->GetDBField('Status') < PM_STATUS_READ) {
+ $object->SetDBField('Status', PM_STATUS_READ);
+ $object->Update();
+ }
+ }
+
+ /**
+ * Returns link to private message sender/recipient public profile
+ *
+ * @param Array $params
+ * @return string
+ */
+ function ProfileLink($params)
+ {
+ $user_field = strtolower($params['type']) == 'from' ? 'FromId' : 'ToId';
+ unset($params['type']);
+
+ $object =& $this->getObject($params);
+ $params['user_id'] = $object->GetDBField($user_field);
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ /**
+ * Returns link for sending private message from user's public profile page
+ *
+ * @param Array $params
+ * @return string
+ */
+ function SendMessageLink($params)
+ {
+ $params['user_id'] = $this->Application->GetVar('user_id');
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/private_messages/private_message_eh.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/private_messages/private_message_eh.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/private_messages/private_message_eh.php (revision 12744)
@@ -0,0 +1,251 @@
+ Array('self' => true),
+ 'OnCreate' => Array('self' => true),
+ 'OnDelete' => Array('self' => true),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Applies folder & message owner filter to message list
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ $folder_id = $this->Application->GetVar('folder_id');
+ if ($folder_id === false) {
+ $folder_id = PM_FOLDER_INBOX;
+ $this->Application->SetVar('folder_id', $folder_id);
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ $user_id = $this->Application->RecallVar('user_id');
+ if ($folder_id == PM_FOLDER_INBOX) {
+ $object->addFilter('owner_filter', '%1$s.ToId = '.$user_id);
+ }
+ else {
+ $object->addFilter('owner_filter', '%1$s.FromId = '.$user_id);
+ }
+ $object->addFilter('folder_filter', '%1$s.FolderId = '.$folder_id);
+ }
+
+ /**
+ * Puts message to Sent folder
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ if ($object->GetDBField('FolderId') != PM_FOLDER_SENT) {
+ // when creating "Inbox" message (from "Sent" message) don't reset folder & status
+ return ;
+ }
+
+ $user_id = $this->Application->RecallVar('user_id');
+ $object->SetDBField('FromId', $user_id);
+ $object->SetDBField('FolderId', PM_FOLDER_SENT);
+ $object->SetDBField('Status', PM_STATUS_READ);
+ }
+
+ /**
+ * Creates 1st post when topic is created
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ parent::OnAfterItemCreate($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $this->Application->EmailEventUser('PM.ADD', $object->GetDBField('ToId'));
+
+ if ($object->GetDBField('FolderId') != PM_FOLDER_SENT) {
+ // 1. create message in sender's "Sent" folder (this method only for this step)
+ // 2. create message body (shared)
+ // 3. create message copy in recipient's "Inbox" folder
+ return ;
+ }
+
+ $message_body =& $this->Application->recallObject($event->Prefix.'-body', null, Array ('skip_autoload' => true));
+ /* @var $message_body kDBItem */
+
+ // 1. create message body (for sender & recipient)
+ $copy_fields = Array ('Subject', 'Body', 'ShowSignatures', 'DisableSmileys', 'DisableBBCodes');
+ $message_body->SetDBFieldsFromHash($object->GetFieldValues(), $copy_fields);
+
+ $body_created = $message_body->Create();
+ if ($body_created) {
+ // 2. link body with message
+ $object->SetDBField('PMBodyId', $message_body->GetID());
+ $object->Update();
+
+ // 3. create message in recipient's Inbox folder
+ $object->SetDBField('FolderId', PM_FOLDER_INBOX);
+ $object->SetDBField('Status', PM_STATUS_UNREAD);
+ $object->Create();
+ }
+ }
+
+ /**
+ * Sets post options to virtual fields
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $options_map = $post_helper->getOptionsMap();
+ $post_options = $object->GetDBField('Options');
+ foreach ($options_map as $option_name => $field_name) {
+ $option_value = $post_helper->GetPostOption($option_name, $post_options);
+ $object->SetDBField($field_name, (int)$option_value);
+ }
+ }
+
+ /**
+ * Goes to next_template after post creation
+ *
+ * @param kEvent $event
+ */
+ function OnCreate(&$event)
+ {
+ parent::OnCreate($event);
+
+ if ($event->status == erSUCCESS && !$this->Application->isAdmin) {
+ $event->SetRedirectParam('opener', 's');
+ $event->redirect = $this->Application->GetVar('next_template');
+ }
+ }
+
+ /**
+ * Prevents user from deleting other user private messages
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $user_id = $this->Application->RecallVar('user_id');
+ $owner_field = ($object->GetDBField('FolderId') == PM_FOLDER_INBOX) ? 'ToId' : 'FromId';
+ if ($object->GetDBField($owner_field) != $user_id) {
+ $event->status = erFAIL;
+ }
+ }
+
+ /**
+ * Updates reference counter in message body record
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $body_idfield = $this->Application->getUnitOption($event->Prefix.'-body', 'IDField');
+ $body_table = $this->Application->getUnitOption($event->Prefix.'-body', 'TableName');
+ $sql = 'UPDATE '.$body_table.'
+ SET ReferenceCount = ReferenceCount - 1
+ WHERE '.$body_idfield.' = '.$object->GetDBField('PMBodyId');
+ $this->Conn->Query($sql);
+ }
+
+ /**
+ * Sets default values to posting options based on persistent session
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields');
+ $virtual_fields['DisableBBCodes']['default'] = (int)!$this->Application->RecallPersistentVar('bbcode');
+ $virtual_fields['DisableSmileys']['default'] = (int)!$this->Application->RecallPersistentVar('smileys');
+ $virtual_fields['ShowSignatures']['default'] = (int)$this->Application->RecallPersistentVar('show_sig');
+ $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields);
+ }
+
+ /**
+ * Checks, that current user is recipient or sender of viewed message
+ *
+ * @param kEvent $event
+ * @return bool
+ */
+ function checkItemStatus(&$event)
+ {
+ $object =& $event->getObject();
+ if (!$object->isLoaded()) {
+ return true;
+ }
+
+ $user_id = $this->Application->RecallVar('user_id');
+ return ($object->GetDBField('FromId') == $user_id) || ($object->GetDBField('ToId') == $user_id);
+ }
+
+ /**
+ * Prepares new reply & new message form
+ *
+ * @param kEvent $event
+ */
+ function OnNew(&$event)
+ {
+ parent::OnNew($event);
+
+ $reply_to = $this->Application->GetVar('reply_to');
+ $user_id = $this->Application->GetVar('user_id');
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ if ($reply_to > 0) {
+ // reply to message
+ $source_msg =& $this->Application->recallObject($event->Prefix.'.-item', null, Array ('skip_autoload' => true));
+ /* @var $source_msg kDBItem */
+
+ $source_msg->Load($reply_to);
+
+ $object->SetDBField('ToId', $source_msg->GetDBField('FromId'));
+ $object->SetDBField('Subject', 'Re: '.$source_msg->GetDBField('Subject'));
+ }
+ elseif ($user_id > 0) {
+ // send message to any user by id
+ $object->SetDBField('ToId', $user_id);
+ }
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/posts/post_eh.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/posts/post_eh.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/posts/post_eh.php (revision 12744)
@@ -0,0 +1,400 @@
+Name, $events)) {
+ return true;
+ }
+
+ return parent::CheckPermission($event);
+ }
+
+ /**
+ * Sets default values
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $user_id = $this->Application->RecallVar('user_id');
+
+ $now = adodb_mktime();
+
+ $object->SetDBField('CreatedById', $user_id);
+ $object->SetDBField('CreatedOn_date', $now);
+ $object->SetDBField('CreatedOn_time', $now);
+
+ $object->SetDBField('ModifiedById', $user_id);
+ $object->SetDBField('Modified_date', $now);
+ $object->SetDBField('Modified_time', $now);
+
+ $object->SetDBField('IPAddress', $_SERVER['REMOTE_ADDR']);
+
+ $sql = 'SELECT Login
+ FROM '.TABLE_PREFIX.'PortalUser
+ WHERE PortalUserId = '.$user_id;
+ $object->SetDBField('PosterAlias', $this->Conn->GetOne($sql));
+
+ // set post options
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $options_map = $post_helper->getOptionsMap();
+ $post_options = $object->GetDBField('Options');
+ foreach ($options_map as $option_name => $field_name) {
+ $option_value = $object->GetDBField($field_name);
+ $post_helper->SetPostOption($option_name, $option_value, $post_options);
+ }
+ $object->SetDBField('Options', $post_options);
+
+ $table_info = $object->getLinkedInfo($event->Special, true);
+ $object->SetDBField($table_info['ForeignKey'], $table_info['ParentId']);
+ }
+
+ /**
+ * Checks if user has permission on post
+ *
+ * @param kEvent $event
+ * @param string $permissions
+ */
+ function checkPostPermission(&$event, $permissions)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $sql = 'SELECT ci.CategoryId, p.CreatedById
+ FROM '.$object->TableName.' p
+ LEFT JOIN '.TABLE_PREFIX.'Topic t ON t.TopicId = p.TopicId
+ LEFT JOIN '.TABLE_PREFIX.'CategoryItems ci ON ci.ItemResourceId = t.ResourceId AND ci.PrimaryCat = 1
+ WHERE p.'.$object->IDField.' = '.$object->GetID();
+ $post_info = $this->Conn->GetRow($sql);
+
+ $perm_helper =& $this->Application->recallObject('PermissionsHelper');
+ /* @var $perm_helper kPermissionsHelper */
+
+ $is_owner = $post_info['CreatedById'] == $this->Application->RecallVar('user_id');
+ $params['permissions'] = 'TOPIC.REPLY.MODIFY|TOPIC.REPLY.OWNER.MODIFY';
+ $params['cat_id'] = $post_info['CategoryId'];
+ return $perm_helper->TagPermissionCheck($params, $is_owner);
+ }
+
+ /**
+ * Sets post options before post update
+ * Ensures, that only user with permission will update topic
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $perm_status = $this->checkPostPermission($event, 'TOPIC.REPLY.MODIFY|TOPIC.REPLY.OWNER.MODIFY');
+ if (!$perm_status) {
+ $event->status = erFAIL;
+ return ;
+ }
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $options_map = $post_helper->getOptionsMap();
+ $post_options = $object->GetDBField('Options');
+ foreach ($options_map as $option_name => $field_name) {
+ $option_value = $object->GetDBField($field_name);
+ $post_helper->SetPostOption($option_name, $option_value, $post_options);
+ }
+ $object->SetDBField('Options', $post_options);
+ }
+
+ /**
+ * Notifies admin about post change
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ parent::OnAfterItemUpdate($event);
+
+ $this->Application->EmailEventAdmin('POST.MODIFY');
+ }
+
+ /**
+ * Checks, that user can delete post
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $perm_status = $this->checkPostPermission($event, 'TOPIC.REPLY.OWNER.DELETE|TOPIC.REPLY.DELETE');
+ if (!$perm_status) {
+ $event->status = erFAIL;
+ }
+ }
+
+ /**
+ * Sets post options to virtual fields
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $options_map = $post_helper->getOptionsMap();
+ $post_options = $object->GetDBField('Options');
+ foreach ($options_map as $option_name => $field_name) {
+ $option_value = $post_helper->GetPostOption($option_name, $post_options);
+ $object->SetDBField($field_name, (int)$option_value);
+ }
+ }
+
+ /**
+ * Updates cached post counter in topic
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $parent_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix');
+
+ $main_object =& $this->Application->recallObject($parent_prefix);
+ /* @var $main_object kCatDBItem */
+
+ // update user posts counter
+ $user_posts = $this->Application->RecallPersistentVar('bb_posts');
+ $this->Application->StorePersistentVar('bb_posts', $user_posts + 1);
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $category_id = $this->Application->GetVar('m_cat_id');
+ $post_helper->PropagateCategoryField($category_id, 'Modified', $object->GetDBField('CreatedOn'));
+
+ if (!$this->Application->isAdmin && $main_object->GetDBField('Posts')) {
+ // don't send any email events when in admin OR new topic just added (0 posts)
+
+ $user_notified = false; // don't send POST.ADD event twice to same user (in case if owner adds new post)
+ if ($main_object->GetDBField('NotifyOwnerOnChanges')) {
+ $user_notified = $main_object->GetDBField('OwnerId');
+ $this->Application->EmailEventUser('POST.ADD', $user_notified);
+ }
+
+ $post_owner_id = $object->GetDBField('CreatedById');
+ if (($post_owner_id > 0) && ($user_notified != $post_owner_id)) {
+ $this->Application->EmailEventUser('POST.ADD', $post_owner_id);
+ }
+
+ $this->Application->EmailEventAdmin('POST.ADD');
+ }
+
+ $post_helper->updateTodayPostsCount($main_object, $object->GetDBField('CreatedOn'), +1);
+ $this->updateTopicInfo($event, $main_object);
+
+ $topic_id = $object->GetDBField('TopicId');
+ $posts_count = $post_helper->updatePostCount($topic_id, +1);
+ $main_object->SetDBField('Posts', $posts_count);
+
+ // autolock topic after N number of posts (if option enabled)
+ $auto_lock = $this->Application->ConfigValue('AutoTopicLockPosts');
+ if ((int)$auto_lock > 0) {
+ if ($posts_count >= $auto_lock) {
+ // user has unlocked topic after $auto_lock and posts again -> ensure that topic will be locked again
+ $this->Application->HandleEvent($parent_prefix.':OnTopicLockToggle');
+ }
+ }
+ }
+
+ /**
+ * Update last post info in topic
+ *
+ * @param kEvent $event
+ * @param kCatDBItem $main_object
+ */
+ function updateTopicInfo(&$event, &$main_object)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $main_object->SetDBField('Modified_date', $object->GetDBField('Modified'));
+ $main_object->SetDBField('Modified_time', $object->GetDBField('Modified'));
+
+ $main_object->SetDBField('LastPostId', $object->GetID());
+
+ $main_object->SetDBField('LastPostDate_date', $object->GetDBField('CreatedOn'));
+ $main_object->SetDBField('LastPostDate_time', $object->GetDBField('CreatedOn'));
+
+ $main_object->Update();
+ }
+
+ /**
+ * Goes to next_template after post creation
+ *
+ * @param kEvent $event
+ */
+ function OnCreate(&$event)
+ {
+ parent::OnCreate($event);
+
+ if ($event->status == erSUCCESS && !$this->Application->isAdmin) {
+ $event->SetRedirectParam('opener', 's');
+ $event->redirect = $this->Application->GetVar('next_template');
+ }
+ }
+
+ /**
+ * Goes to next_template after post editing
+ *
+ * @param kEvent $event
+ */
+ function OnUpdate(&$event)
+ {
+ parent::OnUpdate($event);
+
+ if ($event->status == erSUCCESS && !$this->Application->isAdmin) {
+ $event->SetRedirectParam('opener', 's');
+ $event->redirect = $this->Application->GetVar('next_template');
+ $event->SetRedirectParam('pass', 'm,bb');
+ }
+ }
+
+ /**
+ * Moves reference to last post in topic, when it is deleted
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $topic_id = $object->GetDBField('TopicId');
+ if (!$topic_id) {
+ // deleting non-existing post
+ return ;
+ }
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ // update posts count in topic
+ $post_helper->updatePostCount($topic_id, -1);
+
+ // update post owner posts counter
+ $sql = 'UPDATE '.TABLE_PREFIX.'PersistantSessionData
+ SET VariableValue = IF (VariableValue > 0, VariableValue - 1, 0)
+ WHERE (PortalUserId = '.$object->GetDBField('CreatedById').') AND (VariableName = "bb_posts")';
+ $this->Conn->Query($sql);
+
+
+ $main_object =& $this->Application->recallObject('bb.-item', null, Array('skip_autoload' => true));
+ /* @var $main_object kCatDBItem */
+
+ $main_object->Load($topic_id);
+
+ $post_helper->updateTodayPostsCount($main_object, $object->GetDBField('CreatedOn'), -1);
+
+ if ($main_object->GetDBField('LastPostId') == $object->GetID()) {
+ $sql = 'SELECT PostingId, CreatedOn
+ FROM '.$object->TableName.'
+ WHERE TopicId = '.$topic_id.'
+ ORDER BY PostingId DESC';
+ $last_post = $this->Conn->GetRow($sql);
+
+ $fields_hash = Array (
+ 'LastPostId' => $last_post['PostingId'],
+ 'LastPostDate' => $last_post['CreatedOn'],
+ );
+ $this->Conn->doUpdate($fields_hash, $main_object->TableName, $main_object->IDField.' = '.$topic_id);
+ }
+ }
+
+ /**
+ * Sets default values to posting options based on persistent session
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields');
+ $virtual_fields['DisableBBCodes']['default'] = (int)!$this->Application->RecallPersistentVar('bbcode');
+ $virtual_fields['DisableSmileys']['default'] = (int)!$this->Application->RecallPersistentVar('smileys');
+ $virtual_fields['ShowSignatures']['default'] = (int)$this->Application->RecallPersistentVar('show_sig');
+ $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields);
+ }
+
+ /**
+ * Deletes items & preserves clean env
+ *
+ * @param kEvent $event
+ */
+ function OnDelete(&$event)
+ {
+ parent::OnDelete($event);
+
+ if ($event->status == erSUCCESS && !$this->Application->isAdmin) {
+ $parent_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix');
+ $event->SetRedirectParam('pass', 'm,'.$parent_prefix);
+ }
+ }
+
+ /**
+ * Prepares new reply form
+ *
+ * @param kEvent $event
+ */
+ function OnNew(&$event)
+ {
+ parent::OnNew($event);
+
+ $reply_to = $this->Application->GetVar('reply_to');
+
+ if ($reply_to > 0) {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $source_post =& $this->Application->recallObject($event->Prefix.'.-item', null, Array ('skip_autoload' => true));
+ /* @var $source_post kDBItem */
+
+ $source_post->Load($reply_to);
+
+ $object->SetDBField('Subject', 'Re: '.$source_post->GetDBField('Subject'));
+ $object->SetDBField('PostingText', '[quote id='.$reply_to.']'.$source_post->GetDBField('PostingText').'[/quote]');
+ }
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/posts/post_tp.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/posts/post_tp.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/posts/post_tp.php (revision 12744)
@@ -0,0 +1,315 @@
+Application->getUnitOption($this->Prefix, 'ParentPrefix');
+ $main_object =& $this->Application->recallObject($parent_prefix);
+ /* @var $main_object kCatDBItem */
+
+ if ($main_object->isLoaded()) {
+ $main_object->RegisterHit();
+ }
+
+ return $this->PrintList2($params);
+ }
+
+ /**
+ * Returns link to post author public profile
+ *
+ * @param Array $params
+ * @return string
+ */
+ function ProfileLink($params)
+ {
+ $object =& $this->getObject($params);
+ $params['user_id'] = $object->GetDBField('CreatedById');
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ function PosterField($params)
+ {
+ static $posters = null;
+
+ $object =& $this->getObject($params);
+
+ if (!isset($posters)) {
+ $poster_ids = array_unique($object->GetCol('CreatedById'));
+
+ $user_idfield = $this->Application->getUnitOption('u', 'IDField');
+ $user_table = $this->Application->getUnitOption('u', 'TableName');
+
+ $sql = 'SELECT u.*, g.Name AS PrimaryGroup
+ FROM '.$user_table.' u
+ LEFT JOIN '.TABLE_PREFIX.'UserGroup ug ON ug.PortalUserId = u.PortalUserId AND ug.PrimaryGroup = 1
+ LEFT JOIN '.TABLE_PREFIX.'PortalGroup g ON g.GroupId = ug.GroupId
+ WHERE u.'.$user_idfield.' IN ('.implode(',', $poster_ids).')';
+ $posters = $this->Conn->Query($sql, $user_idfield);
+ }
+
+ $poster =& $this->Application->recallObject('u.poster', null, Array('skip_autoload' => true));
+ /* @var $poster UsersItem */
+
+ $poster_id = $object->GetDBField('CreatedById');
+ if ($poster_id > 0) {
+ // not Guest & root
+ if ($poster->GetID() != $poster_id) {
+ // previous poster differs from requested
+ $poster->SetDBFieldsFromHash($posters[$poster_id]);
+ $poster->setID($poster_id);
+ }
+ return $this->Application->ProcessParsedTag('u.poster', 'Field', $params);
+ }
+
+ return '';
+ }
+
+ /**
+ * Checks if post is made by real user (not Guest or root)
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function PosterFound($params)
+ {
+ $object =& $this->getObject($params);
+
+ return $object->GetDBField('CreatedById') > 0;
+ }
+
+ /**
+ * Posts count created by current poster
+ *
+ * @param Array $params
+ * @return int
+ */
+ function PosterPostsCount($params)
+ {
+ static $posts_count = null;
+
+ $object =& $this->getObject($params);
+
+ if (!isset($posts_count)) {
+ $poster_ids = array_unique($object->GetCol('CreatedById'));
+
+ $sql = 'SELECT VariableValue, PortalUserId
+ FROM '.TABLE_PREFIX.'PersistantSessionData
+ WHERE PortalUserId IN ('.implode(',', $poster_ids).') AND VariableName = "bb_posts"';
+ $posts_count = $this->Conn->GetCol($sql, 'PortalUserId');
+ }
+
+ return $posts_count[$object->GetDBField('CreatedById')];
+ }
+
+ function PostSubject($params)
+ {
+ $object =& $this->getObject($params);
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ return $post_helper->CensorText( $object->GetDBField('Subject') );
+ }
+
+ function PostBody($params)
+ {
+ $object =& $this->getObject($params);
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $body = $object->GetDBField('PostingText');
+
+ // 2. parse post body
+ $sub_blocks = Array (
+ 'smileys' => $params['smiley_render_as'],
+ 'bbcode' => $params['bbcode_render_as'],
+ 'quote' => $params['quote_render_as'],
+ );
+ $body = $post_helper->parsePostBody($body, $object->GetDBField('Options'), $sub_blocks);
+
+ return $body;
+ }
+
+ /**
+ * Checks if poster signature needs to be shown together with post
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function ShowPostSignature($params)
+ {
+ $object =& $this->getObject($params);
+ $post_options = $object->GetDBField('Options');
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ // show poster signature in this post
+ if ($post_helper->GetPostOption('show_sig', $post_options)) {
+ // logged-in user wishes to view signatures in posts
+ $show_other_signatures = $this->Application->RecallPersistentVar('bb_signatures');
+ if ($show_other_signatures) {
+ // don't show signature when it is empty
+ $signature = $this->getUserSignature($object->GetDBField('CreatedById'));
+ return strlen(trim($signature)) ? true : false;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns parsed poster (from current post) signature
+ *
+ * @param Array $params
+ * @return string
+ */
+ function PostSignature($params)
+ {
+ $object =& $this->getObject($params);
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $sub_blocks = Array (
+ 'smileys' => $params['smiley_render_as'],
+ 'bbcode' => $params['bbcode_render_as'],
+ );
+
+ $signature = $this->getUserSignature($object->GetDBField('CreatedById'));
+ return $post_helper->parsePostBody($signature, $object->GetDBField('Options'), $sub_blocks);
+ }
+
+ /**
+ * Returns user signature (cached for all viewed posts on page)
+ *
+ * @param int $user_id
+ * @return string
+ */
+ function getUserSignature($user_id)
+ {
+ static $user_signatures = null;
+
+ $object =& $this->getObject();
+
+ if (!isset($user_signatures)) {
+ $poster_ids = array_unique($object->GetCol('CreatedById'));
+
+ $sql = 'SELECT VariableValue, PortalUserId
+ FROM '.TABLE_PREFIX.'PersistantSessionData
+ WHERE PortalUserId IN ('.implode(',', $poster_ids).') AND VariableName = "my_signature"';
+ $user_signatures = $this->Conn->GetCol($sql, 'PortalUserId');
+ }
+
+ $poster_id = $object->GetDBField('CreatedById');
+ return isset($user_signatures[$poster_id]) ? $user_signatures[$poster_id] : '';
+ }
+
+ /**
+ * Creates link to individual post in topic
+ *
+ * @param Array $params
+ * @return string
+ */
+ function PostLink($params)
+ {
+ $params['pass'] = 'm,bb,bb-post';
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ function ReplyQuotedLink($params)
+ {
+ $object =& $this->getObject($params);
+
+ $params['pass'] = 'm,bb';
+ $params['reply_to'] = $object->GetID();
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ /**
+ * Checks if user have one of required permissions
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function HasPermission($params)
+ {
+ static $category_path = null;
+
+ if (!isset($category_path)) {
+ // get topic category
+ $parent_prefix = $this->Application->getUnitOption($this->Prefix, 'ParentPrefix');
+ $parent_item =& $this->Application->recallObject($parent_prefix, null, Array ('raise_warnings' => 0));
+ $category_path = $parent_item->isLoaded() ? $parent_item->GetDBField('ParentPath') : $this->Application->GetVar('m_cat_id');
+ }
+
+ $perm_helper =& $this->Application->recallObject('PermissionsHelper');
+ /* @var $perm_helper kPermissionsHelper */
+
+ $params['raise_warnings'] = 0;
+ $object =& $this->getObject($params);
+ /* @var $object kDBItem */
+
+ // 1. category restriction
+ $params['cat_id'] = $category_path;
+
+ // 2. owner restriction
+ $is_owner = $object->GetDBField('CreatedById') == $this->Application->RecallVar('user_id');
+
+ return $perm_helper->TagPermissionCheck($params, $is_owner);
+ }
+
+ function CategoryItemCount($params)
+ {
+ $count_helper =& $this->Application->recallObject('CountHelper');
+ /* @var $count_helper kCountHelper */
+
+ return $count_helper->CategoryItemCount('bb', $params, 'SUM(Posts)'); // - COUNT(TopicId)
+ }
+
+ function ItemCount($params)
+ {
+ $count_helper =& $this->Application->recallObject('CountHelper');
+ /* @var $count_helper kCountHelper */
+
+ $today_only = isset($params['today']) && $params['today'];
+ return $count_helper->ItemCount('bb', $today_only, 'SUM(Posts)'); // - COUNT(TopicId)
+ }
+
+ /**
+ * Preserve main item id in subitem pagination url
+ *
+ * @param Array $params
+ * @return string
+ */
+ function PageLink($params)
+ {
+ $object =& $this->getObject($params);
+ /* @var kDBList */
+
+ $parent_info = $object->getLinkedInfo();
+ if ($parent_info['ParentId'] > 0) {
+ $params['pass'] = 'm,'.$this->getPrefixSpecial().','.$parent_info['ParentPrefix'];
+ }
+ return parent::PageLink($params);
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/posts/posts_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/posts/posts_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/posts/posts_config.php (revision 12744)
@@ -0,0 +1,110 @@
+ 'bb-post',
+ 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'PostEventHandler', 'file' => 'post_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'PostTagProcessor', 'file' => 'post_tp.php', 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ ),
+
+ 'IDField' => 'PostingId',
+ 'StatusField' => Array('Pending'),
+
+ 'TitleField' => 'Subject',
+
+ 'TableName' => TABLE_PREFIX.'Posting',
+
+ 'ForeignKey' => 'TopicId',
+ 'ParentTableKey' => 'TopicId',
+ 'ParentPrefix' => 'bb',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'Images img ON (img.ResourceId = u.ResourceId) AND (img.DefaultImg = 1 OR img.Name = "avatar")',
+ ),
+
+ 'ItemSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'Images img ON (img.ResourceId = u.ResourceId) AND (img.DefaultImg = 1 OR img.Name = "avatar")',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array (
+ 'ForcedSorting' => Array ('CreatedOn' => 'asc',),
+ ),
+ ),
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.CreatedById = -1, "root", IF (%1$s.CreatedById = -2, "Guest", "n/a")), u.Login)',
+
+ 'SameImages' => 'img.SameImages',
+ 'LocalThumb' => 'img.LocalThumb',
+ 'ThumbPath' => 'img.ThumbPath',
+ 'ThumbUrl' => 'img.ThumbUrl',
+ 'LocalImage' => 'img.LocalImage',
+ 'LocalPath' => 'img.LocalPath',
+ 'FullUrl' => 'img.Url',
+ ),
+ ),
+
+ 'Fields' => Array (
+ 'PostingId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'IPAddress' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'PosterAlias' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'Pending' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Subject' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL),
+ 'PostingText' => Array ('type' => 'string', 'allow_html' => 1, 'default' => NULL),
+ 'GraphicsUrl' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL),
+ 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
+ 'Modified' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => NULL),
+ 'ModifiedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'default' => NULL),
+ 'CreatedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'default' => NULL),
+ 'TopicId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'ResourceId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'ReplyTo' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Options' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ ),
+
+ 'VirtualFields' => Array (
+ 'DisableBBCodes' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'DisableSmileys' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'ShowSignatures' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 1),
+
+ // for avatar image
+ 'SameImages' => Array('type' => 'string', 'default' => ''),
+ 'LocalThumb' => Array('type' => 'string', 'default' => ''),
+ 'ThumbPath' => Array('type' => 'string', 'default' => ''),
+ 'ThumbUrl' => Array('type' => 'string', 'default' => ''),
+ 'LocalImage' => Array('type' => 'string', 'default' => ''),
+ 'LocalPath' => Array('type' => 'string', 'default' => ''),
+ 'FullUrl' => Array('type' => 'string', 'default' => ''),
+ ),
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/poll_comments/poll_comment_eh.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/poll_comments/poll_comment_eh.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/poll_comments/poll_comment_eh.php (revision 12744)
@@ -0,0 +1,149 @@
+ Array('self' => true, 'subitem' => true,),
+ 'OnItemBuild' => Array('self' => true, 'subitem' => true,),
+ );
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ function OnAfterConfigRead(&$event)
+ {
+ if ($this->Application->RecallVar('user_id') == '-2') { // Guest
+ // make Guest Name and Email required for guests
+ $fields = $this->Application->getUnitOption($event->Prefix, 'Fields');
+ $fields['GuestName']['required'] = 1;
+ $fields['GuestEmail']['required'] = 1;
+ $this->Application->setUnitOption($event->Prefix, 'Fields', $fields);
+ }
+ }
+
+ /**
+ * Applies special filter, that allows to select all commented from current poll
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ if ($this->Application->isAdminUser) {
+ return ;
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ $object->addFilter('comment_status', '(%1$s.Status = ' .STATUS_ACTIVE. ')');
+ }
+
+ /**
+ * Before New PollComment created
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ if ($this->Application->isAdminUser) {
+ return ;
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ // get Poll info
+ $parent_prefix = $this->Application->getUnitOption($this->Prefix, 'ParentPrefix');
+ if($parent_prefix) {
+ $main_object =& $this->Application->recallObject($parent_prefix.'.'.$special, null,Array('raise_warnings' => 0));
+ /* @var $main_object kDBItem */
+
+ if (!$main_object->isLoaded()) {
+ $main_object =& $this->Application->recallObject($parent_prefix);
+ }
+
+ $poll_id = $main_object->GetDBField($this->Application->getUnitOption($event->Prefix, 'ForeignKey'));
+ }
+
+ if ($poll_id) {
+ $spam_helper =& $this->Application->recallObject('SpamHelper');
+ /* @var $spam_helper SpamHelper */
+
+ $spam_helper->InitHelper($poll_id, 'PollComment', 0); // ResourceId used for SpamControl only
+
+ if ($spam_helper->InSpamControl()) {
+ $event->status = erFAIL;
+ $object->SetError('CommentText', 'too_frequent', 'lu_error_AlreadyCommented');
+ return ;
+ }
+ }
+
+ $object->SetDBField('CreatedById', $this->Application->RecallVar('user_id'));
+ $object->SetDBField('UserIP', $_SERVER['REMOTE_ADDR']);
+ $object->SetDBField('PollId', $poll_id); // PollId
+ $object->SetDBField('Status', STATUS_ACTIVE);
+
+ parent::OnBeforeItemCreate($event);
+ }
+
+ /**
+ * Updates item review counter
+ *
+ * @param kEvent $event
+ */
+ function OnCreate(&$event)
+ {
+ parent::OnCreate($event);
+
+ if ($this->Application->isAdminUser) {
+ return;
+ }
+
+ if ($event->status == erSUCCESS) {
+ $event->setRedirectParam('opener', 's');
+ $event->setRedirectParam('pass', 'm,poll');
+ $event->redirect = $this->Application->GetVar('success_template');
+ }
+ }
+
+ /**
+ * Updates item review counter
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ if (!$this->Application->isAdminUser) {
+ $spam_helper =& $this->Application->recallObject('SpamHelper');
+ /* @var $spam_helper SpamHelper */
+
+ $object =& $event->getObject();
+
+ $config_mapping = $this->Application->getUnitOption($event->Prefix, 'ConfigMapping');
+ $comment_settings = $config_mapping['CommentDelayValue'].':'.$config_mapping['CommentDelayInterval'];
+ $spam_helper->InitHelper($object->GetDBField('PollId'), 'PollComment', $comment_settings);
+ $spam_helper->AddToSpamControl();
+ }
+ }
+
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/poll_comments/poll_comments_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/poll_comments/poll_comments_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/poll_comments/poll_comments_config.php (revision 12744)
@@ -0,0 +1,114 @@
+ 'poll-comment',
+
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array ('class' => 'PollCommentEventHandler', 'file' => 'poll_comment_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event'
+ ),
+ 'IDField' => 'CommentId',
+ 'TableName' => TABLE_PREFIX . 'PollsComments',
+
+ 'ParentPrefix' => 'poll',
+ 'ForeignKey' => 'PollId',
+ 'ParentTableKey' => 'PollId',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'StatusField' => Array('Status'),
+
+ // key - special, value - list select sql
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById',
+ ),
+
+ 'ItemSQLs' => Array ('' => 'SELECT * FROM %s'),
+
+ 'ListSortings' => Array (
+ '' => Array(
+ 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('CreatedOn' => 'desc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'CommentId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'PollId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'AnswerId' => Array ('type' => 'int', 'default' => NULL),
+ 'CreatedById' => Array ('type' => 'int', 'formatter'=>'kLEFTFormatter',
+ 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'),
+ 'options' => Array(-1 => 'root', -2 => 'Guest'),
+ 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'',
+ 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login',
+ 'required' => 1, 'not_null' => 1, 'default' => -2),
+ 'GuestName' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'GuestEmail' => Array('type' => 'string', 'max_len' => 255, 'formatter'=>'kFormatter', 'regexp'=>'/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i', 'sample_value' => 'email@domain.com', 'not_null' => '1', 'default' => '', 'error_msgs' => Array('invalid_format'=>'!la_invalid_email!', 'unique'=>'!lu_email_already_exist!'),'required' => 0 ),
+ 'CommentBody' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => NULL, 'required' => 1),
+ 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'),
+ 'UserIP' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Active', 0 => 'la_opt_Disabled', 2 => 'la_opt_Pending'), 'use_phrases' => 1, 'required' => 1, 'not_null' => 1, 'default' => 1),
+ ),
+
+ 'VirtualFields' => Array (
+ 'CommentedByUser' => Array('type' => 'string', 'default' => ''),
+ 'CommentedByEmail' => Array ('type' => 'string', 'default' => ''),
+ ),
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'CommentedByUser' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
+ ),
+ ),
+
+ 'ConfigMapping' => Array (
+ 'PerPage' => 'poll_Perpage_Comments',
+ 'CommentDelayInterval' => 'poll_CommentDelay_Value',
+ 'CommentDelayValue' => 'poll_CommentDelay_Interval',
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 0 => 'icon16_disabled.png',
+ 1 => 'icon16_item.png',
+ 2 => 'icon16_pending.png',
+ 'module' => 'core',
+ ),
+ 'Fields' => Array (
+ 'CommentId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
+ 'CommentBody' => Array ('title' => 'la_col_PollComment', 'data_block' => 'grid_priority_td', 'filter_block' => 'grid_like_filter', 'width' => 250, ),
+
+ 'CommentedByUser' => Array( 'title'=>'la_col_CommentedByUser', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
+
+ 'CreatedOn' => Array ('title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
+ ),
+ ),
+ ),
+
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/private_message_body/private_message_body_eh.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/private_message_body/private_message_body_eh.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/private_message_body/private_message_body_eh.php (revision 12744)
@@ -0,0 +1,56 @@
+getObject();
+ /* @var $object kDBItem */
+
+ // set post options
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $options_map = $post_helper->getOptionsMap();
+ $post_options = $object->GetDBField('Options');
+ foreach ($options_map as $option_name => $field_name) {
+ $option_value = $object->GetDBField($field_name);
+ $post_helper->SetPostOption($option_name, $option_value, $post_options);
+ }
+ $object->SetDBField('Options', $post_options);
+ }
+
+ /**
+ * Deletes message body only when no message is using it
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ if ($object->GetDBField('ReferenceCount') > 0) {
+ $event->status = erFAIL;
+ }
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/private_message_body/private_message_body_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/private_message_body/private_message_body_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/private_message_body/private_message_body_config.php (revision 12744)
@@ -0,0 +1,59 @@
+ 'private-message-body',
+ 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'PrivateMessageBodyEventHandler', 'file' => 'private_message_body_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ ),
+
+ 'IDField' => 'PMBodyId',
+
+ 'TitleField' => 'Subject',
+
+ 'TableName' => TABLE_PREFIX.'PrivateMessageBody',
+
+ 'ForeignKey' => 'PMBodyId',
+ 'ParentTableKey' => 'PMBodyId',
+ 'ParentPrefix' => 'private-message',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'ListSQLs' => Array ('' => ' SELECT %1$s.* %2$s FROM %1$s',),
+ 'ItemSQLs' => Array ('' => ' SELECT %1$s.* %2$s FROM %1$s',),
+
+ 'Fields' => Array (
+ 'PMBodyId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Subject' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'Body' => Array ('type' => 'string', 'default' => NULL),
+ 'Options' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'ReferenceCount' => Array ('type' => 'int', 'not_null' => 1, 'default' => 2),
+ ),
+
+ 'VirtualFields' => Array (
+ 'DisableBBCodes' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'DisableSmileys' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'ShowSignatures' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 1),
+ ),
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/censorship/censorship_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/censorship/censorship_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/censorship/censorship_config.php (revision 12744)
@@ -0,0 +1,95 @@
+ 'censorship',
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array ('class' => 'kDBEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'IDField' => 'CensorshipId',
+
+ 'TableName' => TABLE_PREFIX.'Censorship',
+
+ 'TitleField' => 'BadWord',
+
+ 'TitlePresets' => Array (
+ 'default' => Array (
+ 'new_status_labels' => Array ('censorship' => '!la_title_AddingCensorship!'),
+ 'edit_status_labels' => Array ('censorship' => '!la_title_EditingCensorship!'),
+ ),
+
+ 'censorship_list' => Array ('prefixes' => Array ('censorship_List'), 'format' => "!la_tab_ConfigCensorship!"),
+ 'censorship_edit' => Array ('prefixes' => Array ('censorship'), 'format' => "#censorship_status# '#censorship_titlefield#'"),
+ ),
+
+ 'PermSection' => Array('main' => 'in-bulletin:configuration_censorship'),
+
+ 'Sections' => Array (
+ 'in-bulletin:configuration_censorship' => Array (
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'conf_censorship',
+ 'label' => 'la_tab_ConfigCensorship',
+ 'url' => Array('t' => 'in-bulletin/censorship/censorship_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+ ),
+
+
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s FROM %1$s',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array (
+ 'Sorting' => Array ('BadWord' => 'asc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'CensorshipId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'BadWord' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'Replacement' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'required' => 1, 'default' => ''),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 0 => 'icon16_disabled.png',
+ 1 => 'icon16_item.png',
+ 'module' => 'core',
+ ),
+ 'Fields' => Array (
+ 'CensorshipId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50),
+ 'BadWord' => Array ('title' => 'la_col_BadWord', 'filter_block' => 'grid_like_filter', 'width' => 250),
+ 'Replacement' => Array ('title' => 'la_col_Replacement', 'filter_block' => 'grid_like_filter', 'width' => 250),
+ ),
+ ),
+ ),
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/helpers/helpers_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/helpers/helpers_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/helpers/helpers_config.php (revision 12744)
@@ -0,0 +1,24 @@
+ 'in-bulletin-helpers',
+ 'EventHandlerClass' => Array('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
+
+ 'RegisterClasses' => Array (
+ Array('pseudo' => 'PostHelper', 'class' => 'PostHelper','file' => 'post_helper.php', 'build_event' => '', 'require_classes' => Array('kHelper')),
+ ),
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/helpers/post_helper.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/helpers/post_helper.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/helpers/post_helper.php (revision 12744)
@@ -0,0 +1,418 @@
+ 128,
+ 'disable_bbcode' => 64,
+ 'disable_smileys' => 32,
+ );
+
+ /**
+ * Checks if specific option is set for post
+ *
+ * @param string $option_name
+ * @param Array $options
+ * @return bool
+ */
+ function GetPostOption($option_name, $options)
+ {
+ if (!isset($this->postOptionBits[$option_name])) {
+ return false;
+ }
+
+ $option_bit = $this->postOptionBits[$option_name];
+ return ($options & $option_bit) == $option_bit;
+ }
+
+ /**
+ * Sets given option bit (by name) to post options
+ *
+ * @param string $option_name
+ * @param int $option_value
+ * @param Array $options
+ * @return bool
+ */
+ function SetPostOption($option_name, $option_value, &$options)
+ {
+ if (!isset($this->postOptionBits[$option_name])) {
+ return false;
+ }
+
+ $option_bit = $this->postOptionBits[$option_name];
+ if ($option_value) {
+ $options |= $option_bit;
+ }
+ else {
+ $options = $options &~ $option_bit;
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns post options map to virtual field names
+ *
+ * @return Array
+ */
+ function getOptionsMap()
+ {
+ $options_map = Array (
+ 'show_sig' => 'ShowSignatures',
+ 'disable_smileys' => 'DisableSmileys',
+ 'disable_bbcode' => 'DisableBBCodes',
+ );
+
+ return $options_map;
+ }
+
+ /**
+ * @return void
+ * @param int $date
+ * @desc Set any field to category & all it's parent categories
+ */
+ function PropagateCategoryField($category_id, $field_name, $field_value)
+ {
+ $id_field = $this->Application->getUnitOption('c', 'IDField');
+ $table_name = $this->Application->getUnitOption('c', 'TableName');
+
+ $sql = 'SELECT ParentPath
+ FROM '.$table_name.'
+ WHERE '.$id_field.' = '.$category_id;
+ $parent_path = $this->Conn->GetOne($sql);
+
+ $parent_categories = explode('|', substr($parent_path, 1, -1));
+ if (!$parent_categories) {
+ return false;
+ }
+
+ $fields_hash = Array (
+ $field_name => $field_value,
+ );
+
+ $this->Conn->doUpdate($fields_hash, $table_name, $id_field.' IN ('.implode(',', $parent_categories).')');
+ }
+
+ /**
+ * Sets today posts count & today date for topic
+ *
+ * @param kCatDBItem $object
+ * @param int $increment_by
+ */
+ function updateTodayPostsCount(&$object, $post_date, $increment_by = 1)
+ {
+ $date_now = adodb_date('Y-m-d');
+
+ if (adodb_date('Y-m-d', $post_date) != $date_now) {
+ return ;
+ }
+
+ // last post update date was today or not
+ $today_posts = ($date_now == $object->GetDBField('TodayDate')) ? $object->GetDBField('TodayPosts') : 0;
+
+ $object->SetDBField('TodayDate', $date_now);
+ $object->SetDBField('TodayPosts', $today_posts + $increment_by);
+
+ return $object->Update();
+ }
+
+ function updatePostCount($topic_id, $increment = 1)
+ {
+ $id_field = $this->Application->getUnitOption('bb', 'IDField');
+ $table_name = $this->Application->getUnitOption('bb', 'TableName');
+
+ // helps in case, when 2 (or more) users tries to post in same topic at same time
+ $sql = 'UPDATE '.$table_name.'
+ SET Posts = Posts '.($increment > 0 ? '+' : '-').' '.abs($increment).'
+ WHERE '.$id_field.' = '.$topic_id;
+ $this->Conn->Query($sql);
+
+ // returns new value
+ $sql = 'SELECT Posts
+ FROM '.$table_name.'
+ WHERE '.$id_field.' = '.$topic_id;
+ return $this->Conn->GetOne($sql);
+ }
+ /**
+ * Replaces all special formatting in post before displaing it to user
+ *
+ * @param string $post_body
+ * @param int $post_options bit array of post options
+ * @param Array $sub_blocks block names for rendering smileys & bbcodes
+ * @return string
+ */
+ function parsePostBody($post_body, $post_options, $sub_blocks)
+ {
+ // 1. escape all html sequences
+ $post_body = htmlspecialchars($post_body, ENT_NOQUOTES); // don't touch quotes in bbcode attribute values
+
+ // 2. replace censored words
+ $post_body = $this->CensorText($post_body);
+
+ // 3. replace bb codes
+ if (!$this->GetPostOption('disable_bbcode', $post_options)) {
+ $post_body = $this->replaceBBCodes($post_body, $sub_blocks['bbcode']);
+ }
+
+ // 4. replace smileys
+ if (!$this->GetPostOption('disable_smileys', $post_options)) {
+ $post_body = $this->replaceSmileys($post_body, $sub_blocks['smileys']);
+ }
+
+ // 5. add enters (because we don't use HTML in post body)
+ $post_body = nl2br($post_body);
+
+ // 6. replace quoted text
+ return $this->replacePostQuote($post_body, $sub_blocks['quote']);
+ }
+
+ function replacePostQuote($text, $render_as)
+ {
+ if (preg_match('/\[quote id=([\d]+)\](.*)\[\/quote\]/s', $text, $regs)) {
+ $post =& $this->Application->recallObject('bb-post.-item', null, Array ('skip_autoload' => true));
+ /* @var $post kDBItem */
+
+ $post->Load($regs[1]);
+
+ $block_params = Array ('name' => $render_as, 'PrefixSpecial' => 'bb-post.-item', 'Prefix' => 'bb-post', 'Special' => '-item', 'strip_nl' => 2);
+ $parsed_quote = $this->Application->ParseBlock($block_params);
+ return str_replace($regs[0], $parsed_quote, $text);
+ }
+
+ return $text;
+ }
+
+ /**
+ * Replaces bad words with good words (censorship process)
+ *
+ * @param string $text
+ * @return string
+ */
+ function CensorText($text)
+ {
+ static $censor_words = null;
+
+ if (!isset($censor_words)) {
+ $sql = 'SELECT Replacement, BadWord
+ FROM '.TABLE_PREFIX.'Censorship';
+ $censor_words = $this->Conn->GetCol($sql, 'BadWord');
+ }
+
+ foreach ($censor_words as $replace_from => $replace_to) {
+ $text = str_replace($replace_from, $replace_to, $text);
+ }
+
+ return $text;
+ }
+
+ function replaceSmileys($text, $smiley_element)
+ {
+ static $smileys = null;
+
+ if (!isset($smileys)) {
+ $sql = 'SELECT em.EmotionImage, em.KeyStroke
+ FROM '.TABLE_PREFIX.'Emoticon em
+ WHERE em.Enabled = 1
+ ORDER BY CHAR_LENGTH(em.KeyStroke) DESC';
+ $smileys = $this->Conn->GetCol($sql, 'KeyStroke');
+ }
+
+ $block_params = Array ('name' => $smiley_element, 'smiley_url' => '#SMILEY_URL#');
+ $smiley_mask = trim($this->Application->ParseBlock($block_params));
+
+ $base_url = rtrim($this->Application->BaseURL(),'/');
+ foreach ($smileys as $key_stoke => $image_url) {
+ if (strpos($text, $key_stoke) === false) {
+ continue;
+ }
+
+ $smiley_html = str_replace('#SMILEY_URL#', $base_url.SMILEYS_PATH.$image_url, $smiley_mask);
+ $text = str_replace($key_stoke, $smiley_html, $text);
+ }
+
+ return $text;
+ }
+
+ /**
+ * Sort params by name and then by length
+ *
+ * @param string $a
+ * @param string $b
+ * @return int
+ * @access private
+ */
+ function CmpParams($a, $b)
+ {
+ list ($a, ) = explode(':', $a);
+ list ($b, ) = explode(':', $b);
+
+ $a_len = strlen($a);
+ $b_len = strlen($b);
+ if ($a_len == $b_len) return 0;
+ return $a_len > $b_len ? -1 : 1;
+ }
+
+ function replaceBBCodes($text, $bbcode_element)
+ {
+ // convert phpbb bbcodes to in-bulletin bbcodes
+ $text = $this->preformatBBCodes($text);
+
+ $tags_defs = explode(';', $this->Application->ConfigValue('BBTags')); // 'b:;i:;u:;ul:type|align;font:color|face|size;url:href;img:src|border';
+
+ usort($tags_defs, Array (&$this, 'CmpParams'));
+
+ foreach($tags_defs as $tag) {
+ list ($tag_name, $tag_params) = explode(':', $tag);
+ $tag_params = $tag_params ? array_flip(explode('|', $tag_params)) : 0;
+
+ $text = preg_replace('/\['.$tag_name.'(.*)\](.*)\[\/'.$tag_name.' *\]/Uise','$this->checkBBCodeAttribs("'.$tag_name.'",\'$1\',\'$2\',$tag_params);', $text);
+ }
+
+ // additional processing for [url], [*], [img] bbcode
+ $text = preg_replace('/(.*)<\/url>/Usi','$1 ',$text);
+ $text = preg_replace('/(.*)<\/font>/Usi','$1',$text); // skip empty fonts
+ $text = str_replace( Array('','[*]'),
+ Array('',''),
+ $text);
+
+ // bbcode [code]xxx[/code] processing
+ $text = preg_replace('/\[code\](.*)\[\/code\]/Uise', "\$this->replaceCodeBBCode('$1', '".$bbcode_element."')", $text);
+ return $text;
+ }
+
+ /**
+ * Convert phpbb url bbcode to valid in-bulletin's format
+ *
+ * @param string $text
+ * @return string
+ */
+ function preformatBBCodes($text)
+ {
+ // 1. urls
+ $text = preg_replace('/\[url=(.*)\](.*)\[\/url\]/Ui','[url href="$1"]$2[/url]',$text);
+ $text = preg_replace('/\[url\](.*)\[\/url\]/Ui','[url href="$1"]$1[/url]',$text);
+
+ // 2. images
+ $text = preg_replace('/\[img\](.*)\[\/img\]/Ui','[img src="$1" border="0"][/img]',$text);
+
+ // 3. color
+ $text = preg_replace('/\[color=(.*)\](.*)\[\/color\]/Ui','[font color="$1"]$2[/font]',$text);
+
+ // 4. size
+ $text = preg_replace('/\[size=(.*)\](.*)\[\/size\]/Ui','[font size="$1"]$2[/font]',$text);
+
+ // 5. lists
+ $text = preg_replace('/\[list(.*)\](.*)\[\/list\]/Uis','[ul]$2[/ul]',$text);
+
+ // 6. email to link
+ $text = preg_replace('/\[email\](.*)\[\/email\]/Ui','[url href="mailto:$1"]$1[/url]',$text);
+
+ //7. b tag
+ $text = preg_replace('/\[(b|i|u):(.*)\](.*)\[\/(b|i|u):(.*)\]/Ui','[$1]$3[/$4]',$text);
+
+ //8. code tag
+ $text = preg_replace('/\[code:(.*)\](.*)\[\/code:(.*)\]/Uis','[code]$2[/code]',$text);
+
+ return $text;
+ }
+
+ /**
+ * Removes not allowed params from tag and returns result
+ *
+ * @param string $BBCode bbcode to check
+ * @param string $TagParams params string entered by user
+ * @param string $TextInside text between opening and closing bbcode tag
+ * @param string $ParamsAllowed list of allowed parameter names ("|" separated)
+ * @return string
+ */
+ function checkBBCodeAttribs($BBCode, $TagParams, $TextInside, $ParamsAllowed)
+ {
+ // unescape escaped quotes in tag
+ $TagParams = str_replace('\"', '"', $TagParams);
+ $TextInside = str_replace('\"', '"', $TextInside);
+
+ $params_extracted = preg_match_all('/ +([^=]*)=["\']?([^ "\']*)["\']?/is', $TagParams, $extracted_params, PREG_SET_ORDER);
+
+ if ($ParamsAllowed && $params_extracted) {
+ $ret = Array();
+ foreach ($extracted_params as $param) {
+ $param_name = strtolower(trim( $param[1] ));
+ $param_value = trim($param[2]);
+
+ // 1. prevent hacking
+ if ($BBCode == 'url' && $param_name == 'href') {
+ if (strpos(strtolower($param_value), 'script:') !== false) {
+ // script tag found in "href" parameter of "url" bbcode (equals to hacking) -> remove bbcode
+ return $TextInside;
+ }
+ }
+
+ // 2. leave only allowed params & remove all not allowed
+ if (isset($ParamsAllowed[$param_name])) {
+ $ret[] = $param_name.'="'.$param_value.'"';
+ }
+ }
+
+ $ret = count($ret) ? ' '.implode(' ', $ret) : '';
+ return '<'.$BBCode.$ret.'>'.$TextInside.''.$BBCode.'>';
+ }
+
+ return '<'.$BBCode.'>'.$TextInside.''.$BBCode.'>';
+ }
+
+ function highlightCode($code, $strip_tabs = 0)
+ {
+ if ($strip_tabs) {
+ $code = preg_replace('/(\t){'.$strip_tabs.'}(.*)/', '\\2', $code);
+ }
+
+ $code = str_replace( Array('\\', '/') , Array('_no_match_string_', '_n_m_s_'), $code);
+ $code = highlight_string('', true);
+ $code = str_replace( Array('_no_match_string_', '_n_m_s_'), Array('\\', '/'), $code);
+ $code = preg_replace('/<\?(.*)php(.*)\?>/Us', '\\2', $code);
+
+ $code = preg_replace('/([\r\n]+)/si', '', $code);
+ $code = preg_replace('/([\r\n]+)<\/font>([\r\n]+)<\/code>/si', '
', $code);
+
+ return $code;
+ }
+
+ /**
+ * Replaces [code]php code[/code] bbcode in post
+ *
+ * @param string $input_string code line to highlight
+ * @param string $bbcode_element block name used for bbcode descoration
+ * @return string
+ */
+ function replaceCodeBBCode($input_string, $bbcode_element)
+ {
+ static $bbcode_mask = null;
+
+ if (!isset($bbcode_mask)) {
+ $block_params = Array ('name' => $bbcode_element, 'bb_code' => '#BB_CODE#');
+ $bbcode_mask = trim($this->Application->ParseBlock($block_params));
+ }
+
+ $input_string = trim( str_replace('\"','"', unhtmlentities($input_string)) );
+ $input_string = $this->highlightCode($input_string);
+ $input_string = preg_replace("/\r /s", "\r", $input_string); // undo nl2br added in highlighting
+ $input_string = str_replace('#BB_CODE#', $input_string, $bbcode_mask);
+
+ return $input_string;
+ }
+
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/polls/poll_eh.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/polls/poll_eh.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/polls/poll_eh.php (revision 12744)
@@ -0,0 +1,154 @@
+ Array('self' => 'edit'),
+ 'OnMakeVote' => Array('self' => true),
+ 'OnItemBuild' => Array('self' => true),
+ );
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Applies special filter, that allows to select all poll from given date range
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ if ($this->Application->isAdminUser) {
+ return ;
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ $object->addFilter('poll_range_filter', '(%1$s.StartDate <= ' .adodb_mktime(). ') AND (%1$s.EndDate >= ' .adodb_mktime(). ' OR EndDate IS NULL)');
+ $object->addFilter('poll_status', '(%1$s.Status = ' .STATUS_ACTIVE. ')');
+ }
+
+ /**
+ * Reset votes statistics for current poll
+ *
+ * @param kEvent $event
+ */
+ function OnResetVotes(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $sql = 'DELETE FROM '.TABLE_PREFIX.'PollsStatistics
+ WHERE '.$object->IDField.' = '.$object->GetID();
+ $this->Conn->Query($sql);
+
+
+ $poll_answers_table = $this->Application->getUnitOption('poll-answer', 'TableName');
+ $poll_answers_table = $this->Application->GetTempName($poll_answers_table);
+
+ $sql = 'UPDATE '.$poll_answers_table.' SET VotesQty = 0
+ WHERE '.$object->IDField.' = '.$object->GetID();
+ $this->Conn->Query($sql);
+ }
+
+ /**
+ * Reset votes statistics for current poll
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $object->SetDBField('ResourceId', $this->Application->NextResourceId());
+ }
+
+ /**
+ * Make vote to current poll
+ *
+ * @param kEvent $event
+ */
+ function OnMakeVote(&$event)
+ {
+ $object =& $event->getObject($this->Application->GetVar('poll_id'));
+ /* @var $object kDBItem */
+
+ $poll_answer_id = $this->Application->GetVar('option_id');
+
+ if (!$poll_answer_id) {
+ $event->redirect = false;
+ return ;
+ }
+
+ $ip_address = $_SERVER['REMOTE_ADDR'];
+
+ if (!$object->GetDBField('AllowMultipleVotings')) {
+ $sql = 'SELECT StatisticsId
+ FROM '.TABLE_PREFIX.'PollsStatistics
+ WHERE PollId = '.$object->GetID().' AND UserIP = '.$this->Conn->qstr($ip_address);
+ $voted = $this->Conn->GetOne($sql) > 0;
+ }
+
+ if (!$voted) {
+ $user_id = $this->Application->LoggedIn()? $this->Application->RecallVar('user_id') : '-2';
+ $fields_hash = Array (
+ 'PollId' => $object->GetID(),
+ 'AnswerId' => $poll_answer_id,
+ 'UserIP' => $ip_address,
+ 'CreatedById' => $user_id,
+ 'AnswerDate' => adodb_mktime(),
+ );
+
+ $this->Conn->doInsert($fields_hash, TABLE_PREFIX.'PollsStatistics');
+
+ $poll_table = $this->Application->getUnitOption('poll', 'TableName');
+ $this->Conn->Query('UPDATE '.$poll_table.' SET CachedVotesQty = CachedVotesQty + 1
+ WHERE PollId = '.$object->GetID());
+
+ // update table with answers
+ $poll_answers_table = $this->Application->getUnitOption('poll-answer', 'TableName');
+ $this->Conn->Query('UPDATE '.$poll_answers_table.' SET VotesQty = VotesQty + 1
+ WHERE PollId = '.$object->GetID().' AND AnswerId = '.$poll_answer_id);
+ }
+ $event->setEventParam('PollId', $this->Application->GetVar('poll_id'));
+ $event->redirect = false;
+ }
+
+
+ /**
+ * Cleanup by removing items from PollStatistics before Poll is deleted
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $sql = 'DELETE FROM '.TABLE_PREFIX.'PollsStatistics
+ WHERE PollId = '.$object->GetID();
+ $this->Conn->Query($sql);
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/polls/poll_tp.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/polls/poll_tp.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/polls/poll_tp.php (revision 12744)
@@ -0,0 +1,118 @@
+getObject($params);
+ /* @var $object kDBItem */
+
+ if (!$object->GetDBField('AllowMultipleVotings')) {
+ $sql = 'SELECT StatisticsId
+ FROM '.TABLE_PREFIX.'PollsStatistics
+ WHERE PollId = '.$object->GetID().' AND CreatedById = '.$this->Application->RecallVar('user_id').' AND UserIP = '.$this->Conn->qstr(getenv('REMOTE_ADDR'));
+ return $this->Conn->GetOne($sql) > 0;
+ }
+
+ return false;
+ }
+
+ /**
+ * Allows to tell if user from current ip has voted already for current poll
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function HasCommented($params)
+ {
+ $object =& $this->getObject($params);
+ /* @var $object kDBItem */
+
+ $spam_helper =& $this->Application->recallObject('SpamHelper');
+ /* @var $spam_helper SpamHelper */
+
+ $spam_helper->InitHelper($object->GetID(), 'PollComment', 0); // PollId used for SpamControl only
+ return $spam_helper->InSpamControl();
+ }
+
+ /**
+ * Prints out only filled in answers of current poll
+ *
+ * @param Array $params
+ * @return string
+ */
+ function PrintPoll($params)
+ {
+ $object =& $this->getObject($params);
+
+ $sql = 'SELECT COUNT(AnswerNum), AnswerNum
+ FROM '.TABLE_PREFIX.'PollsStatistics
+ WHERE PollId = '.$object->GetID().'
+ GROUP BY AnswerNum';
+ $statistics = $this->Conn->GetCol($sql, 'AnswerNum');
+
+ $total_votes = array_sum($statistics);
+
+ $block_params = $this->prepareTagParams($params);
+ $block_params['name'] = $params['render_as'];
+
+ $i = 1;
+ $ret = '';
+ while ($i < 8) {
+ $answer = $object->GetDBField('Answer'.$i);
+ if ($answer) {
+ $answer_votes = isset($statistics[$i]) ? $statistics[$i] : 0;
+ if ($total_votes > 0) {
+ $block_params['percent'] = round((100 * $answer_votes) / $total_votes, 0);
+ }
+ else {
+ $block_params['percent'] = 0;
+ }
+
+ $block_params['answer'] = $answer;
+ $block_params['answer_num'] = $i;
+
+ $ret .= $this->Application->ParseBlock($block_params);
+ }
+ $i++;
+ }
+
+ return $ret;
+ }
+
+ /**
+ * Prints link to comments of of current poll
+ *
+ * @param Array $params
+ * @return string
+ */
+ function CommentsLink($params)
+ {
+ $object =& $this->getObject($params);
+
+ $params['pass'] = 'm,poll';
+ $params['poll_id'] = $object->GetID();
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/polls/polls_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/polls/polls_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/polls/polls_config.php (revision 12744)
@@ -0,0 +1,167 @@
+ 'poll',
+ 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'PollEventHandler', 'file' => 'poll_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'PollTagProcessor', 'file' => 'poll_tp.php', 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'IDField' => 'PollId',
+
+ 'TitleField' => 'Name',
+ 'StatusField' => Array('Status'),
+
+
+ 'TitlePresets' => Array(
+ 'default' => Array(
+ 'new_status_labels' => Array('poll' => '!la_title_Adding_Poll!'),
+ 'edit_status_labels' => Array('poll' => '!la_title_Editing_Poll!'),
+ 'new_titlefield' => Array('poll' => '!la_title_NewPoll!'),
+ ),
+
+ 'poll_list' => Array('prefixes' => Array('poll_List'), 'format' => "!la_title_Polls!", ),
+ 'poll_edit' => Array('prefixes' => Array('poll'), 'format' => "#poll_status# '#poll_titlefield#' - !la_title_General!", ),
+ 'poll_edit_answers' => Array ('prefixes' => Array ('poll', 'poll-answer_List'), 'format' => "#poll_status# '#poll_titlefield#' - !la_title_PollAnswers!"),
+
+ 'poll_edit_comments' => Array ('prefixes' => Array ('poll', 'poll-comment_List'), 'format' => "#poll_status# '#poll_titlefield#' - !la_title_PollComments!"),
+
+
+ 'answer_edit' => Array (
+ 'prefixes' => Array ('poll', 'poll-answer'),
+ 'new_status_labels' => Array ('poll-answer' => '!la_title_Adding_Answer!'),
+ 'edit_status_labels' => Array ('poll-answer' => '!la_title_Editing_Answer!'),
+ 'new_titlefield' => Array ('poll-answer' => '!la_title_New_Answer!'),
+ 'format' => "#poll_status# '#poll_titlefield#' - #poll-answer_status# '#poll-answer_titlefield#'"
+ ),
+
+ 'comment_edit' => Array (
+ 'prefixes' => Array ('poll', 'poll-comment'),
+ 'new_status_labels' => Array ('poll-comment' => '!la_title_Adding_Comment!'),
+ 'edit_status_labels' => Array ('poll-comment' => '!la_title_Editing_Comment!'),
+ 'new_titlefield' => Array ('poll-comment' => '!la_title_NewComment!'),
+ 'format' => "#poll_status# '#poll_titlefield#' - #poll-comment_status#",
+ ),
+
+ ),
+
+ 'PermSection' => Array('main' => 'in-bulletin:polls'),
+
+ 'Sections' => Array (
+ 'in-bulletin:polls' => Array (
+ 'parent' => 'in-portal:site',
+ 'icon' => 'polls',
+ 'label' => 'la_title_Polls',
+ 'url' => Array('t' => 'in-bulletin/polls/poll_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 3.6,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'Polls',
+
+ 'ListSQLs' => Array('' => 'SELECT %1$s.* %2$s
+ FROM %1$s',
+
+ ),
+
+ 'ItemSQLs' => Array('' => 'SELECT %1$s.* %2$s
+ FROM %1$s',
+
+ ),
+
+ 'ListSortings' => Array(
+ '' => Array (
+ 'Sorting' => Array('PollId' => 'asc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'PollId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,),
+ 'Name' => Array('type' => 'string', 'not_null' => '1','default' => '', 'required'=> 1, 'max_len' => 255),
+ 'Question' => Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'using_fck' => 1, 'default' => null, 'required' => 1),
+ 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'),
+ 'StartDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'),
+ 'EndDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null),
+ 'Image' => Array (
+ 'type' => 'string',
+ 'formatter' => 'kPictureFormatter',
+ 'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => IMAGES_PATH . 'polls/',
+ 'file_types' => '*.jpg;*.gif;*.png', 'files_description' => '!la_hint_ImageFiles!',
+ 'multiple' => false,
+ 'max_len' => 255, 'not_null' => 1, 'default' => ''
+ ),
+ 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'RequireLogin' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,),
+ 'AllowComments' => Array('type' => 'int', 'not_null' => 1, 'default' => 1,),
+ 'AllowMultipleVotings' => Array('type' => 'int', 'not_null' => 1, 'default' => 1,),
+ 'CachedVotesQty'=> Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Active', 0 => 'la_opt_Disabled'), 'use_phrases' => 1, 'required' => 1, 'not_null' => 1, 'default' => 1),
+
+ ),
+
+ 'SubItems' => Array ('poll-answer', 'poll-comment'),
+
+ 'VirtualFields' => Array (
+// 'PollId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,),
+ ),
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+// 'DaysLeft' => 'IF( ISNULL(%1$s.EndDate), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, %1$s.PosterAlias, \'n/a\')), \'Never\' )',
+ ),
+ ),
+
+ 'EditTabPresets' => Array (
+ 'Default' => Array (
+ Array ('title' => 'la_tab_General', 't' => 'in-bulletin/polls/poll_edit', 'priority' => 1),
+ Array ('title' => 'la_tab_PollAnswers', 't' => 'in-bulletin/polls/poll_edit_answers', 'priority' => 2),
+ Array ('title' => 'la_tab_PollUserComments', 't' => 'in-bulletin/polls/poll_edit_comments', 'priority' => 3),
+ ),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 0 => 'icon16_disabled.png',
+ 1 => 'icon16_item.png',
+ 2 => 'icon16_pending.png',
+ 'module' => 'core',
+ ),
+ 'Fields' => Array (
+ 'PollId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
+ 'Name' => Array ('title' => 'la_col_Name', 'data_block' => 'grid_priority_td', 'filter_block' => 'grid_like_filter', 'width' => 200, ),
+ 'StartDate' => Array ('title' => 'la_col_StartDate', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'EndDate' => Array ('title' => 'la_col_EndDate', 'data_block' => 'poll_expire_td', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'CachedVotesQty' => Array ('title' => 'la_col_VoteCount', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
+ 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
+// 'DaysActive' => Array ('title' => 'la_col_NumberOfDaysActive', 'filter_block' => 'grid_range_filter',),
+ ),
+ ),
+ ),
+
+ );
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/topic_detail.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/topic_detail.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/topic_detail.tpl (revision 12744)
@@ -0,0 +1,148 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [ ]
+
+ - ( )
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="10" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/modify_post.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/modify_post.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/modify_post.tpl (revision 12744)
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+ elements/html_head
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/search_results.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/search_results.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/search_results.tpl (revision 12744)
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ : | : 0
+
+
+ : 05/17/2006
+
+
+
+ img/s.gif" width="1" height="4" alt="" />
+ img/grey_pix.gif" width="100%" height="1" alt="" />
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/new_topic_reply.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/new_topic_reply.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/new_topic_reply.tpl (revision 12744)
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/modify_topic.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/modify_topic.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/modify_topic.tpl (revision 12744)
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/.smsignore
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/.smsignore (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/.smsignore (revision 12744)
@@ -0,0 +1 @@
+topic_detail\.tpl
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/modify_pending_confirm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/modify_pending_confirm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/modify_pending_confirm.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/modify_confirm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/modify_confirm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/modify_confirm.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/new_topic.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/new_topic.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/new_topic.tpl (revision 12744)
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/add_pending_confirm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/add_pending_confirm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/add_pending_confirm.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/topics/add_confirm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/topics/add_confirm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/topics/add_confirm.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/module_info.xml
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/module_info.xml (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/module_info.xml (revision 12744)
@@ -0,0 +1,5 @@
+
+
+ in-bulletin/designs/section
+ in-bulletin/designs/post_list
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/designs/.smsignore
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/designs/.smsignore (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/designs/.smsignore (revision 12744)
@@ -0,0 +1 @@
+.*\.tpl
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/designs/section.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/designs/section.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/designs/section.tpl (revision 12744)
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+ img/s.gif" width="1" height="4" alt="" />
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+ img/forums_new_post.gif" width="20" height="23" alt="" />
+
+
+
+
+
+ img/forums_no_new_post.gif" width="21" height="24" alt="" />
+
+
+
+
+
+ img/forums_locked.gif" width="25" height="23" alt="" />
+
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/view_message.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/view_message.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/view_message.tpl (revision 12744)
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [ "> ]
+
+
+ [ " onclick="return confirm(' ');"> ]
+
+
+
+
+ :
+
+
+
+
+
+
+ :
+ :
+
+
+
+
+
+
+
+ [ "> ]
+
+
+ [ " onclick="return confirm(' ');"> ]
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/private_messages.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/private_messages.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/private_messages.tpl (revision 12744)
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/new_message.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/new_message.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/new_message.tpl (revision 12744)
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/add_confirm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/add_confirm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/my_account/private_messages/add_confirm.tpl (revision 12744)
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/my_account/my_preferences.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/my_account/my_preferences.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/my_account/my_preferences.tpl (revision 12744)
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/my_account/my_items.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/my_account/my_items.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/my_account/my_items.elm.tpl (revision 12744)
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/my_account/preferences_tab.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/my_account/preferences_tab.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/my_account/preferences_tab.elm.tpl (revision 12744)
@@ -0,0 +1 @@
+
Index: branches/5.0.x/themes/advanced/in-bulletin/my_account/my_topics.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/my_account/my_topics.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/my_account/my_topics.tpl (revision 12744)
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/img/icon_post_1.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/toolbar/code_icon.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/toolbar/image_icon.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/toolbar/bold_icon.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/toolbar/italic_icon.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/toolbar/underline_icon.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/toolbar/link_icon.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/ic_pm_list46.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/ic_mytopics46.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/bottom_left_corner.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/bottom_right_corner.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/top_left_corner.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/left_border.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/icons/btn_modify.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/icons/btn_no_icon.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/icons/btn_add_favorites.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/icons/btn_remove_favorites.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/icons/btn_reply.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/top_border.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/big_buttons/bottom_border.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/menu_topics.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/small_buttons/bottom_left_corner.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/small_buttons/bottom_right_corner.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/small_buttons/top_left_corner.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/small_buttons/icons/btn_sm_modify.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/small_buttons/icons/btn_sm_delete.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/small_buttons/icons/btn_threaded.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/small_buttons/icons/btn_sm_quoted.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/small_buttons/top_border.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/img/small_buttons/bottom_border.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/themes/advanced/in-bulletin/inc/styles.css
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/inc/styles.css (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/inc/styles.css (revision 12744)
@@ -0,0 +1,149 @@
+.bbcode {
+ border: 1px solid #888888;
+ background-color: #EEEEEE;
+ padding: 10px;
+}
+
+.forums-header TD
+ {
+ padding:6px;
+ color:#21619e;
+ }
+
+.forums-icon-cell
+ {
+ width:20px;
+ padding-right:10px;
+ vertical-align:top;
+ }
+
+.forums-subheaders
+ {
+ background:#f4f4f4;
+ font-weight:bold;
+ padding:5px 15px;
+ font-size:12px;
+ }
+
+
+.forums-subheaders A
+ {
+ color:#000000;
+ text-decoration: underline;
+ }
+
+.forums-subheaders A:hover
+ {
+ color: #666666;
+ text-decoration: underline;
+ }
+
+.forums-cells
+ {
+ vertical-align: middle;
+ padding:10px;
+ }
+
+.post-background-1
+ {
+ background:#f4f4f4;
+ padding:8px;
+ }
+
+.post-background-2
+ {
+ background:#FFFFFF;
+ padding:8px;
+ }
+
+.post-icon-padding-right
+ {
+ padding-right:10px;
+ }
+
+.topic-prewiew-padding-cell TD
+ {
+ padding: 13px;
+ }
+
+.post-control {
+ padding: 0px !important;
+ vertical-align: top;
+}
+
+
+.no-padding TD
+ {
+ padding:0px;
+ }
+
+
+.forums-icon-description TD
+ {
+ padding:10px;
+ vertical-align:middle;
+ }
+
+.topics-icon-padding
+ {
+ width:14px;
+ padding-right:10px;
+ }
+
+.new-private-message {
+ font-weight: bold;
+}
+
+
+
+.quoted-reply {
+ border: 1px dashed #333;
+}
+
+.quoted-reply td {
+ padding: 5px;
+}
+
+/* --- Topic Button Styles --- */
+.big-button-left-border {
+ background: #EFEFEF url('../img/big_buttons/left_border.gif') repeat-y top left;
+}
+
+.big-button-bottom td {
+ background: #EFEFEF url('../img/big_buttons/bottom_border.gif') repeat-x top left;
+}
+
+.big-button-text {
+ background: #EFEFEF url('../img/big_buttons/top_border.gif') repeat-x top left;
+ font: bold 11px Arial, sans-serif;
+ letter-spacing: 0px;
+ color: #1F569A;
+ padding-top: 14px;
+}
+
+.big-button-text a, .big-button-text a:hover {
+ text-decoration: none;
+}
+
+/* --- Post Button Styles --- */
+.small-button-bottom td {
+ background: #efefef url('../img/small_buttons/bottom_border.gif') repeat-x top left
+}
+
+.small-button-text {
+ background: url('../img/small_buttons/top_border.gif') repeat-x top left;
+ font: 10px Arial, sans-serif;
+ color: #153C6A;
+ padding-top: 15px;
+ vertical-align: bottom;
+ height: 27px;
+}
+
+.small-button-text a {
+ color: #153C6A;
+ text-decoration: none;
+}
+
+.small-button-text a:hover {
+ text-decoration: none;
+}
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/inc/script.js
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/inc/script.js (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/inc/script.js (revision 12744)
@@ -0,0 +1,79 @@
+// apply tagOpen/tagClose to selection in textarea,
+// use sampleText instead of selection if there is none
+function insertTags(tagOpen, tagClose, sampleText, textarea_id) {
+ var txtarea = document.getElementById(textarea_id);
+
+ var selText, isSample = false;
+
+ if (document.selection && document.selection.createRange) { // IE/Opera
+ //save window scroll position
+ if (document.documentElement && document.documentElement.scrollTop) {
+ var winScroll = document.documentElement.scrollTop;
+ }
+ else if (document.body) {
+ var winScroll = document.body.scrollTop;
+ }
+
+ //get current selection
+ txtarea.focus();
+ var range = document.selection.createRange();
+ selText = range.text;
+
+ //insert tags
+ checkSelectedText();
+ range.text = tagOpen + selText + tagClose;
+ //mark sample text as selected
+ if (isSample && range.moveStart) {
+ if (window.opera) {
+ tagClose = tagClose.replace(/\n/g,'');
+ }
+ range.moveStart('character', - tagClose.length - selText.length);
+ range.moveEnd('character', - tagClose.length);
+ }
+ range.select();
+
+ //restore window scroll position
+ if (document.documentElement && document.documentElement.scrollTop) {
+ document.documentElement.scrollTop = winScroll;
+ }
+ else if (document.body) {
+ document.body.scrollTop = winScroll;
+ }
+ } else if (txtarea.selectionStart || txtarea.selectionStart == '0') { // Mozilla
+ //save textarea scroll position
+ var textScroll = txtarea.scrollTop;
+
+ //get current selection
+ txtarea.focus();
+ var startPos = txtarea.selectionStart;
+ var endPos = txtarea.selectionEnd;
+ selText = txtarea.value.substring(startPos, endPos);
+
+ //insert tags
+ checkSelectedText();
+ txtarea.value = txtarea.value.substring(0, startPos)
+ + tagOpen + selText + tagClose
+ + txtarea.value.substring(endPos, txtarea.value.length);
+ //set new selection
+ if (isSample) {
+ txtarea.selectionStart = startPos + tagOpen.length;
+ txtarea.selectionEnd = startPos + tagOpen.length + selText.length;
+ } else {
+ txtarea.selectionStart = startPos + tagOpen.length + selText.length + tagClose.length;
+ txtarea.selectionEnd = txtarea.selectionStart;
+ }
+ //restore textarea scroll position
+ txtarea.scrollTop = textScroll;
+ }
+
+ function checkSelectedText(){
+ if (!selText) {
+ selText = sampleText;
+ isSample = true;
+ } else if (selText.charAt(selText.length - 1) == ' ') { //exclude ending space char
+ selText = selText.substring(0, selText.length - 1);
+ tagClose += ' '
+ }
+ }
+
+}
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/topics.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/topics.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/topics.elm.tpl (revision 12744)
@@ -0,0 +1,143 @@
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+ img/topics_icon.gif" width="14" height="12" alt="" />
+
+
+
+
+
+
+ ">
+
+ img/icon_hot.gif" alt=" "/>
+ img/icon_new.gif" alt=" "/>
+ img/icon_popular.gif" alt=" "/>
+ img/icon_pick.gif" alt=" "/>
+ img/icon_favorite.gif" alt=" "/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ img/topics_icon.gif" width="14" height="12" alt="" />
+ " class="text-title">
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+ ">
+
+ img/icon_hot.gif" alt=" "/>
+ img/icon_new.gif" alt=" "/>
+ img/icon_popular.gif" alt=" "/>
+ img/icon_pick.gif" alt=" "/>
+ img/icon_favorite.gif" alt=" "/>
+
+
+
+ ( : )
+
+
+
+ :
+
+
+
+
+
+ img/ic_details.gif" width="14" height="13" alt="" /> ">
+
+
+
+
+ | img/ic_edit.gif" width="11" height="10" alt="" /> ">
+
+
+
+
+
+ | img/ic_delete.gif" width="11" height="10" alt="" /> " onclick="return confirm(' ');">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ img/big_buttons/top_left_corner.gif" width="11" height="16" alt="" />
+
+
+ ">
+
+
+ "> img/big_buttons/icons/ .gif" alt="">
+
+
+
+
+
+ img/big_buttons/bottom_left_corner.gif" width="11" height="10" alt="" />
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+ img/big_buttons/bottom_right_corner.gif" width="11" height="10" alt="" />
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/html_head.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/html_head.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/html_head.elm.tpl (revision 12744)
@@ -0,0 +1,6 @@
+ inc/styles.css" type="text/css" />
+inc/script.js">
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/private_messages.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/private_messages.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/private_messages.elm.tpl (revision 12744)
@@ -0,0 +1,106 @@
+
+ active-tab inactive-tab">
+ ">
+
+
+
+
+
+
+
+ ">
+
+
+
+
+
+
+
+
+
+
+
+ img/small_buttons/top_left_corner.gif" width="5" height="27" alt="" />
+
+
+ " >
+
+
+ "> img/small_buttons/icons/ .gif">
+
+
+
+
+ img/small_buttons/bottom_left_corner.gif" width="5" height="5" alt="" />
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+ img/small_buttons/bottom_right_corner.gif" width="5" height="5" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+ " />
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+ ">
+
+ ( )
+
+
+ ">
+
+ ( )
+
+
+
+
+ ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/add_poll_comment.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/add_poll_comment.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/add_poll_comment.elm.tpl (revision 12744)
@@ -0,0 +1,48 @@
+
+
+
+ ">
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/poll_comments.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/poll_comments.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/poll_comments.elm.tpl (revision 12744)
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
?height=640&width=480" title="
" class="thickbox">
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/search_results.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/search_results.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/search_results.elm.tpl (revision 12744)
@@ -0,0 +1,53 @@
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+
+ : | : 0
+
+
+ : 05/17/2006
+
+
+
+ img/s.gif" width="1" height="4" alt="" />
+ img/grey_pix.gif" width="100%" height="1" alt="" />
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+ img/s.gif" width="1" height="5" alt="" />
+ "> ...
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/related_items.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/related_items.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/related_items.elm.tpl (revision 12744)
@@ -0,0 +1,7 @@
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/contact_user.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/contact_user.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/contact_user.elm.tpl (revision 12744)
@@ -0,0 +1,8 @@
+
+
+
+
+ ">
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/category_topics.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/category_topics.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/category_topics.elm.tpl (revision 12744)
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/my_favorites.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/my_favorites.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/content_boxes/my_favorites.elm.tpl (revision 12744)
@@ -0,0 +1,33 @@
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/side_boxes/poll_results.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/side_boxes/poll_results.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/side_boxes/poll_results.elm.tpl (revision 12744)
@@ -0,0 +1,8 @@
+
+
+ –
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/side_boxes/action_box.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/side_boxes/action_box.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/side_boxes/action_box.elm.tpl (revision 12744)
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ ">
+
+
+
+
+
+
+
+
+
+
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/side_boxes/polls.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/side_boxes/polls.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/side_boxes/polls.elm.tpl (revision 12744)
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+ " onclick="getElementById('selected_opt_ ').value=' ';getElementById('vote_button').disabled=false;">
+
+
+
+
+
+
+
+
+
+
+ " class="thickbox" title=" ">
+ " border="0" alt=" ">
+
+
+
" style="text-align:left; margin-top:10px; margin-bottom:10px">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ " name="selected_opt_ "/>
+ , getElementById('selected_opt_ ').value); return false;" value=" "/>
+
+
+
+
+
+
+
+
+
+ " title=" " class="thickbox"/>
+
+
" title="
" class="thickbox"/>
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/.smsignore
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/.smsignore (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/.smsignore (revision 12744)
@@ -0,0 +1 @@
+.*\.xml\.tpl
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/forms.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/forms.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/forms.elm.tpl (revision 12744)
@@ -0,0 +1,32 @@
+
+ ">
+
+
+ '); return false;">
+ img/toolbar/bold_icon.png" border="0"/>
+
+ '); return false;">
+ img/toolbar/italic_icon.png" border="0"/>
+
+ '); return false;">
+ img/toolbar/underline_icon.png" border="0"/>
+
+ '); return false;">
+ img/toolbar/link_icon.png" border="0"/>
+
+ '); return false;">
+ img/toolbar/image_icon.png" border="0"/>
+
+ '); return false;">
+ img/toolbar/code_icon.png" border="0"/>
+
+
+
+
+
+
+ " name=" " id=" " cols=" " rows=" " style=" ">
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/posts.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/posts.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/posts.elm.tpl (revision 12744)
@@ -0,0 +1,150 @@
+
+ " />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ img/small_buttons/top_left_corner.gif" width="5" height="27" alt="" />
+
+
+
+ " onclick="return confirm(' ');" >
+
+
+ " onclick="return confirm(' ');" > img/small_buttons/icons/ .gif">
+
+
+
+
+ img/small_buttons/bottom_left_corner.gif" width="5" height="5" alt="" />
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+ img/small_buttons/bottom_right_corner.gif" width="5" height="5" alt="" />
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+ " valign="top">
+
+
+
+ img/icon_post_1.gif" width="21" height="24" alt="" />
+
+
+
+ ">
+
+
+
+
+
+
+ :
+ :
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+ " valign="top">
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ------------------------------------------------------------------------------
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/themes/advanced/in-bulletin/elements/categories.elm.tpl
===================================================================
diff -u
--- branches/5.0.x/themes/advanced/in-bulletin/elements/categories.elm.tpl (revision 0)
+++ branches/5.0.x/themes/advanced/in-bulletin/elements/categories.elm.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+ img/forums_dir.gif" width="20" height="24" alt="" />
+
+
+ ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: branches/5.0.x/in-bulletin/install/prerequisites.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/prerequisites.php (revision 0)
+++ branches/5.0.x/in-bulletin/install/prerequisites.php (revision 12744)
@@ -0,0 +1,80 @@
+_toolkit =& $instance;
+ }
+
+ /**
+ * Checks minimal version, that could be upgradeable
+ *
+ * @param string $mode when called mode {install, standalone, upgrade)
+ */
+ function CheckPrerequisites($versions, $mode)
+ {
+ $errors = Array ();
+
+ if ($mode == 'standalone') {
+ if (!$this->Application->isModuleEnabled('In-Portal')) {
+ $errors[] = 'Please install or enable "In-Portal" module first';
+ }
+ }
+
+ if ($mode == 'upgrade') {
+ $sql = 'SELECT Version
+ FROM ' . TABLE_PREFIX . 'Modules
+ WHERE Name = "In-Portal"';
+ $inportal_version = $this->Conn->GetOne($sql);
+
+ if ($inportal_version === false) {
+ // only, when In-Portal was installed
+ return $errors;
+ }
+
+ $min_version = '4.3.1';
+
+ $current_version = $this->_toolkit->ConvertModuleVersion($inportal_version);
+ $needed_version = $this->_toolkit->ConvertModuleVersion($min_version);
+ if ($current_version < $needed_version) {
+ $errors[] = 'Please upgrade "In-Portal" to version ' . $min_version;
+ }
+ }
+
+ return $errors;
+ }
+ }
+
+?>
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/.htaccess
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/.htaccess (revision 0)
+++ branches/5.0.x/in-bulletin/install/.htaccess (revision 12744)
@@ -0,0 +1 @@
+deny from all
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/module_info.xml
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/module_info.xml (revision 0)
+++ branches/5.0.x/in-bulletin/install/module_info.xml (revision 12744)
@@ -0,0 +1,6 @@
+
+
+ In-Bulletin
+ Discussion Forum
+ in-bulletin/install/img/icon_discussion_forum.gif
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/install_data.sql
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/install_data.sql (revision 0)
+++ branches/5.0.x/in-bulletin/install/install_data.sql (revision 12744)
@@ -0,0 +1,285 @@
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'asc=la_common_Ascending,desc=la_common_Descending', 10.01, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'TopicText=la_opt_TopicText,Posts=la_opt_NumberOfPosts,CreatedOn=la_opt_CreatedOn,LastPostDate=la_opt_LastUpdated,Views=la_opt_TopicViews,CachedRating=la_opt_Rating,LastPoser=la_opt_LastPoster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) ', 10.01, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '', 'TopicText=la_opt_TopicText,Posts=la_opt_NumberOfPosts,CreatedOn=la_opt_CreatedOn,LastPostDate=la_opt_LastUpdated,Views=la_opt_TopicViews,CachedRating=la_opt_Rating,LastPoser=la_opt_LastPoster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) ', 10.02, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_NewDays', 'la_Text_Topics', 'la_topic_newdays_prompt', 'text', '', '', 10.05, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '', 'asc=la_common_Ascending,desc=la_common_Descending', 10.02, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics', 'la_Text_Topics', 'la_topic_perpage_prompt', 'text', '', '', 10.03, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MinPopRating', 'la_Text_Topics', 'la_fld_Topic_MinPopRating', 'text', '', '', 10.06, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MaxHotNumber', 'la_Text_Topics', 'la_fld_Topic_MaxHotNumber', 'text', '', '', 10.08, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_EditorPicksAbove', 'la_Text_Topics', 'la_topic_editorpicksabove_prompt', 'checkbox', '', '', 10.09, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Postings', 'la_posts_subheading', 'la_posts_perpage_prompt', 'text', '', '', 20.01, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Posts_NewDays', 'la_posts_subheading', 'la_posts_newdays_prompt', 'text', '', '', 20.02, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MinPopVotes', 'la_Text_Topics', 'la_fld_Topic_MinPopVotes', 'text', '', '', 10.07, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics_Short', 'la_Text_Topics', 'la_topic_perpage_short_prompt', 'text', '', '', 10.04, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Value', 'la_Text_Topics', 'la_prompt_DupReviews', 'text', '', 'style="width: 50px;"', 10.1, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Interval', 'la_Text_Topics', 'la_prompt_DupReviews', 'select', '', '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year', 10.1, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Value', 'la_Text_Topics', 'la_prompt_DupRating', 'text', '', 'style="width: 50px;"', 10.11, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Interval', 'la_Text_Topics', 'la_prompt_DupRating', 'select', '', '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year', 10.11, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('AutoTopicLockPosts', 'la_Text_Topics', 'la_prompt_PostsToLock', 'text', NULL, NULL, 10.12, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_TopicReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL, NULL, 30.01, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('bb_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 40.01, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 40.02, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_MaxImageCount', 'la_section_ImageSettings', 'la_config_MaxImageCount', 'text', '', '', 50.01, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_ThumbnailImageWidth', 'la_section_ImageSettings', 'la_config_ThumbnailImageWidth', 'text', '', '', 50.02, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_ThumbnailImageHeight', 'la_section_ImageSettings', 'la_config_ThumbnailImageHeight', 'text', '', '', 50.03, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_FullImageWidth', 'la_section_ImageSettings', 'la_config_FullImageWidth', 'text', '', '', 50.04, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_FullImageHeight', 'la_section_ImageSettings', 'la_config_FullImageHeight', 'text', '', '', 50.05, 0, 0);
+
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_topics', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_topics', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_topics', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_topics', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_topics', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_PrivateMessages', 'la_text_PrivateMessages', 'la_text_PrivateMessages_PerPage', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('poll_CommentDelay_Value', 'la_Text_Polls', 'la_prompt_DupPollComments', 'text', '', 'style="width: 50px;"', 60.1, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('poll_CommentDelay_Interval', 'la_Text_Polls', 'la_prompt_DupPollComments', 'select', '', '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year', 60.2, 2, 1);
+
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_Postings', '25', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_Topics', '5', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Posting_SortOrder', 'CreatedOn asc, PostingText', 'inportal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Posts_NewDays', '5', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Bulletin_TopCount', '2', 'inportal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Bulletin_CatNewDays', '10', 'inportal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Bulletin_Pick_First', '1', 'inportal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_SortOrder', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_SortField', 'LastPostDate', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_SortOrder2', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_SortField2', 'Posts', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_NewDays', '6', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_MinPopRating', '3', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_MaxHotNumber', '3', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_EditorPicksAbove', '1', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_MinPopVotes', '8', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Root', '{TopicCatId}', 'In-Portal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Post_Sortfield', DEFAULT, 'In-Bulletin', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Post_SortOrder', DEFAULT, 'In-Bulletin', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'BBTags', 'b:;i:;u:;ul:type|align;font:color|face|size;url:href;img:src|border', 'In-Portal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Post_Background1', '#cccccc', 'In-Portal', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Post_Background2', '#bbbbbb', 'In-Portal', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Background1', '#FAEBD7', 'In-Portal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Background2', '#F5F5DC', 'In-Portal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'AutoTopicLockPosts', '0', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_CategoryTemplate', '/in-bulletin/designs/section', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_ItemTemplate', 'in-bulletin/designs/detail', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Highlight_OpenTag', '', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Highlight_CloseTag', ' ', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_Topics_Short', '3', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'topic_RatingDelay_Interval', '3600', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'topic_RatingDelay_Value', '1', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'topic_ReviewDelay_Interval', '60', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'topic_ReviewDelay_Value', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Increase_topics', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_MaxImageCount', 5, 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_ThumbnailImageWidth', 120, 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_ThumbnailImageHeight', 120, 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_FullImageWidth', 450, 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_FullImageHeight', 450, 'In-Bulletin', 'in-bulletin:configuration_output');
+
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Keyword_topics', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Pop_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Rating_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Increase_posts', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Keyword_posts', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Pop_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Rating_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_ShowMultiple_topics', '0', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_PrivateMessages', '20', 'In-Bulletin', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_TopicReviews', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'poll_CommentDelay_Interval', '60', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'poll_CommentDelay_Value', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+
+INSERT INTO Emoticon VALUES (1, 'Happy Smile', ':)', 1, '');
+INSERT INTO Emoticon VALUES (2, 'Big Grin', ':grin:', 1, '');
+INSERT INTO Emoticon VALUES (3, 'Wink', ';)', 1, '');
+INSERT INTO Emoticon VALUES (4, 'Scared', ':scared:', 1, '');
+INSERT INTO Emoticon VALUES (5, 'Teasing', ':eek:', 1, '');
+INSERT INTO Emoticon VALUES (6, 'Cool', ':cool:', 1, '');
+INSERT INTO Emoticon VALUES (7, 'Angry', ':@', 1, '');
+INSERT INTO Emoticon VALUES (8, 'Squint', ':squint:', 1, '');
+INSERT INTO Emoticon VALUES (9, 'Oops', ':o', 1, '');
+INSERT INTO Emoticon VALUES (10, 'Sad', ':(', 1, '');
+INSERT INTO Emoticon VALUES (11, 'Cry', ':cry:', 1, '');
+INSERT INTO Emoticon VALUES (12, 'Smirk', ';]', 1, '');
+INSERT INTO Emoticon VALUES (13, 'Happy sleep', ':sleep:', 1, '');
+INSERT INTO Emoticon VALUES (14, 'Very angry', ':x', 1, '');
+INSERT INTO Emoticon VALUES (15, 'Geek', ':geek:', 1, '');
+INSERT INTO Emoticon VALUES (16, 'Upset', ';(', 1, '');
+INSERT INTO Emoticon VALUES (17, 'LOL', ':lol:', 1, '');
+INSERT INTO Emoticon VALUES (18, 'Yawn', ':O', 1, '');
+INSERT INTO Emoticon VALUES (19, 'Thinking', ':hm:', 1, '');
+INSERT INTO Emoticon VALUES (20, 'Secret', ':|', 1, '');
+
+UPDATE Emoticon SET EmotionImage = CONCAT('0_',EmoticonId,'.gif');
+
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add.pending', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add.pending', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify.pending', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify.pending', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.APPROVE', NULL, 1, 0, NULL, 'In-Bulletin', 'la_event_topic.approve', 0);
+INSERT INTO Events VALUES(DEFAULT, 'POST.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_post.add', 1);
+INSERT INTO Events VALUES(DEFAULT, 'POST.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_post.modify', 1);
+INSERT INTO Events VALUES(DEFAULT, 'POST.ADD', NULL, 1, 0, NULL, 'In-Bulletin', 'la_event_post.add', 0);
+INSERT INTO Events VALUES(DEFAULT, 'PM.ADD', NULL, 1, 0, NULL, 'In-Bulletin', 'la_event_pm.add', 0);
+
+INSERT INTO ItemTypes VALUES (3, 'In-Bulletin', 'bb', 'Topic', 'TopicText', 'OwnerId', 'Views', 'CachedRating', 'la_ItemTab_Topics', 1, '', 'clsTopic', 'Topic');
+INSERT INTO ItemTypes VALUES (30, 'In-Bulletin', 'posting', 'Posting', 'Subject', 'CreatedById', NULL, NULL, 'la_ItemTab_Posts', 0, '', '', 'Post');
+
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.VIEW', 'lu_PermName_Topic.View_desc', 'lu_PermName_Topic.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.ADD', 'lu_PermName_Topic.Add_desc', 'lu_PermName_Topic.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.ADD.PENDING', 'lu_PermName_Topic.Add.Pending_desc', 'lu_PermName_Topic.Add.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.DELETE', 'lu_PermName_Topic.Delete_desc', 'lu_PermName_Topic.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.MODIFY', 'lu_PermName_Topic.Modify_desc', 'lu_PermName_Topic.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.DELETE', 'lu_PermName_Topic.Reply.Delete_desc', 'lu_PermName_Topic.Reply.Delete_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 'lu_PermName_Topic.Reply.View_desc', 'lu_PermName_Topic.Reply.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 'lu_PermName_Topic.Reply.Add_desc', 'lu_PermName_Topic.Reply.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.MODIFY', 'lu_PermName_Topic.Reply.Modify_desc', 'lu_PermName_Topic.Reply.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.RATE', 'lu_PermName_Topic.Rate_desc', 'lu_PermName_Topic.Rate_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REVIEW', 'lu_PermName_Topic.Review_desc', 'lu_PermName_Topic.Review_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.MODIFY', 'lu_PermName_Topic.Reply.Owner.Modify_desc', 'lu_PermName_Topic.Reply.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.DELETE', 'lu_PermName_Topic.Reply.Owner.Delete_desc', 'lu_PermName_Topic.Reply.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.OWNER.DELETE', 'lu_PermName_Topic.Owner.Delete_desc', 'lu_PermName_Topic.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.MODIFY.PENDING', 'lu_PermName_Topic.Modify.Pending_desc', 'lu_PermName_Topic.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY.PENDING', 'lu_PermName_Topic.Owner.Modify.Pending_desc', 'lu_PermName_Topic.Owner.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY', 'lu_PermName_Topic.Owner.Modify_desc', 'lu_PermName_Topic.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.LOCK', 'lu_PermName_Topic.Lock_desc', 'lu_PermName_Topic.Lock_error', 'In-Bulletin');
+
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT count(*) FROM <%prefix%>Topic WHERE Status=1', NULL, 'la_prompt_ActiveTopics', 0, 1);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS TotalTopics FROM <%prefix%>Topic', NULL, 'la_prompt_TopicsTotal', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS ActiveTopics FROM <%prefix%>Topic WHERE Status = 1', NULL, 'la_prompt_TopicsActive', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS PendingTopics FROM <%prefix%>Topic WHERE Status = 2', NULL, 'la_prompt_TopicsPending', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS DisabledTopics FROM <%prefix%>Topic WHERE Status = 0', NULL, 'la_prompt_TopicsDisabled', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS NewTopics FROM <%prefix%>Topic WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Topic_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewTopics', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>Topic WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickTopics', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS HotTopics FROM <%prefix%>Topic WHERE (HotItem = 1) OR (Posts >= <%m:config name="Topic_MaxHotNumber"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotTopics', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS PopularTopics FROM <%prefix%>Topic WHERE (PopItem = 1) OR ( (CachedRating >= <%topic:hit_count type="top"%>) AND <%topic:hit_count type="top"%> AND (PopItem = 2) )', NULL, 'la_prompt_PopularTopics', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Topic WHERE CachedRating > 0', NULL, 'la_prompt_TopicAverageRating', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT MAX(Views) AS MaxTopicHits FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicHits', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT MAX(CachedVotesQty) AS MaxTopicVotes FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicVotes', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_TopicReviews', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS TotalPosts FROM <%prefix%>Posting', NULL, 'la_prompt_PostsTotal', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostDate', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostTime', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostDate', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostTime', 0, 2);
+
+INSERT INTO SearchConfig VALUES ('Topic', 'NotifyOwnerOnChanges', 0, 1, 'lu_fielddesc_topic_notifyowneronchanges', 'lu_field_notifyowneronchanges', 'In-Bulletin', 'la_text_topic', 1, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicId', 0, 1, 'lu_fielddesc_topic_topicid', 'lu_field_topicid', 'In-Bulletin', 'la_text_topic', 0, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Priority', 0, 1, 'lu_fielddesc_topic_priority', 'lu_field_priority', 'In-Bulletin', 'la_text_topic', 8, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OwnerId', 0, 1, 'lu_fielddesc_topic_ownerid', 'lu_field_ownerid', 'In-Bulletin', 'la_text_topic', 9, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Modified', 0, 1, 'lu_fielddesc_topic_modified', 'lu_field_modified', 'In-Bulletin', 'la_text_topic', 2, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicText', 1, 1, 'lu_fielddesc_topic_topictext', 'lu_field_topictext', 'In-Bulletin', 'la_text_topic', 3, DEFAULT, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Posts', 0, 1, 'lu_fielddesc_topic_posts', 'lu_field_posts', 'In-Bulletin', 'la_text_topic', 4, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Views', 0, 1, 'lu_fielddesc_topic_views', 'lu_field_views', 'In-Bulletin', 'la_text_topic', 5, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'EditorsPick', 0, 1, 'lu_fielddesc_topic_editorspick', 'lu_field_editorspick', 'In-Bulletin', 'la_text_topic', 6, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Status', 0, 1, 'lu_fielddesc_topic_status', 'lu_field_status', 'In-Bulletin', 'la_text_topic', 7, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ModifiedById', 0, 1, 'lu_fielddesc_topic_modifiedbyid', 'lu_field_modifiedbyid', 'In-Bulletin', 'la_text_topic', 10, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ResourceId', 0, 1, 'lu_fielddesc_topic_resourceid', 'lu_field_resourceid', 'In-Bulletin', 'la_text_topic', 11, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicType', 0, 1, 'lu_fielddesc_topic_topictype', 'lu_field_topictype', 'In-Bulletin', 'la_text_topic', 12, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CreatedOn', 0, 1, 'lu_fielddesc_topic_createdon', 'lu_field_createdon', 'In-Bulletin', 'la_text_topic', 13, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedReviewsQty', 0, 1, 'lu_fielddesc_topic_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Bulletin', 'la_text_topic', 14, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedRating', 0, 1, 'lu_fielddesc_topic_cachedrating', 'lu_field_cachedrating', 'In-Bulletin', 'la_text_topic', 15, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedVotesQty', 0, 1, 'lu_fielddesc_topic_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Bulletin', 'la_text_topic', 16, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'NewItem', 0, 1, 'lu_fielddesc_topic_newitem', 'lu_field_newitem', 'In-Bulletin', 'la_text_topic', 17, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PopItem', 0, 1, 'lu_fielddesc_topic_popitem', 'lu_field_popitem', 'In-Bulletin', 'la_text_topic', 18, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'HotItem', 0, 1, 'lu_fielddesc_topic_hotitem', 'lu_field_hotitem', 'In-Bulletin', 'la_text_topic', 19, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PostedBy', 0, 1, 'lu_fielddesc_topic_postedby', 'lu_field_postedby', 'In-Bulletin', 'la_text_topic', 20, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OrgId', 0, 1, 'lu_fielddesc_topic_orgid', 'lu_field_orgid', 'In-Bulletin', 'la_text_topic', 21, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'LastPostId', 0, 1, 'lu_fielddesc_topic_lastpostid', 'lu_field_lastpostid', 'In-Bulletin', 'la_text_topic', 22, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY.PENDING', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.ADD.PENDING', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.RATE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REVIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.DELETE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.RATE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REVIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.ADD.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.RATE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REVIEW', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.LOCK', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:topics.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:setting_folder.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_output.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_output.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_search.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_search.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_censorship.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_censorship.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_censorship.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_censorship.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_emoticon.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_emoticon.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_emoticon.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_email.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_email.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_custom.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_custom.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_custom.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_custom.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:polls.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:polls.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:polls.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:polls.delete', 11, 1, 1, 0);
+
+#INSERT INTO ImportScripts VALUES (DEFAULT, 'In-Bulletin', 'phpbb', 'phpbb_import', 'phpBB 2.x', 'phpBB', 'user_regular,init_cat', 1, 'db');
+
+INSERT INTO CustomField VALUES (DEFAULT, 1, 'bb_ItemTemplate', 'la_fld_cust_bb_ItemTemplate', 0, 'la_title_SystemCF', 'la_fld_cust_bb_ItemTemplate', 'text', NULL, '', 0, 0, 1, 0);
+
+INSERT INTO Modules VALUES ('In-Bulletin', 'in-bulletin/', 'bb', DEFAULT, 1, 3, 'in-bulletin/', {TopicCatId}, NULL);
Index: branches/5.0.x/in-bulletin/install/install_order.txt
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/install_order.txt (revision 0)
+++ branches/5.0.x/in-bulletin/install/install_order.txt (revision 12744)
@@ -0,0 +1 @@
+104
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/english.lang
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/english.lang (revision 0)
+++ branches/5.0.x/in-bulletin/install/english.lang (revision 12744)
@@ -0,0 +1,255 @@
+
+ m/d/Y g:i A m/d/Y g:i:s A . , utf-8 http://docs.in-portal.org/eng/index.php 2
+
+ Q2Vuc29yZWQgV29yZA==
+ VXNlcg==
+ S2V5IFN0cm9rZQ==
+ TGFzdCBQb3N0IE9u
+ RGF0ZS9UaW1l
+ RGF5cyBBY3RpdmU=
+ Q29tbWVudA==
+ UG9zdGVy
+ UmVwbGllcw==
+ UmVwbGFjZW1lbnQ=
+ VG9waWM=
+ Vmlld3M=
+ Vm90ZXM=
+ UG9zdCBBZGRlZA==
+ UG9zdCBNb2RpZmllZA==
+ VG9waWMgQWRkZWQ=
+ QWRkIFBlbmRpbmcgVG9waWM=
+ QXBwcm92ZSBUb3BpYw==
+ TW9kaWZ5IFRvcGlj
+ VG9waWMgTW9kaWZpY2F0aW9ucyBQZW5kaW5n
+ QWxsb3cgQ29tbWVudHM=
+ QWxsb3cgTXVsdGlwbGUgVm90aW5ncw==
+ Q2Vuc29yZWQgV29yZA==
+ VG9waWNzIEl0ZW0gVGVtcGxhdGU=
+ RW5kIERhdGU=
+ SW1hZ2U=
+ S2V5IFN0cm9rZQ==
+ QW5zd2Vy
+ Q29tbWVudA==
+ R3Vlc3QgRW1haWw=
+ R3Vlc3QgTmFtZQ==
+ UG9zdGVkIEJ5
+ UXVlc3Rpb24=
+ UmVwbGFjZW1lbnQ=
+ UmVxdWlyZSBMb2dpbg==
+ VG9waWMgTG9ja2Vk
+ TWF4aW11bSBudW1iZXIgb2YgSE9UIHRvcGljcw==
+ TWluaW11bSByYXRpbmcgdG8gY29uc2lkZXIgdG9waWMgUE9Q
+ TWluaW11bSBudW1iZXIgb2YgcG9zdHMgdG8gY29uc2lkZXIgdG9waWMgUE9Q
+ Vmlld3M=
+ SW4tQnVsbGV0aW4=
+ VG9waWNz
+ TGFzdCBQb3N0ZXI=
+ TGFzdCBVcGRhdGVk
+ TnVtYmVyIG9mIFBvc3Rz
+ VG9waWMgVGV4dA==
+ VG9waWMgVmlld3M=
+ TmV3IHBvc3RzIChkYXlzKQ==
+ TnVtYmVyIG9mIHBvc3RzIHBlciBwYWdl
+ UG9zdHM=
+ QWN0aXZlIFRvcGljcw==
+ QWxsb3cgRHVwbGljYXRlIENvbW1lbnRz
+ RWRpdG9yIFBpY2sgVG9waWNz
+ SG90IFRvcGljcw==
+ TGFzdCBVcGRhdGVkIFBvc3QgRGF0ZQ==
+ TGFzdCBVcGRhdGVkIFBvc3QgVGltZQ==
+ TGFzdCBVcGRhdGVkIFRvcGljIERhdGU=
+ TGFzdCBVcGRhdGVkIFRvcGljIFRpbWU=
+ VG9waWMgTWF4aW11bSBIaXRz
+ VG9waWMgTWF4aW11bSBWb3Rlcw==
+ TmV3ZXN0IFBvc3QgRGF0ZQ==
+ TmV3ZXN0IFBvc3QgVGltZQ==
+ TmV3ZXN0IFRvcGljIERhdGU=
+ TmV3ZXN0IFRvcGljIFRpbWU=
+ TmV3IFRvcGljcw==
+ UG9wdWxhciBUb3BpY3M=
+ UG9zdHMgdG8gbG9jaw==
+ VG90YWwgUG9zdHM=
+ VG9waWNzIEF2ZXJhZ2UgUmF0aW5n
+ VG90YWwgVG9waWMgQ29tbWVudHM=
+ QWN0aXZlIFRvcGljcw==
+ RGlzYWJsZWQgVG9waWNz
+ UGVuZGluZyBUb3BpY3M=
+ VG90YWwgVG9waWNz
+ VG90YWwgVXNlcnMgd2l0aCBUb3BpY3M=
+ VG9waWM=
+ Q2Vuc29yc2hpcA==
+ U21pbGV5cw==
+ QW5zd2Vycw==
+ VXNlciBDb21tZW50cw==
+ VG9waWNz
+ UG9sbCBTZXR0aW5ncw==
+ VG9waWM=
+ VG9waWNz
+ QWRkaW5nIENlbnNvcnNoaXA=
+ QWRkaW5nIFNtaWxleQ==
+ QWRkaW5nIFRvcGlj
+ QWRkaW5nIEFuc3dlcg==
+ QWRkaW5nIENvbW1lbnQ=
+ QWRkaW5nIFBvbGw=
+ RWRpdGluZyBDZW5zb3JzaGlw
+ RWRpdGluZyBTbWlsZXk=
+ RWRpdGluZyBUb3BpYw==
+ RWRpdGluZyBBbnN3ZXI=
+ RWRpdGluZyBDb21tZW50
+ RWRpdGluZyBQb2xs
+ VG9waWNz
+ TmV3IFBvbGw=
+ TmV3IFRvcGlj
+ UG9sbCBBbnN3ZXJz
+ VXNlciBDb21tZW50cw==
+ UG9sbHM=
+ VG9waWNz
+ TmV3IFBvbGw=
+ TmV3IFRvcGlj
+ TmV3IEFuc3dlcg==
+ TmV3IENvbW1lbnQ=
+ UmVzZXQgVm90ZXM=
+ RGlzcGxheSBlZGl0b3IgcGlja3MgYWJvdmUgcmVndWxhciB0b3BpY3M=
+ TmV3IFRvcGljcyAoRGF5cyk=
+ TnVtYmVyIG9mIHRvcGljcyBwZXIgcGFnZQ==
+ VG9waWNzIFBlciBQYWdlIChTaG9ydGxpc3Qp
+ QW5kIHRoZW4gYnk=
+ U29ydCB0b3BpY3MgYnk=
+ RGVsZXRlIFBvc3Q=
+ TG9jayBUb3BpYw==
+ TW9kaWZ5IFBvc3Q=
+ TmV3IFByaXZhdGUgTWVzc2FnZQ==
+ TmV3IHRvcGlj
+ UmF0ZSBUb3BpYw==
+ UmVwbHk=
+ UmVwbHkgUXVvdGVk
+ U2VuZCBQcml2YXRlIE1lc3NhZ2U=
+ VW5sb2NrIFRvcGlj
+ Vm90ZQ==
+ QXV0aG9y
+ RGF0ZQ==
+ Rm9ydW1z
+ RnJvbQ==
+ TGFzdCBQb3N0
+ UG9zdGVy
+ UG9zdHM=
+ UmVwbGllcw==
+ U3ViamVjdA==
+ VG8=
+ VG9waWNz
+ QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSB0aGUgcG9zdD8NClRoaXMgYWN0aW9uIGNhbm5vdCBiZSB1bmRvbmUu
+ QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSB0aGUgcHJpdmF0ZSBtZXNzYWdlPyBUaGlzIGFjdGlvbiBjYW5ub3QgYmUgdW5kb25lLg==
+ QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSB0aGUgdG9waWM/IFRoaXMgYWN0aW9uIGNhbm5vdCBiZSB1bmRvbmUu
+ TWFuYWdlIHlvdXIgVG9waWNzIGhlcmU=
+ TGFzdCBQb3N0IElE
+ UG9zdGVkIEJ5
+ VG9waWMgUG9zdHM=
+ VG9waWMgSUQ=
+ VG9waWMgVGV4dA==
+ VG9waWMgVHlwZQ==
+ QXV0aG9y
+ RElzYWJsZSBCQiBjb2Rlcw==
+ RGlzYWJsZSBzbWlsZXlz
+ RW5hYmxlIEJCIENvZGVz
+ RW5hYmxlIFNtaWxleXM=
+ RnJvbQ==
+ TWVzc2FnZQ==
+ U2lnbmF0dXJl
+ Tm90aWZ5IGFib3V0IFByaXZhdGUgTWVzc2FnZXM=
+ Tm90aWZ5IG1lIGFib3V0IHJlcGxpZXM=
+ UG9zdHMgcGVyIHBhZ2U=
+ U2hvdyBTaWduYXR1cmVz
+ U2hvdyBzaWduYXR1cmU=
+ U3ViamVjdA==
+ VG8=
+ VG9waWNzIHBlciBwYWdl
+ U2VudA==
+ Rm9ydW1z
+ Rm9ydW0gaXMgbG9ja2VkIGZvciBwb3N0aW5n
+ TG9ja2VkIFRvcGlj
+ RGF0ZQ==
+ TXkgVG9waWNz
+ TmV3IFRvcGlj
+ VGhlIHN5c3RlbSBhZG1pbmlzdHJhdG9yIG11c3QgYXBwcm92ZSB5b3VyIHRvcGljIGJlZm9yZSBpdCBpcyBwdWJsaWNseSBhdmFpbGFibGUu
+ VGhlIFRvcGljIHlvdSBoYXZlIGNyZWF0ZWQgaGFzIGJlZW4gYWRkZWQgdG8gdGhlIHN5c3RlbQ==
+ Rm9ydW0gaGFzIG5ldyBwb3N0cw==
+ Tm8gbWVzc2FnZXM=
+ bm8gc3ViamVjdA==
+ Tm8gVG9waWNz
+ Rm9ydW0gaGFzIG5vIG5ldyBwb3N0cw==
+ UmVhZA==
+ UmVwbGllZA==
+ U2VudA==
+ VW5yZWFk
+ Vmlld2Vk
+ QWRkIFBlbmRpbmcgVG9waWM=
+ QWRkIFRvcGlj
+ RGVsZXRlIFRvcGlj
+ TG9jay9VbmxvY2sgVG9waWNz
+ TW9kaWZ5IFRvcGljIFBlbmRpbmc=
+ TW9kaWZ5IFRvcGlj
+ VG9waWMgT3duZXIgRGVsZXRl
+ T3duZXIgTW9kaWZ5IFRvcGljIFBlbmRpbmc=
+ VG9waWMgT3duZXIgTW9kaWZ5
+ UmF0ZSBUb3BpYw==
+ QWRkIFRvcGljIFJlcGx5
+ RGVsZXRlIFRvcGlj
+ UmVwbHkgVG9waWMgTW9kaWZ5
+ UG9zdCBPd25lciBEZWxldGU=
+ UG9zdCBPd25lciBNb2RpZnk=
+ VmlldyBUb3BpYyBSZXBseQ==
+ Q29tbWVudCBUb3BpYw==
+ VmlldyBUb3BpYw==
+ UG9zdGVk
+ cG9zdHM=
+ UHJpdmF0ZSBNZXNzYWdlcw==
+ Rm9ydW1z
+ QWxyZWFkeSB2b3RlZCE=
+ UGxlYXNlIGxvZ2luIHRvIHZvdGUh
+ VGhhbmsgeW91IGZvciB1cGRhdGluZyB5b3VyIHRvcGljLg==
+ VGhhbmsgeW91IGZvciB1cGRhdGluZyB5b3VyIHRvcGljLiBZb3VyIG1vZGlmaWNhdGlvbnMgYXJlIHBlbmRpbmcgZm9yIGFkbWluaXN0cmF0aXZlIGFwcHJvdmFsLg==
+ TXkgVG9waWNz
+ Tm8gcGVybWlzc2lvbnMgdG8gbW9kaWZ5IHRoaXMgdG9waWM=
+ Tm8gcGVybWlzc2lvbnMgdG8gc3VibWl0IGEgbmV3IHRvcGljIGludG8gdGhlIGN1cnJlbnQgY2F0ZWdvcnku
+ Tm8gcGVybWlzc2lvbnMgdG8gcmVwbHkgaW4gdGhpcyB0b3BpYw==
+ Tm8gcGVybWlzc2lvbnMgdG8gbW9kaWZ5IHRoaXMgcG9zdC4=
+ Tm8gcGVybWlzc2lvbnMgdG8gdmlldyByZXBsaWVzIGZvciB0aGlzIHRvcGljLg==
+ QWRkaW5nIENvbW1lbnQ=
+ UHJpdmF0ZSBNZXNzYWdlIFNlbnQ=
+ TmV3IFRvcGljIEFkZGVk
+ TmV3IFRvcGljIFBlbmRpbmc=
+ RmF2b3JpdGUgVG9waWNz
+ VG9waWMgTW9kaWZpY2F0aW9uIENvbmZpcm1hdGlvbg==
+ VG9waWMgUGVuZGluZyBNb2RpZmljYXRpb24gQ29uZmlybWF0aW9u
+ TmV3IFByaXZhdGUgTWVzc2FnZQ==
+ TmV3IFRvcGlj
+ UG9zdCBSZXBseQ==
+ UG9sbHM=
+ UHJpdmF0ZSBNZXNzYWdlIERldGFpbHM=
+ UHJpdmF0ZSBNZXNzYWdlcw==
+ TW9kaWZ5IFBvc3Q=
+ VG9waWMgUG9zdHM=
+ VG9waWNz
+ VG9waWMgU2VhcmNoIFJlc3VsdHM=
+ VmlldyBDb21tZW50cw==
+ VG9waWNz
+ TGFzdCB1cGRhdGVk
+ VG90YWwgdG9waWNz
+
+
+ U3ViamVjdDogTmV3IFByaXZhdGUgTWVzc2FnZQoKWW91IGhhdmUgYSBuZXcgcHJpdmF0ZSBtZXNzYWdlIGhhcyBhcnJpdmVkLg==
+ U3ViamVjdDogTmV3IFRvcGljIFJlcGx5IGhhcyBiZWVuIGFkZGVkCgpOZXcgcmVwbHkgaGFzIGJlZW4gYWRkZWQgdG8gb25lIG9mIHlvdXIgdG9waWNzOiA8YSBocmVmPSI8aW5wMjpiYl9Ub3BpY0xpbmsgdGVtcGxhdGU9Il9fZGVmYXVsdF9fIi8+Ij48aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz48L2E+
+ U3ViamVjdDogTmV3IFRvcGljIFJlcGx5IGhhcyBiZWVuIEFkZGVkCgpOZXcgcmVwbHkgaGFzIGJlZW4gYWRkZWQgdG8gdGhlIFRvcGljOiAgPGEgaHJlZj0iPGlucDI6YmJfVG9waWNMaW5rIHRlbXBsYXRlPSJfX2RlZmF1bHRfXyIvPiI+PGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+PC9hPg==
+ U3ViamVjdDogUG9zdCBoYXMgYmVlbiBNb2RpZmllZAoKQSBwb3N0IGhhcyBiZWVuIG1vZGlmaWVkLg==
+ U3ViamVjdDogTmV3IFRvcGljICI8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4iIGhhcyBiZWVuIHN1Ym1pdHRlZAoKTmV3IFRvcGljIGhhcyBiZWVuIHN1Ym1pdHRlZCBvbiA8aW5wMjptX0Jhc2VVcmwvPjxicj48YnI+DQoNClRvcGljOiA8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4=
+ U3ViamVjdDogTmV3IFRvcGljICI8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4iIGhhcyBiZWVuIHN1Ym1pdHRlZAoKTmV3IFRvcGljIGhhcyBiZWVuIHN1Ym1pdHRlZCBvbiA8aW5wMjptX0Jhc2VVcmwvPjxicj48YnI+DQoNClRvcGljOiA8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4=
+ U3ViamVjdDogTmV3IHRvcGljICI8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4iIGlzIHBlbmRpbmcKCllvdXIgdG9waWMgaXMgcmVjZWl2ZWQgYW5kIHBlbmRpbmcgZm9yIGFkbWluaXN0cmF0aXZlIGFwcHJvdmFsPGJyPjxicj4NCg0KVG9waWM6IDxpbnAyOmJiX0ZpZWxkIG5hbWU9IlRvcGljVGV4dCIvPg==
+ U3ViamVjdDogTmV3IFRvcGljICI8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4iIGlzIHBlbmRpbmcKCk5ldyB0b3BpYyBoYXMgYmVlbiBzdWJtaXR0ZWQgYW5kIHBlbmRpbmcgZm9yIHlvdXIgYXBwcm92YWwuPGJyPjxicj4NCg0KVG9waWM6IDxpbnAyOmJiX0ZpZWxkIG5hbWU9IlRvcGljVGV4dCIvPg==
+ U3ViamVjdDogVG9waWMgIjxpbnAyOmJiX0ZpZWxkIG5hbWU9IlRvcGljVGV4dCIvPiIgaXMgYXBwcm92ZWQKCllvdXIgdG9waWMgaGFzIGJlZW4gYXBwcm92ZWQgb24gPGlucDI6bV9CYXNlVXJsLz48YnI+PGJyPg0KDQpUb3BpYzogPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+
+ U3ViamVjdDogVG9waWMgVXBkYXRlZCAiPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+IgoKWW91ciB0b3BpYyBoYXMgYmVlbiB1cGRhdGVkLjxicj48YnI+DQoNClRvcGljOiA8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4NCg0K
+ U3ViamVjdDogVG9waWMgVXBkYXRlZCBUb3BpYyAiPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+IgoKVXNlciB1cGRhdGVkIHRoZSB0b3BpYy48YnI+PGJyPg0KDQpUb3BpYzogPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+
+ U3ViamVjdDogVG9waWMgTW9kaWZpY2F0aW9ucyAiPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+IiBwZW5kaW5nCgpUb3BpYyBtb2RpZmljYXRpb25zIGFyZSBwZW5kaW5nIGZvciBhZG1pbmlzdHJhdGl2ZSBhcHByb3ZhbC48YnI+PGJyPg0KDQpUb3BpYzogPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+
+ U3ViamVjdDogVG9waWMgTW9kaWZpY2F0aW9ucyAiPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+IiBwZW5kaW5nCgpVc2VyIHN1Ym1pdHRlZCB0byB0b3BpYyBtb2RpZmljYXRpb25zIGFuZCBwZW5kaW5nIGZvciBhcHByb3ZhbC48YnI+PGJyPg0KDQpUb3BpYzogPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/install_schema.sql
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/install_schema.sql (revision 0)
+++ branches/5.0.x/in-bulletin/install/install_schema.sql (revision 12744)
@@ -0,0 +1,198 @@
+CREATE TABLE Posting (
+ PostingId int(11) NOT NULL AUTO_INCREMENT,
+ IPAddress varchar(255) NOT NULL DEFAULT '',
+ PosterAlias varchar(255) NOT NULL DEFAULT '',
+ Pending tinyint(4) NOT NULL DEFAULT '0',
+ `Subject` varchar(255) DEFAULT NULL,
+ PostingText text,
+ GraphicsUrl varchar(255) DEFAULT NULL,
+ CreatedOn int(11) DEFAULT NULL,
+ Modified int(11) DEFAULT NULL,
+ ModifiedById int(11) DEFAULT NULL,
+ CreatedById int(11) DEFAULT NULL,
+ TopicId int(11) NOT NULL DEFAULT '0',
+ ResourceId int(11) NOT NULL DEFAULT '0',
+ ReplyTo int(11) NOT NULL DEFAULT '0',
+ `Options` int(11) NOT NULL DEFAULT '0',
+ PRIMARY KEY (PostingId),
+ KEY TopicId (TopicId),
+ KEY Pending (Pending),
+ KEY CreatedById (CreatedById),
+ KEY CreatedOn (CreatedOn),
+ KEY ModifiedOn (Modified),
+ KEY ModifiedById (ModifiedById)
+);
+
+CREATE TABLE Topic (
+ TopicId int(11) NOT NULL AUTO_INCREMENT,
+ NotifyOwnerOnChanges tinyint(4) NOT NULL DEFAULT '0',
+ Modified int(11) DEFAULT NULL,
+ TopicText varchar(255) NOT NULL DEFAULT '',
+ AutomaticFilename tinyint(3) unsigned NOT NULL DEFAULT '1',
+ Posts int(11) NOT NULL DEFAULT '0',
+ Views double(20,6) NOT NULL DEFAULT '0.000000',
+ EditorsPick tinyint(4) NOT NULL DEFAULT '0',
+ `Status` tinyint(4) unsigned NOT NULL DEFAULT '2',
+ Priority int(11) NOT NULL DEFAULT '0',
+ OwnerId int(11) NOT NULL DEFAULT '-1',
+ ModifiedById int(11) NOT NULL DEFAULT '0',
+ ResourceId int(11) DEFAULT NULL,
+ TopicType int(11) NOT NULL DEFAULT '1',
+ CreatedOn int(11) DEFAULT NULL,
+ CachedReviewsQty int(11) NOT NULL DEFAULT '0',
+ CachedRating varchar(10) NOT NULL DEFAULT '0',
+ CachedVotesQty int(11) NOT NULL DEFAULT '0',
+ NewItem tinyint(4) NOT NULL DEFAULT '2',
+ PopItem tinyint(4) NOT NULL DEFAULT '2',
+ HotItem tinyint(4) NOT NULL DEFAULT '2',
+ PostedBy varchar(255) NOT NULL DEFAULT '',
+ OrgId int(11) DEFAULT NULL,
+ LastPostId int(11) NOT NULL DEFAULT '0',
+ LastPostDate int(11) DEFAULT NULL,
+ TodayDate date DEFAULT NULL,
+ TodayPosts int(11) NOT NULL DEFAULT '0',
+ MetaKeywords varchar(255) DEFAULT NULL,
+ MetaDescription text,
+ PRIMARY KEY (TopicId),
+ UNIQUE KEY ResourceId (ResourceId),
+ KEY OwnerId (OwnerId),
+ KEY ModifiedById (ModifiedById),
+ KEY Posts (Posts),
+ KEY Modified (Modified),
+ KEY Views (Views),
+ KEY EditorsPick (EditorsPick),
+ KEY `Status` (`Status`),
+ KEY Priority (Priority),
+ KEY CreatedOn (CreatedOn),
+ KEY NewItem (NewItem),
+ KEY PopItem (PopItem),
+ KEY HotItem (HotItem),
+ KEY LastPostId (LastPostId)
+);
+
+CREATE TABLE Censorship (
+ CensorshipId int(11) NOT NULL auto_increment,
+ BadWord varchar(80) NOT NULL default '',
+ Replacement varchar(80) NOT NULL default '',
+ PRIMARY KEY (CensorshipId)
+);
+
+CREATE TABLE Emoticon (
+ EmoticonId int(11) NOT NULL AUTO_INCREMENT,
+ `Name` varchar(20) NOT NULL DEFAULT '',
+ KeyStroke varchar(20) NOT NULL DEFAULT '',
+ Enabled int(11) NOT NULL DEFAULT '1',
+ EmotionImage varchar(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (EmoticonId),
+ KEY Enabled (Enabled),
+ KEY EmotionImage (EmotionImage)
+);
+
+CREATE TABLE PrivateMessageBody (
+ PMBodyId int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `Subject` varchar(255) NOT NULL DEFAULT '',
+ Body text,
+ `Options` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ ReferenceCount smallint(5) unsigned NOT NULL DEFAULT '2',
+ PRIMARY KEY (PMBodyId),
+ KEY ReferenceCount (ReferenceCount)
+);
+
+CREATE TABLE PrivateMessages (
+ PmId int(11) unsigned NOT NULL AUTO_INCREMENT,
+ FromId int(11) unsigned DEFAULT NULL,
+ ToId int(11) unsigned DEFAULT NULL,
+ FolderId tinyint(3) NOT NULL DEFAULT '-1',
+ `Status` tinyint(1) unsigned NOT NULL DEFAULT '0',
+ PMBodyId int(11) unsigned NOT NULL DEFAULT '0',
+ CreatedOn int(11) unsigned DEFAULT NULL,
+ PRIMARY KEY (PmId),
+ KEY FromId (FromId),
+ KEY CreatedOn (CreatedOn),
+ KEY ToId (ToId),
+ KEY FolderId (FolderId)
+);
+
+CREATE TABLE TopicCustomData (
+ CustomDataId int(11) NOT NULL auto_increment,
+ ResourceId int(10) unsigned NOT NULL default '0',
+ KEY ResourceId (ResourceId),
+ PRIMARY KEY (CustomDataId)
+);
+
+CREATE TABLE Polls (
+ PollId int(11) NOT NULL AUTO_INCREMENT,
+ `Name` varchar(255) NOT NULL DEFAULT '',
+ l1_Question text,
+ l2_Question text,
+ l3_Question text,
+ l4_Question text,
+ l5_Question text,
+ Image varchar(255) NOT NULL DEFAULT '',
+ CreatedOn int(11) unsigned DEFAULT NULL,
+ StartDate int(11) unsigned DEFAULT NULL,
+ EndDate int(11) unsigned DEFAULT NULL,
+ Priority tinyint(4) NOT NULL DEFAULT '0',
+ RequireLogin tinyint(4) NOT NULL DEFAULT '0',
+ AllowMultipleVotings tinyint(4) NOT NULL DEFAULT '1',
+ AllowComments tinyint(4) NOT NULL DEFAULT '1',
+ `Status` tinyint(4) NOT NULL DEFAULT '1',
+ CachedVotesQty int(11) NOT NULL DEFAULT '0',
+ PRIMARY KEY (PollId),
+ KEY `Status` (`Status`),
+ KEY Priority (Priority),
+ KEY StartDate (StartDate),
+ KEY EndDate (EndDate)
+);
+
+CREATE TABLE PollsAnswers (
+ AnswerId int(11) NOT NULL AUTO_INCREMENT,
+ PollId int(11) NOT NULL DEFAULT '0',
+ l1_Answer text,
+ l2_Answer text,
+ l3_Answer text,
+ l4_Answer text,
+ l5_Answer text,
+ VotesQty int(11) NOT NULL DEFAULT '0',
+ Priority int(11) NOT NULL DEFAULT '0',
+ `Status` tinyint(4) NOT NULL DEFAULT '1',
+ PRIMARY KEY (AnswerId),
+ KEY `Status` (`Status`),
+ KEY Priority (Priority),
+ KEY VoteCount (VotesQty),
+ KEY PollId (PollId)
+);
+
+CREATE TABLE PollsComments (
+ CommentId int(11) NOT NULL AUTO_INCREMENT,
+ PollId int(11) NOT NULL DEFAULT '0',
+ AnswerId int(11) DEFAULT NULL,
+ CreatedById int(11) NOT NULL DEFAULT '-2',
+ GuestName varchar(255) NOT NULL DEFAULT '',
+ GuestEmail varchar(255) NOT NULL DEFAULT '',
+ CommentBody text,
+ CreatedOn int(11) DEFAULT NULL,
+ UserIP varchar(255) NOT NULL DEFAULT '',
+ Priority int(11) NOT NULL DEFAULT '0',
+ `Status` tinyint(4) NOT NULL DEFAULT '1',
+ PRIMARY KEY (CommentId),
+ KEY `Status` (`Status`),
+ KEY Priority (Priority),
+ KEY CreatedOn (CreatedOn),
+ KEY AnswerId (AnswerId),
+ KEY PollId (PollId),
+ KEY CreatedById (CreatedById)
+);
+
+CREATE TABLE PollsStatistics (
+ StatisticsId int(11) NOT NULL AUTO_INCREMENT,
+ PollId int(11) NOT NULL DEFAULT '0',
+ AnswerId int(11) NOT NULL DEFAULT '0',
+ CreatedById int(11) NOT NULL DEFAULT '-2',
+ UserIP varchar(255) NOT NULL DEFAULT '',
+ AnswerDate int(10) unsigned DEFAULT NULL,
+ PRIMARY KEY (StatisticsId),
+ KEY AnswerId (AnswerId,PollId),
+ KEY CreatedById (CreatedById),
+ KEY UserIP (UserIP)
+);
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/remove_schema.sql
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/remove_schema.sql (revision 0)
+++ branches/5.0.x/in-bulletin/install/remove_schema.sql (revision 12744)
@@ -0,0 +1,11 @@
+DROP TABLE Posting;
+DROP TABLE Topic;
+DROP TABLE Censorship;
+DROP TABLE Emoticon;
+DROP TABLE PrivateMessageBody;
+DROP TABLE PrivateMessages;
+DROP TABLE TopicCustomData;
+DROP TABLE Polls;
+DROP TABLE PollsAnswers;
+DROP TABLE PollsComments;
+DROP TABLE PollsStatistics;
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/img/.htaccess
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/img/.htaccess (revision 0)
+++ branches/5.0.x/in-bulletin/install/img/.htaccess (revision 12744)
@@ -0,0 +1 @@
+allow from all
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/img/icon_discussion_forum.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/install/upgrades.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/upgrades.php (revision 0)
+++ branches/5.0.x/in-bulletin/install/upgrades.php (revision 12744)
@@ -0,0 +1,96 @@
+_toolkit =& $instance;
+ }
+
+ /**
+ * Changes table structure, where multilingual fields of TEXT type are present
+ *
+ * @param string $mode when called mode {before, after)
+ */
+ function Upgrade_5_0_0($mode)
+ {
+ if ($mode == 'after') {
+ $root_category = $this->Application->findModule('Name', 'In-Bulletin', 'RootCat');
+
+ $sql = 'UPDATE ' . $this->Application->getUnitOption('c', 'TableName') . '
+ SET UseMenuIconUrl = 1, MenuIconUrl = "in-bulletin/img/menu_topics.gif"
+ WHERE ' . $this->Application->getUnitOption('c', 'IDField') . ' = ' . $root_category;
+ $this->Conn->Query($sql);
+
+ $this->_updateDetailTemplate('bb', 'inbulletin/post_list', 'in-bulletin/designs/detail');
+ }
+ }
+
+ /**
+ * Replaces deprecated detail template design with new one
+ *
+ * @param string $prefix
+ * @param string $from_template
+ * @param string $to_template
+ */
+ function _updateDetailTemplate($prefix, $from_template, $to_template)
+ {
+ $sql = 'SELECT CustomFieldId
+ FROM ' . TABLE_PREFIX . 'CustomField
+ WHERE FieldName = "' . $prefix . '_ItemTemplate"';
+ $custom_field_id = $this->Conn->GetOne($sql);
+
+ $ml_formatter =& $this->Application->recallObject('kMultiLanguage');
+ /* @var $ml_formatter kMultiLanguage */
+
+ $field = $ml_formatter->LangFieldName('cust_' . $custom_field_id, true);
+
+ $sql = 'UPDATE ' . TABLE_PREFIX . 'CategoryCustomData
+ SET ' . $field . ' = "' . $to_template . '"
+ WHERE ' . $field . ' = "' . $from_template . '"';
+ $this->Conn->Query($sql);
+ }
+
+ /**
+ * Update to 5.0.1, update details template
+ *
+ * @param string $mode when called mode {before, after)
+ */
+ function Upgrade_5_0_1($mode)
+ {
+ if ($mode == 'after') {
+ $this->_updateDetailTemplate('bb', 'in-bulletin/designs/detail', 'in-bulletin/topics/topic_detail');
+ }
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/upgrades.sql
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/upgrades.sql (revision 0)
+++ branches/5.0.x/in-bulletin/install/upgrades.sql (revision 12744)
@@ -0,0 +1,164 @@
+# ===== v 4.3.9 =====
+ALTER TABLE Emoticon
+ ADD EmotionImage VARCHAR(255) NOT NULL,
+ ADD INDEX (EmotionImage),
+ DROP ImageId;
+
+UPDATE Emoticon SET EmotionImage = CONCAT('0_',EmoticonId,'.gif') WHERE EmoticonId < 21;
+
+# ===== v 5.0.0 =====
+CREATE TABLE Polls (
+ PollId int(11) NOT NULL auto_increment,
+ `Name` varchar(255) NOT NULL default '',
+ l1_Question text,
+ l2_Question text,
+ l3_Question text,
+ l4_Question text,
+ l5_Question text,
+ Image varchar(255) NOT NULL default '',
+ CreatedOn int(11) unsigned NOT NULL,
+ StartDate int(11) unsigned NOT NULL,
+ EndDate int(11) unsigned default NULL,
+ Priority tinyint(4) NOT NULL default '0',
+ RequireLogin tinyint(4) NOT NULL default '0',
+ AllowMultipleVotings tinyint(4) NOT NULL default '1',
+ AllowComments tinyint(4) NOT NULL default '1',
+ `Status` tinyint(4) NOT NULL default '1',
+ CachedVotesQty int(11) NOT NULL,
+ PRIMARY KEY (PollId),
+ KEY `Status` (`Status`),
+ KEY Priority (Priority),
+ KEY StartDate (StartDate),
+ KEY EndDate (EndDate)
+);
+
+CREATE TABLE PollsAnswers (
+ AnswerId int(11) NOT NULL auto_increment,
+ PollId int(11) NOT NULL,
+ l1_Answer text,
+ l2_Answer text,
+ l3_Answer text,
+ l4_Answer text,
+ l5_Answer text,
+ VotesQty int(11) NOT NULL,
+ Priority int(11) NOT NULL default '0',
+ Status tinyint(4) NOT NULL default '1',
+ PRIMARY KEY (AnswerId),
+ KEY Status (Status),
+ KEY Priority (Priority),
+ KEY VoteCount (VotesQty),
+ KEY PollId (PollId)
+);
+
+CREATE TABLE PollsComments (
+ CommentId int(11) NOT NULL auto_increment,
+ PollId int(11) NOT NULL,
+ AnswerId int(11) default NULL,
+ CreatedById int(11) NOT NULL default '-2',
+ GuestName varchar(255) NOT NULL,
+ GuestEmail varchar(255) NOT NULL,
+ CommentBody text,
+ CreatedOn int(11) NOT NULL,
+ UserIP varchar(255) NOT NULL,
+ Priority int(11) NOT NULL,
+ `Status` tinyint(4) NOT NULL default '1',
+ PRIMARY KEY (CommentId),
+ KEY `Status` (`Status`),
+ KEY Priority (Priority),
+ KEY CreatedOn (CreatedOn),
+ KEY AnswerId (AnswerId),
+ KEY PollId (PollId),
+ KEY CreatedById (CreatedById)
+);
+
+CREATE TABLE PollsStatistics (
+ StatisticsId int(11) NOT NULL auto_increment,
+ PollId int(11) NOT NULL default '0',
+ AnswerId int(11) NOT NULL default '0',
+ CreatedById int(11) NOT NULL default '-2',
+ UserIP varchar(255) NOT NULL,
+ AnswerDate int(10) unsigned default NULL,
+ PRIMARY KEY (StatisticsId),
+ KEY AnswerId (AnswerId,PollId),
+ KEY CreatedById (CreatedById),
+ KEY UserIP (UserIP)
+);
+
+INSERT INTO ConfigurationAdmin VALUES ('poll_CommentDelay_Value', 'la_Text_Polls', 'la_prompt_DupPollComments', 'text', '', '', 60.1, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('poll_CommentDelay_Interval', 'la_Text_Polls', 'la_prompt_DupPollComments', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 60.2, 2, 1);
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'poll_CommentDelay_Interval', '60', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'poll_CommentDelay_Value', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+
+UPDATE Category SET Template = '/in-bulletin/designs/section' WHERE Template = 'inbulletin/index';
+UPDATE Category SET CachedTemplate = '/in-bulletin/designs/section' WHERE CachedTemplate = 'inbulletin/index';
+
+UPDATE ConfigurationValues SET VariableValue = '/in-bulletin/designs/section' WHERE VariableName = 'bb_CategoryTemplate';
+UPDATE ConfigurationValues SET VariableValue = 'in-bulletin/designs/detail' WHERE VariableName = 'bb_ItemTemplate';
+
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:topics.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:setting_folder.view', 11, 1, 1, 0);
+DELETE FROM Permissions WHERE Permission LIKE 'in-bulletin:inbulletin_general.%';
+
+UPDATE Phrase SET Module = 'In-Bulletin' WHERE ((Phrase LIKE '%Topic%' OR Phrase LIKE '%Post%' OR Phrase LIKE '%Forum%' OR Phrase LIKE '%Censor%' OR Phrase LIKE '%Smiley%' OR Phrase = 'la_title_In-Bulletin') AND (Module = 'Core'));
+
+# ===== v 5.0.1 =====
+UPDATE ConfigurationValues SET VariableValue = 'in-bulletin/topics/topic_detail' WHERE VariableName = 'bb_ItemTemplate';
+
+UPDATE ConfigurationAdmin
+SET ValueList = 'TopicText=la_opt_TopicText,Posts=la_opt_NumberOfPosts,CreatedOn=la_opt_CreatedOn,LastPostDate=la_opt_LastUpdated,Views=la_opt_TopicViews,CachedRating=la_opt_Rating,LastPoser=la_opt_LastPoster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) '
+WHERE VariableName IN ('Topic_SortField', 'Topic_SortField2');
+
+UPDATE ConfigurationAdmin
+SET ValueList = 'ASC=la_common_Ascending,DESC=la_common_Descending'
+WHERE VariableName IN ('Topic_SortOrder', 'Topic_SortOrder2');
+
+UPDATE ConfigurationAdmin SET ValueList = '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year' WHERE VariableName = 'topic_ReviewDelay_Interval';
+UPDATE ConfigurationAdmin SET ValueList = '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year' WHERE VariableName = 'topic_RatingDelay_Interval';
+UPDATE ConfigurationAdmin SET ValueList = '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year' WHERE VariableName = 'poll_CommentDelay_Interval';
+
+UPDATE CustomField SET FieldLabel = 'la_fld_cust_bb_ItemTemplate', Prompt = 'la_fld_cust_bb_ItemTemplate' WHERE FieldName = 'bb_ItemTemplate';
+
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add.pending', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add.pending', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify.pending', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify.pending', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.APPROVE', NULL, 1, 0, NULL, 'In-Bulletin', 'la_event_topic.approve', 0);
+
+UPDATE ConfigurationAdmin SET ValueList = 'style="width: 50px;"' WHERE VariableName IN ('topic_ReviewDelay_Value', 'topic_RatingDelay_Value', 'poll_CommentDelay_Value');
+
+# ===== v 5.0.2-B1 =====
+ALTER TABLE PrivateMessageBody CHANGE Body Body text NULL;
+
+ALTER TABLE Emoticon CHANGE EmotionImage EmotionImage VARCHAR(255) NOT NULL DEFAULT '';
+
+ALTER TABLE Polls
+ CHANGE CreatedOn CreatedOn INT(11) UNSIGNED NULL DEFAULT NULL ,
+ CHANGE StartDate StartDate INT(11) UNSIGNED NULL DEFAULT NULL ,
+ CHANGE CachedVotesQty CachedVotesQty INT(11) NOT NULL DEFAULT '0';
+
+ALTER TABLE PollsAnswers
+ CHANGE PollId PollId INT(11) NOT NULL DEFAULT '0',
+ CHANGE VotesQty VotesQty INT(11) NOT NULL DEFAULT '0';
+
+ALTER TABLE PollsComments
+ CHANGE PollId PollId INT(11) NOT NULL DEFAULT '0',
+ CHANGE GuestName GuestName VARCHAR(255) NOT NULL DEFAULT '',
+ CHANGE GuestEmail GuestEmail VARCHAR(255) NOT NULL DEFAULT '',
+ CHANGE CreatedOn CreatedOn INT(11) NULL DEFAULT NULL ,
+ CHANGE UserIP UserIP VARCHAR(255) NOT NULL DEFAULT '',
+ CHANGE Priority Priority INT(11) NOT NULL DEFAULT '0';
+
+ALTER TABLE PollsStatistics CHANGE UserIP UserIP VARCHAR(255) NOT NULL DEFAULT '';
+
+ALTER TABLE Posting
+ CHANGE CreatedOn CreatedOn INT(11) NULL DEFAULT NULL,
+ CHANGE Modified Modified INT(11) NULL DEFAULT NULL;
+
+ALTER TABLE PrivateMessages CHANGE CreatedOn CreatedOn INT(11) UNSIGNED NULL DEFAULT NULL;
+
+ALTER TABLE Topic
+ CHANGE Modified Modified INT(11) NULL DEFAULT NULL,
+ CHANGE CreatedOn CreatedOn INT(11) NULL DEFAULT NULL;
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/constants.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/constants.php (revision 0)
+++ branches/5.0.x/in-bulletin/constants.php (revision 12744)
@@ -0,0 +1,23 @@
+toolkit;
+ /* @var $toolkit kInstallToolkit */
+ }
+
+ $application =& kApplication::Instance();
+ $application->Init();
+
+ if ($application->RecallVar('user_id') != -1) {
+ die('restricted access!');
+ }
+
+ $category =& $toolkit->createModuleCategory('Forums', 'Discussion Forums', '/in-bulletin/designs/section', 'in-bulletin/img/menu_topics.gif');
+
+ $toolkit->RunSQL('/' . $module_folder . '/install/install_schema.sql');
+ $toolkit->RunSQL('/' . $module_folder . '/install/install_data.sql', '{TopicCatId}', $category->GetID());
+ $toolkit->ImportLanguage('/' . $module_folder . '/install/english');
+
+ $toolkit->SetModuleRootCategory($module_folder, $category->GetID());
+
+// $toolkit->linkCustomFields($module_folder, 'bb', 3); // to create Custom Fields for Topics
+ $toolkit->linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field
+ $toolkit->setModuleItemTemplate($category, 'bb', 'in-bulletin/topics/topic_detail');
+
+ $toolkit->finalizeModuleInstall($module_folder, true);
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/relations_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/relations_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/relations_edit.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/topics_reviews.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/topics_reviews.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/topics_reviews.tpl (revision 12744)
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/topics_images.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/topics_images.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/topics_images.tpl (revision 12744)
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/topics_relations.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/topics_relations.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/topics_relations.tpl (revision 12744)
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+
+
+
+
+ ">
+ ">
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/topics_categories.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/topics_categories.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/topics_categories.tpl (revision 12744)
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/images_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/images_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/images_edit.tpl (revision 12744)
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/topics_custom.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/topics_custom.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/topics_custom.tpl (revision 12744)
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/review_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/review_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/review_edit.tpl (revision 12744)
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/topics_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/topics_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/topics_edit.tpl (revision 12744)
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/emoticons/emoticon_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/emoticons/emoticon_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/emoticons/emoticon_edit.tpl (revision 12744)
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: branches/5.0.x/in-bulletin/admin_templates/emoticons/emoticon_list.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/emoticons/emoticon_list.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/emoticons/emoticon_list.tpl (revision 12744)
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/catalog_tab.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/catalog_tab.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/catalog_tab.tpl (revision 12744)
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
" view_template="in-bulletin/catalog_tab" edit_template="in-bulletin/topics/topics_edit" category_id="-1" dep_buttons="new_topic" class="catalog-tab">
+
+
+
+
+ $Catalog.setItemCount(' ', ' ');
+
+
+
+
+
+
+
+
+
+
+ $Catalog.setItemCount(' ', ' ');
+ $Catalog.setCurrentCategory(' ', );
+ $Catalog.saveSearch(' ', ' ', ' ');
+
+
+
+
+ Grids[' '].AddAlternativeGrid(' ', true);
+
+ Grids[' '].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','sep3','cut','copy','move_up','move_down','sep6'));
+ $Catalog.reflectPasteButton( );
+ $Catalog.setViewMenu(' ');
+
+ Grids[' '].DblClick = function() {return false};
+
+ #separator#
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/category_properties.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/category_properties.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/category_properties.tpl (revision 12744)
@@ -0,0 +1,2 @@
+
+
Index: branches/5.0.x/in-bulletin/admin_templates/censorship/censorship_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/censorship/censorship_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/censorship/censorship_edit.tpl (revision 12744)
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/censorship/censorship_list.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/censorship/censorship_list.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/censorship/censorship_list.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/user_item_tab.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/user_item_tab.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/user_item_tab.tpl (revision 12744)
@@ -0,0 +1,34 @@
+
+
+
+
+
" view_template="in-bulletin/user_item_tab" edit_template="in-bulletin/topics/topics_edit" dep_buttons="new_topic" category_id="-1" class="catalog-tab">
+
+
+
+
+
+
+
+
+
+
+
+ $Catalog.setItemCount(' ', ' ');
+ $Catalog.setCurrentCategory(' ', );
+ $Catalog.saveSearch(' ', ' ', ' ');
+
+
+
+ Grids[' '].SetDependantToolbarButtons( new Array('edit','delete'));
+ $Catalog.setViewMenu(' ');
+ #separator#
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/img/logo_bg.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/itemicons/icon16_topics.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/itemicons/icon16_topic_new.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/itemicons/icon16_topic_disabled.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/itemicons/icon16_topic_pending.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/itemicons/icon16_topic.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/icons/icon24_conf_censorship.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/icons/icon24_polls.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/icons/icon24_conf_topics.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/icons/icon24_topics.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/icons/icon24_conf_smileys.png
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/toolbar/tool_new_topic.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/toolbar/tool_new_topic_f3.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/toolbar/tool_new_topic_f2.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/polls/comment_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/polls/comment_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/polls/comment_edit.tpl (revision 12744)
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit_answers.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit_answers.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit_answers.tpl (revision 12744)
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/polls/answer_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/polls/answer_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/polls/answer_edit.tpl (revision 12744)
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/polls/poll_list.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/polls/poll_list.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/polls/poll_list.tpl (revision 12744)
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit_comments.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit_comments.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit_comments.tpl (revision 12744)
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit.tpl (revision 12744)
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/topics/topics_tag_processor.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/topics/topics_tag_processor.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/topics/topics_tag_processor.php (revision 12744)
@@ -0,0 +1,79 @@
+ItemLink($params, 'topic');
+ }
+
+ function ListTopics($params)
+ {
+ return $this->PrintList2($params);
+ }
+
+ function PostingLink($params)
+ {
+ $item_id = getArrayValue($params, 'posting_id');
+ if (!$item_id) {
+ $item_id = $this->Application->GetVar($this->Prefix.'_post_id');
+ }
+ $params[$this->Prefix.'_post_id'] = $item_id;
+ return $this->TopicLink($params);
+ }
+
+ function PostingDeleteLink($params)
+ {
+ $params['Action'] = 'bb_post_delete';
+ return $this->PostingLink($params);
+ }
+
+ /**
+ * Returns topic replies count
+ *
+ * @param Array $params
+ * @return int
+ */
+ function TopicReplies($params)
+ {
+ $object =& $this->getObject($params);
+
+ // -1 - don't count post created together with topic
+ return $object->GetDBField('Posts') ? $object->GetDBField('Posts') - 1 : 0;
+ }
+
+ /**
+ * Returns topic lock statis
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function IsLocked($params)
+ {
+ $object =& $this->getObject($params);
+
+ return $object->GetDBField('TopicType') == 0;
+ }
+
+ function LockToggleLink($params)
+ {
+ $params[$this->Prefix.'_event'] = 'OnTopicLockToggle';
+ $params['pass'] = 'm,'.$this->Prefix;
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/topics/topics_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/topics/topics_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/topics/topics_config.php (revision 12744)
@@ -0,0 +1,407 @@
+ 'bb',
+ 'ItemClass' => Array('class' => 'kCatDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kCatDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'TopicsEventHandler', 'file' => 'topics_event_handler.php', 'require_classes' => Array('kCatDBEventHandler'), 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'TopicsTagProcessor', 'file' => 'topics_tag_processor.php', 'require_classes' => Array('kCatDBTagProcessor'), 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'ConfigPriority' => 0,
+
+ 'RewritePriority' => 103,
+ 'RewriteListener' => 'ModRewriteHelper:CategoryItemRewriteListener',
+
+ 'Hooks' => Array (
+ Array (
+ 'Mode' => hBEFORE,
+ 'Conditional' => false,
+ 'HookToPrefix' => '',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnAfterConfigRead'),
+ 'DoPrefix' => 'cdata',
+ 'DoSpecial' => '*',
+ 'DoEvent' => 'OnDefineCustomFields',
+ ),
+ ),
+
+ 'CatalogItem' => true,
+ 'AdminTemplatePath' => 'topics',
+ 'AdminTemplatePrefix' => 'topics_',
+ 'SearchConfigPostfix' => 'topics',
+
+ 'IDField' => 'TopicId',
+ 'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events
+
+ 'TitleField' => 'TopicText', // field, used in bluebar when editing existing item
+ 'TitlePhrase' => 'la_Text_Topic', // phrase used to specify item type in relationship list
+ 'OwnerField' => 'OwnerId', // usually it is CreatedById
+
+ 'TitlePresets' => Array(
+ 'default' => Array( 'new_status_labels' => Array('bb' => '!la_title_AddingTopic!'),
+ 'edit_status_labels' => Array('bb' => '!la_title_EditingTopic!'),
+ 'new_titlefield' => Array('bb' => '!la_title_NewTopic!'),
+ ),
+
+ 'topics_edit' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_General!"),
+ 'topics_categories' => Array('prefixes' => Array('bb','bb-ci_List'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Categories!"),
+ 'topics_relations' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Relations!"),
+ 'topics_images' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Images!"),
+ 'topics_reviews' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Reviews!"),
+ 'topics_custom' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Custom!"),
+
+ 'images_edit' => Array( 'prefixes' => Array('bb', 'bb-img'),
+ 'new_status_labels' => Array('bb-img'=>'!la_title_Adding_Image!'),
+ 'edit_status_labels' => Array('bb-img'=>'!la_title_Editing_Image!'),
+ 'new_titlefield' => Array('bb-img'=>'!la_title_New_Image!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-img_status# '#bb-img_titlefield#'",
+ ),
+
+ 'reviews_edit' => Array( 'prefixes' => Array('bb', 'bb-rev'),
+ 'new_status_labels' => Array('bb-rev'=>"!la_title_Adding_Review! '!la_title_New_Review!'"),
+ 'edit_status_labels' => Array('bb-rev'=>'!la_title_Editing_Review!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-rev_status#",
+ ),
+
+ 'relations_edit' => Array( 'prefixes' => Array('bb', 'bb-rel'),
+ 'new_status_labels' => Array('bb-rel'=>"!la_title_Adding_Relationship! '!la_title_New_Relationship!'"),
+ 'edit_status_labels' => Array('bb-rel'=>'!la_title_Editing_Relationship!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-rel_status#",
+ ),
+
+ 'tree_in-bulletin' => Array('format' => '!la_Text_Version! '.$this->Application->findModule('Name', 'In-Bulletin', 'Version')),
+ ),
+
+ 'EditTabPresets' => Array (
+ 'Default' => Array (
+ 'general' => Array ('title' => 'la_tab_General', 't' => 'in-bulletin/topics/topics_edit', 'priority' => 1),
+ 'categories' => Array ('title' => 'la_tab_Categories', 't' => 'in-bulletin/topics/topics_categories', 'priority' => 2),
+ 'relations' => Array ('title' => 'la_tab_Relations', 't' => 'in-bulletin/topics/topics_relations', 'priority' => 3),
+ 'images' => Array ('title' => 'la_tab_Images', 't' => 'in-bulletin/topics/topics_images', 'priority' => 4),
+ 'reviews' => Array ('title' => 'la_tab_Reviews', 't' => 'in-bulletin/topics/topics_reviews', 'priority' => 5),
+ 'custom' => Array ('title' => 'la_tab_Custom', 't' => 'in-bulletin/topics/topics_custom', 'priority' => 6),
+ ),
+ ),
+
+ 'PermItemPrefix' => 'TOPIC',
+
+ 'PermTabText' => 'In-Bulletin',
+ 'PermSection' => Array('main' => 'CATEGORY:in-bulletin:topics_list', 'search' => 'in-bulletin:configuration_search', 'email' => 'in-bulletin:configuration_email', 'custom' => 'in-bulletin:configuration_custom'),
+
+ 'Sections' => Array(
+ /*'in-bulletin' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'settings_in-bulletin',
+ 'label' => 'la_title_In-Bulletin',
+ 'url' => Array('t' => 'index', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 3.3,
+ 'container' => true,
+ 'type' => stTREE,
+ ),*/
+
+ 'in-bulletin:topics' => Array(
+ 'parent' => 'in-portal:site',
+ 'icon' => 'topics',
+ 'label' => 'la_tab_Topics',
+ 'url' => Array('t' => 'catalog/advanced_view', 'anchor' => 'tab-bb.showall', 'pass' => 'm'),
+ 'onclick' => 'setCatalogTab(\'bb.showall\')',
+ 'permissions' => Array('view'),
+ 'priority' => 3.4,
+ 'type' => stTREE,
+ ),
+
+ // topic settings
+ 'in-bulletin:setting_folder' => Array (
+ 'parent' => 'in-portal:system',
+ 'icon' => 'conf_topics',
+ 'label' => 'la_title_In-Bulletin',
+ 'url' => Array ('t' => 'index', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array ('view'),
+ 'priority' => 3.5,
+ 'container' => true,
+ 'type' => stTREE,
+ ),
+
+ /*'in-bulletin:inbulletin_general' => Array(
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'core:settings_general',
+ 'label' => 'la_tab_GeneralSettings',
+ 'url' => Array('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 2.9,
+ 'type' => stTREE,
+ ),*/
+
+ 'in-bulletin:configuration_output' => Array(
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'core:conf_output',
+ 'label' => 'la_tab_ConfigOutput',
+ 'url' => Array('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_search' => Array(
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'core:conf_search',
+ 'label' => 'la_tab_ConfigSearch',
+ 'url' => Array('t' => 'config/config_search', 'module_key' => 'topics', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+
+ 'in-bulletin:configuration_email' => Array(
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'core:conf_email',
+ 'label' => 'la_tab_ConfigE-mail',
+ 'url' => Array('t' => 'config/config_email', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_custom' => Array(
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'core:conf_customfields',
+ 'label' => 'la_tab_ConfigCustom',
+ 'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 3, 'pass_section' => true, 'pass' => 'm,cf'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 6,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_new'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_hot'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_pop'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_pick'), 'type' => WHERE_FILTER),
+ ),
+ 'Filters' => Array(
+ 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
+ 'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ),
+ 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
+ 's1' => Array(),
+ 'show_new' => Array('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ),
+ 'show_hot' => Array('label' => 'la_Text_Hot', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ),
+ 'show_pop' => Array('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ),
+ 'show_pick' => Array('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '%1$s.`EditorsPick` != 1' ),
+ )
+ ),
+
+ 'CatalogSelectorName' => 'topiclist',
+
+ 'ItemPropertyMappings' => Array(
+ 'NewDays' => 'Topic_NewDays', // number of days item to be NEW
+ 'MinPopVotes' => 'Topic_MinPopVotes', // minimum number of votes for an item to be POP
+ 'MinPopRating' => 'Topic_MinPopRating', // minimum rating for an item to be POP
+ 'MaxHotNumber' => 'Topic_MaxHotNumber', // maximum number of HOT items
+
+ 'HotLimit' => 'Topic_HotLimit', // variable name in inp_Cache table
+ 'ClickField' => 'Views', // item click count is stored here (in item table)
+ ),
+
+ 'ItemType' => 3, // this is used when relation to product is added from in-portal and via-versa
+
+ 'ViewMenuPhrase' => 'la_title_Topics',
+ 'CatalogTabIcon' => 'in-bulletin:icon16_topics.png',
+ 'UsePendingEditing' => true, // item editing is controlled by TOPIC.ADD/EDIT, TOPIC.ADD/EDIT.PENDING permissions
+
+ 'StatisticsInfo' => Array(
+ 'pending' => Array(
+ 'icon' => 'icon16_topic_pending.gif',
+ 'label' => 'la_Text_Topics',
+ 'js_url' => '#url#',
+ 'url' => Array('t' => 'catalog/advanced_view', 'SetTab' => 'bb', 'pass' => 'm,bb.showall', 'bb.showall_event' => 'OnSetFilterPattern', 'bb.showall_filters' => 'show_active=0,show_pending=1,show_disabled=0,show_new=1,show_hot=1,show_pop=1,show_pick=1'),
+ 'status' => STATUS_PENDING,
+ ),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'Topic',
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.OwnerId = -1, "root", IF (%1$s.OwnerId = -2, "Guest", "n/a")), u.Login)',
+ 'CategoryId' => TABLE_PREFIX.'%3$sCategoryItems.CategoryId',
+ 'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename',
+ 'PrimaryCat' => TABLE_PREFIX.'%3$sCategoryItems.PrimaryCat',
+ 'ParentPath' => TABLE_PREFIX.'Category.ParentPath',
+
+ 'SameImages' => 'img.SameImages',
+ 'LocalThumb' => 'img.LocalThumb',
+ 'ThumbPath' => 'img.ThumbPath',
+ 'ThumbUrl' => 'img.ThumbUrl',
+ 'LocalImage' => 'img.LocalImage',
+ 'LocalPath' => 'img.LocalPath',
+ 'FullUrl' => 'img.Url',
+
+ 'LastPoster' => 'IF (ISNULL(last_post.PosterAlias), "Guest", last_post.PosterAlias)',
+ 'LastPosterId' => 'last_post.CreatedById',
+ ),
+ ),
+
+ 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId
+ LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'Images img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1
+ LEFT JOIN '.TABLE_PREFIX.'PermCache perm ON perm.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.OwnerId = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'Posting last_post ON last_post.PostingId = %1$s.LastPostId
+ LEFT JOIN '.TABLE_PREFIX.'%3$sTopicCustomData cust ON %1$s.ResourceId = cust.ResourceId',
+ ), // key - special, value - list select sql
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('TopicText' => 'asc'),
+ )
+ ),
+ 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId
+ LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'Images img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.OwnerId = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'Posting last_post ON last_post.PostingId = %1$s.LastPostId
+ LEFT JOIN '.TABLE_PREFIX.'%3$sTopicCustomData cust ON %1$s.ResourceId = cust.ResourceId'),
+
+ 'SubItems' => Array('bb-rev', 'bb-ci', 'bb-rel', 'bb-img', 'bb-cdata', 'bb-fav', 'bb-post'),
+
+ 'Fields' => Array (
+ 'TopicId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,),
+ 'NotifyOwnerOnChanges' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'lu_No', 1 => 'lu_Yes'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
+ 'Modified' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'),
+ 'TopicText' => Array('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'AutomaticFilename' => Array('type' => 'int', 'not_null' => 1, 'default' => 1),
+ 'Posts' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Views' => Array('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%d', 'not_null' => 1, 'default' => 0),
+ 'EditorsPick' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
+ 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
+ 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'OwnerId' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'required' => 1, 'default' => -1),
+ 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => 0),
+ 'ResourceId' => Array('type' => 'int', 'default' => null),
+ 'TopicType' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_Yes', 1 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1),
+ 'CreatedOn' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'),
+ 'CachedReviewsQty' => Array('type' => 'int' ,'not_null' => 1, 'default' => 0),
+ 'CachedRating' => Array('type' => 'string', 'not_null' => 1, 'default' => 0),
+ 'CachedVotesQty' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'PostedBy' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'OrgId' => Array('type' => 'int', 'default' => null),
+ 'LastPostId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'LastPostDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null),
+ 'TodayDate' => Array('type' => 'string', 'default' => null),
+ 'TodayPosts' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'MetaKeywords' => Array('type' => 'string', 'default' => null),
+ 'MetaDescription' => Array('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null),
+ ),
+
+ 'VirtualFields' => Array (
+ 'UserName' => Array ('type'=>'string', 'default' => ''),
+ 'CategoryId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => 0),
+ 'Filename' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'CachedNavbar' => Array ('type' => 'string', 'default' => ''),
+
+ 'LastPoster' => Array ('type' => 'string', 'default' => ''),
+ 'LastPosterId' => Array ('type' => 'int', 'default' => -2),
+ 'PostingText' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'required' => 1, 'using_fck' => 1, 'allow_html' => 1, 'default' => ''),
+ 'DisableBBCodes' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'DisableSmileys' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'ShowSignatures' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 1),
+
+ // for primary image
+ 'SameImages' => Array('type' => 'string', 'default' => ''),
+ 'LocalThumb' => Array('type' => 'string', 'default' => ''),
+ 'ThumbPath' => Array('type' => 'string', 'default' => ''),
+ 'ThumbUrl' => Array('type' => 'string', 'default' => ''),
+ 'LocalImage' => Array('type' => 'string', 'default' => ''),
+ 'LocalPath' => Array('type' => 'string', 'default' => ''),
+ 'FullUrl' => Array('type' => 'string', 'default' => ''),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array(
+ 'default' => 'icon16_topic.png',
+ 0 => 'icon16_topic_disabled.png',
+ 1 => 'icon16_topic.png',
+ 2 => 'icon16_topic_pending.png',
+ 'NEW' => 'icon16_topic_new.png',
+ ),
+ 'Fields' => Array(
+ 'TopicId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
+ 'TopicText' => Array('title' => 'la_col_TopicText', 'data_block' => 'grid_catitem_td', 'filter_block' => 'grid_like_filter', 'width' => 300, 'first_chars' => 290, ),
+ 'UserName' => Array('title' => 'la_col_PostedBy', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
+ 'CreatedOn' => Array('title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'Status' => Array('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 70, ),
+ 'LastPostDate' => Array('title' => 'la_col_LastPostOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'Posts' => Array('title' => 'la_col_Posts', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
+ 'Views' => Array('title' => 'la_col_Views', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
+ ),
+ ),
+
+ 'Radio' => Array(
+ 'Icons' => Array(
+ 'default' => 'icon16_topic.png',
+ 0 => 'icon16_topic_disabled.png',
+ 1 => 'icon16_topic.png',
+ 2 => 'icon16_topic_pending.png',
+ 'NEW' => 'icon16_topic_new.png', ),
+ 'Selector' => 'radio',
+ 'Fields' => Array(
+ 'TopicId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
+ 'TopicText' => Array('title' => 'la_col_TopicText', 'data_block' => 'grid_catitem_td', 'filter_block' => 'grid_like_filter', 'width' => 300, 'first_chars' => 290, ),
+ 'UserName' => Array('title' => 'la_col_PostedBy', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
+ 'CreatedOn' => Array('title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'Status' => Array('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 70, ),
+ 'LastPostDate' => Array('title' => 'la_col_LastPostOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'Posts' => Array('title' => 'la_col_Posts', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
+ 'Views' => Array('title' => 'la_col_Views', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
+ ),
+ ),
+ ),
+
+ 'ConfigMapping' => Array(
+ 'PerPage' => 'Perpage_Topics',
+ 'ShortListPerPage' => 'Perpage_Topics_Short',
+ 'ForceEditorPick' => 'Topic_EditorPicksAbove',
+ 'DefaultSorting1Field' => 'Topic_SortField',
+ 'DefaultSorting2Field' => 'Topic_SortField2',
+ 'DefaultSorting1Dir' => 'Topic_SortOrder',
+ 'DefaultSorting2Dir' => 'Topic_SortOrder2',
+
+ 'RatingDelayValue' => 'topic_RatingDelay_Value',
+ 'RatingDelayInterval' => 'topic_RatingDelay_Interval',
+ ),
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/topics/topics_event_handler.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/topics/topics_event_handler.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/topics/topics_event_handler.php (revision 12744)
@@ -0,0 +1,210 @@
+Name == 'OnTopicLockToggle') {
+ $object =& $event->getObject();
+ /* @var $object kCatDBItem */
+
+ if (!$object->isLoaded()) {
+ $event->status = erPERM_FAIL;
+ return false;
+ }
+
+ $category_id = $object->GetDBField('CategoryId');
+ $perm_status = $this->Application->CheckPermission('TOPIC.LOCK', 0, $category_id);
+
+ if (!$perm_status) {
+ $event->status = erPERM_FAIL;
+ }
+
+ return $perm_status;
+ }
+
+ return parent::CheckPermission($event);
+ }
+
+ /**
+ * Lock or unlock topic
+ *
+ * @param kEvent $event
+ */
+ function OnToggleLock(&$event)
+ {
+ $object =& $event->getObject();
+
+ $new_type = $object->GetDBField('TopicType') ? 0 : 1;
+ $object->SetDBField('TopicType', $new_type);
+ $object->Update();
+ }
+
+ /**
+ * Cache topic owner
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ parent::OnBeforeItemUpdate($event);
+
+ $this->cacheItemOwner($event, 'OwnerId', 'PostedBy');
+ }
+
+ /**
+ * Cache topic owner
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ parent::OnBeforeItemCreate($event);
+
+ $this->cacheItemOwner($event, 'OwnerId', 'PostedBy');
+
+ $object =& $event->getObject();
+ /* @var $object kCatDBItem */
+
+ if (!$object->GetDBField('TodayDate')) {
+ $object->SetDBField('TodayDate', adodb_date('Y-m-d'));
+ }
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $object->SetDBField('TopicText', $post_helper->CensorText( $object->GetDBField('TopicText') ));
+ }
+
+ /**
+ * Creates 1st post when topic is created
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ parent::OnAfterItemCreate($event);
+
+ if ($event->Special == '-item') {
+ // don't create first post when cloning
+ return ;
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $post =& $this->Application->recallObject($event->Prefix.'-post', null, Array ('skip_autoload' => true));
+ /* @var $post kDBItem */
+
+ $post->SetDBField('Pending', $object->GetDBField('Status') == STATUS_ACTIVE ? 0 : 1);
+ $post->SetDBField('Subject', '');
+ $post->SetDBField('PostingText', $object->GetDBField('PostingText'));
+
+ $post->SetDBField('ShowSignatures', $object->GetDBField('ShowSignatures'));
+ $post->SetDBField('DisableSmileys', $object->GetDBField('DisableSmileys'));
+ $post->SetDBField('DisableBBCodes', $object->GetDBField('DisableBBCodes'));
+
+ $post->Create();
+
+ // need to update category topic count here
+ }
+
+ /**
+ * Approves 1st post when topic got approved
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ if (!$this->Application->isAdminUser) {
+ return ;
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kCatDBItem */
+
+ if ($object->GetDBField('Posts') == 1) {
+ $post =& $this->Application->recallObject($event->Prefix.'-post', null, Array('skip_autoload' => true));
+ /* @var $post kDBItem */
+
+ $main_status = $object->GetDBField('Status');
+ $post->Load($object->GetDBField('LastPostId'));
+ if ($post->isLoaded()) {
+ $post->SetDBField('Pending', $main_status == STATUS_ACTIVE ? 0 : 1);
+ $post->Update();
+ }
+ }
+ }
+
+ /**
+ * Makes first post body field non-requered when topic has posts already
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ parent::OnAfterItemLoad($event);
+
+ $object =& $event->getObject();
+ /* @var $object kCatDBItem */
+
+ if ($object->GetDBField('Posts') > 0 || !$this->Application->isAdminUser) {
+ $object->setRequired('PostingText', false);
+ }
+ }
+
+ /**
+ * Locks or unlocks topic
+ *
+ * @param kEvent $event
+ */
+ function OnTopicLockToggle(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kCatDBItem */
+
+ $topic_type = $object->GetDBField('TopicType');
+ $object->SetDBField('TopicType', $topic_type == 1 ? 0 : 1);
+ $object->Update();
+ }
+
+ /**
+ * Sets default values to posting options based on persistent session
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ parent::OnAfterConfigRead($event);
+
+ $fields = $this->Application->getUnitOption($event->Prefix, 'Fields');
+ $fields['NotifyOwnerOnChanges']['default'] = (int)$this->Application->RecallPersistentVar('owner_notify');
+ $this->Application->setUnitOption($event->Prefix, 'Fields', $fields);
+
+ $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields');
+ $virtual_fields['DisableBBCodes']['default'] = (int)!$this->Application->RecallPersistentVar('bbcode');
+ $virtual_fields['DisableSmileys']['default'] = (int)!$this->Application->RecallPersistentVar('smileys');
+ $virtual_fields['ShowSignatures']['default'] = (int)$this->Application->RecallPersistentVar('show_sig');
+ $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields);
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/.htaccess
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/.htaccess (revision 0)
+++ branches/5.0.x/in-bulletin/units/.htaccess (revision 12744)
@@ -0,0 +1 @@
+deny from all
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/poll_answers/poll_answers_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/poll_answers/poll_answers_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/poll_answers/poll_answers_config.php (revision 12744)
@@ -0,0 +1,85 @@
+ 'poll-answer',
+
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array ('class' => 'kDBEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event'
+ ),
+ 'IDField' => 'AnswerId',
+ 'TableName' => TABLE_PREFIX . 'PollsAnswers',
+
+ 'ParentPrefix' => 'poll',
+ 'ForeignKey' => 'PollId',
+ 'ParentTableKey' => 'PollId',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'StatusField' => Array('Status'),
+
+ // key - special, value - list select sql
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ ',
+ ),
+
+ 'ItemSQLs' => Array ('' => 'SELECT * FROM %s'),
+
+ 'ListSortings' => Array (
+ '' => Array(
+ 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('Answer' => 'ASC'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'AnswerId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'PollId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Answer' => Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'not_null' => 1, 'using_fck' => 1, 'default' => '', 'required' => 1),
+ 'VotesQty' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Active', 0 => 'la_opt_Disabled'), 'use_phrases' => 1, 'required' => 1, 'not_null' => 1, 'default' => 1),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 0 => 'icon16_disabled.png',
+ 1 => 'icon16_item.png',
+ 2 => 'icon16_pending.png',
+ 'module' => 'core',
+ ),
+ 'Fields' => Array (
+ 'AnswerId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
+ 'Answer' => Array ('title' => 'la_col_Name', 'data_block' => 'grid_priority_td', 'filter_block' => 'grid_like_filter', 'width' => 300, ),
+ 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
+ 'VotesQty' => Array ('title' => 'la_col_VoteCount', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
+
+ ),
+ ),
+ ),
+
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/emoticons/emoticon_eh.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/emoticons/emoticon_eh.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/emoticons/emoticon_eh.php (revision 12744)
@@ -0,0 +1,37 @@
+getObject();
+
+ $emoticon_file = $object->GetField('EmotionImage', 'full_path');
+ if ($emoticon_file) {
+ @unlink($emoticon_file);
+ }
+ }
+
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/emoticons/emoticons_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/emoticons/emoticons_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/emoticons/emoticons_config.php (revision 12744)
@@ -0,0 +1,102 @@
+ 'emoticon',
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array ('class' => 'EmoticonEventHandler', 'file' => 'emoticon_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'IDField' => 'EmoticonId',
+
+ 'TableName' => TABLE_PREFIX.'Emoticon',
+
+ 'TitleField' => 'Name',
+
+ 'TitlePresets' => Array (
+ 'default' => Array (
+ 'new_status_labels' => Array ('emoticon' => '!la_title_AddingSmiley!'),
+ 'edit_status_labels' => Array ('emoticon' => '!la_title_EditingSmiley!'),
+ ),
+
+ 'emoticon_list' => Array ('prefixes' => Array ('emoticon_List'), 'format' => "!la_tab_ConfigSmileys!"),
+ 'emoticon_edit' => Array ('prefixes' => Array ('emoticon'), 'format' => "#emoticon_status# '#emoticon_titlefield#'"),
+ ),
+
+ 'PermSection' => Array('main' => 'in-bulletin:configuration_emoticon'),
+
+ 'Sections' => Array (
+ 'in-bulletin:configuration_emoticon' => Array (
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'conf_smileys',
+ 'label' => 'la_tab_ConfigSmileys',
+ 'url' => Array('t' => 'in-bulletin/emoticons/emoticon_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s FROM %1$s',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array (
+ 'Sorting' => Array ('Name' => 'desc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'EmoticonId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Name' => Array ('type' => 'string', 'max_len' => 20, 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'KeyStroke' => Array ('type' => 'string', 'max_len' => 20, 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'Enabled' => Array ('type' => 'int', 'not_null' => 1, 'default' => 1),
+ 'EmotionImage' => Array (
+ 'type' => 'string', 'max_len' => 255,
+ 'formatter' => 'kUploadFormatter', 'allowed_types' => Array ('image/jpeg', 'image/jpg', 'image/gif', 'image/png', 'image/pjpeg'),
+ 'upload_dir' => SMILEYS_PATH,
+ 'not_null' => 1, 'required' => 1, 'default' => '',
+ ),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 0 => 'icon16_disabled.png',
+ 1 => 'icon16_item.png',
+ 'module' => 'core',
+ ),
+ 'Fields' => Array (
+ 'EmoticonId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50, ),
+ 'Name' => Array ('title' => 'la_col_Name', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
+ 'KeyStroke' => Array ('title' => 'la_col_KeyStroke', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
+ 'EmotionImage' => Array ('title' => 'la_col_Image', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
+ ),
+ ),
+ ),
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/private_messages/private_messages_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/private_messages/private_messages_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/private_messages/private_messages_config.php (revision 12744)
@@ -0,0 +1,109 @@
+ 'private-message',
+ 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'PrivateMessageEventHandler', 'file' => 'private_message_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'PrivateMessageTagProcessor', 'file' => 'private_message_tp.php', 'build_event' => 'OnBuild'),
+
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'IDField' => 'PmId',
+ 'StatusField' => Array ('Status'),
+ 'TitleField' => 'Subject',
+
+ 'PermSection' => Array('main' => 'in-bulletin:private_messages',),
+
+ 'TableName' => TABLE_PREFIX.'PrivateMessages',
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'Subject' => 'pmb.Subject',
+ 'Body' => 'pmb.Body',
+ ),
+ ),
+
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'%3$sPrivateMessageBody pmb ON pmb.PMBodyId = %1$s.PMBodyId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser from_user ON from_user.PortalUserId = %1$s.FromId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser to_user ON to_user.PortalUserId = %1$s.ToId',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array(
+ 'ForcedSorting' => Array('CreatedOn' => 'desc'),
+ ),
+ ),
+
+ 'ItemSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'%3$sPrivateMessageBody pmb ON pmb.PMBodyId = %1$s.PMBodyId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser from_user ON from_user.PortalUserId = %1$s.FromId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser to_user ON to_user.PortalUserId = %1$s.ToId',
+ ),
+
+ 'SubItems' => Array('private-message-body'),
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'Subject' => 'pmb.Subject',
+ 'Body' => 'pmb.Body',
+ 'Options' => 'pmb.Options',
+
+ 'FromName' => 'IF (ISNULL(from_user.Login), IF (%1$s.FromId = -1, "root", IF (%1$s.FromId = -2, "Guest", "n/a")), from_user.Login)',
+ 'ToName' => 'IF (ISNULL(to_user.Login), IF (%1$s.ToId = -1, "root", IF (%1$s.ToId = -2, "Guest", "n/a")), to_user.Login)',
+
+ 'FromFullName' => 'TRIM(CONCAT(from_user.FirstName, " ", from_user.LastName))',
+ 'ToFullName' => 'TRIM(CONCAT(to_user.FirstName, " ", to_user.LastName))',
+ ),
+ ),
+
+ 'Fields' => Array (
+ 'PmId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'FromId' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!lu_error_UserNotFound!'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'required' => 1, 'default' => null),
+ 'ToId' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!lu_error_UserNotFound!'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'required' => 1, 'default' => null),
+ 'FolderId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'lu_Inbox', 1 => 'lu_Sent'), 'use_phrases' => 1, 'not_null' => 1, 'default' => PM_FOLDER_SENT),
+ 'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'lu_opt_MessageUnread', 1 => 'lu_opt_MessageViewed', 2 => 'lu_opt_MessageRead', 3 => 'lu_opt_MessageReplied', 4 => 'lu_opt_MessageSent'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
+ 'PMBodyId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
+ ),
+
+ 'VirtualFields' => Array (
+ 'FromName' => Array ('type' => 'string', 'default' => ''),
+ 'ToName' => Array ('type' => 'string', 'default' => ''),
+ 'Subject' => Array ('type' => 'string', 'default' => ''),
+ 'Body' => Array ('type' => 'string', 'required' => 1, 'default' => ''),
+ 'Options' => Array ('type' => 'string', 'default' => 0),
+
+ 'DisableBBCodes' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'DisableSmileys' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'ShowSignatures' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 1),
+ ),
+
+
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/private_messages/private_message_tp.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/private_messages/private_message_tp.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/private_messages/private_message_tp.php (revision 12744)
@@ -0,0 +1,164 @@
+getObject();
+ /* @var $object kDBItem */
+
+ return $object->GetDBField('Status') < PM_STATUS_READ;
+ }
+
+ /**
+ * Allows to check what folder is currently active
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function FolderSelected($params)
+ {
+ $folder_mapping = Array ('inbox' => PM_FOLDER_INBOX, 'sent' => PM_FOLDER_SENT);
+
+ return (int)$this->Application->GetVar('folder_id') == $folder_mapping[ strtolower($params['folder']) ];
+ }
+
+ /**
+ * Creates link to specific private message folder
+ *
+ * @param Array $params
+ * @return string
+ */
+ function FolderLink($params)
+ {
+ $folder_mapping = Array ('inbox' => PM_FOLDER_INBOX, 'sent' => PM_FOLDER_SENT);
+ $params['folder_id'] = $folder_mapping[ strtolower($params['folder']) ];
+ unset($params['folder']);
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ function MessageSubject($params)
+ {
+ $object =& $this->getObject();
+ /* @var $object kDBItem */
+
+ $params['field'] = 'Subject';
+ $value = $this->Field($params);
+
+ if (!$value && isset($params['empty_title'])) {
+ return '['.$this->Application->Phrase($params['empty_title']).']';
+ }
+
+ return $value;
+ }
+
+ function MessageBody($params)
+ {
+ $object =& $this->getObject($params);
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ // 2. parse post body
+ $sub_blocks = Array (
+ 'smileys' => $params['smiley_render_as'],
+ 'bbcode' => $params['bbcode_render_as'],
+ );
+
+ return $post_helper->parsePostBody($object->GetDBField('Body'), $object->GetDBField('Options'), $sub_blocks);
+ }
+
+ function DeleteLink($params)
+ {
+ $params['pass'] = 'm,'.$this->getPrefixSpecial();
+ $params[$this->getPrefixSpecial().'_event'] = 'OnDelete';
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ function ReplyLink($params)
+ {
+ $params['reply_to'] = $this->Application->GetVar($this->getPrefixSpecial().'_id');
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ /**
+ * User can reply message only in case, when it is not it's own message
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function CanReplyMessage($params)
+ {
+ $object =& $this->getObject();
+ /* @var $object kDBItem */
+
+ return $object->GetDBField('FromId') != $this->Application->RecallVar('user_id');
+ }
+
+ /**
+ * Marks private message as read
+ *
+ * @param Array $params
+ */
+ function MarkAsRead($params)
+ {
+ $object =& $this->getObject();
+ /* @var $object kDBItem */
+
+ if ($object->GetDBField('Status') < PM_STATUS_READ) {
+ $object->SetDBField('Status', PM_STATUS_READ);
+ $object->Update();
+ }
+ }
+
+ /**
+ * Returns link to private message sender/recipient public profile
+ *
+ * @param Array $params
+ * @return string
+ */
+ function ProfileLink($params)
+ {
+ $user_field = strtolower($params['type']) == 'from' ? 'FromId' : 'ToId';
+ unset($params['type']);
+
+ $object =& $this->getObject($params);
+ $params['user_id'] = $object->GetDBField($user_field);
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ /**
+ * Returns link for sending private message from user's public profile page
+ *
+ * @param Array $params
+ * @return string
+ */
+ function SendMessageLink($params)
+ {
+ $params['user_id'] = $this->Application->GetVar('user_id');
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/private_messages/private_message_eh.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/private_messages/private_message_eh.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/private_messages/private_message_eh.php (revision 12744)
@@ -0,0 +1,251 @@
+ Array('self' => true),
+ 'OnCreate' => Array('self' => true),
+ 'OnDelete' => Array('self' => true),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Applies folder & message owner filter to message list
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ $folder_id = $this->Application->GetVar('folder_id');
+ if ($folder_id === false) {
+ $folder_id = PM_FOLDER_INBOX;
+ $this->Application->SetVar('folder_id', $folder_id);
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ $user_id = $this->Application->RecallVar('user_id');
+ if ($folder_id == PM_FOLDER_INBOX) {
+ $object->addFilter('owner_filter', '%1$s.ToId = '.$user_id);
+ }
+ else {
+ $object->addFilter('owner_filter', '%1$s.FromId = '.$user_id);
+ }
+ $object->addFilter('folder_filter', '%1$s.FolderId = '.$folder_id);
+ }
+
+ /**
+ * Puts message to Sent folder
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ if ($object->GetDBField('FolderId') != PM_FOLDER_SENT) {
+ // when creating "Inbox" message (from "Sent" message) don't reset folder & status
+ return ;
+ }
+
+ $user_id = $this->Application->RecallVar('user_id');
+ $object->SetDBField('FromId', $user_id);
+ $object->SetDBField('FolderId', PM_FOLDER_SENT);
+ $object->SetDBField('Status', PM_STATUS_READ);
+ }
+
+ /**
+ * Creates 1st post when topic is created
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ parent::OnAfterItemCreate($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $this->Application->EmailEventUser('PM.ADD', $object->GetDBField('ToId'));
+
+ if ($object->GetDBField('FolderId') != PM_FOLDER_SENT) {
+ // 1. create message in sender's "Sent" folder (this method only for this step)
+ // 2. create message body (shared)
+ // 3. create message copy in recipient's "Inbox" folder
+ return ;
+ }
+
+ $message_body =& $this->Application->recallObject($event->Prefix.'-body', null, Array ('skip_autoload' => true));
+ /* @var $message_body kDBItem */
+
+ // 1. create message body (for sender & recipient)
+ $copy_fields = Array ('Subject', 'Body', 'ShowSignatures', 'DisableSmileys', 'DisableBBCodes');
+ $message_body->SetDBFieldsFromHash($object->GetFieldValues(), $copy_fields);
+
+ $body_created = $message_body->Create();
+ if ($body_created) {
+ // 2. link body with message
+ $object->SetDBField('PMBodyId', $message_body->GetID());
+ $object->Update();
+
+ // 3. create message in recipient's Inbox folder
+ $object->SetDBField('FolderId', PM_FOLDER_INBOX);
+ $object->SetDBField('Status', PM_STATUS_UNREAD);
+ $object->Create();
+ }
+ }
+
+ /**
+ * Sets post options to virtual fields
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $options_map = $post_helper->getOptionsMap();
+ $post_options = $object->GetDBField('Options');
+ foreach ($options_map as $option_name => $field_name) {
+ $option_value = $post_helper->GetPostOption($option_name, $post_options);
+ $object->SetDBField($field_name, (int)$option_value);
+ }
+ }
+
+ /**
+ * Goes to next_template after post creation
+ *
+ * @param kEvent $event
+ */
+ function OnCreate(&$event)
+ {
+ parent::OnCreate($event);
+
+ if ($event->status == erSUCCESS && !$this->Application->isAdmin) {
+ $event->SetRedirectParam('opener', 's');
+ $event->redirect = $this->Application->GetVar('next_template');
+ }
+ }
+
+ /**
+ * Prevents user from deleting other user private messages
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $user_id = $this->Application->RecallVar('user_id');
+ $owner_field = ($object->GetDBField('FolderId') == PM_FOLDER_INBOX) ? 'ToId' : 'FromId';
+ if ($object->GetDBField($owner_field) != $user_id) {
+ $event->status = erFAIL;
+ }
+ }
+
+ /**
+ * Updates reference counter in message body record
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $body_idfield = $this->Application->getUnitOption($event->Prefix.'-body', 'IDField');
+ $body_table = $this->Application->getUnitOption($event->Prefix.'-body', 'TableName');
+ $sql = 'UPDATE '.$body_table.'
+ SET ReferenceCount = ReferenceCount - 1
+ WHERE '.$body_idfield.' = '.$object->GetDBField('PMBodyId');
+ $this->Conn->Query($sql);
+ }
+
+ /**
+ * Sets default values to posting options based on persistent session
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields');
+ $virtual_fields['DisableBBCodes']['default'] = (int)!$this->Application->RecallPersistentVar('bbcode');
+ $virtual_fields['DisableSmileys']['default'] = (int)!$this->Application->RecallPersistentVar('smileys');
+ $virtual_fields['ShowSignatures']['default'] = (int)$this->Application->RecallPersistentVar('show_sig');
+ $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields);
+ }
+
+ /**
+ * Checks, that current user is recipient or sender of viewed message
+ *
+ * @param kEvent $event
+ * @return bool
+ */
+ function checkItemStatus(&$event)
+ {
+ $object =& $event->getObject();
+ if (!$object->isLoaded()) {
+ return true;
+ }
+
+ $user_id = $this->Application->RecallVar('user_id');
+ return ($object->GetDBField('FromId') == $user_id) || ($object->GetDBField('ToId') == $user_id);
+ }
+
+ /**
+ * Prepares new reply & new message form
+ *
+ * @param kEvent $event
+ */
+ function OnNew(&$event)
+ {
+ parent::OnNew($event);
+
+ $reply_to = $this->Application->GetVar('reply_to');
+ $user_id = $this->Application->GetVar('user_id');
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ if ($reply_to > 0) {
+ // reply to message
+ $source_msg =& $this->Application->recallObject($event->Prefix.'.-item', null, Array ('skip_autoload' => true));
+ /* @var $source_msg kDBItem */
+
+ $source_msg->Load($reply_to);
+
+ $object->SetDBField('ToId', $source_msg->GetDBField('FromId'));
+ $object->SetDBField('Subject', 'Re: '.$source_msg->GetDBField('Subject'));
+ }
+ elseif ($user_id > 0) {
+ // send message to any user by id
+ $object->SetDBField('ToId', $user_id);
+ }
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/posts/post_eh.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/posts/post_eh.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/posts/post_eh.php (revision 12744)
@@ -0,0 +1,400 @@
+Name, $events)) {
+ return true;
+ }
+
+ return parent::CheckPermission($event);
+ }
+
+ /**
+ * Sets default values
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $user_id = $this->Application->RecallVar('user_id');
+
+ $now = adodb_mktime();
+
+ $object->SetDBField('CreatedById', $user_id);
+ $object->SetDBField('CreatedOn_date', $now);
+ $object->SetDBField('CreatedOn_time', $now);
+
+ $object->SetDBField('ModifiedById', $user_id);
+ $object->SetDBField('Modified_date', $now);
+ $object->SetDBField('Modified_time', $now);
+
+ $object->SetDBField('IPAddress', $_SERVER['REMOTE_ADDR']);
+
+ $sql = 'SELECT Login
+ FROM '.TABLE_PREFIX.'PortalUser
+ WHERE PortalUserId = '.$user_id;
+ $object->SetDBField('PosterAlias', $this->Conn->GetOne($sql));
+
+ // set post options
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $options_map = $post_helper->getOptionsMap();
+ $post_options = $object->GetDBField('Options');
+ foreach ($options_map as $option_name => $field_name) {
+ $option_value = $object->GetDBField($field_name);
+ $post_helper->SetPostOption($option_name, $option_value, $post_options);
+ }
+ $object->SetDBField('Options', $post_options);
+
+ $table_info = $object->getLinkedInfo($event->Special, true);
+ $object->SetDBField($table_info['ForeignKey'], $table_info['ParentId']);
+ }
+
+ /**
+ * Checks if user has permission on post
+ *
+ * @param kEvent $event
+ * @param string $permissions
+ */
+ function checkPostPermission(&$event, $permissions)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $sql = 'SELECT ci.CategoryId, p.CreatedById
+ FROM '.$object->TableName.' p
+ LEFT JOIN '.TABLE_PREFIX.'Topic t ON t.TopicId = p.TopicId
+ LEFT JOIN '.TABLE_PREFIX.'CategoryItems ci ON ci.ItemResourceId = t.ResourceId AND ci.PrimaryCat = 1
+ WHERE p.'.$object->IDField.' = '.$object->GetID();
+ $post_info = $this->Conn->GetRow($sql);
+
+ $perm_helper =& $this->Application->recallObject('PermissionsHelper');
+ /* @var $perm_helper kPermissionsHelper */
+
+ $is_owner = $post_info['CreatedById'] == $this->Application->RecallVar('user_id');
+ $params['permissions'] = 'TOPIC.REPLY.MODIFY|TOPIC.REPLY.OWNER.MODIFY';
+ $params['cat_id'] = $post_info['CategoryId'];
+ return $perm_helper->TagPermissionCheck($params, $is_owner);
+ }
+
+ /**
+ * Sets post options before post update
+ * Ensures, that only user with permission will update topic
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $perm_status = $this->checkPostPermission($event, 'TOPIC.REPLY.MODIFY|TOPIC.REPLY.OWNER.MODIFY');
+ if (!$perm_status) {
+ $event->status = erFAIL;
+ return ;
+ }
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $options_map = $post_helper->getOptionsMap();
+ $post_options = $object->GetDBField('Options');
+ foreach ($options_map as $option_name => $field_name) {
+ $option_value = $object->GetDBField($field_name);
+ $post_helper->SetPostOption($option_name, $option_value, $post_options);
+ }
+ $object->SetDBField('Options', $post_options);
+ }
+
+ /**
+ * Notifies admin about post change
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ parent::OnAfterItemUpdate($event);
+
+ $this->Application->EmailEventAdmin('POST.MODIFY');
+ }
+
+ /**
+ * Checks, that user can delete post
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $perm_status = $this->checkPostPermission($event, 'TOPIC.REPLY.OWNER.DELETE|TOPIC.REPLY.DELETE');
+ if (!$perm_status) {
+ $event->status = erFAIL;
+ }
+ }
+
+ /**
+ * Sets post options to virtual fields
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $options_map = $post_helper->getOptionsMap();
+ $post_options = $object->GetDBField('Options');
+ foreach ($options_map as $option_name => $field_name) {
+ $option_value = $post_helper->GetPostOption($option_name, $post_options);
+ $object->SetDBField($field_name, (int)$option_value);
+ }
+ }
+
+ /**
+ * Updates cached post counter in topic
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $parent_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix');
+
+ $main_object =& $this->Application->recallObject($parent_prefix);
+ /* @var $main_object kCatDBItem */
+
+ // update user posts counter
+ $user_posts = $this->Application->RecallPersistentVar('bb_posts');
+ $this->Application->StorePersistentVar('bb_posts', $user_posts + 1);
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $category_id = $this->Application->GetVar('m_cat_id');
+ $post_helper->PropagateCategoryField($category_id, 'Modified', $object->GetDBField('CreatedOn'));
+
+ if (!$this->Application->isAdmin && $main_object->GetDBField('Posts')) {
+ // don't send any email events when in admin OR new topic just added (0 posts)
+
+ $user_notified = false; // don't send POST.ADD event twice to same user (in case if owner adds new post)
+ if ($main_object->GetDBField('NotifyOwnerOnChanges')) {
+ $user_notified = $main_object->GetDBField('OwnerId');
+ $this->Application->EmailEventUser('POST.ADD', $user_notified);
+ }
+
+ $post_owner_id = $object->GetDBField('CreatedById');
+ if (($post_owner_id > 0) && ($user_notified != $post_owner_id)) {
+ $this->Application->EmailEventUser('POST.ADD', $post_owner_id);
+ }
+
+ $this->Application->EmailEventAdmin('POST.ADD');
+ }
+
+ $post_helper->updateTodayPostsCount($main_object, $object->GetDBField('CreatedOn'), +1);
+ $this->updateTopicInfo($event, $main_object);
+
+ $topic_id = $object->GetDBField('TopicId');
+ $posts_count = $post_helper->updatePostCount($topic_id, +1);
+ $main_object->SetDBField('Posts', $posts_count);
+
+ // autolock topic after N number of posts (if option enabled)
+ $auto_lock = $this->Application->ConfigValue('AutoTopicLockPosts');
+ if ((int)$auto_lock > 0) {
+ if ($posts_count >= $auto_lock) {
+ // user has unlocked topic after $auto_lock and posts again -> ensure that topic will be locked again
+ $this->Application->HandleEvent($parent_prefix.':OnTopicLockToggle');
+ }
+ }
+ }
+
+ /**
+ * Update last post info in topic
+ *
+ * @param kEvent $event
+ * @param kCatDBItem $main_object
+ */
+ function updateTopicInfo(&$event, &$main_object)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $main_object->SetDBField('Modified_date', $object->GetDBField('Modified'));
+ $main_object->SetDBField('Modified_time', $object->GetDBField('Modified'));
+
+ $main_object->SetDBField('LastPostId', $object->GetID());
+
+ $main_object->SetDBField('LastPostDate_date', $object->GetDBField('CreatedOn'));
+ $main_object->SetDBField('LastPostDate_time', $object->GetDBField('CreatedOn'));
+
+ $main_object->Update();
+ }
+
+ /**
+ * Goes to next_template after post creation
+ *
+ * @param kEvent $event
+ */
+ function OnCreate(&$event)
+ {
+ parent::OnCreate($event);
+
+ if ($event->status == erSUCCESS && !$this->Application->isAdmin) {
+ $event->SetRedirectParam('opener', 's');
+ $event->redirect = $this->Application->GetVar('next_template');
+ }
+ }
+
+ /**
+ * Goes to next_template after post editing
+ *
+ * @param kEvent $event
+ */
+ function OnUpdate(&$event)
+ {
+ parent::OnUpdate($event);
+
+ if ($event->status == erSUCCESS && !$this->Application->isAdmin) {
+ $event->SetRedirectParam('opener', 's');
+ $event->redirect = $this->Application->GetVar('next_template');
+ $event->SetRedirectParam('pass', 'm,bb');
+ }
+ }
+
+ /**
+ * Moves reference to last post in topic, when it is deleted
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $topic_id = $object->GetDBField('TopicId');
+ if (!$topic_id) {
+ // deleting non-existing post
+ return ;
+ }
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ // update posts count in topic
+ $post_helper->updatePostCount($topic_id, -1);
+
+ // update post owner posts counter
+ $sql = 'UPDATE '.TABLE_PREFIX.'PersistantSessionData
+ SET VariableValue = IF (VariableValue > 0, VariableValue - 1, 0)
+ WHERE (PortalUserId = '.$object->GetDBField('CreatedById').') AND (VariableName = "bb_posts")';
+ $this->Conn->Query($sql);
+
+
+ $main_object =& $this->Application->recallObject('bb.-item', null, Array('skip_autoload' => true));
+ /* @var $main_object kCatDBItem */
+
+ $main_object->Load($topic_id);
+
+ $post_helper->updateTodayPostsCount($main_object, $object->GetDBField('CreatedOn'), -1);
+
+ if ($main_object->GetDBField('LastPostId') == $object->GetID()) {
+ $sql = 'SELECT PostingId, CreatedOn
+ FROM '.$object->TableName.'
+ WHERE TopicId = '.$topic_id.'
+ ORDER BY PostingId DESC';
+ $last_post = $this->Conn->GetRow($sql);
+
+ $fields_hash = Array (
+ 'LastPostId' => $last_post['PostingId'],
+ 'LastPostDate' => $last_post['CreatedOn'],
+ );
+ $this->Conn->doUpdate($fields_hash, $main_object->TableName, $main_object->IDField.' = '.$topic_id);
+ }
+ }
+
+ /**
+ * Sets default values to posting options based on persistent session
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields');
+ $virtual_fields['DisableBBCodes']['default'] = (int)!$this->Application->RecallPersistentVar('bbcode');
+ $virtual_fields['DisableSmileys']['default'] = (int)!$this->Application->RecallPersistentVar('smileys');
+ $virtual_fields['ShowSignatures']['default'] = (int)$this->Application->RecallPersistentVar('show_sig');
+ $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields);
+ }
+
+ /**
+ * Deletes items & preserves clean env
+ *
+ * @param kEvent $event
+ */
+ function OnDelete(&$event)
+ {
+ parent::OnDelete($event);
+
+ if ($event->status == erSUCCESS && !$this->Application->isAdmin) {
+ $parent_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix');
+ $event->SetRedirectParam('pass', 'm,'.$parent_prefix);
+ }
+ }
+
+ /**
+ * Prepares new reply form
+ *
+ * @param kEvent $event
+ */
+ function OnNew(&$event)
+ {
+ parent::OnNew($event);
+
+ $reply_to = $this->Application->GetVar('reply_to');
+
+ if ($reply_to > 0) {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $source_post =& $this->Application->recallObject($event->Prefix.'.-item', null, Array ('skip_autoload' => true));
+ /* @var $source_post kDBItem */
+
+ $source_post->Load($reply_to);
+
+ $object->SetDBField('Subject', 'Re: '.$source_post->GetDBField('Subject'));
+ $object->SetDBField('PostingText', '[quote id='.$reply_to.']'.$source_post->GetDBField('PostingText').'[/quote]');
+ }
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/posts/post_tp.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/posts/post_tp.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/posts/post_tp.php (revision 12744)
@@ -0,0 +1,315 @@
+Application->getUnitOption($this->Prefix, 'ParentPrefix');
+ $main_object =& $this->Application->recallObject($parent_prefix);
+ /* @var $main_object kCatDBItem */
+
+ if ($main_object->isLoaded()) {
+ $main_object->RegisterHit();
+ }
+
+ return $this->PrintList2($params);
+ }
+
+ /**
+ * Returns link to post author public profile
+ *
+ * @param Array $params
+ * @return string
+ */
+ function ProfileLink($params)
+ {
+ $object =& $this->getObject($params);
+ $params['user_id'] = $object->GetDBField('CreatedById');
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ function PosterField($params)
+ {
+ static $posters = null;
+
+ $object =& $this->getObject($params);
+
+ if (!isset($posters)) {
+ $poster_ids = array_unique($object->GetCol('CreatedById'));
+
+ $user_idfield = $this->Application->getUnitOption('u', 'IDField');
+ $user_table = $this->Application->getUnitOption('u', 'TableName');
+
+ $sql = 'SELECT u.*, g.Name AS PrimaryGroup
+ FROM '.$user_table.' u
+ LEFT JOIN '.TABLE_PREFIX.'UserGroup ug ON ug.PortalUserId = u.PortalUserId AND ug.PrimaryGroup = 1
+ LEFT JOIN '.TABLE_PREFIX.'PortalGroup g ON g.GroupId = ug.GroupId
+ WHERE u.'.$user_idfield.' IN ('.implode(',', $poster_ids).')';
+ $posters = $this->Conn->Query($sql, $user_idfield);
+ }
+
+ $poster =& $this->Application->recallObject('u.poster', null, Array('skip_autoload' => true));
+ /* @var $poster UsersItem */
+
+ $poster_id = $object->GetDBField('CreatedById');
+ if ($poster_id > 0) {
+ // not Guest & root
+ if ($poster->GetID() != $poster_id) {
+ // previous poster differs from requested
+ $poster->SetDBFieldsFromHash($posters[$poster_id]);
+ $poster->setID($poster_id);
+ }
+ return $this->Application->ProcessParsedTag('u.poster', 'Field', $params);
+ }
+
+ return '';
+ }
+
+ /**
+ * Checks if post is made by real user (not Guest or root)
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function PosterFound($params)
+ {
+ $object =& $this->getObject($params);
+
+ return $object->GetDBField('CreatedById') > 0;
+ }
+
+ /**
+ * Posts count created by current poster
+ *
+ * @param Array $params
+ * @return int
+ */
+ function PosterPostsCount($params)
+ {
+ static $posts_count = null;
+
+ $object =& $this->getObject($params);
+
+ if (!isset($posts_count)) {
+ $poster_ids = array_unique($object->GetCol('CreatedById'));
+
+ $sql = 'SELECT VariableValue, PortalUserId
+ FROM '.TABLE_PREFIX.'PersistantSessionData
+ WHERE PortalUserId IN ('.implode(',', $poster_ids).') AND VariableName = "bb_posts"';
+ $posts_count = $this->Conn->GetCol($sql, 'PortalUserId');
+ }
+
+ return $posts_count[$object->GetDBField('CreatedById')];
+ }
+
+ function PostSubject($params)
+ {
+ $object =& $this->getObject($params);
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ return $post_helper->CensorText( $object->GetDBField('Subject') );
+ }
+
+ function PostBody($params)
+ {
+ $object =& $this->getObject($params);
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $body = $object->GetDBField('PostingText');
+
+ // 2. parse post body
+ $sub_blocks = Array (
+ 'smileys' => $params['smiley_render_as'],
+ 'bbcode' => $params['bbcode_render_as'],
+ 'quote' => $params['quote_render_as'],
+ );
+ $body = $post_helper->parsePostBody($body, $object->GetDBField('Options'), $sub_blocks);
+
+ return $body;
+ }
+
+ /**
+ * Checks if poster signature needs to be shown together with post
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function ShowPostSignature($params)
+ {
+ $object =& $this->getObject($params);
+ $post_options = $object->GetDBField('Options');
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ // show poster signature in this post
+ if ($post_helper->GetPostOption('show_sig', $post_options)) {
+ // logged-in user wishes to view signatures in posts
+ $show_other_signatures = $this->Application->RecallPersistentVar('bb_signatures');
+ if ($show_other_signatures) {
+ // don't show signature when it is empty
+ $signature = $this->getUserSignature($object->GetDBField('CreatedById'));
+ return strlen(trim($signature)) ? true : false;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns parsed poster (from current post) signature
+ *
+ * @param Array $params
+ * @return string
+ */
+ function PostSignature($params)
+ {
+ $object =& $this->getObject($params);
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $sub_blocks = Array (
+ 'smileys' => $params['smiley_render_as'],
+ 'bbcode' => $params['bbcode_render_as'],
+ );
+
+ $signature = $this->getUserSignature($object->GetDBField('CreatedById'));
+ return $post_helper->parsePostBody($signature, $object->GetDBField('Options'), $sub_blocks);
+ }
+
+ /**
+ * Returns user signature (cached for all viewed posts on page)
+ *
+ * @param int $user_id
+ * @return string
+ */
+ function getUserSignature($user_id)
+ {
+ static $user_signatures = null;
+
+ $object =& $this->getObject();
+
+ if (!isset($user_signatures)) {
+ $poster_ids = array_unique($object->GetCol('CreatedById'));
+
+ $sql = 'SELECT VariableValue, PortalUserId
+ FROM '.TABLE_PREFIX.'PersistantSessionData
+ WHERE PortalUserId IN ('.implode(',', $poster_ids).') AND VariableName = "my_signature"';
+ $user_signatures = $this->Conn->GetCol($sql, 'PortalUserId');
+ }
+
+ $poster_id = $object->GetDBField('CreatedById');
+ return isset($user_signatures[$poster_id]) ? $user_signatures[$poster_id] : '';
+ }
+
+ /**
+ * Creates link to individual post in topic
+ *
+ * @param Array $params
+ * @return string
+ */
+ function PostLink($params)
+ {
+ $params['pass'] = 'm,bb,bb-post';
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ function ReplyQuotedLink($params)
+ {
+ $object =& $this->getObject($params);
+
+ $params['pass'] = 'm,bb';
+ $params['reply_to'] = $object->GetID();
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ /**
+ * Checks if user have one of required permissions
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function HasPermission($params)
+ {
+ static $category_path = null;
+
+ if (!isset($category_path)) {
+ // get topic category
+ $parent_prefix = $this->Application->getUnitOption($this->Prefix, 'ParentPrefix');
+ $parent_item =& $this->Application->recallObject($parent_prefix, null, Array ('raise_warnings' => 0));
+ $category_path = $parent_item->isLoaded() ? $parent_item->GetDBField('ParentPath') : $this->Application->GetVar('m_cat_id');
+ }
+
+ $perm_helper =& $this->Application->recallObject('PermissionsHelper');
+ /* @var $perm_helper kPermissionsHelper */
+
+ $params['raise_warnings'] = 0;
+ $object =& $this->getObject($params);
+ /* @var $object kDBItem */
+
+ // 1. category restriction
+ $params['cat_id'] = $category_path;
+
+ // 2. owner restriction
+ $is_owner = $object->GetDBField('CreatedById') == $this->Application->RecallVar('user_id');
+
+ return $perm_helper->TagPermissionCheck($params, $is_owner);
+ }
+
+ function CategoryItemCount($params)
+ {
+ $count_helper =& $this->Application->recallObject('CountHelper');
+ /* @var $count_helper kCountHelper */
+
+ return $count_helper->CategoryItemCount('bb', $params, 'SUM(Posts)'); // - COUNT(TopicId)
+ }
+
+ function ItemCount($params)
+ {
+ $count_helper =& $this->Application->recallObject('CountHelper');
+ /* @var $count_helper kCountHelper */
+
+ $today_only = isset($params['today']) && $params['today'];
+ return $count_helper->ItemCount('bb', $today_only, 'SUM(Posts)'); // - COUNT(TopicId)
+ }
+
+ /**
+ * Preserve main item id in subitem pagination url
+ *
+ * @param Array $params
+ * @return string
+ */
+ function PageLink($params)
+ {
+ $object =& $this->getObject($params);
+ /* @var kDBList */
+
+ $parent_info = $object->getLinkedInfo();
+ if ($parent_info['ParentId'] > 0) {
+ $params['pass'] = 'm,'.$this->getPrefixSpecial().','.$parent_info['ParentPrefix'];
+ }
+ return parent::PageLink($params);
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/posts/posts_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/posts/posts_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/posts/posts_config.php (revision 12744)
@@ -0,0 +1,110 @@
+ 'bb-post',
+ 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'PostEventHandler', 'file' => 'post_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'PostTagProcessor', 'file' => 'post_tp.php', 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ ),
+
+ 'IDField' => 'PostingId',
+ 'StatusField' => Array('Pending'),
+
+ 'TitleField' => 'Subject',
+
+ 'TableName' => TABLE_PREFIX.'Posting',
+
+ 'ForeignKey' => 'TopicId',
+ 'ParentTableKey' => 'TopicId',
+ 'ParentPrefix' => 'bb',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'Images img ON (img.ResourceId = u.ResourceId) AND (img.DefaultImg = 1 OR img.Name = "avatar")',
+ ),
+
+ 'ItemSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'Images img ON (img.ResourceId = u.ResourceId) AND (img.DefaultImg = 1 OR img.Name = "avatar")',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array (
+ 'ForcedSorting' => Array ('CreatedOn' => 'asc',),
+ ),
+ ),
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.CreatedById = -1, "root", IF (%1$s.CreatedById = -2, "Guest", "n/a")), u.Login)',
+
+ 'SameImages' => 'img.SameImages',
+ 'LocalThumb' => 'img.LocalThumb',
+ 'ThumbPath' => 'img.ThumbPath',
+ 'ThumbUrl' => 'img.ThumbUrl',
+ 'LocalImage' => 'img.LocalImage',
+ 'LocalPath' => 'img.LocalPath',
+ 'FullUrl' => 'img.Url',
+ ),
+ ),
+
+ 'Fields' => Array (
+ 'PostingId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'IPAddress' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'PosterAlias' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'Pending' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Subject' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL),
+ 'PostingText' => Array ('type' => 'string', 'allow_html' => 1, 'default' => NULL),
+ 'GraphicsUrl' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL),
+ 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
+ 'Modified' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => NULL),
+ 'ModifiedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'default' => NULL),
+ 'CreatedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'default' => NULL),
+ 'TopicId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'ResourceId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'ReplyTo' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Options' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ ),
+
+ 'VirtualFields' => Array (
+ 'DisableBBCodes' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'DisableSmileys' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'ShowSignatures' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 1),
+
+ // for avatar image
+ 'SameImages' => Array('type' => 'string', 'default' => ''),
+ 'LocalThumb' => Array('type' => 'string', 'default' => ''),
+ 'ThumbPath' => Array('type' => 'string', 'default' => ''),
+ 'ThumbUrl' => Array('type' => 'string', 'default' => ''),
+ 'LocalImage' => Array('type' => 'string', 'default' => ''),
+ 'LocalPath' => Array('type' => 'string', 'default' => ''),
+ 'FullUrl' => Array('type' => 'string', 'default' => ''),
+ ),
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/poll_comments/poll_comment_eh.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/poll_comments/poll_comment_eh.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/poll_comments/poll_comment_eh.php (revision 12744)
@@ -0,0 +1,149 @@
+ Array('self' => true, 'subitem' => true,),
+ 'OnItemBuild' => Array('self' => true, 'subitem' => true,),
+ );
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ function OnAfterConfigRead(&$event)
+ {
+ if ($this->Application->RecallVar('user_id') == '-2') { // Guest
+ // make Guest Name and Email required for guests
+ $fields = $this->Application->getUnitOption($event->Prefix, 'Fields');
+ $fields['GuestName']['required'] = 1;
+ $fields['GuestEmail']['required'] = 1;
+ $this->Application->setUnitOption($event->Prefix, 'Fields', $fields);
+ }
+ }
+
+ /**
+ * Applies special filter, that allows to select all commented from current poll
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ if ($this->Application->isAdminUser) {
+ return ;
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ $object->addFilter('comment_status', '(%1$s.Status = ' .STATUS_ACTIVE. ')');
+ }
+
+ /**
+ * Before New PollComment created
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ if ($this->Application->isAdminUser) {
+ return ;
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ // get Poll info
+ $parent_prefix = $this->Application->getUnitOption($this->Prefix, 'ParentPrefix');
+ if($parent_prefix) {
+ $main_object =& $this->Application->recallObject($parent_prefix.'.'.$special, null,Array('raise_warnings' => 0));
+ /* @var $main_object kDBItem */
+
+ if (!$main_object->isLoaded()) {
+ $main_object =& $this->Application->recallObject($parent_prefix);
+ }
+
+ $poll_id = $main_object->GetDBField($this->Application->getUnitOption($event->Prefix, 'ForeignKey'));
+ }
+
+ if ($poll_id) {
+ $spam_helper =& $this->Application->recallObject('SpamHelper');
+ /* @var $spam_helper SpamHelper */
+
+ $spam_helper->InitHelper($poll_id, 'PollComment', 0); // ResourceId used for SpamControl only
+
+ if ($spam_helper->InSpamControl()) {
+ $event->status = erFAIL;
+ $object->SetError('CommentText', 'too_frequent', 'lu_error_AlreadyCommented');
+ return ;
+ }
+ }
+
+ $object->SetDBField('CreatedById', $this->Application->RecallVar('user_id'));
+ $object->SetDBField('UserIP', $_SERVER['REMOTE_ADDR']);
+ $object->SetDBField('PollId', $poll_id); // PollId
+ $object->SetDBField('Status', STATUS_ACTIVE);
+
+ parent::OnBeforeItemCreate($event);
+ }
+
+ /**
+ * Updates item review counter
+ *
+ * @param kEvent $event
+ */
+ function OnCreate(&$event)
+ {
+ parent::OnCreate($event);
+
+ if ($this->Application->isAdminUser) {
+ return;
+ }
+
+ if ($event->status == erSUCCESS) {
+ $event->setRedirectParam('opener', 's');
+ $event->setRedirectParam('pass', 'm,poll');
+ $event->redirect = $this->Application->GetVar('success_template');
+ }
+ }
+
+ /**
+ * Updates item review counter
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ if (!$this->Application->isAdminUser) {
+ $spam_helper =& $this->Application->recallObject('SpamHelper');
+ /* @var $spam_helper SpamHelper */
+
+ $object =& $event->getObject();
+
+ $config_mapping = $this->Application->getUnitOption($event->Prefix, 'ConfigMapping');
+ $comment_settings = $config_mapping['CommentDelayValue'].':'.$config_mapping['CommentDelayInterval'];
+ $spam_helper->InitHelper($object->GetDBField('PollId'), 'PollComment', $comment_settings);
+ $spam_helper->AddToSpamControl();
+ }
+ }
+
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/poll_comments/poll_comments_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/poll_comments/poll_comments_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/poll_comments/poll_comments_config.php (revision 12744)
@@ -0,0 +1,114 @@
+ 'poll-comment',
+
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array ('class' => 'PollCommentEventHandler', 'file' => 'poll_comment_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event'
+ ),
+ 'IDField' => 'CommentId',
+ 'TableName' => TABLE_PREFIX . 'PollsComments',
+
+ 'ParentPrefix' => 'poll',
+ 'ForeignKey' => 'PollId',
+ 'ParentTableKey' => 'PollId',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'StatusField' => Array('Status'),
+
+ // key - special, value - list select sql
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById',
+ ),
+
+ 'ItemSQLs' => Array ('' => 'SELECT * FROM %s'),
+
+ 'ListSortings' => Array (
+ '' => Array(
+ 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('CreatedOn' => 'desc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'CommentId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'PollId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'AnswerId' => Array ('type' => 'int', 'default' => NULL),
+ 'CreatedById' => Array ('type' => 'int', 'formatter'=>'kLEFTFormatter',
+ 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'),
+ 'options' => Array(-1 => 'root', -2 => 'Guest'),
+ 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'',
+ 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login',
+ 'required' => 1, 'not_null' => 1, 'default' => -2),
+ 'GuestName' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'GuestEmail' => Array('type' => 'string', 'max_len' => 255, 'formatter'=>'kFormatter', 'regexp'=>'/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i', 'sample_value' => 'email@domain.com', 'not_null' => '1', 'default' => '', 'error_msgs' => Array('invalid_format'=>'!la_invalid_email!', 'unique'=>'!lu_email_already_exist!'),'required' => 0 ),
+ 'CommentBody' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => NULL, 'required' => 1),
+ 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'),
+ 'UserIP' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Active', 0 => 'la_opt_Disabled', 2 => 'la_opt_Pending'), 'use_phrases' => 1, 'required' => 1, 'not_null' => 1, 'default' => 1),
+ ),
+
+ 'VirtualFields' => Array (
+ 'CommentedByUser' => Array('type' => 'string', 'default' => ''),
+ 'CommentedByEmail' => Array ('type' => 'string', 'default' => ''),
+ ),
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'CommentedByUser' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
+ ),
+ ),
+
+ 'ConfigMapping' => Array (
+ 'PerPage' => 'poll_Perpage_Comments',
+ 'CommentDelayInterval' => 'poll_CommentDelay_Value',
+ 'CommentDelayValue' => 'poll_CommentDelay_Interval',
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 0 => 'icon16_disabled.png',
+ 1 => 'icon16_item.png',
+ 2 => 'icon16_pending.png',
+ 'module' => 'core',
+ ),
+ 'Fields' => Array (
+ 'CommentId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
+ 'CommentBody' => Array ('title' => 'la_col_PollComment', 'data_block' => 'grid_priority_td', 'filter_block' => 'grid_like_filter', 'width' => 250, ),
+
+ 'CommentedByUser' => Array( 'title'=>'la_col_CommentedByUser', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
+
+ 'CreatedOn' => Array ('title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
+ ),
+ ),
+ ),
+
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/private_message_body/private_message_body_eh.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/private_message_body/private_message_body_eh.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/private_message_body/private_message_body_eh.php (revision 12744)
@@ -0,0 +1,56 @@
+getObject();
+ /* @var $object kDBItem */
+
+ // set post options
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $options_map = $post_helper->getOptionsMap();
+ $post_options = $object->GetDBField('Options');
+ foreach ($options_map as $option_name => $field_name) {
+ $option_value = $object->GetDBField($field_name);
+ $post_helper->SetPostOption($option_name, $option_value, $post_options);
+ }
+ $object->SetDBField('Options', $post_options);
+ }
+
+ /**
+ * Deletes message body only when no message is using it
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ if ($object->GetDBField('ReferenceCount') > 0) {
+ $event->status = erFAIL;
+ }
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/private_message_body/private_message_body_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/private_message_body/private_message_body_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/private_message_body/private_message_body_config.php (revision 12744)
@@ -0,0 +1,59 @@
+ 'private-message-body',
+ 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'PrivateMessageBodyEventHandler', 'file' => 'private_message_body_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ ),
+
+ 'IDField' => 'PMBodyId',
+
+ 'TitleField' => 'Subject',
+
+ 'TableName' => TABLE_PREFIX.'PrivateMessageBody',
+
+ 'ForeignKey' => 'PMBodyId',
+ 'ParentTableKey' => 'PMBodyId',
+ 'ParentPrefix' => 'private-message',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'ListSQLs' => Array ('' => ' SELECT %1$s.* %2$s FROM %1$s',),
+ 'ItemSQLs' => Array ('' => ' SELECT %1$s.* %2$s FROM %1$s',),
+
+ 'Fields' => Array (
+ 'PMBodyId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Subject' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'Body' => Array ('type' => 'string', 'default' => NULL),
+ 'Options' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'ReferenceCount' => Array ('type' => 'int', 'not_null' => 1, 'default' => 2),
+ ),
+
+ 'VirtualFields' => Array (
+ 'DisableBBCodes' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'DisableSmileys' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'ShowSignatures' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 1),
+ ),
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/censorship/censorship_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/censorship/censorship_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/censorship/censorship_config.php (revision 12744)
@@ -0,0 +1,95 @@
+ 'censorship',
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array ('class' => 'kDBEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'IDField' => 'CensorshipId',
+
+ 'TableName' => TABLE_PREFIX.'Censorship',
+
+ 'TitleField' => 'BadWord',
+
+ 'TitlePresets' => Array (
+ 'default' => Array (
+ 'new_status_labels' => Array ('censorship' => '!la_title_AddingCensorship!'),
+ 'edit_status_labels' => Array ('censorship' => '!la_title_EditingCensorship!'),
+ ),
+
+ 'censorship_list' => Array ('prefixes' => Array ('censorship_List'), 'format' => "!la_tab_ConfigCensorship!"),
+ 'censorship_edit' => Array ('prefixes' => Array ('censorship'), 'format' => "#censorship_status# '#censorship_titlefield#'"),
+ ),
+
+ 'PermSection' => Array('main' => 'in-bulletin:configuration_censorship'),
+
+ 'Sections' => Array (
+ 'in-bulletin:configuration_censorship' => Array (
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'conf_censorship',
+ 'label' => 'la_tab_ConfigCensorship',
+ 'url' => Array('t' => 'in-bulletin/censorship/censorship_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+ ),
+
+
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s FROM %1$s',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array (
+ 'Sorting' => Array ('BadWord' => 'asc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'CensorshipId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'BadWord' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'Replacement' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'required' => 1, 'default' => ''),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 0 => 'icon16_disabled.png',
+ 1 => 'icon16_item.png',
+ 'module' => 'core',
+ ),
+ 'Fields' => Array (
+ 'CensorshipId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50),
+ 'BadWord' => Array ('title' => 'la_col_BadWord', 'filter_block' => 'grid_like_filter', 'width' => 250),
+ 'Replacement' => Array ('title' => 'la_col_Replacement', 'filter_block' => 'grid_like_filter', 'width' => 250),
+ ),
+ ),
+ ),
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/helpers/helpers_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/helpers/helpers_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/helpers/helpers_config.php (revision 12744)
@@ -0,0 +1,24 @@
+ 'in-bulletin-helpers',
+ 'EventHandlerClass' => Array('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
+
+ 'RegisterClasses' => Array (
+ Array('pseudo' => 'PostHelper', 'class' => 'PostHelper','file' => 'post_helper.php', 'build_event' => '', 'require_classes' => Array('kHelper')),
+ ),
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/helpers/post_helper.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/helpers/post_helper.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/helpers/post_helper.php (revision 12744)
@@ -0,0 +1,418 @@
+ 128,
+ 'disable_bbcode' => 64,
+ 'disable_smileys' => 32,
+ );
+
+ /**
+ * Checks if specific option is set for post
+ *
+ * @param string $option_name
+ * @param Array $options
+ * @return bool
+ */
+ function GetPostOption($option_name, $options)
+ {
+ if (!isset($this->postOptionBits[$option_name])) {
+ return false;
+ }
+
+ $option_bit = $this->postOptionBits[$option_name];
+ return ($options & $option_bit) == $option_bit;
+ }
+
+ /**
+ * Sets given option bit (by name) to post options
+ *
+ * @param string $option_name
+ * @param int $option_value
+ * @param Array $options
+ * @return bool
+ */
+ function SetPostOption($option_name, $option_value, &$options)
+ {
+ if (!isset($this->postOptionBits[$option_name])) {
+ return false;
+ }
+
+ $option_bit = $this->postOptionBits[$option_name];
+ if ($option_value) {
+ $options |= $option_bit;
+ }
+ else {
+ $options = $options &~ $option_bit;
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns post options map to virtual field names
+ *
+ * @return Array
+ */
+ function getOptionsMap()
+ {
+ $options_map = Array (
+ 'show_sig' => 'ShowSignatures',
+ 'disable_smileys' => 'DisableSmileys',
+ 'disable_bbcode' => 'DisableBBCodes',
+ );
+
+ return $options_map;
+ }
+
+ /**
+ * @return void
+ * @param int $date
+ * @desc Set any field to category & all it's parent categories
+ */
+ function PropagateCategoryField($category_id, $field_name, $field_value)
+ {
+ $id_field = $this->Application->getUnitOption('c', 'IDField');
+ $table_name = $this->Application->getUnitOption('c', 'TableName');
+
+ $sql = 'SELECT ParentPath
+ FROM '.$table_name.'
+ WHERE '.$id_field.' = '.$category_id;
+ $parent_path = $this->Conn->GetOne($sql);
+
+ $parent_categories = explode('|', substr($parent_path, 1, -1));
+ if (!$parent_categories) {
+ return false;
+ }
+
+ $fields_hash = Array (
+ $field_name => $field_value,
+ );
+
+ $this->Conn->doUpdate($fields_hash, $table_name, $id_field.' IN ('.implode(',', $parent_categories).')');
+ }
+
+ /**
+ * Sets today posts count & today date for topic
+ *
+ * @param kCatDBItem $object
+ * @param int $increment_by
+ */
+ function updateTodayPostsCount(&$object, $post_date, $increment_by = 1)
+ {
+ $date_now = adodb_date('Y-m-d');
+
+ if (adodb_date('Y-m-d', $post_date) != $date_now) {
+ return ;
+ }
+
+ // last post update date was today or not
+ $today_posts = ($date_now == $object->GetDBField('TodayDate')) ? $object->GetDBField('TodayPosts') : 0;
+
+ $object->SetDBField('TodayDate', $date_now);
+ $object->SetDBField('TodayPosts', $today_posts + $increment_by);
+
+ return $object->Update();
+ }
+
+ function updatePostCount($topic_id, $increment = 1)
+ {
+ $id_field = $this->Application->getUnitOption('bb', 'IDField');
+ $table_name = $this->Application->getUnitOption('bb', 'TableName');
+
+ // helps in case, when 2 (or more) users tries to post in same topic at same time
+ $sql = 'UPDATE '.$table_name.'
+ SET Posts = Posts '.($increment > 0 ? '+' : '-').' '.abs($increment).'
+ WHERE '.$id_field.' = '.$topic_id;
+ $this->Conn->Query($sql);
+
+ // returns new value
+ $sql = 'SELECT Posts
+ FROM '.$table_name.'
+ WHERE '.$id_field.' = '.$topic_id;
+ return $this->Conn->GetOne($sql);
+ }
+ /**
+ * Replaces all special formatting in post before displaing it to user
+ *
+ * @param string $post_body
+ * @param int $post_options bit array of post options
+ * @param Array $sub_blocks block names for rendering smileys & bbcodes
+ * @return string
+ */
+ function parsePostBody($post_body, $post_options, $sub_blocks)
+ {
+ // 1. escape all html sequences
+ $post_body = htmlspecialchars($post_body, ENT_NOQUOTES); // don't touch quotes in bbcode attribute values
+
+ // 2. replace censored words
+ $post_body = $this->CensorText($post_body);
+
+ // 3. replace bb codes
+ if (!$this->GetPostOption('disable_bbcode', $post_options)) {
+ $post_body = $this->replaceBBCodes($post_body, $sub_blocks['bbcode']);
+ }
+
+ // 4. replace smileys
+ if (!$this->GetPostOption('disable_smileys', $post_options)) {
+ $post_body = $this->replaceSmileys($post_body, $sub_blocks['smileys']);
+ }
+
+ // 5. add enters (because we don't use HTML in post body)
+ $post_body = nl2br($post_body);
+
+ // 6. replace quoted text
+ return $this->replacePostQuote($post_body, $sub_blocks['quote']);
+ }
+
+ function replacePostQuote($text, $render_as)
+ {
+ if (preg_match('/\[quote id=([\d]+)\](.*)\[\/quote\]/s', $text, $regs)) {
+ $post =& $this->Application->recallObject('bb-post.-item', null, Array ('skip_autoload' => true));
+ /* @var $post kDBItem */
+
+ $post->Load($regs[1]);
+
+ $block_params = Array ('name' => $render_as, 'PrefixSpecial' => 'bb-post.-item', 'Prefix' => 'bb-post', 'Special' => '-item', 'strip_nl' => 2);
+ $parsed_quote = $this->Application->ParseBlock($block_params);
+ return str_replace($regs[0], $parsed_quote, $text);
+ }
+
+ return $text;
+ }
+
+ /**
+ * Replaces bad words with good words (censorship process)
+ *
+ * @param string $text
+ * @return string
+ */
+ function CensorText($text)
+ {
+ static $censor_words = null;
+
+ if (!isset($censor_words)) {
+ $sql = 'SELECT Replacement, BadWord
+ FROM '.TABLE_PREFIX.'Censorship';
+ $censor_words = $this->Conn->GetCol($sql, 'BadWord');
+ }
+
+ foreach ($censor_words as $replace_from => $replace_to) {
+ $text = str_replace($replace_from, $replace_to, $text);
+ }
+
+ return $text;
+ }
+
+ function replaceSmileys($text, $smiley_element)
+ {
+ static $smileys = null;
+
+ if (!isset($smileys)) {
+ $sql = 'SELECT em.EmotionImage, em.KeyStroke
+ FROM '.TABLE_PREFIX.'Emoticon em
+ WHERE em.Enabled = 1
+ ORDER BY CHAR_LENGTH(em.KeyStroke) DESC';
+ $smileys = $this->Conn->GetCol($sql, 'KeyStroke');
+ }
+
+ $block_params = Array ('name' => $smiley_element, 'smiley_url' => '#SMILEY_URL#');
+ $smiley_mask = trim($this->Application->ParseBlock($block_params));
+
+ $base_url = rtrim($this->Application->BaseURL(),'/');
+ foreach ($smileys as $key_stoke => $image_url) {
+ if (strpos($text, $key_stoke) === false) {
+ continue;
+ }
+
+ $smiley_html = str_replace('#SMILEY_URL#', $base_url.SMILEYS_PATH.$image_url, $smiley_mask);
+ $text = str_replace($key_stoke, $smiley_html, $text);
+ }
+
+ return $text;
+ }
+
+ /**
+ * Sort params by name and then by length
+ *
+ * @param string $a
+ * @param string $b
+ * @return int
+ * @access private
+ */
+ function CmpParams($a, $b)
+ {
+ list ($a, ) = explode(':', $a);
+ list ($b, ) = explode(':', $b);
+
+ $a_len = strlen($a);
+ $b_len = strlen($b);
+ if ($a_len == $b_len) return 0;
+ return $a_len > $b_len ? -1 : 1;
+ }
+
+ function replaceBBCodes($text, $bbcode_element)
+ {
+ // convert phpbb bbcodes to in-bulletin bbcodes
+ $text = $this->preformatBBCodes($text);
+
+ $tags_defs = explode(';', $this->Application->ConfigValue('BBTags')); // 'b:;i:;u:;ul:type|align;font:color|face|size;url:href;img:src|border';
+
+ usort($tags_defs, Array (&$this, 'CmpParams'));
+
+ foreach($tags_defs as $tag) {
+ list ($tag_name, $tag_params) = explode(':', $tag);
+ $tag_params = $tag_params ? array_flip(explode('|', $tag_params)) : 0;
+
+ $text = preg_replace('/\['.$tag_name.'(.*)\](.*)\[\/'.$tag_name.' *\]/Uise','$this->checkBBCodeAttribs("'.$tag_name.'",\'$1\',\'$2\',$tag_params);', $text);
+ }
+
+ // additional processing for [url], [*], [img] bbcode
+ $text = preg_replace('/(.*)<\/url>/Usi','$1 ',$text);
+ $text = preg_replace('/(.*)<\/font>/Usi','$1',$text); // skip empty fonts
+ $text = str_replace( Array('','[*]'),
+ Array('',''),
+ $text);
+
+ // bbcode [code]xxx[/code] processing
+ $text = preg_replace('/\[code\](.*)\[\/code\]/Uise', "\$this->replaceCodeBBCode('$1', '".$bbcode_element."')", $text);
+ return $text;
+ }
+
+ /**
+ * Convert phpbb url bbcode to valid in-bulletin's format
+ *
+ * @param string $text
+ * @return string
+ */
+ function preformatBBCodes($text)
+ {
+ // 1. urls
+ $text = preg_replace('/\[url=(.*)\](.*)\[\/url\]/Ui','[url href="$1"]$2[/url]',$text);
+ $text = preg_replace('/\[url\](.*)\[\/url\]/Ui','[url href="$1"]$1[/url]',$text);
+
+ // 2. images
+ $text = preg_replace('/\[img\](.*)\[\/img\]/Ui','[img src="$1" border="0"][/img]',$text);
+
+ // 3. color
+ $text = preg_replace('/\[color=(.*)\](.*)\[\/color\]/Ui','[font color="$1"]$2[/font]',$text);
+
+ // 4. size
+ $text = preg_replace('/\[size=(.*)\](.*)\[\/size\]/Ui','[font size="$1"]$2[/font]',$text);
+
+ // 5. lists
+ $text = preg_replace('/\[list(.*)\](.*)\[\/list\]/Uis','[ul]$2[/ul]',$text);
+
+ // 6. email to link
+ $text = preg_replace('/\[email\](.*)\[\/email\]/Ui','[url href="mailto:$1"]$1[/url]',$text);
+
+ //7. b tag
+ $text = preg_replace('/\[(b|i|u):(.*)\](.*)\[\/(b|i|u):(.*)\]/Ui','[$1]$3[/$4]',$text);
+
+ //8. code tag
+ $text = preg_replace('/\[code:(.*)\](.*)\[\/code:(.*)\]/Uis','[code]$2[/code]',$text);
+
+ return $text;
+ }
+
+ /**
+ * Removes not allowed params from tag and returns result
+ *
+ * @param string $BBCode bbcode to check
+ * @param string $TagParams params string entered by user
+ * @param string $TextInside text between opening and closing bbcode tag
+ * @param string $ParamsAllowed list of allowed parameter names ("|" separated)
+ * @return string
+ */
+ function checkBBCodeAttribs($BBCode, $TagParams, $TextInside, $ParamsAllowed)
+ {
+ // unescape escaped quotes in tag
+ $TagParams = str_replace('\"', '"', $TagParams);
+ $TextInside = str_replace('\"', '"', $TextInside);
+
+ $params_extracted = preg_match_all('/ +([^=]*)=["\']?([^ "\']*)["\']?/is', $TagParams, $extracted_params, PREG_SET_ORDER);
+
+ if ($ParamsAllowed && $params_extracted) {
+ $ret = Array();
+ foreach ($extracted_params as $param) {
+ $param_name = strtolower(trim( $param[1] ));
+ $param_value = trim($param[2]);
+
+ // 1. prevent hacking
+ if ($BBCode == 'url' && $param_name == 'href') {
+ if (strpos(strtolower($param_value), 'script:') !== false) {
+ // script tag found in "href" parameter of "url" bbcode (equals to hacking) -> remove bbcode
+ return $TextInside;
+ }
+ }
+
+ // 2. leave only allowed params & remove all not allowed
+ if (isset($ParamsAllowed[$param_name])) {
+ $ret[] = $param_name.'="'.$param_value.'"';
+ }
+ }
+
+ $ret = count($ret) ? ' '.implode(' ', $ret) : '';
+ return '<'.$BBCode.$ret.'>'.$TextInside.''.$BBCode.'>';
+ }
+
+ return '<'.$BBCode.'>'.$TextInside.''.$BBCode.'>';
+ }
+
+ function highlightCode($code, $strip_tabs = 0)
+ {
+ if ($strip_tabs) {
+ $code = preg_replace('/(\t){'.$strip_tabs.'}(.*)/', '\\2', $code);
+ }
+
+ $code = str_replace( Array('\\', '/') , Array('_no_match_string_', '_n_m_s_'), $code);
+ $code = highlight_string('', true);
+ $code = str_replace( Array('_no_match_string_', '_n_m_s_'), Array('\\', '/'), $code);
+ $code = preg_replace('/<\?(.*)php(.*)\?>/Us', '\\2', $code);
+
+ $code = preg_replace('/([\r\n]+)/si', '', $code);
+ $code = preg_replace('/([\r\n]+)<\/font>([\r\n]+)<\/code>/si', '
', $code);
+
+ return $code;
+ }
+
+ /**
+ * Replaces [code]php code[/code] bbcode in post
+ *
+ * @param string $input_string code line to highlight
+ * @param string $bbcode_element block name used for bbcode descoration
+ * @return string
+ */
+ function replaceCodeBBCode($input_string, $bbcode_element)
+ {
+ static $bbcode_mask = null;
+
+ if (!isset($bbcode_mask)) {
+ $block_params = Array ('name' => $bbcode_element, 'bb_code' => '#BB_CODE#');
+ $bbcode_mask = trim($this->Application->ParseBlock($block_params));
+ }
+
+ $input_string = trim( str_replace('\"','"', unhtmlentities($input_string)) );
+ $input_string = $this->highlightCode($input_string);
+ $input_string = preg_replace("/\r /s", "\r", $input_string); // undo nl2br added in highlighting
+ $input_string = str_replace('#BB_CODE#', $input_string, $bbcode_mask);
+
+ return $input_string;
+ }
+
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/polls/poll_eh.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/polls/poll_eh.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/polls/poll_eh.php (revision 12744)
@@ -0,0 +1,154 @@
+ Array('self' => 'edit'),
+ 'OnMakeVote' => Array('self' => true),
+ 'OnItemBuild' => Array('self' => true),
+ );
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Applies special filter, that allows to select all poll from given date range
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ if ($this->Application->isAdminUser) {
+ return ;
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ $object->addFilter('poll_range_filter', '(%1$s.StartDate <= ' .adodb_mktime(). ') AND (%1$s.EndDate >= ' .adodb_mktime(). ' OR EndDate IS NULL)');
+ $object->addFilter('poll_status', '(%1$s.Status = ' .STATUS_ACTIVE. ')');
+ }
+
+ /**
+ * Reset votes statistics for current poll
+ *
+ * @param kEvent $event
+ */
+ function OnResetVotes(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $sql = 'DELETE FROM '.TABLE_PREFIX.'PollsStatistics
+ WHERE '.$object->IDField.' = '.$object->GetID();
+ $this->Conn->Query($sql);
+
+
+ $poll_answers_table = $this->Application->getUnitOption('poll-answer', 'TableName');
+ $poll_answers_table = $this->Application->GetTempName($poll_answers_table);
+
+ $sql = 'UPDATE '.$poll_answers_table.' SET VotesQty = 0
+ WHERE '.$object->IDField.' = '.$object->GetID();
+ $this->Conn->Query($sql);
+ }
+
+ /**
+ * Reset votes statistics for current poll
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $object->SetDBField('ResourceId', $this->Application->NextResourceId());
+ }
+
+ /**
+ * Make vote to current poll
+ *
+ * @param kEvent $event
+ */
+ function OnMakeVote(&$event)
+ {
+ $object =& $event->getObject($this->Application->GetVar('poll_id'));
+ /* @var $object kDBItem */
+
+ $poll_answer_id = $this->Application->GetVar('option_id');
+
+ if (!$poll_answer_id) {
+ $event->redirect = false;
+ return ;
+ }
+
+ $ip_address = $_SERVER['REMOTE_ADDR'];
+
+ if (!$object->GetDBField('AllowMultipleVotings')) {
+ $sql = 'SELECT StatisticsId
+ FROM '.TABLE_PREFIX.'PollsStatistics
+ WHERE PollId = '.$object->GetID().' AND UserIP = '.$this->Conn->qstr($ip_address);
+ $voted = $this->Conn->GetOne($sql) > 0;
+ }
+
+ if (!$voted) {
+ $user_id = $this->Application->LoggedIn()? $this->Application->RecallVar('user_id') : '-2';
+ $fields_hash = Array (
+ 'PollId' => $object->GetID(),
+ 'AnswerId' => $poll_answer_id,
+ 'UserIP' => $ip_address,
+ 'CreatedById' => $user_id,
+ 'AnswerDate' => adodb_mktime(),
+ );
+
+ $this->Conn->doInsert($fields_hash, TABLE_PREFIX.'PollsStatistics');
+
+ $poll_table = $this->Application->getUnitOption('poll', 'TableName');
+ $this->Conn->Query('UPDATE '.$poll_table.' SET CachedVotesQty = CachedVotesQty + 1
+ WHERE PollId = '.$object->GetID());
+
+ // update table with answers
+ $poll_answers_table = $this->Application->getUnitOption('poll-answer', 'TableName');
+ $this->Conn->Query('UPDATE '.$poll_answers_table.' SET VotesQty = VotesQty + 1
+ WHERE PollId = '.$object->GetID().' AND AnswerId = '.$poll_answer_id);
+ }
+ $event->setEventParam('PollId', $this->Application->GetVar('poll_id'));
+ $event->redirect = false;
+ }
+
+
+ /**
+ * Cleanup by removing items from PollStatistics before Poll is deleted
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $sql = 'DELETE FROM '.TABLE_PREFIX.'PollsStatistics
+ WHERE PollId = '.$object->GetID();
+ $this->Conn->Query($sql);
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/polls/poll_tp.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/polls/poll_tp.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/polls/poll_tp.php (revision 12744)
@@ -0,0 +1,118 @@
+getObject($params);
+ /* @var $object kDBItem */
+
+ if (!$object->GetDBField('AllowMultipleVotings')) {
+ $sql = 'SELECT StatisticsId
+ FROM '.TABLE_PREFIX.'PollsStatistics
+ WHERE PollId = '.$object->GetID().' AND CreatedById = '.$this->Application->RecallVar('user_id').' AND UserIP = '.$this->Conn->qstr(getenv('REMOTE_ADDR'));
+ return $this->Conn->GetOne($sql) > 0;
+ }
+
+ return false;
+ }
+
+ /**
+ * Allows to tell if user from current ip has voted already for current poll
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function HasCommented($params)
+ {
+ $object =& $this->getObject($params);
+ /* @var $object kDBItem */
+
+ $spam_helper =& $this->Application->recallObject('SpamHelper');
+ /* @var $spam_helper SpamHelper */
+
+ $spam_helper->InitHelper($object->GetID(), 'PollComment', 0); // PollId used for SpamControl only
+ return $spam_helper->InSpamControl();
+ }
+
+ /**
+ * Prints out only filled in answers of current poll
+ *
+ * @param Array $params
+ * @return string
+ */
+ function PrintPoll($params)
+ {
+ $object =& $this->getObject($params);
+
+ $sql = 'SELECT COUNT(AnswerNum), AnswerNum
+ FROM '.TABLE_PREFIX.'PollsStatistics
+ WHERE PollId = '.$object->GetID().'
+ GROUP BY AnswerNum';
+ $statistics = $this->Conn->GetCol($sql, 'AnswerNum');
+
+ $total_votes = array_sum($statistics);
+
+ $block_params = $this->prepareTagParams($params);
+ $block_params['name'] = $params['render_as'];
+
+ $i = 1;
+ $ret = '';
+ while ($i < 8) {
+ $answer = $object->GetDBField('Answer'.$i);
+ if ($answer) {
+ $answer_votes = isset($statistics[$i]) ? $statistics[$i] : 0;
+ if ($total_votes > 0) {
+ $block_params['percent'] = round((100 * $answer_votes) / $total_votes, 0);
+ }
+ else {
+ $block_params['percent'] = 0;
+ }
+
+ $block_params['answer'] = $answer;
+ $block_params['answer_num'] = $i;
+
+ $ret .= $this->Application->ParseBlock($block_params);
+ }
+ $i++;
+ }
+
+ return $ret;
+ }
+
+ /**
+ * Prints link to comments of of current poll
+ *
+ * @param Array $params
+ * @return string
+ */
+ function CommentsLink($params)
+ {
+ $object =& $this->getObject($params);
+
+ $params['pass'] = 'm,poll';
+ $params['poll_id'] = $object->GetID();
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/polls/polls_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/polls/polls_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/polls/polls_config.php (revision 12744)
@@ -0,0 +1,167 @@
+ 'poll',
+ 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'PollEventHandler', 'file' => 'poll_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'PollTagProcessor', 'file' => 'poll_tp.php', 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'IDField' => 'PollId',
+
+ 'TitleField' => 'Name',
+ 'StatusField' => Array('Status'),
+
+
+ 'TitlePresets' => Array(
+ 'default' => Array(
+ 'new_status_labels' => Array('poll' => '!la_title_Adding_Poll!'),
+ 'edit_status_labels' => Array('poll' => '!la_title_Editing_Poll!'),
+ 'new_titlefield' => Array('poll' => '!la_title_NewPoll!'),
+ ),
+
+ 'poll_list' => Array('prefixes' => Array('poll_List'), 'format' => "!la_title_Polls!", ),
+ 'poll_edit' => Array('prefixes' => Array('poll'), 'format' => "#poll_status# '#poll_titlefield#' - !la_title_General!", ),
+ 'poll_edit_answers' => Array ('prefixes' => Array ('poll', 'poll-answer_List'), 'format' => "#poll_status# '#poll_titlefield#' - !la_title_PollAnswers!"),
+
+ 'poll_edit_comments' => Array ('prefixes' => Array ('poll', 'poll-comment_List'), 'format' => "#poll_status# '#poll_titlefield#' - !la_title_PollComments!"),
+
+
+ 'answer_edit' => Array (
+ 'prefixes' => Array ('poll', 'poll-answer'),
+ 'new_status_labels' => Array ('poll-answer' => '!la_title_Adding_Answer!'),
+ 'edit_status_labels' => Array ('poll-answer' => '!la_title_Editing_Answer!'),
+ 'new_titlefield' => Array ('poll-answer' => '!la_title_New_Answer!'),
+ 'format' => "#poll_status# '#poll_titlefield#' - #poll-answer_status# '#poll-answer_titlefield#'"
+ ),
+
+ 'comment_edit' => Array (
+ 'prefixes' => Array ('poll', 'poll-comment'),
+ 'new_status_labels' => Array ('poll-comment' => '!la_title_Adding_Comment!'),
+ 'edit_status_labels' => Array ('poll-comment' => '!la_title_Editing_Comment!'),
+ 'new_titlefield' => Array ('poll-comment' => '!la_title_NewComment!'),
+ 'format' => "#poll_status# '#poll_titlefield#' - #poll-comment_status#",
+ ),
+
+ ),
+
+ 'PermSection' => Array('main' => 'in-bulletin:polls'),
+
+ 'Sections' => Array (
+ 'in-bulletin:polls' => Array (
+ 'parent' => 'in-portal:site',
+ 'icon' => 'polls',
+ 'label' => 'la_title_Polls',
+ 'url' => Array('t' => 'in-bulletin/polls/poll_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 3.6,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'Polls',
+
+ 'ListSQLs' => Array('' => 'SELECT %1$s.* %2$s
+ FROM %1$s',
+
+ ),
+
+ 'ItemSQLs' => Array('' => 'SELECT %1$s.* %2$s
+ FROM %1$s',
+
+ ),
+
+ 'ListSortings' => Array(
+ '' => Array (
+ 'Sorting' => Array('PollId' => 'asc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'PollId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,),
+ 'Name' => Array('type' => 'string', 'not_null' => '1','default' => '', 'required'=> 1, 'max_len' => 255),
+ 'Question' => Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'using_fck' => 1, 'default' => null, 'required' => 1),
+ 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'),
+ 'StartDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'),
+ 'EndDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null),
+ 'Image' => Array (
+ 'type' => 'string',
+ 'formatter' => 'kPictureFormatter',
+ 'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => IMAGES_PATH . 'polls/',
+ 'file_types' => '*.jpg;*.gif;*.png', 'files_description' => '!la_hint_ImageFiles!',
+ 'multiple' => false,
+ 'max_len' => 255, 'not_null' => 1, 'default' => ''
+ ),
+ 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'RequireLogin' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,),
+ 'AllowComments' => Array('type' => 'int', 'not_null' => 1, 'default' => 1,),
+ 'AllowMultipleVotings' => Array('type' => 'int', 'not_null' => 1, 'default' => 1,),
+ 'CachedVotesQty'=> Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Active', 0 => 'la_opt_Disabled'), 'use_phrases' => 1, 'required' => 1, 'not_null' => 1, 'default' => 1),
+
+ ),
+
+ 'SubItems' => Array ('poll-answer', 'poll-comment'),
+
+ 'VirtualFields' => Array (
+// 'PollId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,),
+ ),
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+// 'DaysLeft' => 'IF( ISNULL(%1$s.EndDate), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, %1$s.PosterAlias, \'n/a\')), \'Never\' )',
+ ),
+ ),
+
+ 'EditTabPresets' => Array (
+ 'Default' => Array (
+ Array ('title' => 'la_tab_General', 't' => 'in-bulletin/polls/poll_edit', 'priority' => 1),
+ Array ('title' => 'la_tab_PollAnswers', 't' => 'in-bulletin/polls/poll_edit_answers', 'priority' => 2),
+ Array ('title' => 'la_tab_PollUserComments', 't' => 'in-bulletin/polls/poll_edit_comments', 'priority' => 3),
+ ),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 0 => 'icon16_disabled.png',
+ 1 => 'icon16_item.png',
+ 2 => 'icon16_pending.png',
+ 'module' => 'core',
+ ),
+ 'Fields' => Array (
+ 'PollId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
+ 'Name' => Array ('title' => 'la_col_Name', 'data_block' => 'grid_priority_td', 'filter_block' => 'grid_like_filter', 'width' => 200, ),
+ 'StartDate' => Array ('title' => 'la_col_StartDate', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'EndDate' => Array ('title' => 'la_col_EndDate', 'data_block' => 'poll_expire_td', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'CachedVotesQty' => Array ('title' => 'la_col_VoteCount', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
+ 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
+// 'DaysActive' => Array ('title' => 'la_col_NumberOfDaysActive', 'filter_block' => 'grid_range_filter',),
+ ),
+ ),
+ ),
+
+ );
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/topics/modify_post.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/topics/modify_post.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/topics/modify_post.tpl (revision 12744)
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+ elements/html_head
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/topics/search_results.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/topics/search_results.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/topics/search_results.tpl (revision 12744)
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ : | : 0
+
+
+ : 05/17/2006
+
+
+
+ img/s.gif" width="1" height="4" alt="" />
+ img/grey_pix.gif" width="100%" height="1" alt="" />
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/topics/new_topic_reply.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/topics/new_topic_reply.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/topics/new_topic_reply.tpl (revision 12744)
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/topics/modify_topic.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/topics/modify_topic.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/topics/modify_topic.tpl (revision 12744)
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/topics/modify_pending_confirm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/topics/modify_pending_confirm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/topics/modify_pending_confirm.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/topics/modify_confirm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/topics/modify_confirm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/topics/modify_confirm.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/topics/new_topic.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/topics/new_topic.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/topics/new_topic.tpl (revision 12744)
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/topics/add_pending_confirm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/topics/add_pending_confirm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/topics/add_pending_confirm.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/topics/add_confirm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/topics/add_confirm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/topics/add_confirm.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/module_info.xml
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/module_info.xml (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/module_info.xml (revision 12744)
@@ -0,0 +1,5 @@
+
+
+ in-bulletin/designs/section
+ in-bulletin/designs/post_list
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/designs/detail.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/designs/detail.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/designs/detail.tpl (revision 12744)
@@ -0,0 +1,154 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [ ]
+
+ - ( )
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="10" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/designs/.smsignore
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/designs/.smsignore (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/designs/.smsignore (revision 12744)
@@ -0,0 +1 @@
+.*\.tpl
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/designs/section.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/designs/section.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/designs/section.tpl (revision 12744)
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+ img/s.gif" width="1" height="4" alt="" />
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+ img/forums_new_post.gif" width="20" height="23" alt="" />
+
+
+
+
+
+ img/forums_no_new_post.gif" width="21" height="24" alt="" />
+
+
+
+
+
+ img/forums_locked.gif" width="25" height="23" alt="" />
+
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/my_account/private_messages/view_message.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/my_account/private_messages/view_message.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/my_account/private_messages/view_message.tpl (revision 12744)
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [ "> ]
+
+
+ [ " onclick="return confirm(' ');"> ]
+
+
+
+
+ :
+
+
+
+
+
+
+ :
+ :
+
+
+
+
+
+
+
+ [ "> ]
+
+
+ [ " onclick="return confirm(' ');"> ]
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/my_account/private_messages/private_messages.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/my_account/private_messages/private_messages.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/my_account/private_messages/private_messages.tpl (revision 12744)
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/my_account/private_messages/new_message.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/my_account/private_messages/new_message.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/my_account/private_messages/new_message.tpl (revision 12744)
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/my_account/private_messages/add_confirm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/my_account/private_messages/add_confirm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/my_account/private_messages/add_confirm.tpl (revision 12744)
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/my_account/my_preferences.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/my_account/my_preferences.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/my_account/my_preferences.tpl (revision 12744)
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/my_account/my_items.elm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/my_account/my_items.elm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/my_account/my_items.elm.tpl (revision 12744)
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/my_account/preferences_tab.elm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/my_account/preferences_tab.elm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/my_account/preferences_tab.elm.tpl (revision 12744)
@@ -0,0 +1 @@
+
Index: branches/RC/themes/default2009/in-bulletin/my_account/my_topics.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/my_account/my_topics.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/my_account/my_topics.tpl (revision 12744)
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/img/icon_post_1.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/toolbar/code_icon.png
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/toolbar/image_icon.png
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/toolbar/bold_icon.png
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/toolbar/italic_icon.png
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/toolbar/underline_icon.png
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/toolbar/link_icon.png
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/ic_pm_list46.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/ic_mytopics46.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/big_buttons/bottom_left_corner.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/big_buttons/bottom_right_corner.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/big_buttons/top_left_corner.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/big_buttons/left_border.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/big_buttons/icons/btn_modify.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/big_buttons/icons/btn_no_icon.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/big_buttons/icons/btn_rate.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/big_buttons/icons/btn_add_favorites.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/big_buttons/icons/btn_remove_favorites.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/big_buttons/icons/btn_reply.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/big_buttons/top_border.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/big_buttons/bottom_border.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/menu_topics.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/small_buttons/bottom_left_corner.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/small_buttons/bottom_right_corner.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/small_buttons/top_left_corner.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/small_buttons/icons/btn_sm_modify.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/small_buttons/icons/btn_sm_delete.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/small_buttons/icons/btn_threaded.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/small_buttons/icons/btn_sm_quoted.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/small_buttons/top_border.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/img/small_buttons/bottom_border.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/themes/default2009/in-bulletin/inc/styles.css
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/inc/styles.css (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/inc/styles.css (revision 12744)
@@ -0,0 +1,149 @@
+.bbcode {
+ border: 1px solid #888888;
+ background-color: #EEEEEE;
+ padding: 10px;
+}
+
+.forums-header TD
+ {
+ padding:6px;
+ color:#21619e;
+ }
+
+.forums-icon-cell
+ {
+ width:20px;
+ padding-right:10px;
+ vertical-align:top;
+ }
+
+.forums-subheaders
+ {
+ background:#f4f4f4;
+ font-weight:bold;
+ padding:5px 15px;
+ font-size:12px;
+ }
+
+
+.forums-subheaders A
+ {
+ color:#000000;
+ text-decoration: underline;
+ }
+
+.forums-subheaders A:hover
+ {
+ color: #666666;
+ text-decoration: underline;
+ }
+
+.forums-cells
+ {
+ vertical-align: middle;
+ padding:10px;
+ }
+
+.post-background-1
+ {
+ background:#f4f4f4;
+ padding:8px;
+ }
+
+.post-background-2
+ {
+ background:#FFFFFF;
+ padding:8px;
+ }
+
+.post-icon-padding-right
+ {
+ padding-right:10px;
+ }
+
+.topic-prewiew-padding-cell TD
+ {
+ padding: 13px;
+ }
+
+.post-control {
+ padding: 0px !important;
+ vertical-align: top;
+}
+
+
+.no-padding TD
+ {
+ padding:0px;
+ }
+
+
+.forums-icon-description TD
+ {
+ padding:10px;
+ vertical-align:middle;
+ }
+
+.topics-icon-padding
+ {
+ width:14px;
+ padding-right:10px;
+ }
+
+.new-private-message {
+ font-weight: bold;
+}
+
+
+
+.quoted-reply {
+ border: 1px dashed #333;
+}
+
+.quoted-reply td {
+ padding: 5px;
+}
+
+/* --- Topic Button Styles --- */
+.big-button-left-border {
+ background: #EFEFEF url(../img/big_buttons/left_border.gif) repeat-y top left;
+}
+
+.big-button-bottom td {
+ background: #EFEFEF url(../img/big_buttons/bottom_border.gif) repeat-x top left;
+}
+
+.big-button-text {
+ background: #EFEFEF url(../img/big_buttons/top_border.gif) repeat-x top left;
+ font: bold 11px Arial, sans-serif;
+ letter-spacing: 0px;
+ color: #1F569A;
+ padding-top: 14px;
+}
+
+.big-button-text a, .big-button-text a:hover {
+ text-decoration: none;
+}
+
+/* --- Post Button Styles --- */
+.small-button-bottom td {
+ background: #efefef url(../img/small_buttons/bottom_border.gif) repeat-x top left
+}
+
+.small-button-text {
+ background: url(../img/small_buttons/top_border.gif) repeat-x top left;
+ font: 10px Arial, sans-serif;
+ color: #153C6A;
+ padding-top: 15px;
+ vertical-align: bottom;
+ height: 27px;
+}
+
+.small-button-text a {
+ color: #153C6A;
+ text-decoration: none;
+}
+
+.small-button-text a:hover {
+ text-decoration: none;
+}
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/inc/script.js
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/inc/script.js (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/inc/script.js (revision 12744)
@@ -0,0 +1,79 @@
+// apply tagOpen/tagClose to selection in textarea,
+// use sampleText instead of selection if there is none
+function insertTags(tagOpen, tagClose, sampleText, textarea_id) {
+ var txtarea = document.getElementById(textarea_id);
+
+ var selText, isSample = false;
+
+ if (document.selection && document.selection.createRange) { // IE/Opera
+ //save window scroll position
+ if (document.documentElement && document.documentElement.scrollTop) {
+ var winScroll = document.documentElement.scrollTop;
+ }
+ else if (document.body) {
+ var winScroll = document.body.scrollTop;
+ }
+
+ //get current selection
+ txtarea.focus();
+ var range = document.selection.createRange();
+ selText = range.text;
+
+ //insert tags
+ checkSelectedText();
+ range.text = tagOpen + selText + tagClose;
+ //mark sample text as selected
+ if (isSample && range.moveStart) {
+ if (window.opera) {
+ tagClose = tagClose.replace(/\n/g,'');
+ }
+ range.moveStart('character', - tagClose.length - selText.length);
+ range.moveEnd('character', - tagClose.length);
+ }
+ range.select();
+
+ //restore window scroll position
+ if (document.documentElement && document.documentElement.scrollTop) {
+ document.documentElement.scrollTop = winScroll;
+ }
+ else if (document.body) {
+ document.body.scrollTop = winScroll;
+ }
+ } else if (txtarea.selectionStart || txtarea.selectionStart == '0') { // Mozilla
+ //save textarea scroll position
+ var textScroll = txtarea.scrollTop;
+
+ //get current selection
+ txtarea.focus();
+ var startPos = txtarea.selectionStart;
+ var endPos = txtarea.selectionEnd;
+ selText = txtarea.value.substring(startPos, endPos);
+
+ //insert tags
+ checkSelectedText();
+ txtarea.value = txtarea.value.substring(0, startPos)
+ + tagOpen + selText + tagClose
+ + txtarea.value.substring(endPos, txtarea.value.length);
+ //set new selection
+ if (isSample) {
+ txtarea.selectionStart = startPos + tagOpen.length;
+ txtarea.selectionEnd = startPos + tagOpen.length + selText.length;
+ } else {
+ txtarea.selectionStart = startPos + tagOpen.length + selText.length + tagClose.length;
+ txtarea.selectionEnd = txtarea.selectionStart;
+ }
+ //restore textarea scroll position
+ txtarea.scrollTop = textScroll;
+ }
+
+ function checkSelectedText(){
+ if (!selText) {
+ selText = sampleText;
+ isSample = true;
+ } else if (selText.charAt(selText.length - 1) == ' ') { //exclude ending space char
+ selText = selText.substring(0, selText.length - 1);
+ tagClose += ' '
+ }
+ }
+
+}
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/elements/topics.elm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/elements/topics.elm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/elements/topics.elm.tpl (revision 12744)
@@ -0,0 +1,143 @@
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+ img/topics_icon.gif" width="14" height="12" alt="" />
+
+
+
+
+
+
+ ">
+
+ img/icon_hot.gif" alt=" "/>
+ img/icon_new.gif" alt=" "/>
+ img/icon_popular.gif" alt=" "/>
+ img/icon_pick.gif" alt=" "/>
+ img/icon_favorite.gif" alt=" "/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ img/topics_icon.gif" width="14" height="12" alt="" />
+ " class="text-title">
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+ ">
+
+ img/icon_hot.gif" alt=" "/>
+ img/icon_new.gif" alt=" "/>
+ img/icon_popular.gif" alt=" "/>
+ img/icon_pick.gif" alt=" "/>
+ img/icon_favorite.gif" alt=" "/>
+
+
+
+ ( : )
+
+
+
+ :
+
+
+
+
+
+ img/ic_details.gif" width="14" height="13" alt="" /> ">
+
+
+
+
+ | img/ic_edit.gif" width="11" height="10" alt="" /> ">
+
+
+
+
+
+ | img/ic_delete.gif" width="11" height="10" alt="" /> " onclick="return confirm(' ');">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ img/big_buttons/top_left_corner.gif" width="11" height="16" alt="" />
+
+
+ ">
+
+
+ "> img/big_buttons/icons/ .gif" alt="">
+
+
+
+
+
+ img/big_buttons/bottom_left_corner.gif" width="11" height="10" alt="" />
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+ img/big_buttons/bottom_right_corner.gif" width="11" height="10" alt="" />
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/elements/html_head.elm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/elements/html_head.elm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/elements/html_head.elm.tpl (revision 12744)
@@ -0,0 +1,6 @@
+ inc/styles.css" type="text/css" />
+inc/script.js">
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/elements/private_messages.elm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/elements/private_messages.elm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/elements/private_messages.elm.tpl (revision 12744)
@@ -0,0 +1,106 @@
+
+ active-tab inactive-tab">
+ ">
+
+
+
+
+
+
+
+ ">
+
+
+
+
+
+
+
+
+
+
+
+ img/small_buttons/top_left_corner.gif" width="5" height="27" alt="" />
+
+
+ " >
+
+
+ "> img/small_buttons/icons/ .gif">
+
+
+
+
+ img/small_buttons/bottom_left_corner.gif" width="5" height="5" alt="" />
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+ img/small_buttons/bottom_right_corner.gif" width="5" height="5" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+ " />
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+ ">
+
+ ( )
+
+
+ ">
+
+ ( )
+
+
+
+
+ ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/elements/content_boxes/add_poll_comment.elm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/elements/content_boxes/add_poll_comment.elm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/elements/content_boxes/add_poll_comment.elm.tpl (revision 12744)
@@ -0,0 +1,48 @@
+
+
+
+ ">
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/elements/content_boxes/poll_comments.elm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/elements/content_boxes/poll_comments.elm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/elements/content_boxes/poll_comments.elm.tpl (revision 12744)
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
?height=640&width=480" title="
" class="thickbox">
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/elements/content_boxes/search_results.elm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/elements/content_boxes/search_results.elm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/elements/content_boxes/search_results.elm.tpl (revision 12744)
@@ -0,0 +1,53 @@
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+
+ : | : 0
+
+
+ : 05/17/2006
+
+
+
+ img/s.gif" width="1" height="4" alt="" />
+ img/grey_pix.gif" width="100%" height="1" alt="" />
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+ img/s.gif" width="1" height="5" alt="" />
+ "> ...
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/elements/content_boxes/related_items.elm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/elements/content_boxes/related_items.elm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/elements/content_boxes/related_items.elm.tpl (revision 12744)
@@ -0,0 +1,7 @@
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/elements/content_boxes/contact_user.elm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/elements/content_boxes/contact_user.elm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/elements/content_boxes/contact_user.elm.tpl (revision 12744)
@@ -0,0 +1,8 @@
+
+
+
+
+ ">
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/elements/content_boxes/category_topics.elm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/elements/content_boxes/category_topics.elm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/elements/content_boxes/category_topics.elm.tpl (revision 12744)
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/elements/content_boxes/my_favorites.elm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/elements/content_boxes/my_favorites.elm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/elements/content_boxes/my_favorites.elm.tpl (revision 12744)
@@ -0,0 +1,33 @@
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/elements/side_boxes/poll_results.elm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/elements/side_boxes/poll_results.elm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/elements/side_boxes/poll_results.elm.tpl (revision 12744)
@@ -0,0 +1,8 @@
+
+
+ –
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/elements/side_boxes/action_box.elm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/elements/side_boxes/action_box.elm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/elements/side_boxes/action_box.elm.tpl (revision 12744)
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ ">
+
+
+
+
+
+
+
+
+
+
Index: branches/RC/themes/default2009/in-bulletin/elements/side_boxes/polls.elm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/elements/side_boxes/polls.elm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/elements/side_boxes/polls.elm.tpl (revision 12744)
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+
+
+
+ " onclick="getElementById('selected_opt_ ').value=' ';" checked>
+
+
+
+
+
+
+
+
+
+
+ " class="thickbox" title=" ">
+ " border="0" alt=" ">
+
+
+
" style="text-align:left; margin-top:10px; margin-bottom:10px">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ " name="selected_opt_ "/>
+ , getElementById('selected_opt_ ').value); return false;" value=" "/>
+
+
+
+
+
+
+
+
+
+ " title=" " class="thickbox"/>
+
+
" title="
" class="thickbox"/>
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/elements/.smsignore
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/elements/.smsignore (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/elements/.smsignore (revision 12744)
@@ -0,0 +1 @@
+.*\.xml\.tpl
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/elements/forms.elm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/elements/forms.elm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/elements/forms.elm.tpl (revision 12744)
@@ -0,0 +1,32 @@
+
+ ">
+
+
+ '); return false;">
+ img/toolbar/bold_icon.png" border="0"/>
+
+ '); return false;">
+ img/toolbar/italic_icon.png" border="0"/>
+
+ '); return false;">
+ img/toolbar/underline_icon.png" border="0"/>
+
+ '); return false;">
+ img/toolbar/link_icon.png" border="0"/>
+
+ '); return false;">
+ img/toolbar/image_icon.png" border="0"/>
+
+ '); return false;">
+ img/toolbar/code_icon.png" border="0"/>
+
+
+
+
+
+
+ " name=" " id=" " cols=" " rows=" " style=" ">
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/elements/posts.elm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/elements/posts.elm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/elements/posts.elm.tpl (revision 12744)
@@ -0,0 +1,150 @@
+
+ " />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ img/small_buttons/top_left_corner.gif" width="5" height="27" alt="" />
+
+
+
+ " onclick="return confirm(' ');" >
+
+
+ " onclick="return confirm(' ');" > img/small_buttons/icons/ .gif">
+
+
+
+
+ img/small_buttons/bottom_left_corner.gif" width="5" height="5" alt="" />
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+ img/small_buttons/bottom_right_corner.gif" width="5" height="5" alt="" />
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+ " valign="top">
+
+
+
+ img/icon_post_1.gif" width="21" height="24" alt="" />
+
+
+
+ ">
+
+
+
+
+
+
+ :
+ :
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+ " valign="top">
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ------------------------------------------------------------------------------
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/RC/themes/default2009/in-bulletin/elements/categories.elm.tpl
===================================================================
diff -u
--- branches/RC/themes/default2009/in-bulletin/elements/categories.elm.tpl (revision 0)
+++ branches/RC/themes/default2009/in-bulletin/elements/categories.elm.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+ img/forums_dir.gif" width="20" height="24" alt="" />
+
+
+ ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: branches/5.0.x/in-bulletin/install/prerequisites.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/prerequisites.php (revision 0)
+++ branches/5.0.x/in-bulletin/install/prerequisites.php (revision 12744)
@@ -0,0 +1,80 @@
+_toolkit =& $instance;
+ }
+
+ /**
+ * Checks minimal version, that could be upgradeable
+ *
+ * @param string $mode when called mode {install, standalone, upgrade)
+ */
+ function CheckPrerequisites($versions, $mode)
+ {
+ $errors = Array ();
+
+ if ($mode == 'standalone') {
+ if (!$this->Application->isModuleEnabled('In-Portal')) {
+ $errors[] = 'Please install or enable "In-Portal" module first';
+ }
+ }
+
+ if ($mode == 'upgrade') {
+ $sql = 'SELECT Version
+ FROM ' . TABLE_PREFIX . 'Modules
+ WHERE Name = "In-Portal"';
+ $inportal_version = $this->Conn->GetOne($sql);
+
+ if ($inportal_version === false) {
+ // only, when In-Portal was installed
+ return $errors;
+ }
+
+ $min_version = '4.3.1';
+
+ $current_version = $this->_toolkit->ConvertModuleVersion($inportal_version);
+ $needed_version = $this->_toolkit->ConvertModuleVersion($min_version);
+ if ($current_version < $needed_version) {
+ $errors[] = 'Please upgrade "In-Portal" to version ' . $min_version;
+ }
+ }
+
+ return $errors;
+ }
+ }
+
+?>
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/install_data.sql
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/install_data.sql (revision 0)
+++ branches/5.0.x/in-bulletin/install/install_data.sql (revision 12744)
@@ -0,0 +1,285 @@
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'asc=la_common_Ascending,desc=la_common_Descending', 10.01, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'TopicText=la_opt_TopicText,Posts=la_opt_NumberOfPosts,CreatedOn=la_opt_CreatedOn,LastPostDate=la_opt_LastUpdated,Views=la_opt_TopicViews,CachedRating=la_opt_Rating,LastPoser=la_opt_LastPoster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) ', 10.01, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '', 'TopicText=la_opt_TopicText,Posts=la_opt_NumberOfPosts,CreatedOn=la_opt_CreatedOn,LastPostDate=la_opt_LastUpdated,Views=la_opt_TopicViews,CachedRating=la_opt_Rating,LastPoser=la_opt_LastPoster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) ', 10.02, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_NewDays', 'la_Text_Topics', 'la_topic_newdays_prompt', 'text', '', '', 10.05, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '', 'asc=la_common_Ascending,desc=la_common_Descending', 10.02, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics', 'la_Text_Topics', 'la_topic_perpage_prompt', 'text', '', '', 10.03, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MinPopRating', 'la_Text_Topics', 'la_fld_Topic_MinPopRating', 'text', '', '', 10.06, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MaxHotNumber', 'la_Text_Topics', 'la_fld_Topic_MaxHotNumber', 'text', '', '', 10.08, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_EditorPicksAbove', 'la_Text_Topics', 'la_topic_editorpicksabove_prompt', 'checkbox', '', '', 10.09, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Postings', 'la_posts_subheading', 'la_posts_perpage_prompt', 'text', '', '', 20.01, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Posts_NewDays', 'la_posts_subheading', 'la_posts_newdays_prompt', 'text', '', '', 20.02, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MinPopVotes', 'la_Text_Topics', 'la_fld_Topic_MinPopVotes', 'text', '', '', 10.07, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics_Short', 'la_Text_Topics', 'la_topic_perpage_short_prompt', 'text', '', '', 10.04, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Value', 'la_Text_Topics', 'la_prompt_DupReviews', 'text', '', 'style="width: 50px;"', 10.1, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Interval', 'la_Text_Topics', 'la_prompt_DupReviews', 'select', '', '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year', 10.1, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Value', 'la_Text_Topics', 'la_prompt_DupRating', 'text', '', 'style="width: 50px;"', 10.11, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Interval', 'la_Text_Topics', 'la_prompt_DupRating', 'select', '', '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year', 10.11, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('AutoTopicLockPosts', 'la_Text_Topics', 'la_prompt_PostsToLock', 'text', NULL, NULL, 10.12, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_TopicReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL, NULL, 30.01, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('bb_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 40.01, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 40.02, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_MaxImageCount', 'la_section_ImageSettings', 'la_config_MaxImageCount', 'text', '', '', 50.01, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_ThumbnailImageWidth', 'la_section_ImageSettings', 'la_config_ThumbnailImageWidth', 'text', '', '', 50.02, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_ThumbnailImageHeight', 'la_section_ImageSettings', 'la_config_ThumbnailImageHeight', 'text', '', '', 50.03, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_FullImageWidth', 'la_section_ImageSettings', 'la_config_FullImageWidth', 'text', '', '', 50.04, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_FullImageHeight', 'la_section_ImageSettings', 'la_config_FullImageHeight', 'text', '', '', 50.05, 0, 0);
+
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_topics', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_topics', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_topics', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_topics', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_topics', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_PrivateMessages', 'la_text_PrivateMessages', 'la_text_PrivateMessages_PerPage', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('poll_CommentDelay_Value', 'la_Text_Polls', 'la_prompt_DupPollComments', 'text', '', 'style="width: 50px;"', 60.1, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('poll_CommentDelay_Interval', 'la_Text_Polls', 'la_prompt_DupPollComments', 'select', '', '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year', 60.2, 2, 1);
+
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_Postings', '25', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_Topics', '5', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Posting_SortOrder', 'CreatedOn asc, PostingText', 'inportal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Posts_NewDays', '5', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Bulletin_TopCount', '2', 'inportal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Bulletin_CatNewDays', '10', 'inportal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Bulletin_Pick_First', '1', 'inportal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_SortOrder', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_SortField', 'LastPostDate', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_SortOrder2', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_SortField2', 'Posts', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_NewDays', '6', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_MinPopRating', '3', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_MaxHotNumber', '3', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_EditorPicksAbove', '1', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_MinPopVotes', '8', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Root', '{TopicCatId}', 'In-Portal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Post_Sortfield', DEFAULT, 'In-Bulletin', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Post_SortOrder', DEFAULT, 'In-Bulletin', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'BBTags', 'b:;i:;u:;ul:type|align;font:color|face|size;url:href;img:src|border', 'In-Portal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Post_Background1', '#cccccc', 'In-Portal', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Post_Background2', '#bbbbbb', 'In-Portal', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Background1', '#FAEBD7', 'In-Portal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Background2', '#F5F5DC', 'In-Portal', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'AutoTopicLockPosts', '0', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_CategoryTemplate', '/in-bulletin/designs/section', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_ItemTemplate', 'in-bulletin/designs/detail', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Highlight_OpenTag', '', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Highlight_CloseTag', ' ', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_Topics_Short', '3', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'topic_RatingDelay_Interval', '3600', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'topic_RatingDelay_Value', '1', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'topic_ReviewDelay_Interval', '60', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'topic_ReviewDelay_Value', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Increase_topics', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_MaxImageCount', 5, 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_ThumbnailImageWidth', 120, 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_ThumbnailImageHeight', 120, 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_FullImageWidth', 450, 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_FullImageHeight', 450, 'In-Bulletin', 'in-bulletin:configuration_output');
+
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Keyword_topics', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Pop_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Rating_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Increase_posts', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Keyword_posts', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Pop_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Rating_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_ShowMultiple_topics', '0', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_PrivateMessages', '20', 'In-Bulletin', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_TopicReviews', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'poll_CommentDelay_Interval', '60', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'poll_CommentDelay_Value', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+
+INSERT INTO Emoticon VALUES (1, 'Happy Smile', ':)', 1, '');
+INSERT INTO Emoticon VALUES (2, 'Big Grin', ':grin:', 1, '');
+INSERT INTO Emoticon VALUES (3, 'Wink', ';)', 1, '');
+INSERT INTO Emoticon VALUES (4, 'Scared', ':scared:', 1, '');
+INSERT INTO Emoticon VALUES (5, 'Teasing', ':eek:', 1, '');
+INSERT INTO Emoticon VALUES (6, 'Cool', ':cool:', 1, '');
+INSERT INTO Emoticon VALUES (7, 'Angry', ':@', 1, '');
+INSERT INTO Emoticon VALUES (8, 'Squint', ':squint:', 1, '');
+INSERT INTO Emoticon VALUES (9, 'Oops', ':o', 1, '');
+INSERT INTO Emoticon VALUES (10, 'Sad', ':(', 1, '');
+INSERT INTO Emoticon VALUES (11, 'Cry', ':cry:', 1, '');
+INSERT INTO Emoticon VALUES (12, 'Smirk', ';]', 1, '');
+INSERT INTO Emoticon VALUES (13, 'Happy sleep', ':sleep:', 1, '');
+INSERT INTO Emoticon VALUES (14, 'Very angry', ':x', 1, '');
+INSERT INTO Emoticon VALUES (15, 'Geek', ':geek:', 1, '');
+INSERT INTO Emoticon VALUES (16, 'Upset', ';(', 1, '');
+INSERT INTO Emoticon VALUES (17, 'LOL', ':lol:', 1, '');
+INSERT INTO Emoticon VALUES (18, 'Yawn', ':O', 1, '');
+INSERT INTO Emoticon VALUES (19, 'Thinking', ':hm:', 1, '');
+INSERT INTO Emoticon VALUES (20, 'Secret', ':|', 1, '');
+
+UPDATE Emoticon SET EmotionImage = CONCAT('0_',EmoticonId,'.gif');
+
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add.pending', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add.pending', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify.pending', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify.pending', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.APPROVE', NULL, 1, 0, NULL, 'In-Bulletin', 'la_event_topic.approve', 0);
+INSERT INTO Events VALUES(DEFAULT, 'POST.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_post.add', 1);
+INSERT INTO Events VALUES(DEFAULT, 'POST.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_post.modify', 1);
+INSERT INTO Events VALUES(DEFAULT, 'POST.ADD', NULL, 1, 0, NULL, 'In-Bulletin', 'la_event_post.add', 0);
+INSERT INTO Events VALUES(DEFAULT, 'PM.ADD', NULL, 1, 0, NULL, 'In-Bulletin', 'la_event_pm.add', 0);
+
+INSERT INTO ItemTypes VALUES (3, 'In-Bulletin', 'bb', 'Topic', 'TopicText', 'OwnerId', 'Views', 'CachedRating', 'la_ItemTab_Topics', 1, '', 'clsTopic', 'Topic');
+INSERT INTO ItemTypes VALUES (30, 'In-Bulletin', 'posting', 'Posting', 'Subject', 'CreatedById', NULL, NULL, 'la_ItemTab_Posts', 0, '', '', 'Post');
+
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.VIEW', 'lu_PermName_Topic.View_desc', 'lu_PermName_Topic.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.ADD', 'lu_PermName_Topic.Add_desc', 'lu_PermName_Topic.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.ADD.PENDING', 'lu_PermName_Topic.Add.Pending_desc', 'lu_PermName_Topic.Add.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.DELETE', 'lu_PermName_Topic.Delete_desc', 'lu_PermName_Topic.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.MODIFY', 'lu_PermName_Topic.Modify_desc', 'lu_PermName_Topic.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.DELETE', 'lu_PermName_Topic.Reply.Delete_desc', 'lu_PermName_Topic.Reply.Delete_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 'lu_PermName_Topic.Reply.View_desc', 'lu_PermName_Topic.Reply.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 'lu_PermName_Topic.Reply.Add_desc', 'lu_PermName_Topic.Reply.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.MODIFY', 'lu_PermName_Topic.Reply.Modify_desc', 'lu_PermName_Topic.Reply.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.RATE', 'lu_PermName_Topic.Rate_desc', 'lu_PermName_Topic.Rate_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REVIEW', 'lu_PermName_Topic.Review_desc', 'lu_PermName_Topic.Review_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.MODIFY', 'lu_PermName_Topic.Reply.Owner.Modify_desc', 'lu_PermName_Topic.Reply.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.DELETE', 'lu_PermName_Topic.Reply.Owner.Delete_desc', 'lu_PermName_Topic.Reply.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.OWNER.DELETE', 'lu_PermName_Topic.Owner.Delete_desc', 'lu_PermName_Topic.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.MODIFY.PENDING', 'lu_PermName_Topic.Modify.Pending_desc', 'lu_PermName_Topic.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY.PENDING', 'lu_PermName_Topic.Owner.Modify.Pending_desc', 'lu_PermName_Topic.Owner.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY', 'lu_PermName_Topic.Owner.Modify_desc', 'lu_PermName_Topic.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.LOCK', 'lu_PermName_Topic.Lock_desc', 'lu_PermName_Topic.Lock_error', 'In-Bulletin');
+
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT count(*) FROM <%prefix%>Topic WHERE Status=1', NULL, 'la_prompt_ActiveTopics', 0, 1);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS TotalTopics FROM <%prefix%>Topic', NULL, 'la_prompt_TopicsTotal', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS ActiveTopics FROM <%prefix%>Topic WHERE Status = 1', NULL, 'la_prompt_TopicsActive', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS PendingTopics FROM <%prefix%>Topic WHERE Status = 2', NULL, 'la_prompt_TopicsPending', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS DisabledTopics FROM <%prefix%>Topic WHERE Status = 0', NULL, 'la_prompt_TopicsDisabled', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS NewTopics FROM <%prefix%>Topic WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Topic_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewTopics', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>Topic WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickTopics', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS HotTopics FROM <%prefix%>Topic WHERE (HotItem = 1) OR (Posts >= <%m:config name="Topic_MaxHotNumber"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotTopics', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS PopularTopics FROM <%prefix%>Topic WHERE (PopItem = 1) OR ( (CachedRating >= <%topic:hit_count type="top"%>) AND <%topic:hit_count type="top"%> AND (PopItem = 2) )', NULL, 'la_prompt_PopularTopics', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Topic WHERE CachedRating > 0', NULL, 'la_prompt_TopicAverageRating', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT MAX(Views) AS MaxTopicHits FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicHits', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT MAX(CachedVotesQty) AS MaxTopicVotes FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicVotes', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_TopicReviews', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS TotalPosts FROM <%prefix%>Posting', NULL, 'la_prompt_PostsTotal', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostDate', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostTime', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostDate', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostTime', 0, 2);
+
+INSERT INTO SearchConfig VALUES ('Topic', 'NotifyOwnerOnChanges', 0, 1, 'lu_fielddesc_topic_notifyowneronchanges', 'lu_field_notifyowneronchanges', 'In-Bulletin', 'la_text_topic', 1, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicId', 0, 1, 'lu_fielddesc_topic_topicid', 'lu_field_topicid', 'In-Bulletin', 'la_text_topic', 0, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Priority', 0, 1, 'lu_fielddesc_topic_priority', 'lu_field_priority', 'In-Bulletin', 'la_text_topic', 8, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OwnerId', 0, 1, 'lu_fielddesc_topic_ownerid', 'lu_field_ownerid', 'In-Bulletin', 'la_text_topic', 9, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Modified', 0, 1, 'lu_fielddesc_topic_modified', 'lu_field_modified', 'In-Bulletin', 'la_text_topic', 2, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicText', 1, 1, 'lu_fielddesc_topic_topictext', 'lu_field_topictext', 'In-Bulletin', 'la_text_topic', 3, DEFAULT, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Posts', 0, 1, 'lu_fielddesc_topic_posts', 'lu_field_posts', 'In-Bulletin', 'la_text_topic', 4, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Views', 0, 1, 'lu_fielddesc_topic_views', 'lu_field_views', 'In-Bulletin', 'la_text_topic', 5, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'EditorsPick', 0, 1, 'lu_fielddesc_topic_editorspick', 'lu_field_editorspick', 'In-Bulletin', 'la_text_topic', 6, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Status', 0, 1, 'lu_fielddesc_topic_status', 'lu_field_status', 'In-Bulletin', 'la_text_topic', 7, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ModifiedById', 0, 1, 'lu_fielddesc_topic_modifiedbyid', 'lu_field_modifiedbyid', 'In-Bulletin', 'la_text_topic', 10, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ResourceId', 0, 1, 'lu_fielddesc_topic_resourceid', 'lu_field_resourceid', 'In-Bulletin', 'la_text_topic', 11, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicType', 0, 1, 'lu_fielddesc_topic_topictype', 'lu_field_topictype', 'In-Bulletin', 'la_text_topic', 12, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CreatedOn', 0, 1, 'lu_fielddesc_topic_createdon', 'lu_field_createdon', 'In-Bulletin', 'la_text_topic', 13, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedReviewsQty', 0, 1, 'lu_fielddesc_topic_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Bulletin', 'la_text_topic', 14, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedRating', 0, 1, 'lu_fielddesc_topic_cachedrating', 'lu_field_cachedrating', 'In-Bulletin', 'la_text_topic', 15, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedVotesQty', 0, 1, 'lu_fielddesc_topic_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Bulletin', 'la_text_topic', 16, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'NewItem', 0, 1, 'lu_fielddesc_topic_newitem', 'lu_field_newitem', 'In-Bulletin', 'la_text_topic', 17, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PopItem', 0, 1, 'lu_fielddesc_topic_popitem', 'lu_field_popitem', 'In-Bulletin', 'la_text_topic', 18, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'HotItem', 0, 1, 'lu_fielddesc_topic_hotitem', 'lu_field_hotitem', 'In-Bulletin', 'la_text_topic', 19, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PostedBy', 0, 1, 'lu_fielddesc_topic_postedby', 'lu_field_postedby', 'In-Bulletin', 'la_text_topic', 20, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OrgId', 0, 1, 'lu_fielddesc_topic_orgid', 'lu_field_orgid', 'In-Bulletin', 'la_text_topic', 21, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'LastPostId', 0, 1, 'lu_fielddesc_topic_lastpostid', 'lu_field_lastpostid', 'In-Bulletin', 'la_text_topic', 22, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY.PENDING', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.ADD.PENDING', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.RATE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REVIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.DELETE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.RATE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REVIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.ADD.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.RATE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REVIEW', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.LOCK', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:topics.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:setting_folder.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_output.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_output.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_search.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_search.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_censorship.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_censorship.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_censorship.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_censorship.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_emoticon.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_emoticon.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_emoticon.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_email.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_email.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_custom.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_custom.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_custom.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_custom.delete', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:polls.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:polls.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:polls.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:polls.delete', 11, 1, 1, 0);
+
+#INSERT INTO ImportScripts VALUES (DEFAULT, 'In-Bulletin', 'phpbb', 'phpbb_import', 'phpBB 2.x', 'phpBB', 'user_regular,init_cat', 1, 'db');
+
+INSERT INTO CustomField VALUES (DEFAULT, 1, 'bb_ItemTemplate', 'la_fld_cust_bb_ItemTemplate', 0, 'la_title_SystemCF', 'la_fld_cust_bb_ItemTemplate', 'text', NULL, '', 0, 0, 1, 0);
+
+INSERT INTO Modules VALUES ('In-Bulletin', 'in-bulletin/', 'bb', DEFAULT, 1, 3, 'in-bulletin/', {TopicCatId}, NULL);
Index: branches/5.0.x/in-bulletin/install/install_order.txt
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/install_order.txt (revision 0)
+++ branches/5.0.x/in-bulletin/install/install_order.txt (revision 12744)
@@ -0,0 +1 @@
+104
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/english.lang
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/english.lang (revision 0)
+++ branches/5.0.x/in-bulletin/install/english.lang (revision 12744)
@@ -0,0 +1,255 @@
+
+ m/d/Y g:i A m/d/Y g:i:s A . , utf-8 http://docs.in-portal.org/eng/index.php 2
+
+ Q2Vuc29yZWQgV29yZA==
+ VXNlcg==
+ S2V5IFN0cm9rZQ==
+ TGFzdCBQb3N0IE9u
+ RGF0ZS9UaW1l
+ RGF5cyBBY3RpdmU=
+ Q29tbWVudA==
+ UG9zdGVy
+ UmVwbGllcw==
+ UmVwbGFjZW1lbnQ=
+ VG9waWM=
+ Vmlld3M=
+ Vm90ZXM=
+ UG9zdCBBZGRlZA==
+ UG9zdCBNb2RpZmllZA==
+ VG9waWMgQWRkZWQ=
+ QWRkIFBlbmRpbmcgVG9waWM=
+ QXBwcm92ZSBUb3BpYw==
+ TW9kaWZ5IFRvcGlj
+ VG9waWMgTW9kaWZpY2F0aW9ucyBQZW5kaW5n
+ QWxsb3cgQ29tbWVudHM=
+ QWxsb3cgTXVsdGlwbGUgVm90aW5ncw==
+ Q2Vuc29yZWQgV29yZA==
+ VG9waWNzIEl0ZW0gVGVtcGxhdGU=
+ RW5kIERhdGU=
+ SW1hZ2U=
+ S2V5IFN0cm9rZQ==
+ QW5zd2Vy
+ Q29tbWVudA==
+ R3Vlc3QgRW1haWw=
+ R3Vlc3QgTmFtZQ==
+ UG9zdGVkIEJ5
+ UXVlc3Rpb24=
+ UmVwbGFjZW1lbnQ=
+ UmVxdWlyZSBMb2dpbg==
+ VG9waWMgTG9ja2Vk
+ TWF4aW11bSBudW1iZXIgb2YgSE9UIHRvcGljcw==
+ TWluaW11bSByYXRpbmcgdG8gY29uc2lkZXIgdG9waWMgUE9Q
+ TWluaW11bSBudW1iZXIgb2YgcG9zdHMgdG8gY29uc2lkZXIgdG9waWMgUE9Q
+ Vmlld3M=
+ SW4tQnVsbGV0aW4=
+ VG9waWNz
+ TGFzdCBQb3N0ZXI=
+ TGFzdCBVcGRhdGVk
+ TnVtYmVyIG9mIFBvc3Rz
+ VG9waWMgVGV4dA==
+ VG9waWMgVmlld3M=
+ TmV3IHBvc3RzIChkYXlzKQ==
+ TnVtYmVyIG9mIHBvc3RzIHBlciBwYWdl
+ UG9zdHM=
+ QWN0aXZlIFRvcGljcw==
+ QWxsb3cgRHVwbGljYXRlIENvbW1lbnRz
+ RWRpdG9yIFBpY2sgVG9waWNz
+ SG90IFRvcGljcw==
+ TGFzdCBVcGRhdGVkIFBvc3QgRGF0ZQ==
+ TGFzdCBVcGRhdGVkIFBvc3QgVGltZQ==
+ TGFzdCBVcGRhdGVkIFRvcGljIERhdGU=
+ TGFzdCBVcGRhdGVkIFRvcGljIFRpbWU=
+ VG9waWMgTWF4aW11bSBIaXRz
+ VG9waWMgTWF4aW11bSBWb3Rlcw==
+ TmV3ZXN0IFBvc3QgRGF0ZQ==
+ TmV3ZXN0IFBvc3QgVGltZQ==
+ TmV3ZXN0IFRvcGljIERhdGU=
+ TmV3ZXN0IFRvcGljIFRpbWU=
+ TmV3IFRvcGljcw==
+ UG9wdWxhciBUb3BpY3M=
+ UG9zdHMgdG8gbG9jaw==
+ VG90YWwgUG9zdHM=
+ VG9waWNzIEF2ZXJhZ2UgUmF0aW5n
+ VG90YWwgVG9waWMgQ29tbWVudHM=
+ QWN0aXZlIFRvcGljcw==
+ RGlzYWJsZWQgVG9waWNz
+ UGVuZGluZyBUb3BpY3M=
+ VG90YWwgVG9waWNz
+ VG90YWwgVXNlcnMgd2l0aCBUb3BpY3M=
+ VG9waWM=
+ Q2Vuc29yc2hpcA==
+ U21pbGV5cw==
+ QW5zd2Vycw==
+ VXNlciBDb21tZW50cw==
+ VG9waWNz
+ UG9sbCBTZXR0aW5ncw==
+ VG9waWM=
+ VG9waWNz
+ QWRkaW5nIENlbnNvcnNoaXA=
+ QWRkaW5nIFNtaWxleQ==
+ QWRkaW5nIFRvcGlj
+ QWRkaW5nIEFuc3dlcg==
+ QWRkaW5nIENvbW1lbnQ=
+ QWRkaW5nIFBvbGw=
+ RWRpdGluZyBDZW5zb3JzaGlw
+ RWRpdGluZyBTbWlsZXk=
+ RWRpdGluZyBUb3BpYw==
+ RWRpdGluZyBBbnN3ZXI=
+ RWRpdGluZyBDb21tZW50
+ RWRpdGluZyBQb2xs
+ VG9waWNz
+ TmV3IFBvbGw=
+ TmV3IFRvcGlj
+ UG9sbCBBbnN3ZXJz
+ VXNlciBDb21tZW50cw==
+ UG9sbHM=
+ VG9waWNz
+ TmV3IFBvbGw=
+ TmV3IFRvcGlj
+ TmV3IEFuc3dlcg==
+ TmV3IENvbW1lbnQ=
+ UmVzZXQgVm90ZXM=
+ RGlzcGxheSBlZGl0b3IgcGlja3MgYWJvdmUgcmVndWxhciB0b3BpY3M=
+ TmV3IFRvcGljcyAoRGF5cyk=
+ TnVtYmVyIG9mIHRvcGljcyBwZXIgcGFnZQ==
+ VG9waWNzIFBlciBQYWdlIChTaG9ydGxpc3Qp
+ QW5kIHRoZW4gYnk=
+ U29ydCB0b3BpY3MgYnk=
+ RGVsZXRlIFBvc3Q=
+ TG9jayBUb3BpYw==
+ TW9kaWZ5IFBvc3Q=
+ TmV3IFByaXZhdGUgTWVzc2FnZQ==
+ TmV3IHRvcGlj
+ UmF0ZSBUb3BpYw==
+ UmVwbHk=
+ UmVwbHkgUXVvdGVk
+ U2VuZCBQcml2YXRlIE1lc3NhZ2U=
+ VW5sb2NrIFRvcGlj
+ Vm90ZQ==
+ QXV0aG9y
+ RGF0ZQ==
+ Rm9ydW1z
+ RnJvbQ==
+ TGFzdCBQb3N0
+ UG9zdGVy
+ UG9zdHM=
+ UmVwbGllcw==
+ U3ViamVjdA==
+ VG8=
+ VG9waWNz
+ QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSB0aGUgcG9zdD8NClRoaXMgYWN0aW9uIGNhbm5vdCBiZSB1bmRvbmUu
+ QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSB0aGUgcHJpdmF0ZSBtZXNzYWdlPyBUaGlzIGFjdGlvbiBjYW5ub3QgYmUgdW5kb25lLg==
+ QXJlIHlvdSBzdXJlIHlvdSB3YW50IHRvIGRlbGV0ZSB0aGUgdG9waWM/IFRoaXMgYWN0aW9uIGNhbm5vdCBiZSB1bmRvbmUu
+ TWFuYWdlIHlvdXIgVG9waWNzIGhlcmU=
+ TGFzdCBQb3N0IElE
+ UG9zdGVkIEJ5
+ VG9waWMgUG9zdHM=
+ VG9waWMgSUQ=
+ VG9waWMgVGV4dA==
+ VG9waWMgVHlwZQ==
+ QXV0aG9y
+ RElzYWJsZSBCQiBjb2Rlcw==
+ RGlzYWJsZSBzbWlsZXlz
+ RW5hYmxlIEJCIENvZGVz
+ RW5hYmxlIFNtaWxleXM=
+ RnJvbQ==
+ TWVzc2FnZQ==
+ U2lnbmF0dXJl
+ Tm90aWZ5IGFib3V0IFByaXZhdGUgTWVzc2FnZXM=
+ Tm90aWZ5IG1lIGFib3V0IHJlcGxpZXM=
+ UG9zdHMgcGVyIHBhZ2U=
+ U2hvdyBTaWduYXR1cmVz
+ U2hvdyBzaWduYXR1cmU=
+ U3ViamVjdA==
+ VG8=
+ VG9waWNzIHBlciBwYWdl
+ U2VudA==
+ Rm9ydW1z
+ Rm9ydW0gaXMgbG9ja2VkIGZvciBwb3N0aW5n
+ TG9ja2VkIFRvcGlj
+ RGF0ZQ==
+ TXkgVG9waWNz
+ TmV3IFRvcGlj
+ VGhlIHN5c3RlbSBhZG1pbmlzdHJhdG9yIG11c3QgYXBwcm92ZSB5b3VyIHRvcGljIGJlZm9yZSBpdCBpcyBwdWJsaWNseSBhdmFpbGFibGUu
+ VGhlIFRvcGljIHlvdSBoYXZlIGNyZWF0ZWQgaGFzIGJlZW4gYWRkZWQgdG8gdGhlIHN5c3RlbQ==
+ Rm9ydW0gaGFzIG5ldyBwb3N0cw==
+ Tm8gbWVzc2FnZXM=
+ bm8gc3ViamVjdA==
+ Tm8gVG9waWNz
+ Rm9ydW0gaGFzIG5vIG5ldyBwb3N0cw==
+ UmVhZA==
+ UmVwbGllZA==
+ U2VudA==
+ VW5yZWFk
+ Vmlld2Vk
+ QWRkIFBlbmRpbmcgVG9waWM=
+ QWRkIFRvcGlj
+ RGVsZXRlIFRvcGlj
+ TG9jay9VbmxvY2sgVG9waWNz
+ TW9kaWZ5IFRvcGljIFBlbmRpbmc=
+ TW9kaWZ5IFRvcGlj
+ VG9waWMgT3duZXIgRGVsZXRl
+ T3duZXIgTW9kaWZ5IFRvcGljIFBlbmRpbmc=
+ VG9waWMgT3duZXIgTW9kaWZ5
+ UmF0ZSBUb3BpYw==
+ QWRkIFRvcGljIFJlcGx5
+ RGVsZXRlIFRvcGlj
+ UmVwbHkgVG9waWMgTW9kaWZ5
+ UG9zdCBPd25lciBEZWxldGU=
+ UG9zdCBPd25lciBNb2RpZnk=
+ VmlldyBUb3BpYyBSZXBseQ==
+ Q29tbWVudCBUb3BpYw==
+ VmlldyBUb3BpYw==
+ UG9zdGVk
+ cG9zdHM=
+ UHJpdmF0ZSBNZXNzYWdlcw==
+ Rm9ydW1z
+ QWxyZWFkeSB2b3RlZCE=
+ UGxlYXNlIGxvZ2luIHRvIHZvdGUh
+ VGhhbmsgeW91IGZvciB1cGRhdGluZyB5b3VyIHRvcGljLg==
+ VGhhbmsgeW91IGZvciB1cGRhdGluZyB5b3VyIHRvcGljLiBZb3VyIG1vZGlmaWNhdGlvbnMgYXJlIHBlbmRpbmcgZm9yIGFkbWluaXN0cmF0aXZlIGFwcHJvdmFsLg==
+ TXkgVG9waWNz
+ Tm8gcGVybWlzc2lvbnMgdG8gbW9kaWZ5IHRoaXMgdG9waWM=
+ Tm8gcGVybWlzc2lvbnMgdG8gc3VibWl0IGEgbmV3IHRvcGljIGludG8gdGhlIGN1cnJlbnQgY2F0ZWdvcnku
+ Tm8gcGVybWlzc2lvbnMgdG8gcmVwbHkgaW4gdGhpcyB0b3BpYw==
+ Tm8gcGVybWlzc2lvbnMgdG8gbW9kaWZ5IHRoaXMgcG9zdC4=
+ Tm8gcGVybWlzc2lvbnMgdG8gdmlldyByZXBsaWVzIGZvciB0aGlzIHRvcGljLg==
+ QWRkaW5nIENvbW1lbnQ=
+ UHJpdmF0ZSBNZXNzYWdlIFNlbnQ=
+ TmV3IFRvcGljIEFkZGVk
+ TmV3IFRvcGljIFBlbmRpbmc=
+ RmF2b3JpdGUgVG9waWNz
+ VG9waWMgTW9kaWZpY2F0aW9uIENvbmZpcm1hdGlvbg==
+ VG9waWMgUGVuZGluZyBNb2RpZmljYXRpb24gQ29uZmlybWF0aW9u
+ TmV3IFByaXZhdGUgTWVzc2FnZQ==
+ TmV3IFRvcGlj
+ UG9zdCBSZXBseQ==
+ UG9sbHM=
+ UHJpdmF0ZSBNZXNzYWdlIERldGFpbHM=
+ UHJpdmF0ZSBNZXNzYWdlcw==
+ TW9kaWZ5IFBvc3Q=
+ VG9waWMgUG9zdHM=
+ VG9waWNz
+ VG9waWMgU2VhcmNoIFJlc3VsdHM=
+ VmlldyBDb21tZW50cw==
+ VG9waWNz
+ TGFzdCB1cGRhdGVk
+ VG90YWwgdG9waWNz
+
+
+ U3ViamVjdDogTmV3IFByaXZhdGUgTWVzc2FnZQoKWW91IGhhdmUgYSBuZXcgcHJpdmF0ZSBtZXNzYWdlIGhhcyBhcnJpdmVkLg==
+ U3ViamVjdDogTmV3IFRvcGljIFJlcGx5IGhhcyBiZWVuIGFkZGVkCgpOZXcgcmVwbHkgaGFzIGJlZW4gYWRkZWQgdG8gb25lIG9mIHlvdXIgdG9waWNzOiA8YSBocmVmPSI8aW5wMjpiYl9Ub3BpY0xpbmsgdGVtcGxhdGU9Il9fZGVmYXVsdF9fIi8+Ij48aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz48L2E+
+ U3ViamVjdDogTmV3IFRvcGljIFJlcGx5IGhhcyBiZWVuIEFkZGVkCgpOZXcgcmVwbHkgaGFzIGJlZW4gYWRkZWQgdG8gdGhlIFRvcGljOiAgPGEgaHJlZj0iPGlucDI6YmJfVG9waWNMaW5rIHRlbXBsYXRlPSJfX2RlZmF1bHRfXyIvPiI+PGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+PC9hPg==
+ U3ViamVjdDogUG9zdCBoYXMgYmVlbiBNb2RpZmllZAoKQSBwb3N0IGhhcyBiZWVuIG1vZGlmaWVkLg==
+ U3ViamVjdDogTmV3IFRvcGljICI8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4iIGhhcyBiZWVuIHN1Ym1pdHRlZAoKTmV3IFRvcGljIGhhcyBiZWVuIHN1Ym1pdHRlZCBvbiA8aW5wMjptX0Jhc2VVcmwvPjxicj48YnI+DQoNClRvcGljOiA8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4=
+ U3ViamVjdDogTmV3IFRvcGljICI8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4iIGhhcyBiZWVuIHN1Ym1pdHRlZAoKTmV3IFRvcGljIGhhcyBiZWVuIHN1Ym1pdHRlZCBvbiA8aW5wMjptX0Jhc2VVcmwvPjxicj48YnI+DQoNClRvcGljOiA8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4=
+ U3ViamVjdDogTmV3IHRvcGljICI8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4iIGlzIHBlbmRpbmcKCllvdXIgdG9waWMgaXMgcmVjZWl2ZWQgYW5kIHBlbmRpbmcgZm9yIGFkbWluaXN0cmF0aXZlIGFwcHJvdmFsPGJyPjxicj4NCg0KVG9waWM6IDxpbnAyOmJiX0ZpZWxkIG5hbWU9IlRvcGljVGV4dCIvPg==
+ U3ViamVjdDogTmV3IFRvcGljICI8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4iIGlzIHBlbmRpbmcKCk5ldyB0b3BpYyBoYXMgYmVlbiBzdWJtaXR0ZWQgYW5kIHBlbmRpbmcgZm9yIHlvdXIgYXBwcm92YWwuPGJyPjxicj4NCg0KVG9waWM6IDxpbnAyOmJiX0ZpZWxkIG5hbWU9IlRvcGljVGV4dCIvPg==
+ U3ViamVjdDogVG9waWMgIjxpbnAyOmJiX0ZpZWxkIG5hbWU9IlRvcGljVGV4dCIvPiIgaXMgYXBwcm92ZWQKCllvdXIgdG9waWMgaGFzIGJlZW4gYXBwcm92ZWQgb24gPGlucDI6bV9CYXNlVXJsLz48YnI+PGJyPg0KDQpUb3BpYzogPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+
+ U3ViamVjdDogVG9waWMgVXBkYXRlZCAiPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+IgoKWW91ciB0b3BpYyBoYXMgYmVlbiB1cGRhdGVkLjxicj48YnI+DQoNClRvcGljOiA8aW5wMjpiYl9GaWVsZCBuYW1lPSJUb3BpY1RleHQiLz4NCg0K
+ U3ViamVjdDogVG9waWMgVXBkYXRlZCBUb3BpYyAiPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+IgoKVXNlciB1cGRhdGVkIHRoZSB0b3BpYy48YnI+PGJyPg0KDQpUb3BpYzogPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+
+ U3ViamVjdDogVG9waWMgTW9kaWZpY2F0aW9ucyAiPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+IiBwZW5kaW5nCgpUb3BpYyBtb2RpZmljYXRpb25zIGFyZSBwZW5kaW5nIGZvciBhZG1pbmlzdHJhdGl2ZSBhcHByb3ZhbC48YnI+PGJyPg0KDQpUb3BpYzogPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+
+ U3ViamVjdDogVG9waWMgTW9kaWZpY2F0aW9ucyAiPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+IiBwZW5kaW5nCgpVc2VyIHN1Ym1pdHRlZCB0byB0b3BpYyBtb2RpZmljYXRpb25zIGFuZCBwZW5kaW5nIGZvciBhcHByb3ZhbC48YnI+PGJyPg0KDQpUb3BpYzogPGlucDI6YmJfRmllbGQgbmFtZT0iVG9waWNUZXh0Ii8+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/install_schema.sql
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/install_schema.sql (revision 0)
+++ branches/5.0.x/in-bulletin/install/install_schema.sql (revision 12744)
@@ -0,0 +1,198 @@
+CREATE TABLE Posting (
+ PostingId int(11) NOT NULL AUTO_INCREMENT,
+ IPAddress varchar(255) NOT NULL DEFAULT '',
+ PosterAlias varchar(255) NOT NULL DEFAULT '',
+ Pending tinyint(4) NOT NULL DEFAULT '0',
+ `Subject` varchar(255) DEFAULT NULL,
+ PostingText text,
+ GraphicsUrl varchar(255) DEFAULT NULL,
+ CreatedOn int(11) DEFAULT NULL,
+ Modified int(11) DEFAULT NULL,
+ ModifiedById int(11) DEFAULT NULL,
+ CreatedById int(11) DEFAULT NULL,
+ TopicId int(11) NOT NULL DEFAULT '0',
+ ResourceId int(11) NOT NULL DEFAULT '0',
+ ReplyTo int(11) NOT NULL DEFAULT '0',
+ `Options` int(11) NOT NULL DEFAULT '0',
+ PRIMARY KEY (PostingId),
+ KEY TopicId (TopicId),
+ KEY Pending (Pending),
+ KEY CreatedById (CreatedById),
+ KEY CreatedOn (CreatedOn),
+ KEY ModifiedOn (Modified),
+ KEY ModifiedById (ModifiedById)
+);
+
+CREATE TABLE Topic (
+ TopicId int(11) NOT NULL AUTO_INCREMENT,
+ NotifyOwnerOnChanges tinyint(4) NOT NULL DEFAULT '0',
+ Modified int(11) DEFAULT NULL,
+ TopicText varchar(255) NOT NULL DEFAULT '',
+ AutomaticFilename tinyint(3) unsigned NOT NULL DEFAULT '1',
+ Posts int(11) NOT NULL DEFAULT '0',
+ Views double(20,6) NOT NULL DEFAULT '0.000000',
+ EditorsPick tinyint(4) NOT NULL DEFAULT '0',
+ `Status` tinyint(4) unsigned NOT NULL DEFAULT '2',
+ Priority int(11) NOT NULL DEFAULT '0',
+ OwnerId int(11) NOT NULL DEFAULT '-1',
+ ModifiedById int(11) NOT NULL DEFAULT '0',
+ ResourceId int(11) DEFAULT NULL,
+ TopicType int(11) NOT NULL DEFAULT '1',
+ CreatedOn int(11) DEFAULT NULL,
+ CachedReviewsQty int(11) NOT NULL DEFAULT '0',
+ CachedRating varchar(10) NOT NULL DEFAULT '0',
+ CachedVotesQty int(11) NOT NULL DEFAULT '0',
+ NewItem tinyint(4) NOT NULL DEFAULT '2',
+ PopItem tinyint(4) NOT NULL DEFAULT '2',
+ HotItem tinyint(4) NOT NULL DEFAULT '2',
+ PostedBy varchar(255) NOT NULL DEFAULT '',
+ OrgId int(11) DEFAULT NULL,
+ LastPostId int(11) NOT NULL DEFAULT '0',
+ LastPostDate int(11) DEFAULT NULL,
+ TodayDate date DEFAULT NULL,
+ TodayPosts int(11) NOT NULL DEFAULT '0',
+ MetaKeywords varchar(255) DEFAULT NULL,
+ MetaDescription text,
+ PRIMARY KEY (TopicId),
+ UNIQUE KEY ResourceId (ResourceId),
+ KEY OwnerId (OwnerId),
+ KEY ModifiedById (ModifiedById),
+ KEY Posts (Posts),
+ KEY Modified (Modified),
+ KEY Views (Views),
+ KEY EditorsPick (EditorsPick),
+ KEY `Status` (`Status`),
+ KEY Priority (Priority),
+ KEY CreatedOn (CreatedOn),
+ KEY NewItem (NewItem),
+ KEY PopItem (PopItem),
+ KEY HotItem (HotItem),
+ KEY LastPostId (LastPostId)
+);
+
+CREATE TABLE Censorship (
+ CensorshipId int(11) NOT NULL auto_increment,
+ BadWord varchar(80) NOT NULL default '',
+ Replacement varchar(80) NOT NULL default '',
+ PRIMARY KEY (CensorshipId)
+);
+
+CREATE TABLE Emoticon (
+ EmoticonId int(11) NOT NULL AUTO_INCREMENT,
+ `Name` varchar(20) NOT NULL DEFAULT '',
+ KeyStroke varchar(20) NOT NULL DEFAULT '',
+ Enabled int(11) NOT NULL DEFAULT '1',
+ EmotionImage varchar(255) NOT NULL DEFAULT '',
+ PRIMARY KEY (EmoticonId),
+ KEY Enabled (Enabled),
+ KEY EmotionImage (EmotionImage)
+);
+
+CREATE TABLE PrivateMessageBody (
+ PMBodyId int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `Subject` varchar(255) NOT NULL DEFAULT '',
+ Body text,
+ `Options` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ ReferenceCount smallint(5) unsigned NOT NULL DEFAULT '2',
+ PRIMARY KEY (PMBodyId),
+ KEY ReferenceCount (ReferenceCount)
+);
+
+CREATE TABLE PrivateMessages (
+ PmId int(11) unsigned NOT NULL AUTO_INCREMENT,
+ FromId int(11) unsigned DEFAULT NULL,
+ ToId int(11) unsigned DEFAULT NULL,
+ FolderId tinyint(3) NOT NULL DEFAULT '-1',
+ `Status` tinyint(1) unsigned NOT NULL DEFAULT '0',
+ PMBodyId int(11) unsigned NOT NULL DEFAULT '0',
+ CreatedOn int(11) unsigned DEFAULT NULL,
+ PRIMARY KEY (PmId),
+ KEY FromId (FromId),
+ KEY CreatedOn (CreatedOn),
+ KEY ToId (ToId),
+ KEY FolderId (FolderId)
+);
+
+CREATE TABLE TopicCustomData (
+ CustomDataId int(11) NOT NULL auto_increment,
+ ResourceId int(10) unsigned NOT NULL default '0',
+ KEY ResourceId (ResourceId),
+ PRIMARY KEY (CustomDataId)
+);
+
+CREATE TABLE Polls (
+ PollId int(11) NOT NULL AUTO_INCREMENT,
+ `Name` varchar(255) NOT NULL DEFAULT '',
+ l1_Question text,
+ l2_Question text,
+ l3_Question text,
+ l4_Question text,
+ l5_Question text,
+ Image varchar(255) NOT NULL DEFAULT '',
+ CreatedOn int(11) unsigned DEFAULT NULL,
+ StartDate int(11) unsigned DEFAULT NULL,
+ EndDate int(11) unsigned DEFAULT NULL,
+ Priority tinyint(4) NOT NULL DEFAULT '0',
+ RequireLogin tinyint(4) NOT NULL DEFAULT '0',
+ AllowMultipleVotings tinyint(4) NOT NULL DEFAULT '1',
+ AllowComments tinyint(4) NOT NULL DEFAULT '1',
+ `Status` tinyint(4) NOT NULL DEFAULT '1',
+ CachedVotesQty int(11) NOT NULL DEFAULT '0',
+ PRIMARY KEY (PollId),
+ KEY `Status` (`Status`),
+ KEY Priority (Priority),
+ KEY StartDate (StartDate),
+ KEY EndDate (EndDate)
+);
+
+CREATE TABLE PollsAnswers (
+ AnswerId int(11) NOT NULL AUTO_INCREMENT,
+ PollId int(11) NOT NULL DEFAULT '0',
+ l1_Answer text,
+ l2_Answer text,
+ l3_Answer text,
+ l4_Answer text,
+ l5_Answer text,
+ VotesQty int(11) NOT NULL DEFAULT '0',
+ Priority int(11) NOT NULL DEFAULT '0',
+ `Status` tinyint(4) NOT NULL DEFAULT '1',
+ PRIMARY KEY (AnswerId),
+ KEY `Status` (`Status`),
+ KEY Priority (Priority),
+ KEY VoteCount (VotesQty),
+ KEY PollId (PollId)
+);
+
+CREATE TABLE PollsComments (
+ CommentId int(11) NOT NULL AUTO_INCREMENT,
+ PollId int(11) NOT NULL DEFAULT '0',
+ AnswerId int(11) DEFAULT NULL,
+ CreatedById int(11) NOT NULL DEFAULT '-2',
+ GuestName varchar(255) NOT NULL DEFAULT '',
+ GuestEmail varchar(255) NOT NULL DEFAULT '',
+ CommentBody text,
+ CreatedOn int(11) DEFAULT NULL,
+ UserIP varchar(255) NOT NULL DEFAULT '',
+ Priority int(11) NOT NULL DEFAULT '0',
+ `Status` tinyint(4) NOT NULL DEFAULT '1',
+ PRIMARY KEY (CommentId),
+ KEY `Status` (`Status`),
+ KEY Priority (Priority),
+ KEY CreatedOn (CreatedOn),
+ KEY AnswerId (AnswerId),
+ KEY PollId (PollId),
+ KEY CreatedById (CreatedById)
+);
+
+CREATE TABLE PollsStatistics (
+ StatisticsId int(11) NOT NULL AUTO_INCREMENT,
+ PollId int(11) NOT NULL DEFAULT '0',
+ AnswerId int(11) NOT NULL DEFAULT '0',
+ CreatedById int(11) NOT NULL DEFAULT '-2',
+ UserIP varchar(255) NOT NULL DEFAULT '',
+ AnswerDate int(10) unsigned DEFAULT NULL,
+ PRIMARY KEY (StatisticsId),
+ KEY AnswerId (AnswerId,PollId),
+ KEY CreatedById (CreatedById),
+ KEY UserIP (UserIP)
+);
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/remove_schema.sql
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/remove_schema.sql (revision 0)
+++ branches/5.0.x/in-bulletin/install/remove_schema.sql (revision 12744)
@@ -0,0 +1,11 @@
+DROP TABLE Posting;
+DROP TABLE Topic;
+DROP TABLE Censorship;
+DROP TABLE Emoticon;
+DROP TABLE PrivateMessageBody;
+DROP TABLE PrivateMessages;
+DROP TABLE TopicCustomData;
+DROP TABLE Polls;
+DROP TABLE PollsAnswers;
+DROP TABLE PollsComments;
+DROP TABLE PollsStatistics;
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/upgrades.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/upgrades.php (revision 0)
+++ branches/5.0.x/in-bulletin/install/upgrades.php (revision 12744)
@@ -0,0 +1,96 @@
+_toolkit =& $instance;
+ }
+
+ /**
+ * Changes table structure, where multilingual fields of TEXT type are present
+ *
+ * @param string $mode when called mode {before, after)
+ */
+ function Upgrade_5_0_0($mode)
+ {
+ if ($mode == 'after') {
+ $root_category = $this->Application->findModule('Name', 'In-Bulletin', 'RootCat');
+
+ $sql = 'UPDATE ' . $this->Application->getUnitOption('c', 'TableName') . '
+ SET UseMenuIconUrl = 1, MenuIconUrl = "in-bulletin/img/menu_topics.gif"
+ WHERE ' . $this->Application->getUnitOption('c', 'IDField') . ' = ' . $root_category;
+ $this->Conn->Query($sql);
+
+ $this->_updateDetailTemplate('bb', 'inbulletin/post_list', 'in-bulletin/designs/detail');
+ }
+ }
+
+ /**
+ * Replaces deprecated detail template design with new one
+ *
+ * @param string $prefix
+ * @param string $from_template
+ * @param string $to_template
+ */
+ function _updateDetailTemplate($prefix, $from_template, $to_template)
+ {
+ $sql = 'SELECT CustomFieldId
+ FROM ' . TABLE_PREFIX . 'CustomField
+ WHERE FieldName = "' . $prefix . '_ItemTemplate"';
+ $custom_field_id = $this->Conn->GetOne($sql);
+
+ $ml_formatter =& $this->Application->recallObject('kMultiLanguage');
+ /* @var $ml_formatter kMultiLanguage */
+
+ $field = $ml_formatter->LangFieldName('cust_' . $custom_field_id, true);
+
+ $sql = 'UPDATE ' . TABLE_PREFIX . 'CategoryCustomData
+ SET ' . $field . ' = "' . $to_template . '"
+ WHERE ' . $field . ' = "' . $from_template . '"';
+ $this->Conn->Query($sql);
+ }
+
+ /**
+ * Update to 5.0.1, update details template
+ *
+ * @param string $mode when called mode {before, after)
+ */
+ function Upgrade_5_0_1($mode)
+ {
+ if ($mode == 'after') {
+ $this->_updateDetailTemplate('bb', 'in-bulletin/designs/detail', 'in-bulletin/topics/topic_detail');
+ }
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/install/upgrades.sql
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/install/upgrades.sql (revision 0)
+++ branches/5.0.x/in-bulletin/install/upgrades.sql (revision 12744)
@@ -0,0 +1,164 @@
+# ===== v 4.3.9 =====
+ALTER TABLE Emoticon
+ ADD EmotionImage VARCHAR(255) NOT NULL,
+ ADD INDEX (EmotionImage),
+ DROP ImageId;
+
+UPDATE Emoticon SET EmotionImage = CONCAT('0_',EmoticonId,'.gif') WHERE EmoticonId < 21;
+
+# ===== v 5.0.0 =====
+CREATE TABLE Polls (
+ PollId int(11) NOT NULL auto_increment,
+ `Name` varchar(255) NOT NULL default '',
+ l1_Question text,
+ l2_Question text,
+ l3_Question text,
+ l4_Question text,
+ l5_Question text,
+ Image varchar(255) NOT NULL default '',
+ CreatedOn int(11) unsigned NOT NULL,
+ StartDate int(11) unsigned NOT NULL,
+ EndDate int(11) unsigned default NULL,
+ Priority tinyint(4) NOT NULL default '0',
+ RequireLogin tinyint(4) NOT NULL default '0',
+ AllowMultipleVotings tinyint(4) NOT NULL default '1',
+ AllowComments tinyint(4) NOT NULL default '1',
+ `Status` tinyint(4) NOT NULL default '1',
+ CachedVotesQty int(11) NOT NULL,
+ PRIMARY KEY (PollId),
+ KEY `Status` (`Status`),
+ KEY Priority (Priority),
+ KEY StartDate (StartDate),
+ KEY EndDate (EndDate)
+);
+
+CREATE TABLE PollsAnswers (
+ AnswerId int(11) NOT NULL auto_increment,
+ PollId int(11) NOT NULL,
+ l1_Answer text,
+ l2_Answer text,
+ l3_Answer text,
+ l4_Answer text,
+ l5_Answer text,
+ VotesQty int(11) NOT NULL,
+ Priority int(11) NOT NULL default '0',
+ Status tinyint(4) NOT NULL default '1',
+ PRIMARY KEY (AnswerId),
+ KEY Status (Status),
+ KEY Priority (Priority),
+ KEY VoteCount (VotesQty),
+ KEY PollId (PollId)
+);
+
+CREATE TABLE PollsComments (
+ CommentId int(11) NOT NULL auto_increment,
+ PollId int(11) NOT NULL,
+ AnswerId int(11) default NULL,
+ CreatedById int(11) NOT NULL default '-2',
+ GuestName varchar(255) NOT NULL,
+ GuestEmail varchar(255) NOT NULL,
+ CommentBody text,
+ CreatedOn int(11) NOT NULL,
+ UserIP varchar(255) NOT NULL,
+ Priority int(11) NOT NULL,
+ `Status` tinyint(4) NOT NULL default '1',
+ PRIMARY KEY (CommentId),
+ KEY `Status` (`Status`),
+ KEY Priority (Priority),
+ KEY CreatedOn (CreatedOn),
+ KEY AnswerId (AnswerId),
+ KEY PollId (PollId),
+ KEY CreatedById (CreatedById)
+);
+
+CREATE TABLE PollsStatistics (
+ StatisticsId int(11) NOT NULL auto_increment,
+ PollId int(11) NOT NULL default '0',
+ AnswerId int(11) NOT NULL default '0',
+ CreatedById int(11) NOT NULL default '-2',
+ UserIP varchar(255) NOT NULL,
+ AnswerDate int(10) unsigned default NULL,
+ PRIMARY KEY (StatisticsId),
+ KEY AnswerId (AnswerId,PollId),
+ KEY CreatedById (CreatedById),
+ KEY UserIP (UserIP)
+);
+
+INSERT INTO ConfigurationAdmin VALUES ('poll_CommentDelay_Value', 'la_Text_Polls', 'la_prompt_DupPollComments', 'text', '', '', 60.1, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('poll_CommentDelay_Interval', 'la_Text_Polls', 'la_prompt_DupPollComments', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 60.2, 2, 1);
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'poll_CommentDelay_Interval', '60', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'poll_CommentDelay_Value', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+
+UPDATE Category SET Template = '/in-bulletin/designs/section' WHERE Template = 'inbulletin/index';
+UPDATE Category SET CachedTemplate = '/in-bulletin/designs/section' WHERE CachedTemplate = 'inbulletin/index';
+
+UPDATE ConfigurationValues SET VariableValue = '/in-bulletin/designs/section' WHERE VariableName = 'bb_CategoryTemplate';
+UPDATE ConfigurationValues SET VariableValue = 'in-bulletin/designs/detail' WHERE VariableName = 'bb_ItemTemplate';
+
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:topics.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:setting_folder.view', 11, 1, 1, 0);
+DELETE FROM Permissions WHERE Permission LIKE 'in-bulletin:inbulletin_general.%';
+
+UPDATE Phrase SET Module = 'In-Bulletin' WHERE ((Phrase LIKE '%Topic%' OR Phrase LIKE '%Post%' OR Phrase LIKE '%Forum%' OR Phrase LIKE '%Censor%' OR Phrase LIKE '%Smiley%' OR Phrase = 'la_title_In-Bulletin') AND (Module = 'Core'));
+
+# ===== v 5.0.1 =====
+UPDATE ConfigurationValues SET VariableValue = 'in-bulletin/topics/topic_detail' WHERE VariableName = 'bb_ItemTemplate';
+
+UPDATE ConfigurationAdmin
+SET ValueList = 'TopicText=la_opt_TopicText,Posts=la_opt_NumberOfPosts,CreatedOn=la_opt_CreatedOn,LastPostDate=la_opt_LastUpdated,Views=la_opt_TopicViews,CachedRating=la_opt_Rating,LastPoser=la_opt_LastPoster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) '
+WHERE VariableName IN ('Topic_SortField', 'Topic_SortField2');
+
+UPDATE ConfigurationAdmin
+SET ValueList = 'ASC=la_common_Ascending,DESC=la_common_Descending'
+WHERE VariableName IN ('Topic_SortOrder', 'Topic_SortOrder2');
+
+UPDATE ConfigurationAdmin SET ValueList = '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year' WHERE VariableName = 'topic_ReviewDelay_Interval';
+UPDATE ConfigurationAdmin SET ValueList = '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year' WHERE VariableName = 'topic_RatingDelay_Interval';
+UPDATE ConfigurationAdmin SET ValueList = '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year' WHERE VariableName = 'poll_CommentDelay_Interval';
+
+UPDATE CustomField SET FieldLabel = 'la_fld_cust_bb_ItemTemplate', Prompt = 'la_fld_cust_bb_ItemTemplate' WHERE FieldName = 'bb_ItemTemplate';
+
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add.pending', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.ADD.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.add.pending', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify.pending', 1);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.MODIFY.PENDING', NULL, 1, 1, NULL, 'In-Bulletin', 'la_event_topic.modify.pending', 0);
+INSERT INTO Events VALUES(DEFAULT, 'TOPIC.APPROVE', NULL, 1, 0, NULL, 'In-Bulletin', 'la_event_topic.approve', 0);
+
+UPDATE ConfigurationAdmin SET ValueList = 'style="width: 50px;"' WHERE VariableName IN ('topic_ReviewDelay_Value', 'topic_RatingDelay_Value', 'poll_CommentDelay_Value');
+
+# ===== v 5.0.2-B1 =====
+ALTER TABLE PrivateMessageBody CHANGE Body Body text NULL;
+
+ALTER TABLE Emoticon CHANGE EmotionImage EmotionImage VARCHAR(255) NOT NULL DEFAULT '';
+
+ALTER TABLE Polls
+ CHANGE CreatedOn CreatedOn INT(11) UNSIGNED NULL DEFAULT NULL ,
+ CHANGE StartDate StartDate INT(11) UNSIGNED NULL DEFAULT NULL ,
+ CHANGE CachedVotesQty CachedVotesQty INT(11) NOT NULL DEFAULT '0';
+
+ALTER TABLE PollsAnswers
+ CHANGE PollId PollId INT(11) NOT NULL DEFAULT '0',
+ CHANGE VotesQty VotesQty INT(11) NOT NULL DEFAULT '0';
+
+ALTER TABLE PollsComments
+ CHANGE PollId PollId INT(11) NOT NULL DEFAULT '0',
+ CHANGE GuestName GuestName VARCHAR(255) NOT NULL DEFAULT '',
+ CHANGE GuestEmail GuestEmail VARCHAR(255) NOT NULL DEFAULT '',
+ CHANGE CreatedOn CreatedOn INT(11) NULL DEFAULT NULL ,
+ CHANGE UserIP UserIP VARCHAR(255) NOT NULL DEFAULT '',
+ CHANGE Priority Priority INT(11) NOT NULL DEFAULT '0';
+
+ALTER TABLE PollsStatistics CHANGE UserIP UserIP VARCHAR(255) NOT NULL DEFAULT '';
+
+ALTER TABLE Posting
+ CHANGE CreatedOn CreatedOn INT(11) NULL DEFAULT NULL,
+ CHANGE Modified Modified INT(11) NULL DEFAULT NULL;
+
+ALTER TABLE PrivateMessages CHANGE CreatedOn CreatedOn INT(11) UNSIGNED NULL DEFAULT NULL;
+
+ALTER TABLE Topic
+ CHANGE Modified Modified INT(11) NULL DEFAULT NULL,
+ CHANGE CreatedOn CreatedOn INT(11) NULL DEFAULT NULL;
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/constants.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/constants.php (revision 0)
+++ branches/5.0.x/in-bulletin/constants.php (revision 12744)
@@ -0,0 +1,23 @@
+toolkit;
+ /* @var $toolkit kInstallToolkit */
+ }
+
+ $application =& kApplication::Instance();
+ $application->Init();
+
+ if ($application->RecallVar('user_id') != -1) {
+ die('restricted access!');
+ }
+
+ $category =& $toolkit->createModuleCategory('Forums', 'Discussion Forums', '/in-bulletin/designs/section', 'in-bulletin/img/menu_topics.gif');
+
+ $toolkit->RunSQL('/' . $module_folder . '/install/install_schema.sql');
+ $toolkit->RunSQL('/' . $module_folder . '/install/install_data.sql', '{TopicCatId}', $category->GetID());
+ $toolkit->ImportLanguage('/' . $module_folder . '/install/english');
+
+ $toolkit->SetModuleRootCategory($module_folder, $category->GetID());
+
+// $toolkit->linkCustomFields($module_folder, 'bb', 3); // to create Custom Fields for Topics
+ $toolkit->linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field
+ $toolkit->setModuleItemTemplate($category, 'bb', 'in-bulletin/topics/topic_detail');
+
+ $toolkit->finalizeModuleInstall($module_folder, true);
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/relations_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/relations_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/relations_edit.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/topics_reviews.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/topics_reviews.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/topics_reviews.tpl (revision 12744)
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/topics_images.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/topics_images.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/topics_images.tpl (revision 12744)
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/topics_relations.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/topics_relations.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/topics_relations.tpl (revision 12744)
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+
+
+
+
+ ">
+ ">
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/topics_categories.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/topics_categories.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/topics_categories.tpl (revision 12744)
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/images_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/images_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/images_edit.tpl (revision 12744)
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/topics_custom.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/topics_custom.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/topics_custom.tpl (revision 12744)
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/review_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/review_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/review_edit.tpl (revision 12744)
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/topics/topics_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/topics/topics_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/topics/topics_edit.tpl (revision 12744)
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/emoticons/emoticon_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/emoticons/emoticon_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/emoticons/emoticon_edit.tpl (revision 12744)
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: branches/5.0.x/in-bulletin/admin_templates/emoticons/emoticon_list.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/emoticons/emoticon_list.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/emoticons/emoticon_list.tpl (revision 12744)
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/catalog_tab.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/catalog_tab.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/catalog_tab.tpl (revision 12744)
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
" view_template="in-bulletin/catalog_tab" edit_template="in-bulletin/topics/topics_edit" category_id="-1" dep_buttons="new_topic" class="catalog-tab">
+
+
+
+
+ $Catalog.setItemCount(' ', ' ');
+
+
+
+
+
+
+
+
+
+
+ $Catalog.setItemCount(' ', ' ');
+ $Catalog.setCurrentCategory(' ', );
+ $Catalog.saveSearch(' ', ' ', ' ');
+
+
+
+
+ Grids[' '].AddAlternativeGrid(' ', true);
+
+ Grids[' '].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','sep3','cut','copy','move_up','move_down','sep6'));
+ $Catalog.reflectPasteButton( );
+ $Catalog.setViewMenu(' ');
+
+ Grids[' '].DblClick = function() {return false};
+
+ #separator#
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/category_properties.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/category_properties.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/category_properties.tpl (revision 12744)
@@ -0,0 +1,2 @@
+
+
Index: branches/5.0.x/in-bulletin/admin_templates/censorship/censorship_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/censorship/censorship_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/censorship/censorship_edit.tpl (revision 12744)
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/censorship/censorship_list.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/censorship/censorship_list.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/censorship/censorship_list.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/user_item_tab.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/user_item_tab.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/user_item_tab.tpl (revision 12744)
@@ -0,0 +1,34 @@
+
+
+
+
+
" view_template="in-bulletin/user_item_tab" edit_template="in-bulletin/topics/topics_edit" dep_buttons="new_topic" category_id="-1" class="catalog-tab">
+
+
+
+
+
+
+
+
+
+
+
+ $Catalog.setItemCount(' ', ' ');
+ $Catalog.setCurrentCategory(' ', );
+ $Catalog.saveSearch(' ', ' ', ' ');
+
+
+
+ Grids[' '].SetDependantToolbarButtons( new Array('edit','delete'));
+ $Catalog.setViewMenu(' ');
+ #separator#
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/img/logo_bg.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/in-bulletin/admin_templates/img/itemicons/icon16_topic_new.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/in-bulletin/admin_templates/img/itemicons/icon16_topic_pick.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/in-bulletin/admin_templates/img/itemicons/icon16_topic_hot.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/in-bulletin/admin_templates/img/itemicons/icon16_topic_pending.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/in-bulletin/admin_templates/img/itemicons/icon16_topic_disabled.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/in-bulletin/admin_templates/img/itemicons/icon16_topic.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/in-bulletin/admin_templates/img/itemicons/icon16_topic_pop.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/in-bulletin/admin_templates/img/icons/icon24_settings_in-bulletin.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/in-bulletin/admin_templates/img/icons/icon46_list_settings_smiley.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/in-bulletin/admin_templates/img/icons/icon46_settings_in-bulletin.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/in-bulletin/admin_templates/img/icons/icon46_list_settings_censor.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/in-bulletin/admin_templates/img/icons/icon24_settings_censor.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/in-bulletin/admin_templates/img/icons/icon46_topics.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/in-bulletin/admin_templates/img/icons/icon24_settings_smiley.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/in-bulletin/admin_templates/img/icons/icon46_list_settings_in-bulletin.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/in-bulletin/admin_templates/img/icons/icon46_settings_smiley.gif
===================================================================
diff -u
Binary files differ
Index: branches/RC/in-bulletin/admin_templates/img/icons/icon46_settings_censor.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/toolbar/tool_new_topic.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/toolbar/tool_new_topic_f3.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/img/toolbar/tool_new_topic_f2.gif
===================================================================
diff -u
Binary files differ
Index: branches/5.0.x/in-bulletin/admin_templates/polls/comment_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/polls/comment_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/polls/comment_edit.tpl (revision 12744)
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit_answers.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit_answers.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit_answers.tpl (revision 12744)
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/polls/answer_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/polls/answer_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/polls/answer_edit.tpl (revision 12744)
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/polls/poll_list.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/polls/poll_list.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/polls/poll_list.tpl (revision 12744)
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit_comments.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit_comments.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit_comments.tpl (revision 12744)
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit.tpl
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit.tpl (revision 0)
+++ branches/5.0.x/in-bulletin/admin_templates/polls/poll_edit.tpl (revision 12744)
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/topics/topics_tag_processor.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/topics/topics_tag_processor.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/topics/topics_tag_processor.php (revision 12744)
@@ -0,0 +1,79 @@
+ItemLink($params, 'topic');
+ }
+
+ function ListTopics($params)
+ {
+ return $this->PrintList2($params);
+ }
+
+ function PostingLink($params)
+ {
+ $item_id = getArrayValue($params, 'posting_id');
+ if (!$item_id) {
+ $item_id = $this->Application->GetVar($this->Prefix.'_post_id');
+ }
+ $params[$this->Prefix.'_post_id'] = $item_id;
+ return $this->TopicLink($params);
+ }
+
+ function PostingDeleteLink($params)
+ {
+ $params['Action'] = 'bb_post_delete';
+ return $this->PostingLink($params);
+ }
+
+ /**
+ * Returns topic replies count
+ *
+ * @param Array $params
+ * @return int
+ */
+ function TopicReplies($params)
+ {
+ $object =& $this->getObject($params);
+
+ // -1 - don't count post created together with topic
+ return $object->GetDBField('Posts') ? $object->GetDBField('Posts') - 1 : 0;
+ }
+
+ /**
+ * Returns topic lock statis
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function IsLocked($params)
+ {
+ $object =& $this->getObject($params);
+
+ return $object->GetDBField('TopicType') == 0;
+ }
+
+ function LockToggleLink($params)
+ {
+ $params[$this->Prefix.'_event'] = 'OnTopicLockToggle';
+ $params['pass'] = 'm,'.$this->Prefix;
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/topics/topics_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/topics/topics_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/topics/topics_config.php (revision 12744)
@@ -0,0 +1,407 @@
+ 'bb',
+ 'ItemClass' => Array('class' => 'kCatDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kCatDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'TopicsEventHandler', 'file' => 'topics_event_handler.php', 'require_classes' => Array('kCatDBEventHandler'), 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'TopicsTagProcessor', 'file' => 'topics_tag_processor.php', 'require_classes' => Array('kCatDBTagProcessor'), 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'ConfigPriority' => 0,
+
+ 'RewritePriority' => 103,
+ 'RewriteListener' => 'ModRewriteHelper:CategoryItemRewriteListener',
+
+ 'Hooks' => Array (
+ Array (
+ 'Mode' => hBEFORE,
+ 'Conditional' => false,
+ 'HookToPrefix' => '',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnAfterConfigRead'),
+ 'DoPrefix' => 'cdata',
+ 'DoSpecial' => '*',
+ 'DoEvent' => 'OnDefineCustomFields',
+ ),
+ ),
+
+ 'CatalogItem' => true,
+ 'AdminTemplatePath' => 'topics',
+ 'AdminTemplatePrefix' => 'topics_',
+ 'SearchConfigPostfix' => 'topics',
+
+ 'IDField' => 'TopicId',
+ 'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events
+
+ 'TitleField' => 'TopicText', // field, used in bluebar when editing existing item
+ 'TitlePhrase' => 'la_Text_Topic', // phrase used to specify item type in relationship list
+ 'OwnerField' => 'OwnerId', // usually it is CreatedById
+
+ 'TitlePresets' => Array(
+ 'default' => Array( 'new_status_labels' => Array('bb' => '!la_title_AddingTopic!'),
+ 'edit_status_labels' => Array('bb' => '!la_title_EditingTopic!'),
+ 'new_titlefield' => Array('bb' => '!la_title_NewTopic!'),
+ ),
+
+ 'topics_edit' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_General!"),
+ 'topics_categories' => Array('prefixes' => Array('bb','bb-ci_List'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Categories!"),
+ 'topics_relations' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Relations!"),
+ 'topics_images' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Images!"),
+ 'topics_reviews' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Reviews!"),
+ 'topics_custom' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Custom!"),
+
+ 'images_edit' => Array( 'prefixes' => Array('bb', 'bb-img'),
+ 'new_status_labels' => Array('bb-img'=>'!la_title_Adding_Image!'),
+ 'edit_status_labels' => Array('bb-img'=>'!la_title_Editing_Image!'),
+ 'new_titlefield' => Array('bb-img'=>'!la_title_New_Image!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-img_status# '#bb-img_titlefield#'",
+ ),
+
+ 'reviews_edit' => Array( 'prefixes' => Array('bb', 'bb-rev'),
+ 'new_status_labels' => Array('bb-rev'=>"!la_title_Adding_Review! '!la_title_New_Review!'"),
+ 'edit_status_labels' => Array('bb-rev'=>'!la_title_Editing_Review!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-rev_status#",
+ ),
+
+ 'relations_edit' => Array( 'prefixes' => Array('bb', 'bb-rel'),
+ 'new_status_labels' => Array('bb-rel'=>"!la_title_Adding_Relationship! '!la_title_New_Relationship!'"),
+ 'edit_status_labels' => Array('bb-rel'=>'!la_title_Editing_Relationship!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-rel_status#",
+ ),
+
+ 'tree_in-bulletin' => Array('format' => '!la_Text_Version! '.$this->Application->findModule('Name', 'In-Bulletin', 'Version')),
+ ),
+
+ 'EditTabPresets' => Array (
+ 'Default' => Array (
+ 'general' => Array ('title' => 'la_tab_General', 't' => 'in-bulletin/topics/topics_edit', 'priority' => 1),
+ 'categories' => Array ('title' => 'la_tab_Categories', 't' => 'in-bulletin/topics/topics_categories', 'priority' => 2),
+ 'relations' => Array ('title' => 'la_tab_Relations', 't' => 'in-bulletin/topics/topics_relations', 'priority' => 3),
+ 'images' => Array ('title' => 'la_tab_Images', 't' => 'in-bulletin/topics/topics_images', 'priority' => 4),
+ 'reviews' => Array ('title' => 'la_tab_Reviews', 't' => 'in-bulletin/topics/topics_reviews', 'priority' => 5),
+ 'custom' => Array ('title' => 'la_tab_Custom', 't' => 'in-bulletin/topics/topics_custom', 'priority' => 6),
+ ),
+ ),
+
+ 'PermItemPrefix' => 'TOPIC',
+
+ 'PermTabText' => 'In-Bulletin',
+ 'PermSection' => Array('main' => 'CATEGORY:in-bulletin:topics_list', 'search' => 'in-bulletin:configuration_search', 'email' => 'in-bulletin:configuration_email', 'custom' => 'in-bulletin:configuration_custom'),
+
+ 'Sections' => Array(
+ /*'in-bulletin' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'settings_in-bulletin',
+ 'label' => 'la_title_In-Bulletin',
+ 'url' => Array('t' => 'index', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 3.3,
+ 'container' => true,
+ 'type' => stTREE,
+ ),*/
+
+ 'in-bulletin:topics' => Array(
+ 'parent' => 'in-portal:site',
+ 'icon' => 'topics',
+ 'label' => 'la_tab_Topics',
+ 'url' => Array('t' => 'catalog/advanced_view', 'anchor' => 'tab-bb.showall', 'pass' => 'm'),
+ 'onclick' => 'setCatalogTab(\'bb.showall\')',
+ 'permissions' => Array('view'),
+ 'priority' => 3.4,
+ 'type' => stTREE,
+ ),
+
+ // topic settings
+ 'in-bulletin:setting_folder' => Array (
+ 'parent' => 'in-portal:system',
+ 'icon' => 'conf_topics',
+ 'label' => 'la_title_In-Bulletin',
+ 'url' => Array ('t' => 'index', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array ('view'),
+ 'priority' => 3.5,
+ 'container' => true,
+ 'type' => stTREE,
+ ),
+
+ /*'in-bulletin:inbulletin_general' => Array(
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'core:settings_general',
+ 'label' => 'la_tab_GeneralSettings',
+ 'url' => Array('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 2.9,
+ 'type' => stTREE,
+ ),*/
+
+ 'in-bulletin:configuration_output' => Array(
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'core:conf_output',
+ 'label' => 'la_tab_ConfigOutput',
+ 'url' => Array('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_search' => Array(
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'core:conf_search',
+ 'label' => 'la_tab_ConfigSearch',
+ 'url' => Array('t' => 'config/config_search', 'module_key' => 'topics', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+
+ 'in-bulletin:configuration_email' => Array(
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'core:conf_email',
+ 'label' => 'la_tab_ConfigE-mail',
+ 'url' => Array('t' => 'config/config_email', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_custom' => Array(
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'core:conf_customfields',
+ 'label' => 'la_tab_ConfigCustom',
+ 'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 3, 'pass_section' => true, 'pass' => 'm,cf'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 6,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_new'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_hot'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_pop'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_pick'), 'type' => WHERE_FILTER),
+ ),
+ 'Filters' => Array(
+ 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
+ 'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ),
+ 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
+ 's1' => Array(),
+ 'show_new' => Array('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ),
+ 'show_hot' => Array('label' => 'la_Text_Hot', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ),
+ 'show_pop' => Array('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ),
+ 'show_pick' => Array('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '%1$s.`EditorsPick` != 1' ),
+ )
+ ),
+
+ 'CatalogSelectorName' => 'topiclist',
+
+ 'ItemPropertyMappings' => Array(
+ 'NewDays' => 'Topic_NewDays', // number of days item to be NEW
+ 'MinPopVotes' => 'Topic_MinPopVotes', // minimum number of votes for an item to be POP
+ 'MinPopRating' => 'Topic_MinPopRating', // minimum rating for an item to be POP
+ 'MaxHotNumber' => 'Topic_MaxHotNumber', // maximum number of HOT items
+
+ 'HotLimit' => 'Topic_HotLimit', // variable name in inp_Cache table
+ 'ClickField' => 'Views', // item click count is stored here (in item table)
+ ),
+
+ 'ItemType' => 3, // this is used when relation to product is added from in-portal and via-versa
+
+ 'ViewMenuPhrase' => 'la_title_Topics',
+ 'CatalogTabIcon' => 'in-bulletin:icon16_topics.png',
+ 'UsePendingEditing' => true, // item editing is controlled by TOPIC.ADD/EDIT, TOPIC.ADD/EDIT.PENDING permissions
+
+ 'StatisticsInfo' => Array(
+ 'pending' => Array(
+ 'icon' => 'icon16_topic_pending.gif',
+ 'label' => 'la_Text_Topics',
+ 'js_url' => '#url#',
+ 'url' => Array('t' => 'catalog/advanced_view', 'SetTab' => 'bb', 'pass' => 'm,bb.showall', 'bb.showall_event' => 'OnSetFilterPattern', 'bb.showall_filters' => 'show_active=0,show_pending=1,show_disabled=0,show_new=1,show_hot=1,show_pop=1,show_pick=1'),
+ 'status' => STATUS_PENDING,
+ ),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'Topic',
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.OwnerId = -1, "root", IF (%1$s.OwnerId = -2, "Guest", "n/a")), u.Login)',
+ 'CategoryId' => TABLE_PREFIX.'%3$sCategoryItems.CategoryId',
+ 'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename',
+ 'PrimaryCat' => TABLE_PREFIX.'%3$sCategoryItems.PrimaryCat',
+ 'ParentPath' => TABLE_PREFIX.'Category.ParentPath',
+
+ 'SameImages' => 'img.SameImages',
+ 'LocalThumb' => 'img.LocalThumb',
+ 'ThumbPath' => 'img.ThumbPath',
+ 'ThumbUrl' => 'img.ThumbUrl',
+ 'LocalImage' => 'img.LocalImage',
+ 'LocalPath' => 'img.LocalPath',
+ 'FullUrl' => 'img.Url',
+
+ 'LastPoster' => 'IF (ISNULL(last_post.PosterAlias), "Guest", last_post.PosterAlias)',
+ 'LastPosterId' => 'last_post.CreatedById',
+ ),
+ ),
+
+ 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId
+ LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'Images img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1
+ LEFT JOIN '.TABLE_PREFIX.'PermCache perm ON perm.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.OwnerId = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'Posting last_post ON last_post.PostingId = %1$s.LastPostId
+ LEFT JOIN '.TABLE_PREFIX.'%3$sTopicCustomData cust ON %1$s.ResourceId = cust.ResourceId',
+ ), // key - special, value - list select sql
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('TopicText' => 'asc'),
+ )
+ ),
+ 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId
+ LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'Images img ON img.ResourceId = %1$s.ResourceId AND img.DefaultImg = 1
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.OwnerId = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'Posting last_post ON last_post.PostingId = %1$s.LastPostId
+ LEFT JOIN '.TABLE_PREFIX.'%3$sTopicCustomData cust ON %1$s.ResourceId = cust.ResourceId'),
+
+ 'SubItems' => Array('bb-rev', 'bb-ci', 'bb-rel', 'bb-img', 'bb-cdata', 'bb-fav', 'bb-post'),
+
+ 'Fields' => Array (
+ 'TopicId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,),
+ 'NotifyOwnerOnChanges' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'lu_No', 1 => 'lu_Yes'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
+ 'Modified' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'),
+ 'TopicText' => Array('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'AutomaticFilename' => Array('type' => 'int', 'not_null' => 1, 'default' => 1),
+ 'Posts' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Views' => Array('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%d', 'not_null' => 1, 'default' => 0),
+ 'EditorsPick' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
+ 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
+ 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'OwnerId' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'required' => 1, 'default' => -1),
+ 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => 0),
+ 'ResourceId' => Array('type' => 'int', 'default' => null),
+ 'TopicType' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_Yes', 1 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1),
+ 'CreatedOn' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'),
+ 'CachedReviewsQty' => Array('type' => 'int' ,'not_null' => 1, 'default' => 0),
+ 'CachedRating' => Array('type' => 'string', 'not_null' => 1, 'default' => 0),
+ 'CachedVotesQty' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'PostedBy' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'OrgId' => Array('type' => 'int', 'default' => null),
+ 'LastPostId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'LastPostDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null),
+ 'TodayDate' => Array('type' => 'string', 'default' => null),
+ 'TodayPosts' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'MetaKeywords' => Array('type' => 'string', 'default' => null),
+ 'MetaDescription' => Array('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => null),
+ ),
+
+ 'VirtualFields' => Array (
+ 'UserName' => Array ('type'=>'string', 'default' => ''),
+ 'CategoryId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (), 'default' => 0),
+ 'Filename' => Array ('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'CachedNavbar' => Array ('type' => 'string', 'default' => ''),
+
+ 'LastPoster' => Array ('type' => 'string', 'default' => ''),
+ 'LastPosterId' => Array ('type' => 'int', 'default' => -2),
+ 'PostingText' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'required' => 1, 'using_fck' => 1, 'allow_html' => 1, 'default' => ''),
+ 'DisableBBCodes' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'DisableSmileys' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'ShowSignatures' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 1),
+
+ // for primary image
+ 'SameImages' => Array('type' => 'string', 'default' => ''),
+ 'LocalThumb' => Array('type' => 'string', 'default' => ''),
+ 'ThumbPath' => Array('type' => 'string', 'default' => ''),
+ 'ThumbUrl' => Array('type' => 'string', 'default' => ''),
+ 'LocalImage' => Array('type' => 'string', 'default' => ''),
+ 'LocalPath' => Array('type' => 'string', 'default' => ''),
+ 'FullUrl' => Array('type' => 'string', 'default' => ''),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array(
+ 'default' => 'icon16_topic.png',
+ 0 => 'icon16_topic_disabled.png',
+ 1 => 'icon16_topic.png',
+ 2 => 'icon16_topic_pending.png',
+ 'NEW' => 'icon16_topic_new.png',
+ ),
+ 'Fields' => Array(
+ 'TopicId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
+ 'TopicText' => Array('title' => 'la_col_TopicText', 'data_block' => 'grid_catitem_td', 'filter_block' => 'grid_like_filter', 'width' => 300, 'first_chars' => 290, ),
+ 'UserName' => Array('title' => 'la_col_PostedBy', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
+ 'CreatedOn' => Array('title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'Status' => Array('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 70, ),
+ 'LastPostDate' => Array('title' => 'la_col_LastPostOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'Posts' => Array('title' => 'la_col_Posts', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
+ 'Views' => Array('title' => 'la_col_Views', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
+ ),
+ ),
+
+ 'Radio' => Array(
+ 'Icons' => Array(
+ 'default' => 'icon16_topic.png',
+ 0 => 'icon16_topic_disabled.png',
+ 1 => 'icon16_topic.png',
+ 2 => 'icon16_topic_pending.png',
+ 'NEW' => 'icon16_topic_new.png', ),
+ 'Selector' => 'radio',
+ 'Fields' => Array(
+ 'TopicId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
+ 'TopicText' => Array('title' => 'la_col_TopicText', 'data_block' => 'grid_catitem_td', 'filter_block' => 'grid_like_filter', 'width' => 300, 'first_chars' => 290, ),
+ 'UserName' => Array('title' => 'la_col_PostedBy', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
+ 'CreatedOn' => Array('title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'Status' => Array('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 70, ),
+ 'LastPostDate' => Array('title' => 'la_col_LastPostOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'Posts' => Array('title' => 'la_col_Posts', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
+ 'Views' => Array('title' => 'la_col_Views', 'filter_block' => 'grid_range_filter', 'width' => 70, ),
+ ),
+ ),
+ ),
+
+ 'ConfigMapping' => Array(
+ 'PerPage' => 'Perpage_Topics',
+ 'ShortListPerPage' => 'Perpage_Topics_Short',
+ 'ForceEditorPick' => 'Topic_EditorPicksAbove',
+ 'DefaultSorting1Field' => 'Topic_SortField',
+ 'DefaultSorting2Field' => 'Topic_SortField2',
+ 'DefaultSorting1Dir' => 'Topic_SortOrder',
+ 'DefaultSorting2Dir' => 'Topic_SortOrder2',
+
+ 'RatingDelayValue' => 'topic_RatingDelay_Value',
+ 'RatingDelayInterval' => 'topic_RatingDelay_Interval',
+ ),
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/topics/topics_event_handler.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/topics/topics_event_handler.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/topics/topics_event_handler.php (revision 12744)
@@ -0,0 +1,210 @@
+Name == 'OnTopicLockToggle') {
+ $object =& $event->getObject();
+ /* @var $object kCatDBItem */
+
+ if (!$object->isLoaded()) {
+ $event->status = erPERM_FAIL;
+ return false;
+ }
+
+ $category_id = $object->GetDBField('CategoryId');
+ $perm_status = $this->Application->CheckPermission('TOPIC.LOCK', 0, $category_id);
+
+ if (!$perm_status) {
+ $event->status = erPERM_FAIL;
+ }
+
+ return $perm_status;
+ }
+
+ return parent::CheckPermission($event);
+ }
+
+ /**
+ * Lock or unlock topic
+ *
+ * @param kEvent $event
+ */
+ function OnToggleLock(&$event)
+ {
+ $object =& $event->getObject();
+
+ $new_type = $object->GetDBField('TopicType') ? 0 : 1;
+ $object->SetDBField('TopicType', $new_type);
+ $object->Update();
+ }
+
+ /**
+ * Cache topic owner
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ parent::OnBeforeItemUpdate($event);
+
+ $this->cacheItemOwner($event, 'OwnerId', 'PostedBy');
+ }
+
+ /**
+ * Cache topic owner
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ parent::OnBeforeItemCreate($event);
+
+ $this->cacheItemOwner($event, 'OwnerId', 'PostedBy');
+
+ $object =& $event->getObject();
+ /* @var $object kCatDBItem */
+
+ if (!$object->GetDBField('TodayDate')) {
+ $object->SetDBField('TodayDate', adodb_date('Y-m-d'));
+ }
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $object->SetDBField('TopicText', $post_helper->CensorText( $object->GetDBField('TopicText') ));
+ }
+
+ /**
+ * Creates 1st post when topic is created
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ parent::OnAfterItemCreate($event);
+
+ if ($event->Special == '-item') {
+ // don't create first post when cloning
+ return ;
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $post =& $this->Application->recallObject($event->Prefix.'-post', null, Array ('skip_autoload' => true));
+ /* @var $post kDBItem */
+
+ $post->SetDBField('Pending', $object->GetDBField('Status') == STATUS_ACTIVE ? 0 : 1);
+ $post->SetDBField('Subject', '');
+ $post->SetDBField('PostingText', $object->GetDBField('PostingText'));
+
+ $post->SetDBField('ShowSignatures', $object->GetDBField('ShowSignatures'));
+ $post->SetDBField('DisableSmileys', $object->GetDBField('DisableSmileys'));
+ $post->SetDBField('DisableBBCodes', $object->GetDBField('DisableBBCodes'));
+
+ $post->Create();
+
+ // need to update category topic count here
+ }
+
+ /**
+ * Approves 1st post when topic got approved
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ if (!$this->Application->isAdminUser) {
+ return ;
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kCatDBItem */
+
+ if ($object->GetDBField('Posts') == 1) {
+ $post =& $this->Application->recallObject($event->Prefix.'-post', null, Array('skip_autoload' => true));
+ /* @var $post kDBItem */
+
+ $main_status = $object->GetDBField('Status');
+ $post->Load($object->GetDBField('LastPostId'));
+ if ($post->isLoaded()) {
+ $post->SetDBField('Pending', $main_status == STATUS_ACTIVE ? 0 : 1);
+ $post->Update();
+ }
+ }
+ }
+
+ /**
+ * Makes first post body field non-requered when topic has posts already
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ parent::OnAfterItemLoad($event);
+
+ $object =& $event->getObject();
+ /* @var $object kCatDBItem */
+
+ if ($object->GetDBField('Posts') > 0 || !$this->Application->isAdminUser) {
+ $object->setRequired('PostingText', false);
+ }
+ }
+
+ /**
+ * Locks or unlocks topic
+ *
+ * @param kEvent $event
+ */
+ function OnTopicLockToggle(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kCatDBItem */
+
+ $topic_type = $object->GetDBField('TopicType');
+ $object->SetDBField('TopicType', $topic_type == 1 ? 0 : 1);
+ $object->Update();
+ }
+
+ /**
+ * Sets default values to posting options based on persistent session
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ parent::OnAfterConfigRead($event);
+
+ $fields = $this->Application->getUnitOption($event->Prefix, 'Fields');
+ $fields['NotifyOwnerOnChanges']['default'] = (int)$this->Application->RecallPersistentVar('owner_notify');
+ $this->Application->setUnitOption($event->Prefix, 'Fields', $fields);
+
+ $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields');
+ $virtual_fields['DisableBBCodes']['default'] = (int)!$this->Application->RecallPersistentVar('bbcode');
+ $virtual_fields['DisableSmileys']['default'] = (int)!$this->Application->RecallPersistentVar('smileys');
+ $virtual_fields['ShowSignatures']['default'] = (int)$this->Application->RecallPersistentVar('show_sig');
+ $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields);
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/poll_answers/poll_answers_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/poll_answers/poll_answers_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/poll_answers/poll_answers_config.php (revision 12744)
@@ -0,0 +1,85 @@
+ 'poll-answer',
+
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array ('class' => 'kDBEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event'
+ ),
+ 'IDField' => 'AnswerId',
+ 'TableName' => TABLE_PREFIX . 'PollsAnswers',
+
+ 'ParentPrefix' => 'poll',
+ 'ForeignKey' => 'PollId',
+ 'ParentTableKey' => 'PollId',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'StatusField' => Array('Status'),
+
+ // key - special, value - list select sql
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ ',
+ ),
+
+ 'ItemSQLs' => Array ('' => 'SELECT * FROM %s'),
+
+ 'ListSortings' => Array (
+ '' => Array(
+ 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('Answer' => 'ASC'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'AnswerId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'PollId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Answer' => Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'not_null' => 1, 'using_fck' => 1, 'default' => '', 'required' => 1),
+ 'VotesQty' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Active', 0 => 'la_opt_Disabled'), 'use_phrases' => 1, 'required' => 1, 'not_null' => 1, 'default' => 1),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 0 => 'icon16_disabled.png',
+ 1 => 'icon16_item.png',
+ 2 => 'icon16_pending.png',
+ 'module' => 'core',
+ ),
+ 'Fields' => Array (
+ 'AnswerId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
+ 'Answer' => Array ('title' => 'la_col_Name', 'data_block' => 'grid_priority_td', 'filter_block' => 'grid_like_filter', 'width' => 300, ),
+ 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
+ 'VotesQty' => Array ('title' => 'la_col_VoteCount', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
+
+ ),
+ ),
+ ),
+
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/emoticons/emoticon_eh.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/emoticons/emoticon_eh.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/emoticons/emoticon_eh.php (revision 12744)
@@ -0,0 +1,37 @@
+getObject();
+
+ $emoticon_file = $object->GetField('EmotionImage', 'full_path');
+ if ($emoticon_file) {
+ @unlink($emoticon_file);
+ }
+ }
+
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/emoticons/emoticons_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/emoticons/emoticons_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/emoticons/emoticons_config.php (revision 12744)
@@ -0,0 +1,102 @@
+ 'emoticon',
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array ('class' => 'EmoticonEventHandler', 'file' => 'emoticon_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'IDField' => 'EmoticonId',
+
+ 'TableName' => TABLE_PREFIX.'Emoticon',
+
+ 'TitleField' => 'Name',
+
+ 'TitlePresets' => Array (
+ 'default' => Array (
+ 'new_status_labels' => Array ('emoticon' => '!la_title_AddingSmiley!'),
+ 'edit_status_labels' => Array ('emoticon' => '!la_title_EditingSmiley!'),
+ ),
+
+ 'emoticon_list' => Array ('prefixes' => Array ('emoticon_List'), 'format' => "!la_tab_ConfigSmileys!"),
+ 'emoticon_edit' => Array ('prefixes' => Array ('emoticon'), 'format' => "#emoticon_status# '#emoticon_titlefield#'"),
+ ),
+
+ 'PermSection' => Array('main' => 'in-bulletin:configuration_emoticon'),
+
+ 'Sections' => Array (
+ 'in-bulletin:configuration_emoticon' => Array (
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'conf_smileys',
+ 'label' => 'la_tab_ConfigSmileys',
+ 'url' => Array('t' => 'in-bulletin/emoticons/emoticon_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s FROM %1$s',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array (
+ 'Sorting' => Array ('Name' => 'desc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'EmoticonId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Name' => Array ('type' => 'string', 'max_len' => 20, 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'KeyStroke' => Array ('type' => 'string', 'max_len' => 20, 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'Enabled' => Array ('type' => 'int', 'not_null' => 1, 'default' => 1),
+ 'EmotionImage' => Array (
+ 'type' => 'string', 'max_len' => 255,
+ 'formatter' => 'kUploadFormatter', 'allowed_types' => Array ('image/jpeg', 'image/jpg', 'image/gif', 'image/png', 'image/pjpeg'),
+ 'upload_dir' => SMILEYS_PATH,
+ 'not_null' => 1, 'required' => 1, 'default' => '',
+ ),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 0 => 'icon16_disabled.png',
+ 1 => 'icon16_item.png',
+ 'module' => 'core',
+ ),
+ 'Fields' => Array (
+ 'EmoticonId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50, ),
+ 'Name' => Array ('title' => 'la_col_Name', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
+ 'KeyStroke' => Array ('title' => 'la_col_KeyStroke', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
+ 'EmotionImage' => Array ('title' => 'la_col_Image', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
+ ),
+ ),
+ ),
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/private_messages/private_messages_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/private_messages/private_messages_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/private_messages/private_messages_config.php (revision 12744)
@@ -0,0 +1,109 @@
+ 'private-message',
+ 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'PrivateMessageEventHandler', 'file' => 'private_message_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'PrivateMessageTagProcessor', 'file' => 'private_message_tp.php', 'build_event' => 'OnBuild'),
+
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'IDField' => 'PmId',
+ 'StatusField' => Array ('Status'),
+ 'TitleField' => 'Subject',
+
+ 'PermSection' => Array('main' => 'in-bulletin:private_messages',),
+
+ 'TableName' => TABLE_PREFIX.'PrivateMessages',
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'Subject' => 'pmb.Subject',
+ 'Body' => 'pmb.Body',
+ ),
+ ),
+
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'%3$sPrivateMessageBody pmb ON pmb.PMBodyId = %1$s.PMBodyId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser from_user ON from_user.PortalUserId = %1$s.FromId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser to_user ON to_user.PortalUserId = %1$s.ToId',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array(
+ 'ForcedSorting' => Array('CreatedOn' => 'desc'),
+ ),
+ ),
+
+ 'ItemSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'%3$sPrivateMessageBody pmb ON pmb.PMBodyId = %1$s.PMBodyId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser from_user ON from_user.PortalUserId = %1$s.FromId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser to_user ON to_user.PortalUserId = %1$s.ToId',
+ ),
+
+ 'SubItems' => Array('private-message-body'),
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'Subject' => 'pmb.Subject',
+ 'Body' => 'pmb.Body',
+ 'Options' => 'pmb.Options',
+
+ 'FromName' => 'IF (ISNULL(from_user.Login), IF (%1$s.FromId = -1, "root", IF (%1$s.FromId = -2, "Guest", "n/a")), from_user.Login)',
+ 'ToName' => 'IF (ISNULL(to_user.Login), IF (%1$s.ToId = -1, "root", IF (%1$s.ToId = -2, "Guest", "n/a")), to_user.Login)',
+
+ 'FromFullName' => 'TRIM(CONCAT(from_user.FirstName, " ", from_user.LastName))',
+ 'ToFullName' => 'TRIM(CONCAT(to_user.FirstName, " ", to_user.LastName))',
+ ),
+ ),
+
+ 'Fields' => Array (
+ 'PmId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'FromId' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!lu_error_UserNotFound!'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'required' => 1, 'default' => null),
+ 'ToId' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!lu_error_UserNotFound!'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'required' => 1, 'default' => null),
+ 'FolderId' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'lu_Inbox', 1 => 'lu_Sent'), 'use_phrases' => 1, 'not_null' => 1, 'default' => PM_FOLDER_SENT),
+ 'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'lu_opt_MessageUnread', 1 => 'lu_opt_MessageViewed', 2 => 'lu_opt_MessageRead', 3 => 'lu_opt_MessageReplied', 4 => 'lu_opt_MessageSent'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
+ 'PMBodyId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
+ ),
+
+ 'VirtualFields' => Array (
+ 'FromName' => Array ('type' => 'string', 'default' => ''),
+ 'ToName' => Array ('type' => 'string', 'default' => ''),
+ 'Subject' => Array ('type' => 'string', 'default' => ''),
+ 'Body' => Array ('type' => 'string', 'required' => 1, 'default' => ''),
+ 'Options' => Array ('type' => 'string', 'default' => 0),
+
+ 'DisableBBCodes' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'DisableSmileys' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'ShowSignatures' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 1),
+ ),
+
+
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/private_messages/private_message_tp.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/private_messages/private_message_tp.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/private_messages/private_message_tp.php (revision 12744)
@@ -0,0 +1,164 @@
+getObject();
+ /* @var $object kDBItem */
+
+ return $object->GetDBField('Status') < PM_STATUS_READ;
+ }
+
+ /**
+ * Allows to check what folder is currently active
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function FolderSelected($params)
+ {
+ $folder_mapping = Array ('inbox' => PM_FOLDER_INBOX, 'sent' => PM_FOLDER_SENT);
+
+ return (int)$this->Application->GetVar('folder_id') == $folder_mapping[ strtolower($params['folder']) ];
+ }
+
+ /**
+ * Creates link to specific private message folder
+ *
+ * @param Array $params
+ * @return string
+ */
+ function FolderLink($params)
+ {
+ $folder_mapping = Array ('inbox' => PM_FOLDER_INBOX, 'sent' => PM_FOLDER_SENT);
+ $params['folder_id'] = $folder_mapping[ strtolower($params['folder']) ];
+ unset($params['folder']);
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ function MessageSubject($params)
+ {
+ $object =& $this->getObject();
+ /* @var $object kDBItem */
+
+ $params['field'] = 'Subject';
+ $value = $this->Field($params);
+
+ if (!$value && isset($params['empty_title'])) {
+ return '['.$this->Application->Phrase($params['empty_title']).']';
+ }
+
+ return $value;
+ }
+
+ function MessageBody($params)
+ {
+ $object =& $this->getObject($params);
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ // 2. parse post body
+ $sub_blocks = Array (
+ 'smileys' => $params['smiley_render_as'],
+ 'bbcode' => $params['bbcode_render_as'],
+ );
+
+ return $post_helper->parsePostBody($object->GetDBField('Body'), $object->GetDBField('Options'), $sub_blocks);
+ }
+
+ function DeleteLink($params)
+ {
+ $params['pass'] = 'm,'.$this->getPrefixSpecial();
+ $params[$this->getPrefixSpecial().'_event'] = 'OnDelete';
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ function ReplyLink($params)
+ {
+ $params['reply_to'] = $this->Application->GetVar($this->getPrefixSpecial().'_id');
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ /**
+ * User can reply message only in case, when it is not it's own message
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function CanReplyMessage($params)
+ {
+ $object =& $this->getObject();
+ /* @var $object kDBItem */
+
+ return $object->GetDBField('FromId') != $this->Application->RecallVar('user_id');
+ }
+
+ /**
+ * Marks private message as read
+ *
+ * @param Array $params
+ */
+ function MarkAsRead($params)
+ {
+ $object =& $this->getObject();
+ /* @var $object kDBItem */
+
+ if ($object->GetDBField('Status') < PM_STATUS_READ) {
+ $object->SetDBField('Status', PM_STATUS_READ);
+ $object->Update();
+ }
+ }
+
+ /**
+ * Returns link to private message sender/recipient public profile
+ *
+ * @param Array $params
+ * @return string
+ */
+ function ProfileLink($params)
+ {
+ $user_field = strtolower($params['type']) == 'from' ? 'FromId' : 'ToId';
+ unset($params['type']);
+
+ $object =& $this->getObject($params);
+ $params['user_id'] = $object->GetDBField($user_field);
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ /**
+ * Returns link for sending private message from user's public profile page
+ *
+ * @param Array $params
+ * @return string
+ */
+ function SendMessageLink($params)
+ {
+ $params['user_id'] = $this->Application->GetVar('user_id');
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/private_messages/private_message_eh.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/private_messages/private_message_eh.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/private_messages/private_message_eh.php (revision 12744)
@@ -0,0 +1,251 @@
+ Array('self' => true),
+ 'OnCreate' => Array('self' => true),
+ 'OnDelete' => Array('self' => true),
+ );
+
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Applies folder & message owner filter to message list
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ $folder_id = $this->Application->GetVar('folder_id');
+ if ($folder_id === false) {
+ $folder_id = PM_FOLDER_INBOX;
+ $this->Application->SetVar('folder_id', $folder_id);
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ $user_id = $this->Application->RecallVar('user_id');
+ if ($folder_id == PM_FOLDER_INBOX) {
+ $object->addFilter('owner_filter', '%1$s.ToId = '.$user_id);
+ }
+ else {
+ $object->addFilter('owner_filter', '%1$s.FromId = '.$user_id);
+ }
+ $object->addFilter('folder_filter', '%1$s.FolderId = '.$folder_id);
+ }
+
+ /**
+ * Puts message to Sent folder
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ if ($object->GetDBField('FolderId') != PM_FOLDER_SENT) {
+ // when creating "Inbox" message (from "Sent" message) don't reset folder & status
+ return ;
+ }
+
+ $user_id = $this->Application->RecallVar('user_id');
+ $object->SetDBField('FromId', $user_id);
+ $object->SetDBField('FolderId', PM_FOLDER_SENT);
+ $object->SetDBField('Status', PM_STATUS_READ);
+ }
+
+ /**
+ * Creates 1st post when topic is created
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ parent::OnAfterItemCreate($event);
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $this->Application->EmailEventUser('PM.ADD', $object->GetDBField('ToId'));
+
+ if ($object->GetDBField('FolderId') != PM_FOLDER_SENT) {
+ // 1. create message in sender's "Sent" folder (this method only for this step)
+ // 2. create message body (shared)
+ // 3. create message copy in recipient's "Inbox" folder
+ return ;
+ }
+
+ $message_body =& $this->Application->recallObject($event->Prefix.'-body', null, Array ('skip_autoload' => true));
+ /* @var $message_body kDBItem */
+
+ // 1. create message body (for sender & recipient)
+ $copy_fields = Array ('Subject', 'Body', 'ShowSignatures', 'DisableSmileys', 'DisableBBCodes');
+ $message_body->SetDBFieldsFromHash($object->GetFieldValues(), $copy_fields);
+
+ $body_created = $message_body->Create();
+ if ($body_created) {
+ // 2. link body with message
+ $object->SetDBField('PMBodyId', $message_body->GetID());
+ $object->Update();
+
+ // 3. create message in recipient's Inbox folder
+ $object->SetDBField('FolderId', PM_FOLDER_INBOX);
+ $object->SetDBField('Status', PM_STATUS_UNREAD);
+ $object->Create();
+ }
+ }
+
+ /**
+ * Sets post options to virtual fields
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $options_map = $post_helper->getOptionsMap();
+ $post_options = $object->GetDBField('Options');
+ foreach ($options_map as $option_name => $field_name) {
+ $option_value = $post_helper->GetPostOption($option_name, $post_options);
+ $object->SetDBField($field_name, (int)$option_value);
+ }
+ }
+
+ /**
+ * Goes to next_template after post creation
+ *
+ * @param kEvent $event
+ */
+ function OnCreate(&$event)
+ {
+ parent::OnCreate($event);
+
+ if ($event->status == erSUCCESS && !$this->Application->isAdmin) {
+ $event->SetRedirectParam('opener', 's');
+ $event->redirect = $this->Application->GetVar('next_template');
+ }
+ }
+
+ /**
+ * Prevents user from deleting other user private messages
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $user_id = $this->Application->RecallVar('user_id');
+ $owner_field = ($object->GetDBField('FolderId') == PM_FOLDER_INBOX) ? 'ToId' : 'FromId';
+ if ($object->GetDBField($owner_field) != $user_id) {
+ $event->status = erFAIL;
+ }
+ }
+
+ /**
+ * Updates reference counter in message body record
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $body_idfield = $this->Application->getUnitOption($event->Prefix.'-body', 'IDField');
+ $body_table = $this->Application->getUnitOption($event->Prefix.'-body', 'TableName');
+ $sql = 'UPDATE '.$body_table.'
+ SET ReferenceCount = ReferenceCount - 1
+ WHERE '.$body_idfield.' = '.$object->GetDBField('PMBodyId');
+ $this->Conn->Query($sql);
+ }
+
+ /**
+ * Sets default values to posting options based on persistent session
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields');
+ $virtual_fields['DisableBBCodes']['default'] = (int)!$this->Application->RecallPersistentVar('bbcode');
+ $virtual_fields['DisableSmileys']['default'] = (int)!$this->Application->RecallPersistentVar('smileys');
+ $virtual_fields['ShowSignatures']['default'] = (int)$this->Application->RecallPersistentVar('show_sig');
+ $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields);
+ }
+
+ /**
+ * Checks, that current user is recipient or sender of viewed message
+ *
+ * @param kEvent $event
+ * @return bool
+ */
+ function checkItemStatus(&$event)
+ {
+ $object =& $event->getObject();
+ if (!$object->isLoaded()) {
+ return true;
+ }
+
+ $user_id = $this->Application->RecallVar('user_id');
+ return ($object->GetDBField('FromId') == $user_id) || ($object->GetDBField('ToId') == $user_id);
+ }
+
+ /**
+ * Prepares new reply & new message form
+ *
+ * @param kEvent $event
+ */
+ function OnNew(&$event)
+ {
+ parent::OnNew($event);
+
+ $reply_to = $this->Application->GetVar('reply_to');
+ $user_id = $this->Application->GetVar('user_id');
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ if ($reply_to > 0) {
+ // reply to message
+ $source_msg =& $this->Application->recallObject($event->Prefix.'.-item', null, Array ('skip_autoload' => true));
+ /* @var $source_msg kDBItem */
+
+ $source_msg->Load($reply_to);
+
+ $object->SetDBField('ToId', $source_msg->GetDBField('FromId'));
+ $object->SetDBField('Subject', 'Re: '.$source_msg->GetDBField('Subject'));
+ }
+ elseif ($user_id > 0) {
+ // send message to any user by id
+ $object->SetDBField('ToId', $user_id);
+ }
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/posts/post_eh.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/posts/post_eh.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/posts/post_eh.php (revision 12744)
@@ -0,0 +1,400 @@
+Name, $events)) {
+ return true;
+ }
+
+ return parent::CheckPermission($event);
+ }
+
+ /**
+ * Sets default values
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $user_id = $this->Application->RecallVar('user_id');
+
+ $now = adodb_mktime();
+
+ $object->SetDBField('CreatedById', $user_id);
+ $object->SetDBField('CreatedOn_date', $now);
+ $object->SetDBField('CreatedOn_time', $now);
+
+ $object->SetDBField('ModifiedById', $user_id);
+ $object->SetDBField('Modified_date', $now);
+ $object->SetDBField('Modified_time', $now);
+
+ $object->SetDBField('IPAddress', $_SERVER['REMOTE_ADDR']);
+
+ $sql = 'SELECT Login
+ FROM '.TABLE_PREFIX.'PortalUser
+ WHERE PortalUserId = '.$user_id;
+ $object->SetDBField('PosterAlias', $this->Conn->GetOne($sql));
+
+ // set post options
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $options_map = $post_helper->getOptionsMap();
+ $post_options = $object->GetDBField('Options');
+ foreach ($options_map as $option_name => $field_name) {
+ $option_value = $object->GetDBField($field_name);
+ $post_helper->SetPostOption($option_name, $option_value, $post_options);
+ }
+ $object->SetDBField('Options', $post_options);
+
+ $table_info = $object->getLinkedInfo($event->Special, true);
+ $object->SetDBField($table_info['ForeignKey'], $table_info['ParentId']);
+ }
+
+ /**
+ * Checks if user has permission on post
+ *
+ * @param kEvent $event
+ * @param string $permissions
+ */
+ function checkPostPermission(&$event, $permissions)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $sql = 'SELECT ci.CategoryId, p.CreatedById
+ FROM '.$object->TableName.' p
+ LEFT JOIN '.TABLE_PREFIX.'Topic t ON t.TopicId = p.TopicId
+ LEFT JOIN '.TABLE_PREFIX.'CategoryItems ci ON ci.ItemResourceId = t.ResourceId AND ci.PrimaryCat = 1
+ WHERE p.'.$object->IDField.' = '.$object->GetID();
+ $post_info = $this->Conn->GetRow($sql);
+
+ $perm_helper =& $this->Application->recallObject('PermissionsHelper');
+ /* @var $perm_helper kPermissionsHelper */
+
+ $is_owner = $post_info['CreatedById'] == $this->Application->RecallVar('user_id');
+ $params['permissions'] = 'TOPIC.REPLY.MODIFY|TOPIC.REPLY.OWNER.MODIFY';
+ $params['cat_id'] = $post_info['CategoryId'];
+ return $perm_helper->TagPermissionCheck($params, $is_owner);
+ }
+
+ /**
+ * Sets post options before post update
+ * Ensures, that only user with permission will update topic
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $perm_status = $this->checkPostPermission($event, 'TOPIC.REPLY.MODIFY|TOPIC.REPLY.OWNER.MODIFY');
+ if (!$perm_status) {
+ $event->status = erFAIL;
+ return ;
+ }
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $options_map = $post_helper->getOptionsMap();
+ $post_options = $object->GetDBField('Options');
+ foreach ($options_map as $option_name => $field_name) {
+ $option_value = $object->GetDBField($field_name);
+ $post_helper->SetPostOption($option_name, $option_value, $post_options);
+ }
+ $object->SetDBField('Options', $post_options);
+ }
+
+ /**
+ * Notifies admin about post change
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemUpdate(&$event)
+ {
+ parent::OnAfterItemUpdate($event);
+
+ $this->Application->EmailEventAdmin('POST.MODIFY');
+ }
+
+ /**
+ * Checks, that user can delete post
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $perm_status = $this->checkPostPermission($event, 'TOPIC.REPLY.OWNER.DELETE|TOPIC.REPLY.DELETE');
+ if (!$perm_status) {
+ $event->status = erFAIL;
+ }
+ }
+
+ /**
+ * Sets post options to virtual fields
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemLoad(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $options_map = $post_helper->getOptionsMap();
+ $post_options = $object->GetDBField('Options');
+ foreach ($options_map as $option_name => $field_name) {
+ $option_value = $post_helper->GetPostOption($option_name, $post_options);
+ $object->SetDBField($field_name, (int)$option_value);
+ }
+ }
+
+ /**
+ * Updates cached post counter in topic
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $parent_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix');
+
+ $main_object =& $this->Application->recallObject($parent_prefix);
+ /* @var $main_object kCatDBItem */
+
+ // update user posts counter
+ $user_posts = $this->Application->RecallPersistentVar('bb_posts');
+ $this->Application->StorePersistentVar('bb_posts', $user_posts + 1);
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $category_id = $this->Application->GetVar('m_cat_id');
+ $post_helper->PropagateCategoryField($category_id, 'Modified', $object->GetDBField('CreatedOn'));
+
+ if (!$this->Application->isAdmin && $main_object->GetDBField('Posts')) {
+ // don't send any email events when in admin OR new topic just added (0 posts)
+
+ $user_notified = false; // don't send POST.ADD event twice to same user (in case if owner adds new post)
+ if ($main_object->GetDBField('NotifyOwnerOnChanges')) {
+ $user_notified = $main_object->GetDBField('OwnerId');
+ $this->Application->EmailEventUser('POST.ADD', $user_notified);
+ }
+
+ $post_owner_id = $object->GetDBField('CreatedById');
+ if (($post_owner_id > 0) && ($user_notified != $post_owner_id)) {
+ $this->Application->EmailEventUser('POST.ADD', $post_owner_id);
+ }
+
+ $this->Application->EmailEventAdmin('POST.ADD');
+ }
+
+ $post_helper->updateTodayPostsCount($main_object, $object->GetDBField('CreatedOn'), +1);
+ $this->updateTopicInfo($event, $main_object);
+
+ $topic_id = $object->GetDBField('TopicId');
+ $posts_count = $post_helper->updatePostCount($topic_id, +1);
+ $main_object->SetDBField('Posts', $posts_count);
+
+ // autolock topic after N number of posts (if option enabled)
+ $auto_lock = $this->Application->ConfigValue('AutoTopicLockPosts');
+ if ((int)$auto_lock > 0) {
+ if ($posts_count >= $auto_lock) {
+ // user has unlocked topic after $auto_lock and posts again -> ensure that topic will be locked again
+ $this->Application->HandleEvent($parent_prefix.':OnTopicLockToggle');
+ }
+ }
+ }
+
+ /**
+ * Update last post info in topic
+ *
+ * @param kEvent $event
+ * @param kCatDBItem $main_object
+ */
+ function updateTopicInfo(&$event, &$main_object)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $main_object->SetDBField('Modified_date', $object->GetDBField('Modified'));
+ $main_object->SetDBField('Modified_time', $object->GetDBField('Modified'));
+
+ $main_object->SetDBField('LastPostId', $object->GetID());
+
+ $main_object->SetDBField('LastPostDate_date', $object->GetDBField('CreatedOn'));
+ $main_object->SetDBField('LastPostDate_time', $object->GetDBField('CreatedOn'));
+
+ $main_object->Update();
+ }
+
+ /**
+ * Goes to next_template after post creation
+ *
+ * @param kEvent $event
+ */
+ function OnCreate(&$event)
+ {
+ parent::OnCreate($event);
+
+ if ($event->status == erSUCCESS && !$this->Application->isAdmin) {
+ $event->SetRedirectParam('opener', 's');
+ $event->redirect = $this->Application->GetVar('next_template');
+ }
+ }
+
+ /**
+ * Goes to next_template after post editing
+ *
+ * @param kEvent $event
+ */
+ function OnUpdate(&$event)
+ {
+ parent::OnUpdate($event);
+
+ if ($event->status == erSUCCESS && !$this->Application->isAdmin) {
+ $event->SetRedirectParam('opener', 's');
+ $event->redirect = $this->Application->GetVar('next_template');
+ $event->SetRedirectParam('pass', 'm,bb');
+ }
+ }
+
+ /**
+ * Moves reference to last post in topic, when it is deleted
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $topic_id = $object->GetDBField('TopicId');
+ if (!$topic_id) {
+ // deleting non-existing post
+ return ;
+ }
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ // update posts count in topic
+ $post_helper->updatePostCount($topic_id, -1);
+
+ // update post owner posts counter
+ $sql = 'UPDATE '.TABLE_PREFIX.'PersistantSessionData
+ SET VariableValue = IF (VariableValue > 0, VariableValue - 1, 0)
+ WHERE (PortalUserId = '.$object->GetDBField('CreatedById').') AND (VariableName = "bb_posts")';
+ $this->Conn->Query($sql);
+
+
+ $main_object =& $this->Application->recallObject('bb.-item', null, Array('skip_autoload' => true));
+ /* @var $main_object kCatDBItem */
+
+ $main_object->Load($topic_id);
+
+ $post_helper->updateTodayPostsCount($main_object, $object->GetDBField('CreatedOn'), -1);
+
+ if ($main_object->GetDBField('LastPostId') == $object->GetID()) {
+ $sql = 'SELECT PostingId, CreatedOn
+ FROM '.$object->TableName.'
+ WHERE TopicId = '.$topic_id.'
+ ORDER BY PostingId DESC';
+ $last_post = $this->Conn->GetRow($sql);
+
+ $fields_hash = Array (
+ 'LastPostId' => $last_post['PostingId'],
+ 'LastPostDate' => $last_post['CreatedOn'],
+ );
+ $this->Conn->doUpdate($fields_hash, $main_object->TableName, $main_object->IDField.' = '.$topic_id);
+ }
+ }
+
+ /**
+ * Sets default values to posting options based on persistent session
+ *
+ * @param kEvent $event
+ */
+ function OnAfterConfigRead(&$event)
+ {
+ $virtual_fields = $this->Application->getUnitOption($event->Prefix, 'VirtualFields');
+ $virtual_fields['DisableBBCodes']['default'] = (int)!$this->Application->RecallPersistentVar('bbcode');
+ $virtual_fields['DisableSmileys']['default'] = (int)!$this->Application->RecallPersistentVar('smileys');
+ $virtual_fields['ShowSignatures']['default'] = (int)$this->Application->RecallPersistentVar('show_sig');
+ $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields);
+ }
+
+ /**
+ * Deletes items & preserves clean env
+ *
+ * @param kEvent $event
+ */
+ function OnDelete(&$event)
+ {
+ parent::OnDelete($event);
+
+ if ($event->status == erSUCCESS && !$this->Application->isAdmin) {
+ $parent_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix');
+ $event->SetRedirectParam('pass', 'm,'.$parent_prefix);
+ }
+ }
+
+ /**
+ * Prepares new reply form
+ *
+ * @param kEvent $event
+ */
+ function OnNew(&$event)
+ {
+ parent::OnNew($event);
+
+ $reply_to = $this->Application->GetVar('reply_to');
+
+ if ($reply_to > 0) {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $source_post =& $this->Application->recallObject($event->Prefix.'.-item', null, Array ('skip_autoload' => true));
+ /* @var $source_post kDBItem */
+
+ $source_post->Load($reply_to);
+
+ $object->SetDBField('Subject', 'Re: '.$source_post->GetDBField('Subject'));
+ $object->SetDBField('PostingText', '[quote id='.$reply_to.']'.$source_post->GetDBField('PostingText').'[/quote]');
+ }
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/posts/post_tp.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/posts/post_tp.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/posts/post_tp.php (revision 12744)
@@ -0,0 +1,315 @@
+Application->getUnitOption($this->Prefix, 'ParentPrefix');
+ $main_object =& $this->Application->recallObject($parent_prefix);
+ /* @var $main_object kCatDBItem */
+
+ if ($main_object->isLoaded()) {
+ $main_object->RegisterHit();
+ }
+
+ return $this->PrintList2($params);
+ }
+
+ /**
+ * Returns link to post author public profile
+ *
+ * @param Array $params
+ * @return string
+ */
+ function ProfileLink($params)
+ {
+ $object =& $this->getObject($params);
+ $params['user_id'] = $object->GetDBField('CreatedById');
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ function PosterField($params)
+ {
+ static $posters = null;
+
+ $object =& $this->getObject($params);
+
+ if (!isset($posters)) {
+ $poster_ids = array_unique($object->GetCol('CreatedById'));
+
+ $user_idfield = $this->Application->getUnitOption('u', 'IDField');
+ $user_table = $this->Application->getUnitOption('u', 'TableName');
+
+ $sql = 'SELECT u.*, g.Name AS PrimaryGroup
+ FROM '.$user_table.' u
+ LEFT JOIN '.TABLE_PREFIX.'UserGroup ug ON ug.PortalUserId = u.PortalUserId AND ug.PrimaryGroup = 1
+ LEFT JOIN '.TABLE_PREFIX.'PortalGroup g ON g.GroupId = ug.GroupId
+ WHERE u.'.$user_idfield.' IN ('.implode(',', $poster_ids).')';
+ $posters = $this->Conn->Query($sql, $user_idfield);
+ }
+
+ $poster =& $this->Application->recallObject('u.poster', null, Array('skip_autoload' => true));
+ /* @var $poster UsersItem */
+
+ $poster_id = $object->GetDBField('CreatedById');
+ if ($poster_id > 0) {
+ // not Guest & root
+ if ($poster->GetID() != $poster_id) {
+ // previous poster differs from requested
+ $poster->SetDBFieldsFromHash($posters[$poster_id]);
+ $poster->setID($poster_id);
+ }
+ return $this->Application->ProcessParsedTag('u.poster', 'Field', $params);
+ }
+
+ return '';
+ }
+
+ /**
+ * Checks if post is made by real user (not Guest or root)
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function PosterFound($params)
+ {
+ $object =& $this->getObject($params);
+
+ return $object->GetDBField('CreatedById') > 0;
+ }
+
+ /**
+ * Posts count created by current poster
+ *
+ * @param Array $params
+ * @return int
+ */
+ function PosterPostsCount($params)
+ {
+ static $posts_count = null;
+
+ $object =& $this->getObject($params);
+
+ if (!isset($posts_count)) {
+ $poster_ids = array_unique($object->GetCol('CreatedById'));
+
+ $sql = 'SELECT VariableValue, PortalUserId
+ FROM '.TABLE_PREFIX.'PersistantSessionData
+ WHERE PortalUserId IN ('.implode(',', $poster_ids).') AND VariableName = "bb_posts"';
+ $posts_count = $this->Conn->GetCol($sql, 'PortalUserId');
+ }
+
+ return $posts_count[$object->GetDBField('CreatedById')];
+ }
+
+ function PostSubject($params)
+ {
+ $object =& $this->getObject($params);
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ return $post_helper->CensorText( $object->GetDBField('Subject') );
+ }
+
+ function PostBody($params)
+ {
+ $object =& $this->getObject($params);
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $body = $object->GetDBField('PostingText');
+
+ // 2. parse post body
+ $sub_blocks = Array (
+ 'smileys' => $params['smiley_render_as'],
+ 'bbcode' => $params['bbcode_render_as'],
+ 'quote' => $params['quote_render_as'],
+ );
+ $body = $post_helper->parsePostBody($body, $object->GetDBField('Options'), $sub_blocks);
+
+ return $body;
+ }
+
+ /**
+ * Checks if poster signature needs to be shown together with post
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function ShowPostSignature($params)
+ {
+ $object =& $this->getObject($params);
+ $post_options = $object->GetDBField('Options');
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ // show poster signature in this post
+ if ($post_helper->GetPostOption('show_sig', $post_options)) {
+ // logged-in user wishes to view signatures in posts
+ $show_other_signatures = $this->Application->RecallPersistentVar('bb_signatures');
+ if ($show_other_signatures) {
+ // don't show signature when it is empty
+ $signature = $this->getUserSignature($object->GetDBField('CreatedById'));
+ return strlen(trim($signature)) ? true : false;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns parsed poster (from current post) signature
+ *
+ * @param Array $params
+ * @return string
+ */
+ function PostSignature($params)
+ {
+ $object =& $this->getObject($params);
+
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $sub_blocks = Array (
+ 'smileys' => $params['smiley_render_as'],
+ 'bbcode' => $params['bbcode_render_as'],
+ );
+
+ $signature = $this->getUserSignature($object->GetDBField('CreatedById'));
+ return $post_helper->parsePostBody($signature, $object->GetDBField('Options'), $sub_blocks);
+ }
+
+ /**
+ * Returns user signature (cached for all viewed posts on page)
+ *
+ * @param int $user_id
+ * @return string
+ */
+ function getUserSignature($user_id)
+ {
+ static $user_signatures = null;
+
+ $object =& $this->getObject();
+
+ if (!isset($user_signatures)) {
+ $poster_ids = array_unique($object->GetCol('CreatedById'));
+
+ $sql = 'SELECT VariableValue, PortalUserId
+ FROM '.TABLE_PREFIX.'PersistantSessionData
+ WHERE PortalUserId IN ('.implode(',', $poster_ids).') AND VariableName = "my_signature"';
+ $user_signatures = $this->Conn->GetCol($sql, 'PortalUserId');
+ }
+
+ $poster_id = $object->GetDBField('CreatedById');
+ return isset($user_signatures[$poster_id]) ? $user_signatures[$poster_id] : '';
+ }
+
+ /**
+ * Creates link to individual post in topic
+ *
+ * @param Array $params
+ * @return string
+ */
+ function PostLink($params)
+ {
+ $params['pass'] = 'm,bb,bb-post';
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ function ReplyQuotedLink($params)
+ {
+ $object =& $this->getObject($params);
+
+ $params['pass'] = 'm,bb';
+ $params['reply_to'] = $object->GetID();
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+
+ /**
+ * Checks if user have one of required permissions
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function HasPermission($params)
+ {
+ static $category_path = null;
+
+ if (!isset($category_path)) {
+ // get topic category
+ $parent_prefix = $this->Application->getUnitOption($this->Prefix, 'ParentPrefix');
+ $parent_item =& $this->Application->recallObject($parent_prefix, null, Array ('raise_warnings' => 0));
+ $category_path = $parent_item->isLoaded() ? $parent_item->GetDBField('ParentPath') : $this->Application->GetVar('m_cat_id');
+ }
+
+ $perm_helper =& $this->Application->recallObject('PermissionsHelper');
+ /* @var $perm_helper kPermissionsHelper */
+
+ $params['raise_warnings'] = 0;
+ $object =& $this->getObject($params);
+ /* @var $object kDBItem */
+
+ // 1. category restriction
+ $params['cat_id'] = $category_path;
+
+ // 2. owner restriction
+ $is_owner = $object->GetDBField('CreatedById') == $this->Application->RecallVar('user_id');
+
+ return $perm_helper->TagPermissionCheck($params, $is_owner);
+ }
+
+ function CategoryItemCount($params)
+ {
+ $count_helper =& $this->Application->recallObject('CountHelper');
+ /* @var $count_helper kCountHelper */
+
+ return $count_helper->CategoryItemCount('bb', $params, 'SUM(Posts)'); // - COUNT(TopicId)
+ }
+
+ function ItemCount($params)
+ {
+ $count_helper =& $this->Application->recallObject('CountHelper');
+ /* @var $count_helper kCountHelper */
+
+ $today_only = isset($params['today']) && $params['today'];
+ return $count_helper->ItemCount('bb', $today_only, 'SUM(Posts)'); // - COUNT(TopicId)
+ }
+
+ /**
+ * Preserve main item id in subitem pagination url
+ *
+ * @param Array $params
+ * @return string
+ */
+ function PageLink($params)
+ {
+ $object =& $this->getObject($params);
+ /* @var kDBList */
+
+ $parent_info = $object->getLinkedInfo();
+ if ($parent_info['ParentId'] > 0) {
+ $params['pass'] = 'm,'.$this->getPrefixSpecial().','.$parent_info['ParentPrefix'];
+ }
+ return parent::PageLink($params);
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/posts/posts_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/posts/posts_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/posts/posts_config.php (revision 12744)
@@ -0,0 +1,110 @@
+ 'bb-post',
+ 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'PostEventHandler', 'file' => 'post_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'PostTagProcessor', 'file' => 'post_tp.php', 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ ),
+
+ 'IDField' => 'PostingId',
+ 'StatusField' => Array('Pending'),
+
+ 'TitleField' => 'Subject',
+
+ 'TableName' => TABLE_PREFIX.'Posting',
+
+ 'ForeignKey' => 'TopicId',
+ 'ParentTableKey' => 'TopicId',
+ 'ParentPrefix' => 'bb',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'Images img ON (img.ResourceId = u.ResourceId) AND (img.DefaultImg = 1 OR img.Name = "avatar")',
+ ),
+
+ 'ItemSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'Images img ON (img.ResourceId = u.ResourceId) AND (img.DefaultImg = 1 OR img.Name = "avatar")',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array (
+ 'ForcedSorting' => Array ('CreatedOn' => 'asc',),
+ ),
+ ),
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.CreatedById = -1, "root", IF (%1$s.CreatedById = -2, "Guest", "n/a")), u.Login)',
+
+ 'SameImages' => 'img.SameImages',
+ 'LocalThumb' => 'img.LocalThumb',
+ 'ThumbPath' => 'img.ThumbPath',
+ 'ThumbUrl' => 'img.ThumbUrl',
+ 'LocalImage' => 'img.LocalImage',
+ 'LocalPath' => 'img.LocalPath',
+ 'FullUrl' => 'img.Url',
+ ),
+ ),
+
+ 'Fields' => Array (
+ 'PostingId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'IPAddress' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'PosterAlias' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'Pending' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Subject' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL),
+ 'PostingText' => Array ('type' => 'string', 'allow_html' => 1, 'default' => NULL),
+ 'GraphicsUrl' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL),
+ 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => '#NOW#'),
+ 'Modified' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => NULL),
+ 'ModifiedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'default' => NULL),
+ 'CreatedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'default' => NULL),
+ 'TopicId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'ResourceId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'ReplyTo' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Options' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ ),
+
+ 'VirtualFields' => Array (
+ 'DisableBBCodes' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'DisableSmileys' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'ShowSignatures' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 1),
+
+ // for avatar image
+ 'SameImages' => Array('type' => 'string', 'default' => ''),
+ 'LocalThumb' => Array('type' => 'string', 'default' => ''),
+ 'ThumbPath' => Array('type' => 'string', 'default' => ''),
+ 'ThumbUrl' => Array('type' => 'string', 'default' => ''),
+ 'LocalImage' => Array('type' => 'string', 'default' => ''),
+ 'LocalPath' => Array('type' => 'string', 'default' => ''),
+ 'FullUrl' => Array('type' => 'string', 'default' => ''),
+ ),
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/poll_comments/poll_comment_eh.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/poll_comments/poll_comment_eh.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/poll_comments/poll_comment_eh.php (revision 12744)
@@ -0,0 +1,149 @@
+ Array('self' => true, 'subitem' => true,),
+ 'OnItemBuild' => Array('self' => true, 'subitem' => true,),
+ );
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ function OnAfterConfigRead(&$event)
+ {
+ if ($this->Application->RecallVar('user_id') == '-2') { // Guest
+ // make Guest Name and Email required for guests
+ $fields = $this->Application->getUnitOption($event->Prefix, 'Fields');
+ $fields['GuestName']['required'] = 1;
+ $fields['GuestEmail']['required'] = 1;
+ $this->Application->setUnitOption($event->Prefix, 'Fields', $fields);
+ }
+ }
+
+ /**
+ * Applies special filter, that allows to select all commented from current poll
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ if ($this->Application->isAdminUser) {
+ return ;
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ $object->addFilter('comment_status', '(%1$s.Status = ' .STATUS_ACTIVE. ')');
+ }
+
+ /**
+ * Before New PollComment created
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ if ($this->Application->isAdminUser) {
+ return ;
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ // get Poll info
+ $parent_prefix = $this->Application->getUnitOption($this->Prefix, 'ParentPrefix');
+ if($parent_prefix) {
+ $main_object =& $this->Application->recallObject($parent_prefix.'.'.$special, null,Array('raise_warnings' => 0));
+ /* @var $main_object kDBItem */
+
+ if (!$main_object->isLoaded()) {
+ $main_object =& $this->Application->recallObject($parent_prefix);
+ }
+
+ $poll_id = $main_object->GetDBField($this->Application->getUnitOption($event->Prefix, 'ForeignKey'));
+ }
+
+ if ($poll_id) {
+ $spam_helper =& $this->Application->recallObject('SpamHelper');
+ /* @var $spam_helper SpamHelper */
+
+ $spam_helper->InitHelper($poll_id, 'PollComment', 0); // ResourceId used for SpamControl only
+
+ if ($spam_helper->InSpamControl()) {
+ $event->status = erFAIL;
+ $object->SetError('CommentText', 'too_frequent', 'lu_error_AlreadyCommented');
+ return ;
+ }
+ }
+
+ $object->SetDBField('CreatedById', $this->Application->RecallVar('user_id'));
+ $object->SetDBField('UserIP', $_SERVER['REMOTE_ADDR']);
+ $object->SetDBField('PollId', $poll_id); // PollId
+ $object->SetDBField('Status', STATUS_ACTIVE);
+
+ parent::OnBeforeItemCreate($event);
+ }
+
+ /**
+ * Updates item review counter
+ *
+ * @param kEvent $event
+ */
+ function OnCreate(&$event)
+ {
+ parent::OnCreate($event);
+
+ if ($this->Application->isAdminUser) {
+ return;
+ }
+
+ if ($event->status == erSUCCESS) {
+ $event->setRedirectParam('opener', 's');
+ $event->setRedirectParam('pass', 'm,poll');
+ $event->redirect = $this->Application->GetVar('success_template');
+ }
+ }
+
+ /**
+ * Updates item review counter
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemCreate(&$event)
+ {
+ if (!$this->Application->isAdminUser) {
+ $spam_helper =& $this->Application->recallObject('SpamHelper');
+ /* @var $spam_helper SpamHelper */
+
+ $object =& $event->getObject();
+
+ $config_mapping = $this->Application->getUnitOption($event->Prefix, 'ConfigMapping');
+ $comment_settings = $config_mapping['CommentDelayValue'].':'.$config_mapping['CommentDelayInterval'];
+ $spam_helper->InitHelper($object->GetDBField('PollId'), 'PollComment', $comment_settings);
+ $spam_helper->AddToSpamControl();
+ }
+ }
+
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/poll_comments/poll_comments_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/poll_comments/poll_comments_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/poll_comments/poll_comments_config.php (revision 12744)
@@ -0,0 +1,114 @@
+ 'poll-comment',
+
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array ('class' => 'PollCommentEventHandler', 'file' => 'poll_comment_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event'
+ ),
+ 'IDField' => 'CommentId',
+ 'TableName' => TABLE_PREFIX . 'PollsComments',
+
+ 'ParentPrefix' => 'poll',
+ 'ForeignKey' => 'PollId',
+ 'ParentTableKey' => 'PollId',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'StatusField' => Array('Status'),
+
+ // key - special, value - list select sql
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser pu ON pu.PortalUserId = %1$s.CreatedById',
+ ),
+
+ 'ItemSQLs' => Array ('' => 'SELECT * FROM %s'),
+
+ 'ListSortings' => Array (
+ '' => Array(
+ 'ForcedSorting' => Array('Priority' => 'desc'),
+ 'Sorting' => Array('CreatedOn' => 'desc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'CommentId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'PollId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'AnswerId' => Array ('type' => 'int', 'default' => NULL),
+ 'CreatedById' => Array ('type' => 'int', 'formatter'=>'kLEFTFormatter',
+ 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'),
+ 'options' => Array(-1 => 'root', -2 => 'Guest'),
+ 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'',
+ 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login',
+ 'required' => 1, 'not_null' => 1, 'default' => -2),
+ 'GuestName' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'GuestEmail' => Array('type' => 'string', 'max_len' => 255, 'formatter'=>'kFormatter', 'regexp'=>'/^(' . REGEX_EMAIL_USER . '@' . REGEX_EMAIL_DOMAIN . ')$/i', 'sample_value' => 'email@domain.com', 'not_null' => '1', 'default' => '', 'error_msgs' => Array('invalid_format'=>'!la_invalid_email!', 'unique'=>'!lu_email_already_exist!'),'required' => 0 ),
+ 'CommentBody' => Array ('type' => 'string', 'formatter' => 'kFormatter', 'using_fck' => 1, 'default' => NULL, 'required' => 1),
+ 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'),
+ 'UserIP' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'Priority' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Active', 0 => 'la_opt_Disabled', 2 => 'la_opt_Pending'), 'use_phrases' => 1, 'required' => 1, 'not_null' => 1, 'default' => 1),
+ ),
+
+ 'VirtualFields' => Array (
+ 'CommentedByUser' => Array('type' => 'string', 'default' => ''),
+ 'CommentedByEmail' => Array ('type' => 'string', 'default' => ''),
+ ),
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'CommentedByUser' => 'IF( ISNULL(pu.Login), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, \'Guest\', \'n/a\')), pu.Login )',
+ ),
+ ),
+
+ 'ConfigMapping' => Array (
+ 'PerPage' => 'poll_Perpage_Comments',
+ 'CommentDelayInterval' => 'poll_CommentDelay_Value',
+ 'CommentDelayValue' => 'poll_CommentDelay_Interval',
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 0 => 'icon16_disabled.png',
+ 1 => 'icon16_item.png',
+ 2 => 'icon16_pending.png',
+ 'module' => 'core',
+ ),
+ 'Fields' => Array (
+ 'CommentId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
+ 'CommentBody' => Array ('title' => 'la_col_PollComment', 'data_block' => 'grid_priority_td', 'filter_block' => 'grid_like_filter', 'width' => 250, ),
+
+ 'CommentedByUser' => Array( 'title'=>'la_col_CommentedByUser', 'filter_block' => 'grid_like_filter', 'width' => 150, ),
+
+ 'CreatedOn' => Array ('title' => 'la_col_CreatedOn', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
+ ),
+ ),
+ ),
+
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/private_message_body/private_message_body_eh.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/private_message_body/private_message_body_eh.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/private_message_body/private_message_body_eh.php (revision 12744)
@@ -0,0 +1,56 @@
+getObject();
+ /* @var $object kDBItem */
+
+ // set post options
+ $post_helper =& $this->Application->recallObject('PostHelper');
+ /* @var $post_helper PostHelper */
+
+ $options_map = $post_helper->getOptionsMap();
+ $post_options = $object->GetDBField('Options');
+ foreach ($options_map as $option_name => $field_name) {
+ $option_value = $object->GetDBField($field_name);
+ $post_helper->SetPostOption($option_name, $option_value, $post_options);
+ }
+ $object->SetDBField('Options', $post_options);
+ }
+
+ /**
+ * Deletes message body only when no message is using it
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemDelete(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ if ($object->GetDBField('ReferenceCount') > 0) {
+ $event->status = erFAIL;
+ }
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/private_message_body/private_message_body_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/private_message_body/private_message_body_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/private_message_body/private_message_body_config.php (revision 12744)
@@ -0,0 +1,59 @@
+ 'private-message-body',
+ 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'PrivateMessageBodyEventHandler', 'file' => 'private_message_body_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ ),
+
+ 'IDField' => 'PMBodyId',
+
+ 'TitleField' => 'Subject',
+
+ 'TableName' => TABLE_PREFIX.'PrivateMessageBody',
+
+ 'ForeignKey' => 'PMBodyId',
+ 'ParentTableKey' => 'PMBodyId',
+ 'ParentPrefix' => 'private-message',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'ListSQLs' => Array ('' => ' SELECT %1$s.* %2$s FROM %1$s',),
+ 'ItemSQLs' => Array ('' => ' SELECT %1$s.* %2$s FROM %1$s',),
+
+ 'Fields' => Array (
+ 'PMBodyId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Subject' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'Body' => Array ('type' => 'string', 'default' => NULL),
+ 'Options' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'ReferenceCount' => Array ('type' => 'int', 'not_null' => 1, 'default' => 2),
+ ),
+
+ 'VirtualFields' => Array (
+ 'DisableBBCodes' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'DisableSmileys' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'ShowSignatures' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 1),
+ ),
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/censorship/censorship_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/censorship/censorship_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/censorship/censorship_config.php (revision 12744)
@@ -0,0 +1,95 @@
+ 'censorship',
+ 'ItemClass' => Array ('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array ('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array ('class' => 'kDBEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array ('class' => 'kDBTagProcessor', 'file' => '', 'build_event' => 'OnBuild'),
+
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'IDField' => 'CensorshipId',
+
+ 'TableName' => TABLE_PREFIX.'Censorship',
+
+ 'TitleField' => 'BadWord',
+
+ 'TitlePresets' => Array (
+ 'default' => Array (
+ 'new_status_labels' => Array ('censorship' => '!la_title_AddingCensorship!'),
+ 'edit_status_labels' => Array ('censorship' => '!la_title_EditingCensorship!'),
+ ),
+
+ 'censorship_list' => Array ('prefixes' => Array ('censorship_List'), 'format' => "!la_tab_ConfigCensorship!"),
+ 'censorship_edit' => Array ('prefixes' => Array ('censorship'), 'format' => "#censorship_status# '#censorship_titlefield#'"),
+ ),
+
+ 'PermSection' => Array('main' => 'in-bulletin:configuration_censorship'),
+
+ 'Sections' => Array (
+ 'in-bulletin:configuration_censorship' => Array (
+ 'parent' => 'in-bulletin:setting_folder',
+ 'icon' => 'conf_censorship',
+ 'label' => 'la_tab_ConfigCensorship',
+ 'url' => Array('t' => 'in-bulletin/censorship/censorship_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+ ),
+
+
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s FROM %1$s',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array (
+ 'Sorting' => Array ('BadWord' => 'asc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'CensorshipId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'BadWord' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'Replacement' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'required' => 1, 'default' => ''),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 0 => 'icon16_disabled.png',
+ 1 => 'icon16_item.png',
+ 'module' => 'core',
+ ),
+ 'Fields' => Array (
+ 'CensorshipId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 50),
+ 'BadWord' => Array ('title' => 'la_col_BadWord', 'filter_block' => 'grid_like_filter', 'width' => 250),
+ 'Replacement' => Array ('title' => 'la_col_Replacement', 'filter_block' => 'grid_like_filter', 'width' => 250),
+ ),
+ ),
+ ),
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/helpers/helpers_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/helpers/helpers_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/helpers/helpers_config.php (revision 12744)
@@ -0,0 +1,24 @@
+ 'in-bulletin-helpers',
+ 'EventHandlerClass' => Array('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'),
+
+ 'RegisterClasses' => Array (
+ Array('pseudo' => 'PostHelper', 'class' => 'PostHelper','file' => 'post_helper.php', 'build_event' => '', 'require_classes' => Array('kHelper')),
+ ),
+ );
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/helpers/post_helper.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/helpers/post_helper.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/helpers/post_helper.php (revision 12744)
@@ -0,0 +1,418 @@
+ 128,
+ 'disable_bbcode' => 64,
+ 'disable_smileys' => 32,
+ );
+
+ /**
+ * Checks if specific option is set for post
+ *
+ * @param string $option_name
+ * @param Array $options
+ * @return bool
+ */
+ function GetPostOption($option_name, $options)
+ {
+ if (!isset($this->postOptionBits[$option_name])) {
+ return false;
+ }
+
+ $option_bit = $this->postOptionBits[$option_name];
+ return ($options & $option_bit) == $option_bit;
+ }
+
+ /**
+ * Sets given option bit (by name) to post options
+ *
+ * @param string $option_name
+ * @param int $option_value
+ * @param Array $options
+ * @return bool
+ */
+ function SetPostOption($option_name, $option_value, &$options)
+ {
+ if (!isset($this->postOptionBits[$option_name])) {
+ return false;
+ }
+
+ $option_bit = $this->postOptionBits[$option_name];
+ if ($option_value) {
+ $options |= $option_bit;
+ }
+ else {
+ $options = $options &~ $option_bit;
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns post options map to virtual field names
+ *
+ * @return Array
+ */
+ function getOptionsMap()
+ {
+ $options_map = Array (
+ 'show_sig' => 'ShowSignatures',
+ 'disable_smileys' => 'DisableSmileys',
+ 'disable_bbcode' => 'DisableBBCodes',
+ );
+
+ return $options_map;
+ }
+
+ /**
+ * @return void
+ * @param int $date
+ * @desc Set any field to category & all it's parent categories
+ */
+ function PropagateCategoryField($category_id, $field_name, $field_value)
+ {
+ $id_field = $this->Application->getUnitOption('c', 'IDField');
+ $table_name = $this->Application->getUnitOption('c', 'TableName');
+
+ $sql = 'SELECT ParentPath
+ FROM '.$table_name.'
+ WHERE '.$id_field.' = '.$category_id;
+ $parent_path = $this->Conn->GetOne($sql);
+
+ $parent_categories = explode('|', substr($parent_path, 1, -1));
+ if (!$parent_categories) {
+ return false;
+ }
+
+ $fields_hash = Array (
+ $field_name => $field_value,
+ );
+
+ $this->Conn->doUpdate($fields_hash, $table_name, $id_field.' IN ('.implode(',', $parent_categories).')');
+ }
+
+ /**
+ * Sets today posts count & today date for topic
+ *
+ * @param kCatDBItem $object
+ * @param int $increment_by
+ */
+ function updateTodayPostsCount(&$object, $post_date, $increment_by = 1)
+ {
+ $date_now = adodb_date('Y-m-d');
+
+ if (adodb_date('Y-m-d', $post_date) != $date_now) {
+ return ;
+ }
+
+ // last post update date was today or not
+ $today_posts = ($date_now == $object->GetDBField('TodayDate')) ? $object->GetDBField('TodayPosts') : 0;
+
+ $object->SetDBField('TodayDate', $date_now);
+ $object->SetDBField('TodayPosts', $today_posts + $increment_by);
+
+ return $object->Update();
+ }
+
+ function updatePostCount($topic_id, $increment = 1)
+ {
+ $id_field = $this->Application->getUnitOption('bb', 'IDField');
+ $table_name = $this->Application->getUnitOption('bb', 'TableName');
+
+ // helps in case, when 2 (or more) users tries to post in same topic at same time
+ $sql = 'UPDATE '.$table_name.'
+ SET Posts = Posts '.($increment > 0 ? '+' : '-').' '.abs($increment).'
+ WHERE '.$id_field.' = '.$topic_id;
+ $this->Conn->Query($sql);
+
+ // returns new value
+ $sql = 'SELECT Posts
+ FROM '.$table_name.'
+ WHERE '.$id_field.' = '.$topic_id;
+ return $this->Conn->GetOne($sql);
+ }
+ /**
+ * Replaces all special formatting in post before displaing it to user
+ *
+ * @param string $post_body
+ * @param int $post_options bit array of post options
+ * @param Array $sub_blocks block names for rendering smileys & bbcodes
+ * @return string
+ */
+ function parsePostBody($post_body, $post_options, $sub_blocks)
+ {
+ // 1. escape all html sequences
+ $post_body = htmlspecialchars($post_body, ENT_NOQUOTES); // don't touch quotes in bbcode attribute values
+
+ // 2. replace censored words
+ $post_body = $this->CensorText($post_body);
+
+ // 3. replace bb codes
+ if (!$this->GetPostOption('disable_bbcode', $post_options)) {
+ $post_body = $this->replaceBBCodes($post_body, $sub_blocks['bbcode']);
+ }
+
+ // 4. replace smileys
+ if (!$this->GetPostOption('disable_smileys', $post_options)) {
+ $post_body = $this->replaceSmileys($post_body, $sub_blocks['smileys']);
+ }
+
+ // 5. add enters (because we don't use HTML in post body)
+ $post_body = nl2br($post_body);
+
+ // 6. replace quoted text
+ return $this->replacePostQuote($post_body, $sub_blocks['quote']);
+ }
+
+ function replacePostQuote($text, $render_as)
+ {
+ if (preg_match('/\[quote id=([\d]+)\](.*)\[\/quote\]/s', $text, $regs)) {
+ $post =& $this->Application->recallObject('bb-post.-item', null, Array ('skip_autoload' => true));
+ /* @var $post kDBItem */
+
+ $post->Load($regs[1]);
+
+ $block_params = Array ('name' => $render_as, 'PrefixSpecial' => 'bb-post.-item', 'Prefix' => 'bb-post', 'Special' => '-item', 'strip_nl' => 2);
+ $parsed_quote = $this->Application->ParseBlock($block_params);
+ return str_replace($regs[0], $parsed_quote, $text);
+ }
+
+ return $text;
+ }
+
+ /**
+ * Replaces bad words with good words (censorship process)
+ *
+ * @param string $text
+ * @return string
+ */
+ function CensorText($text)
+ {
+ static $censor_words = null;
+
+ if (!isset($censor_words)) {
+ $sql = 'SELECT Replacement, BadWord
+ FROM '.TABLE_PREFIX.'Censorship';
+ $censor_words = $this->Conn->GetCol($sql, 'BadWord');
+ }
+
+ foreach ($censor_words as $replace_from => $replace_to) {
+ $text = str_replace($replace_from, $replace_to, $text);
+ }
+
+ return $text;
+ }
+
+ function replaceSmileys($text, $smiley_element)
+ {
+ static $smileys = null;
+
+ if (!isset($smileys)) {
+ $sql = 'SELECT em.EmotionImage, em.KeyStroke
+ FROM '.TABLE_PREFIX.'Emoticon em
+ WHERE em.Enabled = 1
+ ORDER BY CHAR_LENGTH(em.KeyStroke) DESC';
+ $smileys = $this->Conn->GetCol($sql, 'KeyStroke');
+ }
+
+ $block_params = Array ('name' => $smiley_element, 'smiley_url' => '#SMILEY_URL#');
+ $smiley_mask = trim($this->Application->ParseBlock($block_params));
+
+ $base_url = rtrim($this->Application->BaseURL(),'/');
+ foreach ($smileys as $key_stoke => $image_url) {
+ if (strpos($text, $key_stoke) === false) {
+ continue;
+ }
+
+ $smiley_html = str_replace('#SMILEY_URL#', $base_url.SMILEYS_PATH.$image_url, $smiley_mask);
+ $text = str_replace($key_stoke, $smiley_html, $text);
+ }
+
+ return $text;
+ }
+
+ /**
+ * Sort params by name and then by length
+ *
+ * @param string $a
+ * @param string $b
+ * @return int
+ * @access private
+ */
+ function CmpParams($a, $b)
+ {
+ list ($a, ) = explode(':', $a);
+ list ($b, ) = explode(':', $b);
+
+ $a_len = strlen($a);
+ $b_len = strlen($b);
+ if ($a_len == $b_len) return 0;
+ return $a_len > $b_len ? -1 : 1;
+ }
+
+ function replaceBBCodes($text, $bbcode_element)
+ {
+ // convert phpbb bbcodes to in-bulletin bbcodes
+ $text = $this->preformatBBCodes($text);
+
+ $tags_defs = explode(';', $this->Application->ConfigValue('BBTags')); // 'b:;i:;u:;ul:type|align;font:color|face|size;url:href;img:src|border';
+
+ usort($tags_defs, Array (&$this, 'CmpParams'));
+
+ foreach($tags_defs as $tag) {
+ list ($tag_name, $tag_params) = explode(':', $tag);
+ $tag_params = $tag_params ? array_flip(explode('|', $tag_params)) : 0;
+
+ $text = preg_replace('/\['.$tag_name.'(.*)\](.*)\[\/'.$tag_name.' *\]/Uise','$this->checkBBCodeAttribs("'.$tag_name.'",\'$1\',\'$2\',$tag_params);', $text);
+ }
+
+ // additional processing for [url], [*], [img] bbcode
+ $text = preg_replace('/(.*)<\/url>/Usi','$1 ',$text);
+ $text = preg_replace('/(.*)<\/font>/Usi','$1',$text); // skip empty fonts
+ $text = str_replace( Array('','[*]'),
+ Array('',''),
+ $text);
+
+ // bbcode [code]xxx[/code] processing
+ $text = preg_replace('/\[code\](.*)\[\/code\]/Uise', "\$this->replaceCodeBBCode('$1', '".$bbcode_element."')", $text);
+ return $text;
+ }
+
+ /**
+ * Convert phpbb url bbcode to valid in-bulletin's format
+ *
+ * @param string $text
+ * @return string
+ */
+ function preformatBBCodes($text)
+ {
+ // 1. urls
+ $text = preg_replace('/\[url=(.*)\](.*)\[\/url\]/Ui','[url href="$1"]$2[/url]',$text);
+ $text = preg_replace('/\[url\](.*)\[\/url\]/Ui','[url href="$1"]$1[/url]',$text);
+
+ // 2. images
+ $text = preg_replace('/\[img\](.*)\[\/img\]/Ui','[img src="$1" border="0"][/img]',$text);
+
+ // 3. color
+ $text = preg_replace('/\[color=(.*)\](.*)\[\/color\]/Ui','[font color="$1"]$2[/font]',$text);
+
+ // 4. size
+ $text = preg_replace('/\[size=(.*)\](.*)\[\/size\]/Ui','[font size="$1"]$2[/font]',$text);
+
+ // 5. lists
+ $text = preg_replace('/\[list(.*)\](.*)\[\/list\]/Uis','[ul]$2[/ul]',$text);
+
+ // 6. email to link
+ $text = preg_replace('/\[email\](.*)\[\/email\]/Ui','[url href="mailto:$1"]$1[/url]',$text);
+
+ //7. b tag
+ $text = preg_replace('/\[(b|i|u):(.*)\](.*)\[\/(b|i|u):(.*)\]/Ui','[$1]$3[/$4]',$text);
+
+ //8. code tag
+ $text = preg_replace('/\[code:(.*)\](.*)\[\/code:(.*)\]/Uis','[code]$2[/code]',$text);
+
+ return $text;
+ }
+
+ /**
+ * Removes not allowed params from tag and returns result
+ *
+ * @param string $BBCode bbcode to check
+ * @param string $TagParams params string entered by user
+ * @param string $TextInside text between opening and closing bbcode tag
+ * @param string $ParamsAllowed list of allowed parameter names ("|" separated)
+ * @return string
+ */
+ function checkBBCodeAttribs($BBCode, $TagParams, $TextInside, $ParamsAllowed)
+ {
+ // unescape escaped quotes in tag
+ $TagParams = str_replace('\"', '"', $TagParams);
+ $TextInside = str_replace('\"', '"', $TextInside);
+
+ $params_extracted = preg_match_all('/ +([^=]*)=["\']?([^ "\']*)["\']?/is', $TagParams, $extracted_params, PREG_SET_ORDER);
+
+ if ($ParamsAllowed && $params_extracted) {
+ $ret = Array();
+ foreach ($extracted_params as $param) {
+ $param_name = strtolower(trim( $param[1] ));
+ $param_value = trim($param[2]);
+
+ // 1. prevent hacking
+ if ($BBCode == 'url' && $param_name == 'href') {
+ if (strpos(strtolower($param_value), 'script:') !== false) {
+ // script tag found in "href" parameter of "url" bbcode (equals to hacking) -> remove bbcode
+ return $TextInside;
+ }
+ }
+
+ // 2. leave only allowed params & remove all not allowed
+ if (isset($ParamsAllowed[$param_name])) {
+ $ret[] = $param_name.'="'.$param_value.'"';
+ }
+ }
+
+ $ret = count($ret) ? ' '.implode(' ', $ret) : '';
+ return '<'.$BBCode.$ret.'>'.$TextInside.''.$BBCode.'>';
+ }
+
+ return '<'.$BBCode.'>'.$TextInside.''.$BBCode.'>';
+ }
+
+ function highlightCode($code, $strip_tabs = 0)
+ {
+ if ($strip_tabs) {
+ $code = preg_replace('/(\t){'.$strip_tabs.'}(.*)/', '\\2', $code);
+ }
+
+ $code = str_replace( Array('\\', '/') , Array('_no_match_string_', '_n_m_s_'), $code);
+ $code = highlight_string('', true);
+ $code = str_replace( Array('_no_match_string_', '_n_m_s_'), Array('\\', '/'), $code);
+ $code = preg_replace('/<\?(.*)php(.*)\?>/Us', '\\2', $code);
+
+ $code = preg_replace('/([\r\n]+)/si', '', $code);
+ $code = preg_replace('/([\r\n]+)<\/font>([\r\n]+)<\/code>/si', '
', $code);
+
+ return $code;
+ }
+
+ /**
+ * Replaces [code]php code[/code] bbcode in post
+ *
+ * @param string $input_string code line to highlight
+ * @param string $bbcode_element block name used for bbcode descoration
+ * @return string
+ */
+ function replaceCodeBBCode($input_string, $bbcode_element)
+ {
+ static $bbcode_mask = null;
+
+ if (!isset($bbcode_mask)) {
+ $block_params = Array ('name' => $bbcode_element, 'bb_code' => '#BB_CODE#');
+ $bbcode_mask = trim($this->Application->ParseBlock($block_params));
+ }
+
+ $input_string = trim( str_replace('\"','"', unhtmlentities($input_string)) );
+ $input_string = $this->highlightCode($input_string);
+ $input_string = preg_replace("/\r /s", "\r", $input_string); // undo nl2br added in highlighting
+ $input_string = str_replace('#BB_CODE#', $input_string, $bbcode_mask);
+
+ return $input_string;
+ }
+
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/polls/poll_eh.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/polls/poll_eh.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/polls/poll_eh.php (revision 12744)
@@ -0,0 +1,154 @@
+ Array('self' => 'edit'),
+ 'OnMakeVote' => Array('self' => true),
+ 'OnItemBuild' => Array('self' => true),
+ );
+ $this->permMapping = array_merge($this->permMapping, $permissions);
+ }
+
+ /**
+ * Applies special filter, that allows to select all poll from given date range
+ *
+ * @param kEvent $event
+ */
+ function SetCustomQuery(&$event)
+ {
+ if ($this->Application->isAdminUser) {
+ return ;
+ }
+
+ $object =& $event->getObject();
+ /* @var $object kDBList */
+
+ $object->addFilter('poll_range_filter', '(%1$s.StartDate <= ' .adodb_mktime(). ') AND (%1$s.EndDate >= ' .adodb_mktime(). ' OR EndDate IS NULL)');
+ $object->addFilter('poll_status', '(%1$s.Status = ' .STATUS_ACTIVE. ')');
+ }
+
+ /**
+ * Reset votes statistics for current poll
+ *
+ * @param kEvent $event
+ */
+ function OnResetVotes(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $sql = 'DELETE FROM '.TABLE_PREFIX.'PollsStatistics
+ WHERE '.$object->IDField.' = '.$object->GetID();
+ $this->Conn->Query($sql);
+
+
+ $poll_answers_table = $this->Application->getUnitOption('poll-answer', 'TableName');
+ $poll_answers_table = $this->Application->GetTempName($poll_answers_table);
+
+ $sql = 'UPDATE '.$poll_answers_table.' SET VotesQty = 0
+ WHERE '.$object->IDField.' = '.$object->GetID();
+ $this->Conn->Query($sql);
+ }
+
+ /**
+ * Reset votes statistics for current poll
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $object->SetDBField('ResourceId', $this->Application->NextResourceId());
+ }
+
+ /**
+ * Make vote to current poll
+ *
+ * @param kEvent $event
+ */
+ function OnMakeVote(&$event)
+ {
+ $object =& $event->getObject($this->Application->GetVar('poll_id'));
+ /* @var $object kDBItem */
+
+ $poll_answer_id = $this->Application->GetVar('option_id');
+
+ if (!$poll_answer_id) {
+ $event->redirect = false;
+ return ;
+ }
+
+ $ip_address = $_SERVER['REMOTE_ADDR'];
+
+ if (!$object->GetDBField('AllowMultipleVotings')) {
+ $sql = 'SELECT StatisticsId
+ FROM '.TABLE_PREFIX.'PollsStatistics
+ WHERE PollId = '.$object->GetID().' AND UserIP = '.$this->Conn->qstr($ip_address);
+ $voted = $this->Conn->GetOne($sql) > 0;
+ }
+
+ if (!$voted) {
+ $user_id = $this->Application->LoggedIn()? $this->Application->RecallVar('user_id') : '-2';
+ $fields_hash = Array (
+ 'PollId' => $object->GetID(),
+ 'AnswerId' => $poll_answer_id,
+ 'UserIP' => $ip_address,
+ 'CreatedById' => $user_id,
+ 'AnswerDate' => adodb_mktime(),
+ );
+
+ $this->Conn->doInsert($fields_hash, TABLE_PREFIX.'PollsStatistics');
+
+ $poll_table = $this->Application->getUnitOption('poll', 'TableName');
+ $this->Conn->Query('UPDATE '.$poll_table.' SET CachedVotesQty = CachedVotesQty + 1
+ WHERE PollId = '.$object->GetID());
+
+ // update table with answers
+ $poll_answers_table = $this->Application->getUnitOption('poll-answer', 'TableName');
+ $this->Conn->Query('UPDATE '.$poll_answers_table.' SET VotesQty = VotesQty + 1
+ WHERE PollId = '.$object->GetID().' AND AnswerId = '.$poll_answer_id);
+ }
+ $event->setEventParam('PollId', $this->Application->GetVar('poll_id'));
+ $event->redirect = false;
+ }
+
+
+ /**
+ * Cleanup by removing items from PollStatistics before Poll is deleted
+ *
+ * @param kEvent $event
+ */
+ function OnAfterItemDelete(&$event)
+ {
+ $object =& $event->getObject();
+ /* @var $object kDBItem */
+
+ $sql = 'DELETE FROM '.TABLE_PREFIX.'PollsStatistics
+ WHERE PollId = '.$object->GetID();
+ $this->Conn->Query($sql);
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/polls/poll_tp.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/polls/poll_tp.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/polls/poll_tp.php (revision 12744)
@@ -0,0 +1,118 @@
+getObject($params);
+ /* @var $object kDBItem */
+
+ if (!$object->GetDBField('AllowMultipleVotings')) {
+ $sql = 'SELECT StatisticsId
+ FROM '.TABLE_PREFIX.'PollsStatistics
+ WHERE PollId = '.$object->GetID().' AND CreatedById = '.$this->Application->RecallVar('user_id').' AND UserIP = '.$this->Conn->qstr(getenv('REMOTE_ADDR'));
+ return $this->Conn->GetOne($sql) > 0;
+ }
+
+ return false;
+ }
+
+ /**
+ * Allows to tell if user from current ip has voted already for current poll
+ *
+ * @param Array $params
+ * @return bool
+ */
+ function HasCommented($params)
+ {
+ $object =& $this->getObject($params);
+ /* @var $object kDBItem */
+
+ $spam_helper =& $this->Application->recallObject('SpamHelper');
+ /* @var $spam_helper SpamHelper */
+
+ $spam_helper->InitHelper($object->GetID(), 'PollComment', 0); // PollId used for SpamControl only
+ return $spam_helper->InSpamControl();
+ }
+
+ /**
+ * Prints out only filled in answers of current poll
+ *
+ * @param Array $params
+ * @return string
+ */
+ function PrintPoll($params)
+ {
+ $object =& $this->getObject($params);
+
+ $sql = 'SELECT COUNT(AnswerNum), AnswerNum
+ FROM '.TABLE_PREFIX.'PollsStatistics
+ WHERE PollId = '.$object->GetID().'
+ GROUP BY AnswerNum';
+ $statistics = $this->Conn->GetCol($sql, 'AnswerNum');
+
+ $total_votes = array_sum($statistics);
+
+ $block_params = $this->prepareTagParams($params);
+ $block_params['name'] = $params['render_as'];
+
+ $i = 1;
+ $ret = '';
+ while ($i < 8) {
+ $answer = $object->GetDBField('Answer'.$i);
+ if ($answer) {
+ $answer_votes = isset($statistics[$i]) ? $statistics[$i] : 0;
+ if ($total_votes > 0) {
+ $block_params['percent'] = round((100 * $answer_votes) / $total_votes, 0);
+ }
+ else {
+ $block_params['percent'] = 0;
+ }
+
+ $block_params['answer'] = $answer;
+ $block_params['answer_num'] = $i;
+
+ $ret .= $this->Application->ParseBlock($block_params);
+ }
+ $i++;
+ }
+
+ return $ret;
+ }
+
+ /**
+ * Prints link to comments of of current poll
+ *
+ * @param Array $params
+ * @return string
+ */
+ function CommentsLink($params)
+ {
+ $object =& $this->getObject($params);
+
+ $params['pass'] = 'm,poll';
+ $params['poll_id'] = $object->GetID();
+
+ return $this->Application->ProcessParsedTag('m', 'Link', $params);
+ }
+ }
\ No newline at end of file
Index: branches/5.0.x/in-bulletin/units/polls/polls_config.php
===================================================================
diff -u
--- branches/5.0.x/in-bulletin/units/polls/polls_config.php (revision 0)
+++ branches/5.0.x/in-bulletin/units/polls/polls_config.php (revision 12744)
@@ -0,0 +1,167 @@
+ 'poll',
+ 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'PollEventHandler', 'file' => 'poll_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'PollTagProcessor', 'file' => 'poll_tp.php', 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array(
+ 1 => 'id',
+ 2 => 'page',
+ 3 => 'event',
+ 4 => 'mode',
+ ),
+
+ 'IDField' => 'PollId',
+
+ 'TitleField' => 'Name',
+ 'StatusField' => Array('Status'),
+
+
+ 'TitlePresets' => Array(
+ 'default' => Array(
+ 'new_status_labels' => Array('poll' => '!la_title_Adding_Poll!'),
+ 'edit_status_labels' => Array('poll' => '!la_title_Editing_Poll!'),
+ 'new_titlefield' => Array('poll' => '!la_title_NewPoll!'),
+ ),
+
+ 'poll_list' => Array('prefixes' => Array('poll_List'), 'format' => "!la_title_Polls!", ),
+ 'poll_edit' => Array('prefixes' => Array('poll'), 'format' => "#poll_status# '#poll_titlefield#' - !la_title_General!", ),
+ 'poll_edit_answers' => Array ('prefixes' => Array ('poll', 'poll-answer_List'), 'format' => "#poll_status# '#poll_titlefield#' - !la_title_PollAnswers!"),
+
+ 'poll_edit_comments' => Array ('prefixes' => Array ('poll', 'poll-comment_List'), 'format' => "#poll_status# '#poll_titlefield#' - !la_title_PollComments!"),
+
+
+ 'answer_edit' => Array (
+ 'prefixes' => Array ('poll', 'poll-answer'),
+ 'new_status_labels' => Array ('poll-answer' => '!la_title_Adding_Answer!'),
+ 'edit_status_labels' => Array ('poll-answer' => '!la_title_Editing_Answer!'),
+ 'new_titlefield' => Array ('poll-answer' => '!la_title_New_Answer!'),
+ 'format' => "#poll_status# '#poll_titlefield#' - #poll-answer_status# '#poll-answer_titlefield#'"
+ ),
+
+ 'comment_edit' => Array (
+ 'prefixes' => Array ('poll', 'poll-comment'),
+ 'new_status_labels' => Array ('poll-comment' => '!la_title_Adding_Comment!'),
+ 'edit_status_labels' => Array ('poll-comment' => '!la_title_Editing_Comment!'),
+ 'new_titlefield' => Array ('poll-comment' => '!la_title_NewComment!'),
+ 'format' => "#poll_status# '#poll_titlefield#' - #poll-comment_status#",
+ ),
+
+ ),
+
+ 'PermSection' => Array('main' => 'in-bulletin:polls'),
+
+ 'Sections' => Array (
+ 'in-bulletin:polls' => Array (
+ 'parent' => 'in-portal:site',
+ 'icon' => 'polls',
+ 'label' => 'la_title_Polls',
+ 'url' => Array('t' => 'in-bulletin/polls/poll_list', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 3.6,
+ 'type' => stTREE,
+ ),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'Polls',
+
+ 'ListSQLs' => Array('' => 'SELECT %1$s.* %2$s
+ FROM %1$s',
+
+ ),
+
+ 'ItemSQLs' => Array('' => 'SELECT %1$s.* %2$s
+ FROM %1$s',
+
+ ),
+
+ 'ListSortings' => Array(
+ '' => Array (
+ 'Sorting' => Array('PollId' => 'asc'),
+ )
+ ),
+
+ 'Fields' => Array (
+ 'PollId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,),
+ 'Name' => Array('type' => 'string', 'not_null' => '1','default' => '', 'required'=> 1, 'max_len' => 255),
+ 'Question' => Array('type' => 'string', 'formatter' => 'kMultiLanguage', 'using_fck' => 1, 'default' => null, 'required' => 1),
+ 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'),
+ 'StartDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#'),
+ 'EndDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null),
+ 'Image' => Array (
+ 'type' => 'string',
+ 'formatter' => 'kPictureFormatter',
+ 'max_size' => MAX_UPLOAD_SIZE, 'upload_dir' => IMAGES_PATH . 'polls/',
+ 'file_types' => '*.jpg;*.gif;*.png', 'files_description' => '!la_hint_ImageFiles!',
+ 'multiple' => false,
+ 'max_len' => 255, 'not_null' => 1, 'default' => ''
+ ),
+ 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'RequireLogin' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,),
+ 'AllowComments' => Array('type' => 'int', 'not_null' => 1, 'default' => 1,),
+ 'AllowMultipleVotings' => Array('type' => 'int', 'not_null' => 1, 'default' => 1,),
+ 'CachedVotesQty'=> Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Status' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_opt_Active', 0 => 'la_opt_Disabled'), 'use_phrases' => 1, 'required' => 1, 'not_null' => 1, 'default' => 1),
+
+ ),
+
+ 'SubItems' => Array ('poll-answer', 'poll-comment'),
+
+ 'VirtualFields' => Array (
+// 'PollId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,),
+ ),
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+// 'DaysLeft' => 'IF( ISNULL(%1$s.EndDate), IF (%1$s.CreatedById = -1, \'root\', IF (%1$s.CreatedById = -2, %1$s.PosterAlias, \'n/a\')), \'Never\' )',
+ ),
+ ),
+
+ 'EditTabPresets' => Array (
+ 'Default' => Array (
+ Array ('title' => 'la_tab_General', 't' => 'in-bulletin/polls/poll_edit', 'priority' => 1),
+ Array ('title' => 'la_tab_PollAnswers', 't' => 'in-bulletin/polls/poll_edit_answers', 'priority' => 2),
+ Array ('title' => 'la_tab_PollUserComments', 't' => 'in-bulletin/polls/poll_edit_comments', 'priority' => 3),
+ ),
+ ),
+
+ 'Grids' => Array (
+ 'Default' => Array (
+ 'Icons' => Array (
+ 'default' => 'icon16_item.png',
+ 0 => 'icon16_disabled.png',
+ 1 => 'icon16_item.png',
+ 2 => 'icon16_pending.png',
+ 'module' => 'core',
+ ),
+ 'Fields' => Array (
+ 'PollId' => Array ('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td', 'filter_block' => 'grid_range_filter', 'width' => 60, ),
+ 'Name' => Array ('title' => 'la_col_Name', 'data_block' => 'grid_priority_td', 'filter_block' => 'grid_like_filter', 'width' => 200, ),
+ 'StartDate' => Array ('title' => 'la_col_StartDate', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'EndDate' => Array ('title' => 'la_col_EndDate', 'data_block' => 'poll_expire_td', 'filter_block' => 'grid_date_range_filter', 'width' => 145, ),
+ 'CachedVotesQty' => Array ('title' => 'la_col_VoteCount', 'filter_block' => 'grid_like_filter', 'width' => 100, ),
+ 'Status' => Array ('title' => 'la_col_Status', 'filter_block' => 'grid_options_filter', 'width' => 100, ),
+// 'DaysActive' => Array ('title' => 'la_col_NumberOfDaysActive', 'filter_block' => 'grid_range_filter',),
+ ),
+ ),
+ ),
+
+ );
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.5.2/in-bulletin/admin_templates/catalog_tab.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.5.2/in-bulletin/admin_templates/catalog_tab.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.5.2/in-bulletin/admin_templates/catalog_tab.tpl (revision 12744)
@@ -0,0 +1,50 @@
+
+
+
+ a_toolbar.AddButton( new ToolBarButton('in-bulletin:new_topic', ' ', function() {
+ std_precreate_item(' ', 'in-bulletin/topics/topics_edit');
+ }, true
+ ) );
+
+
+
+
" view_template="in-bulletin/catalog_tab" edit_template="in-bulletin/topics/topics_edit" category_id="-1" dep_buttons="new_topic" class="catalog-tab">
+
+
+
+
+
+
+
+
+ $Catalog.setItemCount(' ', ' ');
+ $Catalog.setCurrentCategory(' ', );
+
+
+
+
+ Grids[' '].AddAlternativeGrid(' ', true);
+
+ Grids[' '].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','sep3','cut','copy','move_up','move_down','sep6'));
+ $Catalog.reflectPasteButton( );
+ $Catalog.setViewMenu(' ');
+
+ Grids[' '].RadioMode = true;
+ Grids[' '].DblClick = function() {return false};
+
+ #separator#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.10.24/in-bulletin/admin/addreview.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.10.24/in-bulletin/admin/addreview.php (revision 0)
+++ branches/unlabeled/unlabeled-1.10.24/in-bulletin/admin/addreview.php (revision 12744)
@@ -0,0 +1,222 @@
+SourceTable = $objSession->GetEditTable("Topic");
+$objEditCat->EnablePaging = FALSE;
+//Multiedit init
+$en = (int)$_GET["en"];
+$objEditCat->Query_Item("SELECT * FROM ".$objEditCat->SourceTable);
+$itemcount=$objEditCat->NumItems();
+$c = $objEditCat->GetItemByIndex($en);
+
+unset($objEditItems);
+
+$objEditItems = new clsItemReviewList();
+$objEditItems->SourceTable = $objSession->GetEditTable("ItemReview");
+
+if(isset($_POST["itemlist"]))
+{
+ if(is_array($_POST["itemlist"]))
+ {
+ $ReviewId = $_POST["itemlist"][0];
+ }
+ else
+ {
+ $ReviewId = $_POST["itemlist"];
+ }
+ $Rev = $objEditItems->GetItem($ReviewId);
+ $action = "m_review_edit";
+}
+else
+{
+ $Rev = new clsItemReview();
+ $Rev->Set("ItemId",$c->Get("ResourceId"));
+ $Rev->Set("ItemType",4);
+ $Rev->Set("Status",2);
+ $Rev->Set("Priority",0);
+ $Rev->Set("CreatedById",$objSession->Get("PortalUserId"));
+ $Rev->Set("CreatedOn",adodb_date("U"));
+ $action = "m_review_add";
+}
+
+$envar = "env=" . BuildEnv() . "&en=$en";
+
+$section = 'in-bulletin:edittopic_review';
+
+$ado = &GetADODBConnection();
+
+
+if(is_numeric($Rev->Get("CreatedById")))
+{
+ if($Rev->Get("CreatedById")>0)
+ {
+ $u = $objUsers->GetUser($Rev->Get("CreatedById"));
+ $login_name = $u->Get("Login");
+ }
+ else
+ $login_name = "root";
+}
+else
+{
+ if($objSession->Get("PortalUserId")>0)
+ {
+ $u = $objUsers->Get($objSession->Get("PortalUserId"));
+ $login_name = $u->Get("CreatedById");
+ }
+ else
+ $login_name="root";
+}
+
+$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Topic")." '".$c->Get("TopicText")."' - ".prompt_language("la_tab_Review")." by ".$login_name;
+
+$objListToolBar = new clsToolBar();
+$objListToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_save_review('topic','in-bulletin/admin/addtopic_reviews.php',0);",$imagesURL."/toolbar/tool_select.gif");
+$objListToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","do_save_review('topic','in-bulletin/admin/addtopic_reviews.php',-1);",$imagesURL."/toolbar/tool_cancel.gif");
+int_header($objListToolBar,NULL,$title);
+if ($objSession->GetVariable("HasChanges") == 1) {
+?>
+
+
+
+
+
+
+
+
+" name="viewmenu">
+
+
+
+
+
+
+
+
+
+
Index: branches/unlabeled/unlabeled-1.31.2/in-bulletin/units/topics/topics_config.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.31.2/in-bulletin/units/topics/topics_config.php (revision 0)
+++ branches/unlabeled/unlabeled-1.31.2/in-bulletin/units/topics/topics_config.php (revision 12744)
@@ -0,0 +1,308 @@
+ 'bb',
+ 'ItemClass' => Array('class' => 'kCatDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kCatDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'TopicsEventHandler', 'file' => 'topics_event_handler.php', 'require_classes' => Array('kCatDBEventHandler'), 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'TopicsTagProcessor', 'file' => 'topics_tag_processor.php', 'require_classes' => Array('kCatDBTagProcessor'), 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+ 'QueryString' => Array(
+ 1 => 'id', // topic id
+ 2 => 'post_id', // post id
+ 3 => 'Page', // topic page
+ 4 => 'Post_Page', // posts page
+ 5 => 'pm_Page', // private message page
+ 6 => 'pm_id', // private message id
+ 7 => 'Reviews_Page',
+ 8 => 'event',
+ 9 => 'mode',
+ ),
+
+ 'CatalogItem' => true,
+ 'AdminTemplatePath' => 'topics',
+ 'AdminTemplatePrefix' => 'topics_',
+ 'IDField' => 'TopicId',
+ 'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events
+
+ 'TitleField' => 'TopicText', // field, used in bluebar when editing existing item
+ 'TitlePhrase' => 'la_Text_Topic', // phrase used to specify item type in relationship list
+
+ 'TitlePresets' => Array(
+ 'default' => Array( 'new_status_labels' => Array('bb' => '!la_title_AddingTopic!'),
+ 'edit_status_labels' => Array('bb' => '!la_title_EditingTopic!'),
+ 'new_titlefield' => Array('bb' => '!la_title_NewTopic!'),
+ ),
+
+ 'topics_edit' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_General!"),
+ 'topics_categories' => Array('prefixes' => Array('bb','bb-ci_List'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Categories!"),
+ 'topics_relations' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Relations!"),
+ 'topics_images' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Images!"),
+ 'topics_reviews' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Reviews!"),
+ 'topics_custom' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Custom!"),
+
+ 'images_edit' => Array( 'prefixes' => Array('bb', 'bb-img'),
+ 'new_status_labels' => Array('bb-img'=>'!la_title_Adding_Image!'),
+ 'edit_status_labels' => Array('bb-img'=>'!la_title_Editing_Image!'),
+ 'new_titlefield' => Array('bb-img'=>'!la_title_New_Image!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-img_status# '#bb-img_titlefield#'",
+ ),
+
+ 'reviews_edit' => Array( 'prefixes' => Array('bb', 'bb-rev'),
+ 'new_status_labels' => Array('bb-rev'=>"!la_title_Adding_Review! '!la_title_New_Review!'"),
+ 'edit_status_labels' => Array('bb-rev'=>'!la_title_Editing_Review!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-rev_status#",
+ ),
+
+ 'relations_edit' => Array( 'prefixes' => Array('bb', 'bb-rel'),
+ 'new_status_labels' => Array('bb-rel'=>"!la_title_Adding_Relationship! '!la_title_New_Relationship!'"),
+ 'edit_status_labels' => Array('bb-rel'=>'!la_title_Editing_Relationship!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-rel_status#",
+ ),
+
+ 'tree_in-bulletin' => Array('format' => '!la_Text_Version! '.$this->Application->findModule('Name', 'In-Bulletin', 'Version')),
+ ),
+
+ 'PermItemPrefix' => 'TOPIC',
+
+ 'PermTabText' => 'In-Bulletin',
+ 'PermSection' => Array('main' => 'CATEGORY:in-bulletin:topics_list', 'search' => 'in-bulletin:configuration_search', 'email' => 'in-bulletin:configuration_email', 'custom' => 'in-bulletin:configuration_custom'),
+
+ 'Sections' => Array(
+ 'in-bulletin' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'settings_in-bulletin',
+ 'label' => 'la_title_In-Bulletin',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 3.3,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:inbulletin_general' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_general',
+ 'label' => 'la_tab_GeneralSettings',
+ 'url' => Array('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_output' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_output',
+ 'label' => 'la_tab_ConfigOutput',
+ 'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_search' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_search',
+ 'label' => 'la_tab_ConfigSearch',
+ 'url' => Array('t' => 'config/config_search', 'module_key' => 'topics', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_censorship' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_censor',
+ 'label' => 'la_tab_ConfigCensorship',
+ 'url' => Array('index_file' => '../in-bulletin/admin/censor_config.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_emoticon' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_smiley',
+ 'label' => 'la_tab_ConfigSmileys',
+ 'url' => Array('index_file' => '../in-bulletin/admin/emoticon_config.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_email' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_email',
+ 'label' => 'la_tab_ConfigE-mail',
+ 'url' => Array('t' => 'config/config_email', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 6,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_custom' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_custom',
+ 'label' => 'la_tab_ConfigCustom',
+ 'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 3, 'pass_section' => true, 'pass' => 'm,cf'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 7,
+ 'type' => stTREE,
+ ),
+
+ ),
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_new'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_hot'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_pop'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_pick'), 'type' => WHERE_FILTER),
+ ),
+ 'Filters' => Array(
+ 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
+ 'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ),
+ 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
+ 's1' => Array(),
+ 'show_new' => Array('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ),
+ 'show_hot' => Array('label' => 'la_Text_Hot', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ),
+ 'show_pop' => Array('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ),
+ 'show_pick' => Array('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '%1$s.`EditorsPick` != 1' ),
+ )
+ ),
+
+ 'CatalogSelectorName' => 'topiclist',
+
+ 'ItemPropertyMappings' => Array(
+ 'NewDays' => 'Topic_NewDays', // number of days item to be NEW
+ 'MinPopVotes' => 'Topic_MinPopVotes', // minimum number of votes for an item to be POP
+ 'MinPopRating' => 'Topic_MinPopRating', // minimum rating for an item to be POP
+ 'MaxHotNumber' => 'Topic_MaxHotNumber', // maximum number of HOT items
+
+ 'HotLimit' => 'Topic_HotLimit', // variable name in inp_Cache table
+ 'ClickField' => 'Views', // item click count is stored here (in item table)
+ ),
+
+ 'ItemType' => 3, // this is used when relation to product is added from in-portal and via-versa
+
+ 'ViewMenuPhrase' => 'la_title_Topics',
+
+ 'StatisticsInfo' => Array(
+ 'pending' => Array(
+ 'icon' => 'icon16_topic_pending.gif',
+ 'label' => 'la_Text_Topics',
+ 'js_url' => "set_persistant_var('Topic_View', 47, 'advanced_view', '#url#')",
+ 'url' => Array('t' => 'advanced_view', 'index_file' => 'advanced_view.php', 'SetTab' => 'topics', 'pass' => 'm'),
+ 'status' => STATUS_PENDING,
+ ),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'Topic',
+
+ 'CalculatedFields' => Array(
+ '' => Array (
+ 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.OwnerId = -1, "root", IF (%1$s.OwnerId = -2, "Guest", "n/a")), u.Login)',
+ 'CategoryId' => TABLE_PREFIX.'CategoryItems.CategoryId',
+ 'Filename' => TABLE_PREFIX.'CategoryItems.Filename',
+ ),
+ ),
+
+ 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'CategoryItems ON '.TABLE_PREFIX.'CategoryItems.ItemResourceId = %1$s.ResourceId
+ LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'CategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'PermCache perm ON perm.CategoryId = '.TABLE_PREFIX.'CategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.OwnerId = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'%3$sTopicCustomData cust ON %1$s.ResourceId = cust.ResourceId',
+ ), // key - special, value - list select sql
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('EditorsPick' => 'desc', 'Priority' => 'desc'),
+ 'Sorting' => Array('TopicText' => 'asc'),
+ )
+ ),
+ 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'CategoryItems ON '.TABLE_PREFIX.'CategoryItems.ItemResourceId = %1$s.ResourceId
+ LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'CategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.OwnerId = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'%3$sTopicCustomData cust ON %1$s.ResourceId = cust.ResourceId'),
+
+ 'SubItems' => Array('bb-rev', 'bb-ci', 'bb-rel', 'bb-img', 'bb-cdata'),
+
+ 'Fields' => Array (
+ 'TopicId' => Array(),
+ 'NotifyOwnerOnChanges' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Modified' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'not_null' => 1, 'default' => '#NOW#'),
+ 'TopicText' => Array('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'AutomaticFilename' => Array('type' => 'int', 'not_null' => 1, 'default' => 1),
+ 'Posts' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Views' => Array('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%d', 'not_null' => 1, 'default' => 0),
+ 'EditorsPick' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
+ 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
+ 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => ''),
+ 'OwnerId' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'required' => 1, 'default' => -1),
+ 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => 0),
+ 'ResourceId' => Array('type' => 'int', 'default' => ''),
+ 'TopicType' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_Yes', 1 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1),
+ 'CreatedOn' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#', 'not_null' => 1),
+ 'CachedReviewsQty' => Array('type' => 'int' ,'not_null' => 1, 'default' => 0),
+ 'CachedRating' => Array('type' => 'string', 'default' => ''),
+ 'CachedVotesQty' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'PostedBy' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'OrgId' => Array('type' => 'int', 'default' => 0),
+ 'LastPostId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'LastPostDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => 1, 'default' => ''),
+ 'TodayDate' => Array('type' => 'string', 'not_null' => 1, 'default' => '0000-00-00'),
+ 'TodayPosts' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ ),
+
+ 'VirtualFields' => Array(
+ 'UserName' => Array('type'=>'string', 'default' => ''),
+ 'CategoryId' => Array('type' => 'int', 'default' => 0),
+ 'Filename' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'CachedNavbar' => Array('type' => 'string', 'default' => ''),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array(1 => 'icon16_topic.gif', 2 => 'icon16_topic_pending.gif', 0 => 'icon16_topic_disabled.gif', 'HOT' => 'icon16_topic_hot.gif', 'POP' => 'icon16_topic_pop.gif', 'NEW' => 'icon16_topic_new.gif', 'PICK' => 'icon16_topic_pick.gif'),
+ 'Fields' => Array(
+ 'TopicId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td'),
+ 'TopicText' => Array('title' => 'la_col_TopicText', 'data_block' => 'grid_catitem_td'),
+ 'UserName' => Array('title' => 'la_col_PostedBy'),
+ 'Modified_formatted' => Array('title' => 'la_col_ModifiedDate', 'sort_field' => 'Modified'),
+ 'Posts' => Array('title' => 'la_col_Posts'),
+ 'Views' => Array('title' => 'la_col_Views'),
+ ),
+ ),
+
+ 'Radio' => Array(
+ 'Icons' => Array(1 => 'icon16_topic.gif', 2 => 'icon16_topic_pending.gif', 0 => 'icon16_topic_disabled.gif', 'HOT' => 'icon16_topic_hot.gif', 'POP' => 'icon16_topic_pop.gif', 'NEW' => 'icon16_topic_new.gif', 'PICK' => 'icon16_topic_pick.gif'),
+ 'Fields' => Array(
+ 'TopicId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_radio_td'),
+ 'TopicText' => Array('title' => 'la_col_TopicText', 'data_block' => 'grid_catitem_td'),
+ 'UserName' => Array('title' => 'la_col_PostedBy'),
+ 'Modified_formatted' => Array('title' => 'la_col_ModifiedDate', 'sort_field' => 'Modified'),
+ 'Posts' => Array('title' => 'la_col_Posts'),
+ 'Views' => Array('title' => 'la_col_Views'),
+ ),
+ ),
+ ),
+
+ 'ConfigMapping' => Array(
+ 'PerPage' => 'Perpage_Topics',
+ 'ShortListPerPage' => 'Perpage_Topics_Short',
+ 'DefaultSorting1Field' => 'Topic_SortField',
+ 'DefaultSorting2Field' => 'Topic_SortField2',
+ 'DefaultSorting1Dir' => 'Topic_SortOrder',
+ 'DefaultSorting2Dir' => 'Topic_SortOrder2',
+ ),
+ );
+
+
+?>
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.53.2/in-bulletin/admin/install/inportal_data.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.53.2/in-bulletin/admin/install/inportal_data.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.53.2/in-bulletin/admin/install/inportal_data.sql (revision 12744)
@@ -0,0 +1,254 @@
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.01, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'TopicText=la_Topic_Text,Posts=la_Number_of_Posts,CreatedOn=la_CreatedOn,LastPostDate=la_LastUpdate,Views=la_Topic_Views,CachedRating=la_Rating,LastPoser=la_Poster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) ', 10.01, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '', 'TopicText=la_Topic_Text,Posts=la_Number_of_Posts,CreatedOn=la_CreatedOn,LastPostDate=la_LastUpdate,Views=la_Topic_Views,CachedRating=la_Rating,LastPoser=la_Poster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) ', 10.02, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_NewDays', 'la_Text_Topics', 'la_topic_newdays_prompt', 'text', '', 'asc=la_common_ascending,desc=la_common_descending', 10.05, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.02, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics', 'la_Text_Topics', 'la_topic_perpage_prompt', 'text', '', '', 10.03, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MinPopRating', 'la_Text_Topics', 'la_fld_Topic_MinPopRating', 'text', '', '', 10.06, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MaxHotNumber', 'la_Text_Topics', 'la_fld_Topic_MaxHotNumber', 'text', '', '', 10.08, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_EditorPicksAbove', 'la_Text_Topics', 'la_topic_editorpicksabove_prompt', 'checkbox', '', '', 10.09, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Postings', 'la_posts_subheading', 'la_posts_perpage_prompt', 'text', '', '', 20.01, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Posts_NewDays', 'la_posts_subheading', 'la_posts_newdays_prompt', 'text', '', '', 20.02, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MinPopVotes', 'la_Text_Topics', 'la_fld_Topic_MinPopVotes', 'text', '', '', 10.07, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics_Short', 'la_Text_Topics', 'la_topic_perpage_short_prompt', 'text', '', '', 10.04, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Value', 'la_Text_Topics', 'la_prompt_DupReviews', 'text', '', '', 10.1, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Interval', 'la_Text_Topics', 'la_prompt_DupReviews', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.1, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Value', 'la_Text_Topics', 'la_prompt_DupRating', 'text', '', '', 10.11, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Interval', 'la_Text_Topics', 'la_prompt_DupRating', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.11, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('AutoTopicLockPosts', 'la_Text_Topics', 'la_prompt_PostsToLock', 'text', NULL, NULL, 10.12, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_TopicReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL, NULL, 30.01, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('bb_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 40.01, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 40.02, 0, 0);
+
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_topics', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_topics', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_topics', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_topics', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_topics', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_PrivateMessages', 'la_text_PrivateMessages', 'la_text_PrivateMessages_PerPage', 'text', NULL, NULL, 0, 0, 1);
+
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_Postings', '25', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_Topics', '5', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Posting_SortOrder', 'CreatedOn asc, PostingText', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Posts_NewDays', '5', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Bulletin_TopCount', '2', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Bulletin_CatNewDays', '10', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Bulletin_Pick_First', '1', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_SortOrder', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_SortField', 'LastPostDate', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_SortOrder2', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_SortField2', 'Posts', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_NewDays', '6', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_MinPopRating', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_MaxHotNumber', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_EditorPicksAbove', '1', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_MinPopVotes', '8', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Root', '{TopicCatId}', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Post_Sortfield', DEFAULT, 'In-Bulletin', '')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Post_SortOrder', DEFAULT, 'In-Bulletin', '')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'BBTags', 'b:;i:;u:;ul:type|align;font:color|face|size;url:href;img:src|border', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Post_Background1', '#cccccc', 'In-Portal', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Post_Background2', '#bbbbbb', 'In-Portal', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Background1', '#FAEBD7', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Background2', '#F5F5DC', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'AutoTopicLockPosts', '0', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_CategoryTemplate', 'inbulletin/index', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'bb_ItemTemplate', 'inbulletin/post_list', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Highlight_OpenTag', '', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Topic_Highlight_CloseTag', ' ', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_Topics_Short', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'topic_RatingDelay_Interval', '3600', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'topic_RatingDelay_Value', '1', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'topic_ReviewDelay_Interval', '60', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'topic_ReviewDelay_Value', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Increase_topics', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Keyword_topics', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Pop_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Rating_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Increase_posts', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Keyword_posts', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Pop_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'SearchRel_Rating_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Search_ShowMultiple_topics', '0', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_PrivateMessages', '20', 'In-Bulletin', '');
+INSERT INTO ConfigurationValues VALUES (DEFAULT, 'Perpage_TopicReviews', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+
+INSERT INTO Emoticon VALUES (1, 'Happy Smile', 0, ':)', 1);
+INSERT INTO Emoticon VALUES (2, 'Big Grin', 0, ':grin:', 1);
+INSERT INTO Emoticon VALUES (3, 'Wink', 0, ';)', 1);
+INSERT INTO Emoticon VALUES (4, 'Scared', 0, ':scared:', 1);
+INSERT INTO Emoticon VALUES (5, 'Teasing', 0, ':eek:', 1);
+INSERT INTO Emoticon VALUES (6, 'Cool', 0, ':cool:', 1);
+INSERT INTO Emoticon VALUES (7, 'Angry', 0, ':@', 1);
+INSERT INTO Emoticon VALUES (8, 'Squint', 0, ':squint:', 1);
+INSERT INTO Emoticon VALUES (9, 'Oops', 0, ':o', 1);
+INSERT INTO Emoticon VALUES (10, 'Sad', 0, ':(', 1);
+INSERT INTO Emoticon VALUES (11, 'Cry', 0, ':cry:', 1);
+INSERT INTO Emoticon VALUES (12, 'Smirk', 0, ';]', 1);
+INSERT INTO Emoticon VALUES (13, 'Happy sleep', 0, ':sleep:', 1);
+INSERT INTO Emoticon VALUES (14, 'Very angry', 0, ':x', 1);
+INSERT INTO Emoticon VALUES (15, 'Geek', 0, ':geek:', 1);
+INSERT INTO Emoticon VALUES (16, 'Upset', 0, ';(', 1);
+INSERT INTO Emoticon VALUES (17, 'LOL', 0, ':lol:', 1);
+INSERT INTO Emoticon VALUES (18, 'Yawn', 0, ':O', 1);
+INSERT INTO Emoticon VALUES (19, 'Thinking', 0, ':hm:', 1);
+INSERT INTO Emoticon VALUES (20, 'Secret', 0, ':|', 1);
+
+INSERT INTO Events VALUES (DEFAULT, 'TOPIC.ADD', NULL, 2, 0, 'In-Bulletin', 'la_event_topic.add', 1);
+INSERT INTO Events VALUES (DEFAULT, 'POST.ADD', NULL, 2, 0, 'In-Bulletin', 'la_event_post.add', 1);
+INSERT INTO Events VALUES (DEFAULT, 'POST.MODIFY', NULL, 2, 0, 'In-Bulletin', 'la_event_post.modify', 1);
+INSERT INTO Events VALUES (DEFAULT, 'POST.ADD', NULL, 1, 0, 'In-Bulletin', 'la_event_post.add', 0);
+INSERT INTO Events VALUES (DEFAULT, 'PM.ADD', NULL, 1, 0, 'In-Bulletin', 'la_event_pm.add', 0);
+
+INSERT INTO ItemTypes VALUES (3, 'In-Bulletin', 'bb', 'Topic', 'TopicText', 'OwnerId', 'Views', 'CachedRating', 'la_ItemTab_Topics', 1, '', 'clsTopic', 'Topic');
+INSERT INTO ItemTypes VALUES (30, 'In-Bulletin', 'posting', 'Posting', 'Subject', 'CreatedById', NULL, NULL, 'la_ItemTab_Posts', 0, '', '', 'Post');
+
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.VIEW', 'lu_PermName_Topic.View_desc', 'lu_PermName_Topic.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.ADD', 'lu_PermName_Topic.Add_desc', 'lu_PermName_Topic.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.ADD.PENDING', 'lu_PermName_Topic.Add.Pending_desc', 'lu_PermName_Topic.Add.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.DELETE', 'lu_PermName_Topic.Delete_desc', 'lu_PermName_Topic.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.MODIFY', 'lu_PermName_Topic.Modify_desc', 'lu_PermName_Topic.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.DELETE', 'lu_PermName_Topic.Reply.Delete_desc', 'lu_PermName_Topic.Reply.Delete_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 'lu_PermName_Topic.Reply.View_desc', 'lu_PermName_Topic.Reply.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 'lu_PermName_Topic.Reply.Add_desc', 'lu_PermName_Topic.Reply.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.MODIFY', 'lu_PermName_Topic.Reply.Modify_desc', 'lu_PermName_Topic.Reply.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.RATE', 'lu_PermName_Topic.Rate_desc', 'lu_PermName_Topic.Rate_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REVIEW', 'lu_PermName_Topic.Review_desc', 'lu_PermName_Topic.Review_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.MODIFY', 'lu_PermName_Topic.Reply.Owner.Modify_desc', 'lu_PermName_Topic.Reply.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.DELETE', 'lu_PermName_Topic.Reply.Owner.Delete_desc', 'lu_PermName_Topic.Reply.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.OWNER.DELETE', 'lu_PermName_Topic.Owner.Delete_desc', 'lu_PermName_Topic.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.MODIFY.PENDING', 'lu_PermName_Topic.Modify.Pending_desc', 'lu_PermName_Topic.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY.PENDING', 'lu_PermName_Topic.Owner.Modify.Pending_desc', 'lu_PermName_Topic.Owner.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY', 'lu_PermName_Topic.Owner.Modify_desc', 'lu_PermName_Topic.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig VALUES (DEFAULT, 'TOPIC.LOCK', 'lu_PermName_Topic.Lock_desc', 'lu_PermName_Topic.Lock_error', 'In-Bulletin');
+
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT count(*) FROM <%prefix%>Topic WHERE Status=1', NULL, 'la_prompt_ActiveTopics', 0, 1);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS TotalTopics FROM <%prefix%>Topic', NULL, 'la_prompt_TopicsTotal', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS ActiveTopics FROM <%prefix%>Topic WHERE Status = 1', NULL, 'la_prompt_TopicsActive', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS PendingTopics FROM <%prefix%>Topic WHERE Status = 2', NULL, 'la_prompt_TopicsPending', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS DisabledTopics FROM <%prefix%>Topic WHERE Status = 0', NULL, 'la_prompt_TopicsDisabled', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS NewTopics FROM <%prefix%>Topic WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Topic_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewTopics', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>Topic WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickTopics', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS HotTopics FROM <%prefix%>Topic WHERE (HotItem = 1) OR (Posts >= <%m:config name="Topic_MaxHotNumber"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotTopics', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS PopularTopics FROM <%prefix%>Topic WHERE (PopItem = 1) OR ( (CachedRating >= <%topic:hit_count type="top"%>) AND <%topic:hit_count type="top"%> AND (PopItem = 2) )', NULL, '(*) la_prompt_PopularTopics', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Topic WHERE CachedRating > 0', NULL, 'la_prompt_TopicAverageRating', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT MAX(Views) AS MaxTopicHits FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicHits', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT MAX(CachedVotesQty) AS MaxTopicVotes FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicVotes', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_TopicReviews', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT COUNT(*) AS TotalPosts FROM <%prefix%>Posting', NULL, 'la_prompt_PostsTotal', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostDate', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostTime', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostDate', 0, 2);
+INSERT INTO StatItem VALUES (DEFAULT, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostTime', 0, 2);
+
+INSERT INTO SearchConfig VALUES ('Topic', 'NotifyOwnerOnChanges', 0, 1, 'lu_fielddesc_topic_notifyowneronchanges', 'lu_field_notifyowneronchanges', 'In-Bulletin', 'la_text_topic', 1, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicId', 0, 1, 'lu_fielddesc_topic_topicid', 'lu_field_topicid', 'In-Bulletin', 'la_text_topic', 0, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Priority', 0, 1, 'lu_fielddesc_topic_priority', 'lu_field_priority', 'In-Bulletin', 'la_text_topic', 8, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OwnerId', 0, 1, 'lu_fielddesc_topic_ownerid', 'lu_field_ownerid', 'In-Bulletin', 'la_text_topic', 9, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Modified', 0, 1, 'lu_fielddesc_topic_modified', 'lu_field_modified', 'In-Bulletin', 'la_text_topic', 2, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicText', 1, 1, 'lu_fielddesc_topic_topictext', 'lu_field_topictext', 'In-Bulletin', 'la_text_topic', 3, DEFAULT, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Posts', 0, 1, 'lu_fielddesc_topic_posts', 'lu_field_posts', 'In-Bulletin', 'la_text_topic', 4, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Views', 0, 1, 'lu_fielddesc_topic_views', 'lu_field_views', 'In-Bulletin', 'la_text_topic', 5, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'EditorsPick', 0, 1, 'lu_fielddesc_topic_editorspick', 'lu_field_editorspick', 'In-Bulletin', 'la_text_topic', 6, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Status', 0, 1, 'lu_fielddesc_topic_status', 'lu_field_status', 'In-Bulletin', 'la_text_topic', 7, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ModifiedById', 0, 1, 'lu_fielddesc_topic_modifiedbyid', 'lu_field_modifiedbyid', 'In-Bulletin', 'la_text_topic', 10, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ResourceId', 0, 1, 'lu_fielddesc_topic_resourceid', 'lu_field_resourceid', 'In-Bulletin', 'la_text_topic', 11, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicType', 0, 1, 'lu_fielddesc_topic_topictype', 'lu_field_topictype', 'In-Bulletin', 'la_text_topic', 12, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CreatedOn', 0, 1, 'lu_fielddesc_topic_createdon', 'lu_field_createdon', 'In-Bulletin', 'la_text_topic', 13, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedReviewsQty', 0, 1, 'lu_fielddesc_topic_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Bulletin', 'la_text_topic', 14, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedRating', 0, 1, 'lu_fielddesc_topic_cachedrating', 'lu_field_cachedrating', 'In-Bulletin', 'la_text_topic', 15, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedVotesQty', 0, 1, 'lu_fielddesc_topic_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Bulletin', 'la_text_topic', 16, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'NewItem', 0, 1, 'lu_fielddesc_topic_newitem', 'lu_field_newitem', 'In-Bulletin', 'la_text_topic', 17, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PopItem', 0, 1, 'lu_fielddesc_topic_popitem', 'lu_field_popitem', 'In-Bulletin', 'la_text_topic', 18, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'HotItem', 0, 1, 'lu_fielddesc_topic_hotitem', 'lu_field_hotitem', 'In-Bulletin', 'la_text_topic', 19, DEFAULT, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PostedBy', 0, 1, 'lu_fielddesc_topic_postedby', 'lu_field_postedby', 'In-Bulletin', 'la_text_topic', 20, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OrgId', 0, 1, 'lu_fielddesc_topic_orgid', 'lu_field_orgid', 'In-Bulletin', 'la_text_topic', 21, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'LastPostId', 0, 1, 'lu_fielddesc_topic_lastpostid', 'lu_field_lastpostid', 'In-Bulletin', 'la_text_topic', 22, DEFAULT, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY.PENDING', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.ADD.PENDING', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.RATE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REVIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.DELETE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'CATEGORY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'FAVORITES', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.RATE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REVIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.ADD.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.RATE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REVIEW', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.REPLY.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'TOPIC.LOCK', 15, 0, 0, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:inbulletin_general.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:inbulletin_general.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_output.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_output.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_search.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_search.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_censorship.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_censorship.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_censorship.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_emoticon.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_emoticon.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_emoticon.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_email.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_email.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_custom.view', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_custom.add', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_custom.edit', 11, 1, 1, 0);
+INSERT INTO Permissions VALUES (DEFAULT, 'in-bulletin:configuration_custom.delete', 11, 1, 1, 0);
+
+INSERT INTO ImportScripts VALUES (DEFAULT, 'In-Bulletin', 'phpbb', 'phpbb_import', 'phpBB 2.x', 'phpBB', 'user_regular,init_cat', 1, 'db');
+
+INSERT INTO CustomField VALUES (DEFAULT, 1, 'bb_ItemTemplate', 'bb_ItemTemplate', 'la_title_SystemCF', 'bb_ItemTemplate', 'text', NULL, 0, 0, 1);
+
+INSERT INTO Modules VALUES ('In-Bulletin', 'in-bulletin/', 'bb', '4.1.0', 1, 3, 'inbulletin/', {TopicCatId}, '1054738405');
Index: branches/unlabeled/unlabeled-1.29.10/in-bulletin/posting.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.29.10/in-bulletin/posting.php (revision 0)
+++ branches/unlabeled/unlabeled-1.29.10/in-bulletin/posting.php (revision 12744)
@@ -0,0 +1,996 @@
+clsItem();
+ $this->adodbConnection = &GetADODBConnection();
+ $this->tablename=GetTablePrefix()."Posting";
+ $this->type=30;
+ $this->BasePermission="TOPIC.REPLY";
+ $this->TagPrefix="posting";
+ $this->id_field = "PostingId";
+ $this->Locked = FALSE;
+ if(isset($PostingId))
+ $this->LoadFromDatabase($PostingId);
+ }
+
+ function Delete()
+ {
+ $oldparent = $this->Get("PostingId");
+ $newparent = $this->Get("ReplyTo");
+ $sql="UPDATE ".$this->tablename." SET ReplyTo=$newparent WHERE ReplyTo=$oldparent";
+ $this->adodbConnection->Execute($sql);
+ parent::Delete();
+ }
+
+ function GetUserPosts($UserId)
+ {
+ global $Errors, $objUsers;
+ $sql = "SELECT COUNT(PostingId) as pcount FROM ".$this->tablename." WHERE CreatedById=$UserId";
+ $result = $this->adodbConnection->Execute($sql);
+ if ($result === false)
+ {
+ $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"","clsPosting","GetUserPosts");
+ return false;
+ }
+ $posts = $result->fields["pcount"];
+
+ return $posts;
+ }
+
+ function PostOption($name)
+ {
+ $OptionsMap = Array('show_sig'=>128,'disable_bbcode'=>64,'disable_smileys'=>32);
+ if(!isset($OptionsMap[$name]))return false;
+ $opt = $this->Get("Options");
+ return (($opt & $OptionsMap[$name]) == $OptionsMap[$name]) ? 1 : 0;
+ }
+
+ function SetPostOption($name,$value)
+ {
+ $OptionsMap = Array('show_sig'=>128,'disable_bbcode'=>64,'disable_smileys'=>32);
+ if(!isset($OptionsMap[$name]))return false;
+
+ $opt=(int)$this->Get("Options");
+ if($value)
+ {
+ $opt|=$OptionsMap[$name];
+ }
+ else
+ {
+ $opt=$opt&~$OptionsMap[$name];
+ }
+ $this->Set("Options",$opt);
+ }
+
+ function LoadFromDatabase($Id)
+ {
+ global $Errors;
+
+ if(!isset($Id))
+ {
+ $Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"GetUserPosts");
+ return false;
+ }
+
+ $sql = sprintf("SELECT * FROM ".$this->tablename." WHERE PostingId = '%s'",$Id);
+ $result = $this->adodbConnection->Execute($sql);
+ if ($result === false)
+ {
+ $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromDatabase");
+ return false;
+ }
+ $this->SetFromArray($result->fields);
+ $this->Clean();
+ return true;
+ }
+
+ function GetTotalPosts()
+ {
+ global $Errors,$objSession;
+
+ $sql = "SELECT count(*) as PostCount FROM ".$this->tablename;
+ $result = $this->adodbConnection->Execute($sql);
+ if ($result === false || !$result)
+ {
+ $Errors->AddError("error.DatabaseError",NULL,$objSession->adodbConnection->ErrorMsg(),"","clsPosting","GetTotalPosts");
+ return false;
+ }
+ return $result->fields["PostCount"];
+ }
+
+ function RenderText($text,$QouteTemplate)
+ {
+ global $objSmileys;
+
+ $ret = $this->ReplaceQuote($ret,$QuoteTemplate);
+
+ if(!$this->PostOption("disable_smileys"))
+ $ret = $objSmileys->ParseText($ret);
+ if(!$this->PostOption("disable_bbcode"))
+ $ret = ReplaceBBCode($ret);
+ return $ret;
+ }
+
+ function ReplaceQuote($text,$QuoteTemplate)
+ {
+ global $objPostingList;
+
+ //$template = new clsItemTemplate();
+ if(strstr($text,"[quote"))
+ {
+ $text .= " ";
+ $pos = strpos($text,"[quote");
+ $endopen = strpos($text,"]",$urlpos);
+ $closepos = getLastStr($text,"[/quote]"); // strrpos($text,"[/quote]");
+
+ if($endopen && $closepos)
+ {
+ $tagText = substr($text,$pos, $closepos + strlen("[/quote]") - $pos);
+ $innerText = substr($text,$endopen+1,$closepos - $endopen-1);
+ $tagText = substr($text,$pos+1,$endopen - $pos-1);
+ $attr = substr($tagText,6);
+ $attribs = explode("=",$attr);
+// echo "Tag: $tagText Inner: $innerText \n";
+// echo $attribs[0]."=".$attribs[1];
+ if($attribs[0]=="id")
+ {
+ $QuoteId = $attribs[1];
+ $p = new clsPosting($QuoteId);// $objPostingList->GetItem($QuoteId);
+ if(is_object($p))
+ {
+ // echo "Parsing $QuoteTemplate..";
+ $p->Set("PostingText",$innerText);
+ $text = substr($text,0,$pos).$p->ParseTemplate($QuoteTemplate).substr($text,$closepos+8)." ";
+ // echo $text;
+ }
+ }
+ }
+ }
+ return $text;
+ }
+
+ function Link($template="")
+ {
+ global $var_list_update, $bb_var_list_update, $var_list;
+
+ if(strlen($template))
+ {
+ $var_list_update["t"] = $template;
+ }
+ else
+ $var_list_update["t"] = $var_list["t"];
+
+ $bb_var_list_update["top"] = $this->Get("TopicId");
+ $bb_var_list_update["post"] = $this->Get("PostingId");
+ $ret = HREF_Wrapper();
+ unset($bb_var_list_update["top"],$bb_var_list_update["post"], $var_list_update["t"]);
+ return $ret;
+ }
+
+ function ParseObject($element)
+ {
+ global $objConfig, $objSmileys, $objSession, $objUsers, $objCatList,
+ $var_list_update, $var_list, $bb_var_list_update, $objCensorList;
+
+ $extra_attribs = ExtraAttributes($element->attributes);
+ if(strtolower($element->name)==$this->TagPrefix)
+ {
+ $field = strtolower($element->attributes["_field"]);
+ switch($field)
+ {
+ case "id":
+ case "postingid":
+ /*
+ @field:posting.postingid
+ @description: Returns the ID field for the post
+ */
+ $ret = $this->Get("PostingId");
+ break;
+ case "subject":
+ /*
+ @field:posting.subject
+ @description: Returns the post subject, if set
+ */
+ $ret = $objCensorList->CensorText($this->Get("Subject"));
+ break;
+ /*
+ @field:posting.image
+ @description:Return an image associated with the topic
+ @attrib:_default:bool:If true, will return the default image if the requested image does not exist
+ @attrib:_name::Return the image with this name
+ @attrib:_thumbnail:bool:If true, return the thumbnail version of the image
+ @attrib:_imagetag:bool:If true, returns a complete image tag. exta html attributes are passed to the image tag
+ */
+ case "modifiedby":
+ /*
+ @field:posting.modifiedby
+ @description:parse a user field of the user that last modified the topic
+ @attrib:_usertag::User field to return (defaults to login ID)
+ */
+ $field = $element->attributes["_usertag"];
+ if(!strlen($field))
+ {
+ $field = "user_login";
+ }
+ $u = $objUsers->GetItem($this->Get("ModifiedById"));
+ $ret = $u->parsetag($field);
+ break;
+ case "depth":
+ /*
+ @field:posting.depth
+ @description: For threaded post lists, this field returns the depth of the post (how many replies deep this post is)
+ @attrib:_multiplier:int:value to multiply the dept by
+ */
+ $ret = (int)$this->Get("Depth");
+ if(is_numeric($element->attributes["_multiplier"]))
+ $ret = $ret * $element->attributes["_multiplier"];
+ break;
+ case "createdby":
+ /*
+ @field:posting.createdby
+ @description:parse a user field of the user that created this post
+ @attrib:_usertag::User field to return (defaults to login ID)
+ */
+ $userfield = $element->attributes["_usertag"];
+ if(!strlen($userfield))
+ {
+ $userfield = "login";
+ }
+ if(!is_object($this->Poster))
+ {
+ $user_id = $this->Get('CreatedById');
+ if (!$user_id) { // we have registred user, not guest
+ // user_id == 0 - "View Threaded" issued just after deleting reply.
+ global $bb_var_list;
+ $topic_id = $bb_var_list['top'];
+ $sql = 'SELECT PostingId FROM '.GetTablePrefix().'Posting
+ WHERE TopicId = '.$topic_id.'
+ ORDER BY CreatedOn ASC';
+ $db =& GetADODBConnection();
+ $bb_var_list['post'] = $db->GetOne($sql);
+ $this->LoadFromDatabase($bb_var_list['post']);
+ }
+
+ $this->Poster =& $objUsers->GetItem( $this->Get('CreatedById') );
+ }
+
+ $condition = is_object($this->Poster);
+ if ($element->attributes['_isactive'])
+ {
+ $condition = $condition && ($this->Poster->Get('Status')==1);
+ }
+
+ if ($element->attributes["_name"]=='avatar')
+ {
+ if (!is_object($objImageList)) $objImageList =& new clsImageList();
+ if ($this->Poster->Get('Status')==1)
+ {
+ $objAvatar = $objImageList->GetImageByName($this->Poster->Get('ResourceId'), 'avatar', 1);
+ }
+ $condition = $condition && is_object($objAvatar);
+ //$condition = $condition && $this->Poster->;
+ }
+
+ if($condition)
+ {
+ $e = new clsHtmlTag();
+ $e->name = $this->Poster->TagPrefix;
+ $e->attributes = $element->attributes;
+ $e->attributes["_field"] = $userfield;
+ $ret = $this->Poster->ParseObject($e);
+ }
+ else
+ {
+ $ret = '';
+ }
+ break;
+ case "user_posts":
+ /*
+ @field:posting.user_posts
+ @description:Number of posts made by the creator of this post
+ */
+ if(!is_object($this->Poster))
+ {
+ $this->Poster =& $objUsers->GetItem($this->Get("CreatedById"));
+ }
+ $ret = $this->Poster->GetPersistantVariable("bb_posts");
+ if(!strlen($ret))
+ {
+ (int)$ret = $this->GetUserPosts($this->Get("CreatedById"));
+ $this->Poster->SetPersistantVariable("bb_posts",$ret);
+ }
+ break;
+
+ case "posteralias":
+ /*
+ @field:posting.posteralias
+ @description: Alias used by the poster, or the login name if not set
+ */
+ $ret = $this->Get("PosterAlias");
+ if(!strlen($ret))
+ {
+ if(!is_object($this->Poster)) {
+ $this->Poster =& $objUsers->GetItem($this->Get("CreatedById"));
+ }
+
+ $ret = $this->Poster->parsetag("user_login");
+
+ if ($ret == '') {
+ $ret = admin_language("lu_Guest");
+ }
+ }
+ break;
+ case "custom":
+ /*
+ @field:posting.custom
+ @description:Returns a custom field
+ @attrib:_customfield::field name to return
+ @attrib:_default::default value
+ */
+ $field = $element->attributes["_customfield"];
+ $default = $element->attributes["_default"];
+ $ret = $this->GetCustomFieldValue($field,$default);
+ break;
+ case "date":
+ /*
+ @field:posting.date
+ @description:Returns the date/time the post was created
+ @attrib:_tz:bool:Convert the date to the user's local time
+ @attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr
+ */
+ $d = $this->Get('CreatedOn');
+ if (!$element->GetAttributeByName('_tz')) {
+ $element->SetAttributeByName('_tz', 'auto');
+ }
+ $ret = $this->ParseTimeStamp($d,$element->attributes);
+ break;
+ case "modifieddate":
+ /*
+ @field:posting.modifieddate
+ @description:Returns the date/time the topic was last modified
+ @attrib:_tz:bool:Convert the date to the user's local time
+ @attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr
+ */
+ $d = $this->Get('Modified');
+ if (!$element->GetAttributeByName('_tz')) {
+ $element->SetAttributeByName('_tz', 'auto');
+ }
+ $ret = $this->ParseTimeStamp($d,$element->attributes);
+ break;
+
+ case "link":
+ /*
+ @field:posting.link
+ @description: Returns a link to the post
+ @attrib:_perm::Comma-separated permission list to check, any one permission granted to the user will create the link
+ @attrib:_template:tpl:Tempalte to link to if access is granted
+ @attrib:_text:lang:Language tag to display as the link text
+ @attrib:_plaintext:: Plain text to use instead of language tag
+ @attrib:image::Image URL to display in the anchor tag
+ */
+ $p = $element->attributes["_perm"];
+ if(strlen($p))
+ {
+ $hasperm = $objSession->HasCatPermission($p);
+ }
+ else
+ $hasperm = TRUE;
+ if($hasperm)
+ {
+ $t = $element->attributes["_template"];
+ $url = $this->Link($t);
+ if($element->attributes["_fulltag"])
+ {
+ $ret = "";
+ $text = $element->attributes["_text"];
+ if(!strlen($text))
+ {
+ $text = $element->attributes["_plaintext"];
+ if(!strlen($text))
+ {
+ if(strlen($element->attributes["_image"]))
+ {
+ $text = " attributes["_image"]."\" BORDER=\"0\">";
+ }
+ }
+ $ret .= $text." ";
+ }
+ }
+ else
+ $ret = $url;
+ }
+ else
+ $ret = "";
+ break;
+ case "link_edit":
+ /*
+ @field:posting.link_edit
+ @description: Returns a link to edit the post. A complete anchor tag is returned, and the tag class is set to 'topic_reply'
+ @attrib:_template:tpl:Template link should point to
+ @attrib:_text:lang:Language tag to display as the link text
+ @attrib:_plaintext:: Plain text to use instead of language tag
+ @attrib:image::Image URL to display in the anchor tag
+ */
+ //echo $this->Get("CreatedById")." User: ".$objSession->Get("PortalUserId");
+ $hasperm = (($this->Get("CreatedById")==$objSession->Get("PortalUserId") &&
+ $objSession->HasCatPermission("TOPIC.REPLY.OWNER.MODIFY")) ||
+ $objSession->HasCatPermission("TOPIC.REPLY.MODIFY"));
+ if($hasperm && !$this->Locked)
+ {
+ $t = $element->attributes["_template"];
+ $url = $this->Link($t);
+ if($element->attributes["_fulltag"])
+ {
+ $ret = "";
+ $text = $element->attributes["_text"];
+ if(!strlen($text))
+ {
+ $text = $element->attributes["_plaintext"];
+ if(!strlen($text))
+ {
+ if(strlen($element->attributes["_image"]))
+ {
+ $text = " attributes["_image"]."\" BORDER=\"0\">";
+ }
+ }
+ $ret .= $text." ";
+ }
+ else
+ $ret .= language($text)."
";
+ }
+ else
+ $ret = $url;
+ }
+ else
+ $ret = "";
+ break;
+ case "link_delete":
+ /*
+ @field:topic.link_delete
+ @description: Returns a link to delete the post. A complete anchor tag is returned, and the tag class is set to 'topic_reply'
+ @attrib:_template:tpl:Template link should point to
+ @attrib:_text:lang:Language tag to display as the link text
+ @attrib:_plaintext:: Plain text to use instead of language tag
+ @attrib:image::Image URL to display in the anchor tag
+ */
+ $OwnerPerm = ($objSession->HasCatPermission("TOPIC.REPLY.OWNER.DELETE") &&
+ $this->Get("CreatedById")==$objSession->Get("PortalUserId"));
+ if(($objSession->HasCatPermission("TOPIC.REPLY.DELETE") || $OwnerPerm)
+ && !$this->Locked)
+ {
+ $t = $element->attributes["_template"];
+ if(strlen($t))
+ {
+ $var_list_update["t"] = $t;
+ }
+ else
+ $var_list_update["t"] = $var_list["t"];
+ $text = $element->attributes["_text"];
+ $plaintext = $element->attributes["_plaintext"];
+ $bb_var_list_update["top"] = $this->Get("TopicId");
+ $bb_var_list_update["post"] = $this->Get("PostingId");
+ $ret = " 'bb_post_delete') ) ."\">";
+ $text = $element->attributes["_text"];
+ if(!strlen($text))
+ {
+ $text = $element->attributes["_plaintext"];
+ if(!strlen($text))
+ {
+ if(strlen($element->attributes["_image"]))
+ {
+ $text = " attributes["_image"]."\" BORDER=\"0\">";
+ }
+ }
+ $ret .= $text." ";
+ }
+ else
+ $ret .= language($text)."";
+ }
+ else
+ $ret = "";
+ unset($bb_var_list_update["top"]);
+ break;
+ case "link_quote":
+ /*
+ @field:posting.link_quote
+ @description: Returns a link to reply to the post, with the post quoted in the reply
+ @attrib:_template:tpl:Template link should point to
+ @attrib:_text:lang:Language tag to display as the link text
+ @attrib:_plaintext:: Plain text to use instead of language tag
+ @attrib:image::Image URL to display in the anchor tag
+ @attrib:_fulltag:bool:If set true, returns a complete anchor tag, otherwise returns just the URL
+ */
+ $hasperm = $objSession->HasCatPermission("TOPIC.REPLY.ADD");
+ if($hasperm && !$this->Locked)
+ {
+ $t = $element->attributes["_template"];
+
+ $url = $this->Link($t);
+ if($element->attributes["_fulltag"])
+ {
+ $ret = "";
+ $text = $element->attributes["_text"];
+ if(!strlen($text))
+ {
+ $text = $element->attributes["_plaintext"];
+ if(!strlen($text))
+ {
+ if(strlen($element->attributes["_image"]))
+ {
+ $text = " attributes["_image"]."\" BORDER=\"0\">";
+ }
+ }
+ $ret .= $text." ";
+ }
+ else
+ $ret .= language($text)."";
+ }
+ else
+ $ret = $url;
+ }
+ else
+ {
+ $ret = "";
+ }
+ break;
+ case "admin_icon":
+ if($element->attributes["fulltag"])
+ {
+ $ret = " StatusIcon()."\">";
+ }
+ else
+ $ret = $this->StatusIcon();
+ break;
+ case "body":
+ /*
+ @field:posting.body
+ @description:Returns the post body
+ @attrib:_parsed:bool:If true, quoted text, smileys, bbcode, and signatures are expanded out
+ */
+ if( $element->GetAttributeByName('_parsed') )
+ {
+ $ret = $this->Get('PostingText');
+
+ $ret = str_replace( Array("[/code]\r\n","[/quote]\r\n"),Array('[/code]','[/quote]'), $ret);
+ $ret = str_replace('"', '"', $ret);
+ $ret = $this->ReplaceQuote($ret,$element->attributes["_quotetemplate"]);
+ $ret = $objCensorList->CensorText($ret);
+ if(!$this->PostOption("disable_smileys"))
+ {
+ $ret = $objSmileys->ParseText($ret);
+ }
+
+ if(!$this->PostOption("disable_bbcode"))
+ {
+ $ret = ReplaceBBCode($ret);
+ }
+ //$ret = str_replace("\n", ' ', $ret);
+ $ret = nl2br($ret);
+ while ( strpos($ret, ' ') !== false )
+ {
+ $ret = str_replace(' ', ' ', $ret);
+ }
+
+
+ if( $this->PostOption("show_sig") && $element->GetAttributeByName('_signature') > 0 )
+ {
+ if(!is_object($this->Poster))
+ {
+ $this->Poster =& $objUsers->GetUser($this->Get("CreatedById"));
+ }
+ $showsig = $this->PostOption("show_sig"); // show post creator signature in this post
+ $UserSig = (int)$objSession->GetPersistantVariable("bb_signatures"); // viewing user wishes to see other signatures
+ if($showsig == 1 && $UserSig == 1)
+ {
+ $sig = $this->Poster->GetPersistantVariable("my_signature");
+ $sig = htmlspecialchars($sig,ENT_NOQUOTES);
+ if( !$this->PostOption("disable_smileys") ) $sig = $objSmileys->ParseText($sig);
+ if( !$this->PostOption("disable_bbcode") ) $sig = ReplaceBBCode($sig);
+ $ret .= " ".nl2br($sig);
+ }
+ }
+ }
+ else
+ {
+ $ret = $this->Get("PostingText");
+ }
+ break;
+
+// default:
+// $tag = $this->TagPrefix."_".$field;
+// $ret = $this->parsetag($tag);
+// break;
+
+ /*
+ @field:posting.relevance
+ @description:Displays the post relevance in search results
+ @attrib:_displaymode:: How the relevance should be displayed
+
+ "Numerical": Show the decimal value
+ "Bar": Show the HTML representing the relevance. Returns two HTML cells ≶td< with specified background colors
+ "Graphical":Show image representing the relevance
+
+ @attrib:_onimage::Zero relevance image shown in graphical display mode. Also used as prefix to build other images (i.e. prefix+"_"+percentage+".file_extension"
+ @attrib:_OffBackGroundColor::Off background color of HTML cell in bar display mode
+ @attrib:_OnBackGroundColor::On background color of HTML cell in bar display mode
+ */
+
+ }
+ if(!strlen($ret))
+ {
+ $ret = parent::ParseObject($element);
+ }
+ }
+ else
+ {
+ $fcall = $element->Execute();
+ if(substr($fcall,0,8)=="{Unknown")
+ {
+ $ret = $this->parsetag($element->name);
+ }
+ else
+ $ret = $fcall;
+ }
+ return $ret;
+ }
+
+/*
+ function parsetag($tag)
+ {
+ global $objConfig, $objUsers, $m_var_list_update, $bb_var_list_update, $var_list_update, $objSession, $bb_var_list, $bbperm;
+ if(is_object($tag))
+ {
+ $tagname = $tag->name;
+ }
+ else
+ $tagname = $tag;
+ switch($tagname)
+ {
+ case "posting_id":
+ return $this->Get("PostingId");
+ break;
+ case "posting_resource_id":
+ return $this->Get("ResourceId");
+ break;
+ case "posting_ip":
+ return $this->Get("IPAddress");
+ break;
+ case "posting_alias":
+ return $this->Get("PosterAlias");
+ break;
+ case "posting_text":
+ return inp_unescape($this->Get("PostingText"));
+ break;
+ case "posting_date":
+ if($this->Get("CreatedOn")<=0)
+ return "";
+ return LangDate($this->Get("CreatedOn"), 0, true);
+ break;
+ case "posting_modified":
+ if($this->Get("ModifiedOn")<=0)
+ return "";
+ return LangDate($this->Get("ModifiedOn"), 0, true);
+ break;
+ case "posting_topicid":
+ return $this->Get("TopicId");
+ break;
+ case "posting_reply_quote_link":
+ $bb_var_list_update["post"]=$this->Get("PostingId");
+ $var_list_update["t"]="inbulletin/bb_post_edit_reply_form";
+ $ret = HREF_Wrapper();
+ unset($bb_var_list_update["post"],$var_list_update["t"]);
+ return $ret;
+ break;
+ case "posting_edit_link":
+ $bb_var_list_update["post"]=$this->Get("PostingId");
+ $var_list_update["t"]="inbulletin/bb_post_edit_reply_form";
+ $ret = HREF_Wrapper('', Array('edit' => 'yes') );
+ unset($bb_var_list_update["post"],$var_list_update["t"]);
+ return $ret;
+ break;
+ case "cell_back":
+ if ($bb_var_list_update["post_cell"]==$objConfig->Get("Post_Background1"))
+ {
+ $bb_var_list_update["post_cell"]=$objConfig->Get("Post_Background2");
+ return $objConfig->Get("Post_Background2");
+ }
+ else
+ {
+ $bb_var_list_update["post_cell"]=$objConfig->Get("Post_Background1");
+ return $objConfig->Get("Post_Background1");
+ }
+ break;
+
+ default:
+ return $tag;
+ break;
+ }
+ }
+*/
+}
+
+class _clsPostingList extends clsItemCollection
+{
+ var $TopicID;
+ var $Page;
+
+ function _clsPostingList()
+ {
+ global $bb_var_list;
+
+ $this->clsItemCollection();
+ $this->TopicID=-1;
+ $this->classname = "clsPosting";
+ $this->SourceTable = GetTablePrefix()."Posting";
+ $this->BasePermission="TOPIC";
+ $this->Page = $bb_var_list["pp"];
+ }
+
+ function CurrentPostID()
+ {
+ global $bb_var_list;
+ $p = (int)$bb_var_list["post"];
+ if($p==0)
+ {
+ $sql = "SELECT PostingId FROM ".$this->SourceTable." WHERE TopicId=".$this->TopicID;
+ $sql .=" AND ReplyTo=0 ORDER BY CreatedOn ASC LIMIT 1";
+ $rs = $this->adodbConnection->Execute($sql);
+ if($rs && !$rs->EOF)
+ $bb_var_list["post"] = $rs->fields["PostingId"];
+ }
+ return (int)$bb_var_list["post"];
+ }
+
+ function &GetCurrentPost()
+ {
+ $id = $this->CurrentPostID();
+ $p = $this->GetItem($id);
+ return $p;
+ }
+
+ function Query_Posting($whereClause,$orderByClause="", $limit=NULL)
+ {
+ global $Errors, $objSession;
+
+ $resultSet = array();
+
+ $sql = "SELECT * FROM ".$this->SourceTable." ";
+
+ if(isset($whereClause))
+ $sql = sprintf('%s WHERE %s',$sql,$whereClause);
+
+ if(isset($orderByClause))
+ $sql = sprintf('%s ORDER BY %s',$sql,$orderByClause);
+ if(strlen(trim($limit))>0)
+ $sql .= " ".$limit;
+
+ if($objSession->HasSystemPermission("DEBUG.LIST"))
+ echo htmlentities($sql,ENT_NOQUOTES)." \n";
+
+ $this->Query_Item($sql);
+
+ return $this->Items;
+ }
+
+ function DeleteTopicPosts($TopicId)
+ {
+ global $objTopicList;
+ $this->Clear();
+ $topic = $objTopicList->GetItem($TopicId);
+ $sql = "SELECT * FROM ".$this->SourceTable." WHERE TopicId=".$TopicId;
+ $this->Query_Item($sql);
+ $count = $this->NumItems();
+
+ if( is_object($topic) ) $topic->ClearCacheData();
+ DeleteTagCache("m_itemcount","Post%");
+
+ if($this->NumItems()>0)
+ {
+ foreach($this->Items as $p)
+ {
+ $p->Delete();
+ }
+ }
+ $this->Clear();
+ }
+
+
+ function DoGlobalCount($attribs)
+ {
+ global $objCountCache, $objTopicList;
+
+ $cc = $objCountCache->GetValue(0,30,$objTopicList->CacheListExtraId("_"),(int)getArrayValue($attribs,'_today'), 3600);
+ $cc = null;
+ if(!is_numeric($cc))
+ {
+ $sql = $objTopicList->SqlGlobalCount($attribs);
+ $rs = $this->adodbConnection->Execute($sql);
+ $ret = ($rs && !$rs->EOF) ? $rs->fields['CachedVal'] : '0';
+ $objCountCache->SetValue(0,30,$objTopicList->CacheListExtraId("_"),(int)getArrayValue($attribs,'_today'),$ret);
+ }
+ else
+ $ret = $cc;
+
+ //echo "DoGlobalCount Posting: $ret ";
+ return $ret;
+ }
+
+ function CategoryCount($attribs)
+ {
+ global $objCatList, $objCountCache;
+
+ $cat = $attribs["_catid"];
+ if(!is_numeric($cat))
+ {
+ $cat = $objCatList->CurrentCategoryID();
+ }
+ if((int)$cat>0)
+ $c = $objCatList->GetCategory($cat);
+
+ $cc = $objCountCache->GetValue(1,30,$cat,0,3600);
+ //print_pre($attribs);
+ if(is_numeric($cc) && $attribs["_forceupdate"] != 1)
+ {
+ return $cc;
+ }
+
+ $CatTable = GetTablePrefix()."CategoryItems";
+ //$t = $this->SourceTable;
+ $t = GetTablePrefix()."Topic";
+ $p = $this->SourceTable;
+
+ $sql = "SELECT (SUM(Posts)-COUNT(TopicId)) as MyCount FROM $t ";
+ $sql .=" INNER JOIN $CatTable ON ($CatTable.ItemResourceId=$t.ResourceId) ";
+ if($attribs["_subcats"])
+ {
+ $ctable = $objCatList->SourceTable;
+ $sql .= "INNER JOIN $ctable ON ($CatTable.CategoryId=$ctable.CategoryId) ";
+ $sql .= "WHERE (ParentPath LIKE '".$c->Get("ParentPath")."%' ";
+ if(!$attribs["_countcurrent"])
+ {
+ $sql .=" AND $ctable.CategoryId != $cat) ";
+ }
+ else
+ $sql .=") ";
+ }
+ else
+ $sql .="WHERE ($CatTable.CategoryId=".$cat." AND $t.Status=1) ";
+
+ if($attribs["_today"])
+ {
+ $today = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d"),adodb_date("Y"));
+ $sql .= "AND ($t.CreatedOn>=$today) ";
+ }
+ //echo "Cat:".$sql." \n";
+ $rs = $this->adodbConnection->Execute($sql);
+ $ret = "";
+ if($rs && !$rs->EOF)
+ {
+ $ret = (int)$rs->fields["MyCount"];
+
+ }
+ if(is_numeric($ret))
+ $objCountCache->SetValue(1,30,$cat,0,$ret);
+ return $ret;
+ }
+
+ function LoadTopicPosts()
+ {
+ global $objConfig, $objTopicList;
+
+ $o=""; //prepare output
+
+ $this->Clear();
+ if($this->Page<1)
+ $this->Page=1;
+ if(is_numeric($objConfig->Get("Perpage_Postings")))
+ {
+ $Start = ($this->Page-1)*$objConfig->Get("Perpage_Postings");
+ $limit = "LIMIT ".$Start.",".$objConfig->Get("Perpage_Postings");
+ }
+ else
+ $limit = NULL;
+
+ $where = "TopicId=".$this->TopicID;
+ $this->QueryItemCount=TableCount(GetTablePrefix()."Posting",$where,0);
+ $this->Query_Posting($where,"CreatedOn ASC",$limit);
+ $t = $objTopicList->GetItem($this->TopicID);
+ if($t->Get("TopicType")==0)
+ {
+ for($x=0;$x<$this->NumItems();$x++)
+ $this->Items[$x]->Locked=TRUE;
+ }
+ return $this->Items;
+ }
+
+ function GetPageLinkList($dest_template = null, $page = '', $PagesToList = 10, $HideEmpty = true, $extra_attributes = '')
+ {
+ global $objConfig, $bb_var_list_update, $var_list_update, $bb_var_list, $var_list;
+
+ $PerPage = $objConfig->Get("Perpage_Postings");
+ if ($PerPage < 1) $PerPage = 20;
+
+ $NumPages = ceil( $this->GetNumPages($PerPage) );
+ $var_list_update['t'] = isset($dest_template) && $dest_template ? $dest_template : $var_list['t'];
+
+ $o = '';
+ if ($this->Page > $NumPages) $this->Page = $NumPages;
+
+ if ($NumPages == 1 && $HideEmpty) return '';
+
+ $StartPage = (int)$this->Page - ($PagesToList / 2);
+ if ($StartPage < 1) $StartPage = 1;
+
+ $EndPage = $StartPage + ($PagesToList - 1);
+ if ($EndPage > $NumPages)
+ {
+ $EndPage = $NumPages;
+ $StartPage = $EndPage-($PagesToList-1);
+ if ($StartPage < 1) $StartPage = 1;
+ }
+
+ $o = '';
+ if ($StartPage > 1)
+ {
+ $bb_var_list_update['pp'] = $this->Page - $PagesToList;
+ $bb_var_list_update['top'] = $this->TopicID;
+ $prev_url = HREF_Wrapper();
+ $o .= '<< ';
+ }
+
+ for ($p = $StartPage; $p <= $EndPage; $p++)
+ {
+ if ($p != $this->Page)
+ {
+ $bb_var_list_update['pp'] = $p;
+ $bb_var_list_update['top'] = $this->TopicID;
+ $href = HREF_Wrapper();
+ $o .= ' '.$p.' ';
+ }
+ else
+ {
+ $o .= $p;
+ }
+ }
+ if ($EndPage < $NumPages && $EndPage > 0)
+ {
+ $bb_var_list_update['pp'] = $this->Page + $PagesToList;
+ $bb_var_list_update['top'] = $this->TopicID;
+ $next_url = HREF_Wrapper();
+ $o .= ' >> ';
+ }
+
+ unset($bb_var_list_update["pp"],$bb_var_list_update["top"],$var_list_update["t"] );
+ return $o;
+ }
+
+ function ResetCache($CategoryId)
+ {
+ global $objCountCache;
+ if( $objCountCache->NumItems() == 0 )
+ {
+ $objCountCache->Query_Item('SELECT * FROM '.$objCountCache->SourceTable);
+ }
+
+ $db =& GetADODBConnection();
+ $sql = 'SELECT ParentPath FROM '.GetTablePrefix().'Category WHERE CategoryId = '.$CategoryId;
+ $parents = $db->GetOne($sql);
+ $parents = substr($parents,1,strlen($parents)-2);
+ $parents = explode('|',$parents);
+ foreach($parents as $ParentCategoryId)
+ {
+ $objCountCache->DeleteValue(0, 30, $ParentCategoryId, 0); // total topic count
+ $objCountCache->DeleteValue(0, 30, $ParentCategoryId, 1); // total
+ }
+ }
+}/*clsPostingList*/
+?>
Index: branches/unlabeled/unlabeled-1.44.2/in-bulletin/admin/install/inportal_data.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.44.2/in-bulletin/admin/install/inportal_data.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.44.2/in-bulletin/admin/install/inportal_data.sql (revision 12744)
@@ -0,0 +1,256 @@
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 1,1)
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'TopicText=la_Topic_Text,Posts=la_Number_of_Posts,CreatedOn=la_CreatedOn,LastPostDate=la_LastUpdate,Views=la_Topic_Views,CachedRating=la_Rating,LastPoser=la_Poster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) ', 0,1)
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '','TopicText=la_Topic_Text,Posts=la_Number_of_Posts,CreatedOn=la_CreatedOn,LastPostDate=la_LastUpdate,Views=la_Topic_Views,CachedRating=la_Rating,LastPoser=la_Poster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) ', 2,1)
+INSERT INTO ConfigurationAdmin VALUES ('Topic_NewDays', 'la_Text_Topics', 'la_topic_newdays_prompt', 'text', '', 'asc=la_common_ascending,desc=la_common_descending', 4,1)
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 3,1)
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics', 'la_Text_Topics', 'la_topic_perpage_prompt', 'text', '', '', 3,1)
+INSERT INTO ConfigurationAdmin VALUES ('Topic_PostsToPop', 'la_Text_Topics', 'la_topic_poststopop_prompt', 'text', '', '', 4,1)
+INSERT INTO ConfigurationAdmin VALUES ('Topic_VotesToHot', 'la_Text_Topics', 'la_topic_votestohot_prompt', 'text', '', '', 4,1)
+INSERT INTO ConfigurationAdmin VALUES ('Topic_EditorPicksAbove', 'la_Text_Topics', 'la_topic_editorpicksabove_prompt', 'checkbox', '', '', 5,1)
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Postings', 'la_posts_subheading', 'la_posts_perpage_prompt', 'text', '', '', 6,1)
+INSERT INTO ConfigurationAdmin VALUES ('Posts_NewDays', 'la_posts_subheading', 'la_posts_newdays_prompt', 'text', '', '', 6,1)
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MinVotes', 'la_Text_Topics', 'la_topic_MinVotes_prompt', 'text', '', '', 4,1)
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics_Short', 'la_Text_Topics', 'la_topic_perpage_short_prompt', 'text', '', '', 3,1)
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Value', 'la_Text_Topics', 'la_prompt_DupReviews', 'text', '', '', 14, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Interval', 'la_Text_Topics', 'la_prompt_DupReviews', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 15, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Value', 'la_Text_Topics', 'la_prompt_DupRating', 'text', '', '', 16, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Interval', 'la_Text_Topics', 'la_prompt_DupRating', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 17, 1);
+INSERT INTO ConfigurationAdmin VALUES ('AutoTopicLockPosts', 'la_Text_Topics', 'la_prompt_PostsToLock', 'text', NULL , NULL , '18', '0')
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_TopicReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL , NULL , '5', '1')
+INSERT INTO ConfigurationAdmin VALUES ('bb_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 1, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 1, 0);
+
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_topics', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_topics', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_topics', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_topics', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_topics', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 1);
+
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Postings', '25', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Topics', '5', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Posting_SortOrder', 'CreatedOn asc, PostingText', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Posts_NewDays', '5', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Bulletin_TopCount', '2', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Bulletin_CatNewDays', '10', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Bulletin_Pick_First', '1', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortOrder', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortField', 'LastPostDate', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortOrder2', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortField2', 'Posts', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_NewDays', '6', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_PostsToPop', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_VotesToHot', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_EditorPicksAbove', '1', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_MinVotes', '8', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Root', '{TopicCatId}', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_Sortfield', NULL, 'In-Bulletin', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_SortOrder', NULL, 'In-Bulletin', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'BBTags', 'b:;i:;u:;ul:type|align;font:color|face|size;url:href;img:src|border', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_Background1', '#cccccc', 'In-Portal', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_Background2', '#bbbbbb', 'In-Portal', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Background1', '#FAEBD7', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Background2', '#F5F5DC', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'AutoTopicLockPosts', '0', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'bb_CategoryTemplate', 'inbulletin/index', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'bb_ItemTemplate', 'inbulletin/post_list', 'In-Bulletin', 'in-bulletin:configuration_output');
+
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Highlight_OpenTag', '', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Highlight_CloseTag', ' ', 'In-Bulletin', 'in-bulletin:configuration_output')
+
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Topics_Short', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_RatingDelay_Interval', '3600', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_RatingDelay_Value', '1', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_ReviewDelay_Interval', '60', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_ReviewDelay_Value', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Increase_topics', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Keyword_topics', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Pop_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Rating_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Increase_posts', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Keyword_posts', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Pop_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Rating_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'Search_ShowMultiple_topics', '0', 'In-Bulletin', 'in-bulletin:configuration_search');
+
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_PrivateMessages', 'la_text_PrivateMessages', 'la_text_PrivateMessages_PerPage', 'text', NULL , NULL , '0', '1');
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_PrivateMessages', '20', 'In-Bulletin', '');
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_TopicReviews', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (1, 'Happy Smile', 0, ':)', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (2, 'Big Grin', 0, ':grin:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (3, 'Wink', 0, ';)', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (4, 'Scared', 0, ':scared:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (5, 'Teasing', 0, ':eek:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (6, 'Cool', 0, ':cool:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (7, 'Angry', 0, ':@', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (8, 'Squint', 0, ':squint:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (9, 'Oops', 0, ':o', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (10, 'Sad', 0, ':(', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (11, 'Cry', 0, ':cry:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (12, 'Smirk', 0, ';]', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (13, 'Happy sleep', 0, ':sleep:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (14, 'Very angry', 0, ':x', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (15, 'Geek', 0, ':geek:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (16, 'Upset', 0, ';(', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (17, 'LOL', 0, ':lol:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (18, 'Yawn', 0, ':O', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (19, 'Thinking', 0, ':hm:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (20, 'Secret', 0, ':|', 1);
+
+INSERT INTO Events VALUES (1, 'TOPIC.ADD', 2, 0, 'In-Bulletin', 'la_event_topic.add', 1)
+INSERT INTO Events VALUES (2, 'POST.ADD', 2, 0, 'In-Bulletin', 'la_event_post.add', 1)
+INSERT INTO Events VALUES (3, 'POST.MODIFY', 2, 0, 'In-Bulletin', 'la_event_post.modify', 1)
+INSERT INTO Events VALUES (4, 'POST.ADD', 1, 0, 'In-Bulletin', 'la_event_post.add', 0)
+INSERT INTO Events VALUES (66, 'PM.ADD', 1, 0, 'In-Bulletin', 'la_event_pm.add', 0);
+
+INSERT INTO ItemTypes VALUES (3, 'In-Bulletin', 'bb', 'Topic', 'TopicText', 'OwnerId', 'Views', 'CachedRating', 'la_ItemTab_Topics', 1, '', 'clsTopic', 'Topic');
+INSERT INTO ItemTypes VALUES (30, 'In-Bulletin', 'posting', 'Posting', 'Subject', 'CreatedById', NULL, NULL, 'la_ItemTab_Posts', 0, '', '', 'Post');
+
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.VIEW', 'lu_PermName_Topic.View_desc', 'lu_PermName_Topic.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.ADD', 'lu_PermName_Topic.Add_desc', 'lu_PermName_Topic.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.ADD.PENDING', 'lu_PermName_Topic.Add.Pending_desc', 'lu_PermName_Topic.Add.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.DELETE', 'lu_PermName_Topic.Delete_desc', 'lu_PermName_Topic.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.MODIFY', 'lu_PermName_Topic.Modify_desc', 'lu_PermName_Topic.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.DELETE', 'lu_PermName_Topic.Reply.Delete_desc', 'lu_PermName_Topic.Reply.Delete_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.VIEW', 'lu_PermName_Topic.Reply.View_desc', 'lu_PermName_Topic.Reply.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.ADD', 'lu_PermName_Topic.Reply.Add_desc', 'lu_PermName_Topic.Reply.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.MODIFY', 'lu_PermName_Topic.Reply.Modify_desc', 'lu_PermName_Topic.Reply.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.RATE', 'lu_PermName_Topic.Rate_desc', 'lu_PermName_Topic.Rate_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REVIEW', 'lu_PermName_Topic.Review_desc', 'lu_PermName_Topic.Review_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 'lu_PermName_Topic.Reply.Owner.Modify_desc', 'lu_PermName_Topic.Reply.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 'lu_PermName_Topic.Reply.Owner.Delete_desc', 'lu_PermName_Topic.Reply.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.OWNER.DELETE', 'lu_PermName_Topic.Owner.Delete_desc', 'lu_PermName_Topic.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.MODIFY.PENDING', 'lu_PermName_Topic.Modify.Pending_desc', 'lu_PermName_Topic.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.OWNER.MODIFY.PENDING', 'lu_PermName_Topic.Owner.Modify.Pending_desc', 'lu_PermName_Topic.Owner.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.OWNER.MODIFY', 'lu_PermName_Topic.Owner.Modify_desc', 'lu_PermName_Topic.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.LOCK', 'lu_PermName_Topic.Lock_desc', 'lu_PermName_Topic.Lock_error', 'In-Bulletin');
+
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT count(*) FROM <%prefix%>Topic WHERE Status=1', NULL, 'la_prompt_ActiveTopics', 0, 1);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS TotalTopics FROM <%prefix%>Topic', NULL, 'la_prompt_TopicsTotal', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS ActiveTopics FROM <%prefix%>Topic WHERE Status = 1', NULL, 'la_prompt_TopicsActive', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS PendingTopics FROM <%prefix%>Topic WHERE Status = 2', NULL, 'la_prompt_TopicsPending', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS DisabledTopics FROM <%prefix%>Topic WHERE Status = 0', NULL, 'la_prompt_TopicsDisabled', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS NewTopics FROM <%prefix%>Topic WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Topic_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>Topic WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS HotTopics FROM <%prefix%>Topic WHERE (HotItem = 1) OR (Posts >= <%m:config name="Topic_VotesToHot"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS PopularTopics FROM <%prefix%>Topic WHERE (PopItem = 1) OR ( (CachedRating >= <%topic:hit_count type="top"%>) AND <%topic:hit_count type="top"%> AND (PopItem = 2) )', NULL, '(*) la_prompt_PopularTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Topic WHERE CachedRating > 0', NULL, 'la_prompt_TopicAverageRating', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT MAX(Views) AS MaxTopicHits FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicHits', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT MAX(CachedVotesQty) AS MaxTopicVotes FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicVotes', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_TopicReviews', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS TotalPosts FROM <%prefix%>Posting', NULL, 'la_prompt_PostsTotal', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostTime', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostTime', 0, 2);
+
+INSERT INTO SearchConfig VALUES ('Topic', 'NotifyOwnerOnChanges', 0, 1, 'lu_fielddesc_topic_notifyowneronchanges', 'lu_field_notifyowneronchanges', 'In-Bulletin', 'la_text_topic', 1, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicId', 0, 1, 'lu_fielddesc_topic_topicid', 'lu_field_topicid', 'In-Bulletin', 'la_text_topic', 0, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Priority', 0, 1, 'lu_fielddesc_topic_priority', 'lu_field_priority', 'In-Bulletin', 'la_text_topic', 8, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OwnerId', 0, 1, 'lu_fielddesc_topic_ownerid', 'lu_field_ownerid', 'In-Bulletin', 'la_text_topic', 9, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Modified', 0, 1, 'lu_fielddesc_topic_modified', 'lu_field_modified', 'In-Bulletin', 'la_text_topic', 2, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicText', 1, 1, 'lu_fielddesc_topic_topictext', 'lu_field_topictext', 'In-Bulletin', 'la_text_topic', 3, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Posts', 0, 1, 'lu_fielddesc_topic_posts', 'lu_field_posts', 'In-Bulletin', 'la_text_topic', 4, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Views', 0, 1, 'lu_fielddesc_topic_views', 'lu_field_views', 'In-Bulletin', 'la_text_topic', 5, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'EditorsPick', 0, 1, 'lu_fielddesc_topic_editorspick', 'lu_field_editorspick', 'In-Bulletin', 'la_text_topic', 6, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Status', 0, 1, 'lu_fielddesc_topic_status', 'lu_field_status', 'In-Bulletin', 'la_text_topic', 7, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ModifiedById', 0, 1, 'lu_fielddesc_topic_modifiedbyid', 'lu_field_modifiedbyid', 'In-Bulletin', 'la_text_topic', 10, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ResourceId', 0, 1, 'lu_fielddesc_topic_resourceid', 'lu_field_resourceid', 'In-Bulletin', 'la_text_topic', 11, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicType', 0, 1, 'lu_fielddesc_topic_topictype', 'lu_field_topictype', 'In-Bulletin', 'la_text_topic', 12, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CreatedOn', 0, 1, 'lu_fielddesc_topic_createdon', 'lu_field_createdon', 'In-Bulletin', 'la_text_topic', 13, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedReviewsQty', 0, 1, 'lu_fielddesc_topic_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Bulletin', 'la_text_topic', 14, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedRating', 0, 1, 'lu_fielddesc_topic_cachedrating', 'lu_field_cachedrating', 'In-Bulletin', 'la_text_topic', 15, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedVotesQty', 0, 1, 'lu_fielddesc_topic_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Bulletin', 'la_text_topic', 16, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'NewItem', 0, 1, 'lu_fielddesc_topic_newitem', 'lu_field_newitem', 'In-Bulletin', 'la_text_topic', 17, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PopItem', 0, 1, 'lu_fielddesc_topic_popitem', 'lu_field_popitem', 'In-Bulletin', 'la_text_topic', 18, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'HotItem', 0, 1, 'lu_fielddesc_topic_hotitem', 'lu_field_hotitem', 'In-Bulletin', 'la_text_topic', 19, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PostedBy', 0, 1, 'lu_fielddesc_topic_postedby', 'lu_field_postedby', 'In-Bulletin', 'la_text_topic', 20, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OrgId', 0, 1, 'lu_fielddesc_topic_orgid', 'lu_field_orgid', 'In-Bulletin', 'la_text_topic', 21, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'LastPostId', 0, 1, 'lu_fielddesc_topic_lastpostid', 'lu_field_lastpostid', 'In-Bulletin', 'la_text_topic', 22, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY.PENDING', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD.PENDING', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.RATE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REVIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.RATE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REVIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.RATE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REVIEW', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.LOCK', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:inbulletin_general.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:inbulletin_general.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_output.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_output.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_search.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_search.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_email.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_email.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.delete', 11, 1, 1, 0);
+
+INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('phpbb', 'In-Bulletin', 'phpbb_import', 'phpBB 2.x', 'phpBB', 'user_regular,init_cat', 1, 'db');
+
+INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('In-Bulletin', 'in-bulletin/', 'bb', '1.2.0', 1, 3, 'inbulletin/', {TopicCatId}, '1054738405');
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.20.2/in-bulletin/admin/install.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.20.2/in-bulletin/admin/install.php (revision 0)
+++ branches/unlabeled/unlabeled-1.20.2/in-bulletin/admin/install.php (revision 12744)
@@ -0,0 +1,108 @@
+Init();
+
+ require_once FULL_PATH.'/admin/install/install_lib.php';
+ require_once FULL_PATH.'/kernel/include/tag-class.php';
+ require_once FULL_PATH.'/'.$MODULE_NAME.'/emoticon.php';
+ if( !isset($objTagList) ) $objTagList = new clsTagList();
+
+ $ado =& GetADODBConnection();
+
+ // create module category
+ $ml_formatter =& $application->recallObject('kMultiLanguage');
+ $name_field = $ml_formatter->LangFieldName('Name');
+ $description_field = $ml_formatter->LangFieldName('Description');
+
+ $cat =& $application->recallObject('c', null, Array('skip_autoload' => true));
+ $cat->Clear();
+ $cat_fields = Array($name_field => 'Forums', 'AutomaticFilename' => 1, 'Filename' => 'Forums',
+ $description_field => 'Discussion Forums', 'Status' => 1, 'ParentId' => 0,
+ 'CategoryTemplate' => 'inbulletin/index', 'CachedCategoryTemplate' => 'inbulletin/index');
+ $cat->SetDBFieldsFromHash($cat_fields);
+ $cat->Create();
+
+ $cat_id = $cat->GetID();
+
+ $filename = FULL_PATH.'/'.$MODULE_NAME.'/admin/install/inportal_schema.sql';
+ if (file_exists($filename)) RunSchemaFile($ado, $filename);
+
+ $filename = FULL_PATH.'/'.$MODULE_NAME.'/admin/install/inportal_data.sql';
+ if (file_exists($filename))
+ {
+ $sql = file($filename);
+ for ($x = 0; $x < count($sql); $x++)
+ {
+ $sql[$x] = str_replace('{TopicCatId}', $cat_id, $sql[$x]);
+ }
+ RunSQLText($ado, $sql);
+
+ $sql = 'SELECT Version FROM '.TABLE_PREFIX.'Modules WHERE Name = '.$ado->qstr('In-Bulletin');
+ $mod_version = $application->Conn->GetOne($sql);
+
+ if (!(isset($ini_file) && $ini_file)) {
+ $ini_file = FULL_PATH.'/config.php';
+ $ini_vars = inst_parse_portal_ini($ini_file, true);
+ }
+
+ set_ini_value('Module Versions', 'In-Bulletin', $mod_version);
+ save_values();
+
+ $objTagList->ParseFile(FULL_PATH.'/'.$MODULE_NAME.'/parser.php');
+ }
+
+ linkCustomFields('KERNEL', 'c', 1); // to create ItemTemplate custom field
+
+ $cat->defineFields();
+ $application->removeObject('c-cdata');
+ $cat->SetDBField('cust_bb_ItemTemplate', 'inbulletin/post_list');
+ $cat->Update();
+
+ $sql = 'DELETE FROM '.TABLE_PREFIX.'Cache WHERE (VarName = "config_files") OR (VarName LIKE "%_parsed")';
+ $application->Conn->Query($sql);
+
+ $objModules->Refresh();
+ $objModules->SetModuleRoot('In-Bulletin', $cat_id);
+
+ $inp_cat =& $objCatList->GetCategory($cat_id);
+ $inp_cat->UpdateCachedPath();
+ $inp_cat->UpdateACL();
+
+ function bb_inst_SmileyImages()
+ {
+ global $MODULE_NAME;
+ $objSmileys = new clsEmoticonList();
+ $objImageList = new clsImageList();
+ $objSmileys->Clear();
+ $objSmileys->Query_Item('SELECT * FROM '.$objSmileys->SourceTable);
+ foreach($objSmileys->Items as $s)
+ {
+ $img =& $objImageList->Add($s->Get('Name'), $s->Get('Name'), 0, 1, 1, '', '', $s->Get('Enabled'), 0, 0, 0,1);
+ $img->Set('LocalPath',$MODULE_NAME.'/images/emoticons/0_'.$s->Get('EmoticonId').'.gif');
+ $img->Set('ThumbPath',$MODULE_NAME.'/images/emoticons/0_'.$s->Get('EmoticonId').'.gif');
+ $img->Update();
+
+ $s->Set('ImageId',$img->Get('ImageId'));
+ $s->Update();
+ }
+ }
+
+ bb_inst_SmileyImages();
+
+ finalizeModuleInstall($MODULE_NAME);
+
+?>
Index: branches/unlabeled/unlabeled-1.17.2/in-bulletin/admin/install/inportal_schema.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.17.2/in-bulletin/admin/install/inportal_schema.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.17.2/in-bulletin/admin/install/inportal_schema.sql (revision 12744)
@@ -0,0 +1,110 @@
+
+CREATE TABLE Posting (
+ PostingId int(11) NOT NULL auto_increment,
+ IPAddress varchar(255) NOT NULL default '',
+ PosterAlias varchar(255) NOT NULL default '',
+ Pending tinyint(4) NOT NULL default '0',
+ Subject varchar(255) default NULL,
+ PostingText text,
+ GraphicsUrl varchar(255) default NULL,
+ CreatedOn int(11) NOT NULL default '0',
+ Modified int(11) NOT NULL default '0',
+ ModifiedById int(11) default NULL,
+ CreatedById int(11) default NULL,
+ TopicId int(11) NOT NULL default '0',
+ ResourceId int(11) NOT NULL default '0',
+ ReplyTo int(11) NOT NULL default '0',
+ Options int(11) NOT NULL default '0',
+ PRIMARY KEY (PostingId),
+ KEY TopicId (TopicId),
+ KEY Pending (Pending),
+ KEY CreatedById (CreatedById),
+ KEY CreatedOn (CreatedOn),
+ KEY ModifiedOn (Modified),
+ KEY ModifiedById (ModifiedById)
+)
+# --------------------------------------------------------
+CREATE TABLE Topic (
+ TopicId int(11) NOT NULL auto_increment,
+ NotifyOwnerOnChanges tinyint(4) NOT NULL default '0',
+ Modified int(11) NOT NULL default '0',
+ TopicText varchar(255) NOT NULL default '',
+ Filename varchar(255) NOT NULL,
+ AutomaticFilename tinyint(3) unsigned NOT NULL default '0',
+ Posts int(11) NOT NULL default '0',
+ Views double(20,6) NOT NULL default '0',
+ EditorsPick tinyint(4) NOT NULL default '0',
+ Status tinyint(4) unsigned NOT NULL default '2',
+ Priority int(11) NOT NULL default '0',
+ OwnerId int(11) NOT NULL default '0',
+ ModifiedById int(11) NOT NULL default '0',
+ ResourceId int(11) default NULL,
+ TopicType int(11) NOT NULL default '0',
+ CreatedOn int(11) NOT NULL default '0',
+ CachedReviewsQty int(11) NOT NULL default '0',
+ CachedRating varchar(10) default NULL,
+ CachedVotesQty int(11) NOT NULL default '0',
+ NewItem tinyint(4) NOT NULL default '2',
+ PopItem tinyint(4) NOT NULL default '2',
+ HotItem tinyint(4) NOT NULL default '2',
+ PostedBy varchar(255) NOT NULL default '',
+ OrgId int(11) default '0',
+ LastPostId int(11) NOT NULL default '0',
+ LastPostDate int(11) NOT NULL default '0',
+ TodayDate date NOT NULL default '0000-00-00',
+ TodayPosts int(11) NOT NULL default '0',
+ PRIMARY KEY (TopicId),
+ KEY OwnerId (OwnerId),
+ UNIQUE KEY ResourceId (ResourceId),
+ KEY ModifiedById (ModifiedById),
+ KEY Posts (Posts),
+ KEY Modified (Modified),
+ KEY Filename (Filename(5))
+)
+# --------------------------------------------------------
+CREATE TABLE Censorship (
+ CensorshipId int(11) NOT NULL auto_increment,
+ BadWord varchar(80) NOT NULL default '',
+ Replacement varchar(80) NOT NULL default '',
+ PRIMARY KEY (CensorshipId)
+)
+# --------------------------------------------------------
+CREATE TABLE Emoticon (
+ EmoticonId int(11) NOT NULL auto_increment,
+ Name varchar(20) NOT NULL default '',
+ ImageId int(11) NOT NULL default '0',
+ KeyStroke varchar(20) NOT NULL default '',
+ Enabled int(11) NOT NULL default '1',
+ PRIMARY KEY (EmoticonId)
+)
+# --------------------------------------------------------
+CREATE TABLE PrivateMessageBody (
+ PMBodyId int(11) unsigned NOT NULL auto_increment,
+ Subject varchar(255) NOT NULL default '',
+ Body text NOT NULL,
+ Options tinyint(3) unsigned NOT NULL default '0',
+ ReferenceCount smallint(5) unsigned NOT NULL default '0',
+ PRIMARY KEY (PMBodyId)
+)
+# --------------------------------------------------------
+CREATE TABLE PrivateMessages (
+ PmId int(11) unsigned NOT NULL auto_increment,
+ FromId int(11) unsigned NOT NULL default '0',
+ ToId int(11) unsigned NOT NULL default '0',
+ FolderId tinyint(3) NOT NULL default '0',
+ Status tinyint(1) unsigned NOT NULL default '0',
+ PMBodyId int(11) unsigned NOT NULL default '0',
+ CreatedOn int(11) unsigned NOT NULL default '0',
+ PRIMARY KEY (PmId),
+ KEY FromId (FromId),
+ KEY CreatedOn (CreatedOn),
+ KEY ToId (ToId)
+)
+# --------------------------------------------------------
+CREATE TABLE TopicCustomData (
+ CustomDataId int(11) NOT NULL auto_increment,
+ ResourceId int(10) unsigned NOT NULL default '0',
+ KEY ResourceId (ResourceId),
+ PRIMARY KEY (CustomDataId)
+)
+# --------------------------------------------------------
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.8.24/in-bulletin/admin/addcensor_word.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.8.24/in-bulletin/admin/addcensor_word.php (revision 0)
+++ branches/unlabeled/unlabeled-1.8.24/in-bulletin/admin/addcensor_word.php (revision 12744)
@@ -0,0 +1,134 @@
+Get("BadWord");
+}
+else
+{
+ $c = new clsCensorWord();
+ $c->Set("Language",$objSession->Get("Language"));
+ $action = "bb_censorword_add";
+ $name = prompt_language("la_Text_NewCensorWord");
+
+}
+
+$title = GetTitle("la_Text_Censorship", '',$c->Get('CensorshipId'), $name);//prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Censorship")." -'$name'";
+/* page header */
+$charset = GetRegionalOption('Charset');
+print <<
+
+ In-portal
+
+
+
+
+
+
+
+
+
+
+
+END;
+
+$sec = $objSections->GetSection($section);
+
+$objCatToolBar = new clsToolBar();
+$objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('customfield','CensorEditStatus','in-bulletin/admin/censor_config.php',1,'')","tool_select.gif");
+$objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","jump_to_url('in-bulletin/admin/censor_config.php','');","tool_cancel.gif");
+
+int_header($objCatToolBar,NULL,$title);
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: branches/unlabeled/unlabeled-1.8.2/in-bulletin/admin/install/langpacks/english.lang
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.8.2/in-bulletin/admin/install/langpacks/english.lang (revision 0)
+++ branches/unlabeled/unlabeled-1.8.2/in-bulletin/admin/install/langpacks/english.lang (revision 12744)
@@ -0,0 +1,33 @@
+
+ m/d/Y g:i:s A m/d/Y g:i:s A . , iso-8859-1 2
+
+ RGF0ZS9UaW1l
+ UG9zdGVy
+ UmVwbGllcw==
+ VG9waWM=
+ Vmlld3M=
+ VG9waWNzIEl0ZW0gVGVtcGxhdGU=
+ UG9zdGVkIEJ5
+ VG9waWMgTG9ja2Vk
+ TWF4aW11bSBudW1iZXIgb2YgSE9UIHRvcGljcw==
+ TWluaW11bSByYXRpbmcgdG8gY29uc2lkZXIgdG9waWMgUE9Q
+ TWluaW11bSBudW1iZXIgb2YgcG9zdHMgdG8gY29uc2lkZXIgdG9waWMgUE9Q
+ Vmlld3M=
+ SW4tYnVsbGV0aW4=
+ UG9zdGVy
+ VG9waWM=
+ QWRkaW5nIFRvcGlj
+ RWRpdGluZyBUb3BpYw==
+ TmV3IFRvcGlj
+ VG9waWNz
+ TmV3IFRvcGlj
+
+
+ WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTmV3IFByaXZhdGUgTWVzc2FnZQoKQSBuZXcgcHJpdmF0ZSBtZXNzYWdlIGhhcyBhcnJpdmVkLiA=
+ WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IE5ldyByZXBseSBoYXMgYmVlbiBhZGRlZAoKTmV3IHJlcGx5IGhhcyBiZWVuIGFkZGVkIHRvIG9uZSBvZiB5b3VyIHBvc3RzOg0KDQo8aW5wOnRvcGljIF9maWVsZD0idGV4dCIgLz4gLSA8aW5wOnRvcGljIF9maWVsZD0ibGluayIgX1RlbXBsYXRlPSJpbmJ1bGxldGluL3Bvc3RfbGlzdCIgLz4=
+ WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IE5ldyByZXBseSBoYXMgYmVlbiBhZGRlZAoKTmV3IHJlcGx5IGhhcyBiZWVuIGFkZGVkIHRvIG9uZSBvZiB5b3VyIHBvc3RzOg0KDQo8aW5wOnRvcGljIF9maWVsZD0idGV4dCIgLz4gLSA8aW5wOnRvcGljIF9maWVsZD0ibGluayIgX1RlbXBsYXRlPSJpbmJ1bGxldGluL3Bvc3RfbGlzdCIgLz4=
+ WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogUG9zIG1vZGlmaWVkCgpBIHBvc3QgaGFzIGJlZW4gbW9kaWZpZWQu
+ WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogVG9waWMgYWRkZGUKCkEgdG9waWMgaGFzIGJlZW4gYWRkZWQu
+
+
+
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.8.2/in-bulletin/units/topics/topics_event_handler.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.8.2/in-bulletin/units/topics/topics_event_handler.php (revision 0)
+++ branches/unlabeled/unlabeled-1.8.2/in-bulletin/units/topics/topics_event_handler.php (revision 12744)
@@ -0,0 +1,194 @@
+getPrefixSpecial();
+ $url_params = $event->getEventParam('url_params');
+ $pass_events = $event->getEventParam('pass_events');
+
+ $query_vars = $this->Application->getUnitOption($event->Prefix, 'QueryString');
+
+ $event_key = array_search('event', $query_vars);
+ if ($event_key) {
+ // pass through event of this prefix
+ unset($query_vars[$event_key]);
+ }
+
+ if (!getArrayValue($url_params, $prefix_special.'_event')) {
+ // if empty event, then remove it from url
+ unset( $url_params[$prefix_special.'_event'] );
+ }
+
+ //if pass events is off and event is not implicity passed
+ if ( !$pass_events && !isset($url_params[$prefix_special.'_event']) )
+ {
+ unset($url_params[$prefix_special.'_event']); // remove event from url if requested
+ //otherwise it will use value from get_var
+ }
+
+ if(!$query_vars) return true;
+
+ $processed_params = Array();
+ foreach($query_vars as $index => $var_name)
+ {
+ //if value passed in params use it, otherwise use current from application
+ $var_name = $prefix_special.'_'.$var_name;
+ $processed_params[$var_name] = isset( $url_params[$var_name] ) ? $url_params[$var_name] : $this->Application->GetVar($var_name);
+ if ( isset($url_params[$var_name]) ) unset( $url_params[$var_name] );
+ }
+
+ $ret = '';
+
+ // topic
+ if($processed_params[$prefix_special.'_id'])
+ {
+ // this allows to fill 3 cache records with one query (see this method for details)
+ $category_id = isset($url_params['m_cat_id']) ? $url_params['m_cat_id'] : $this->Application->GetVar('m_cat_id');
+ $category_filename = $this->Application->getFilename('c', $category_id);
+
+ // if template is also item template of category, then remove template
+ $template = getArrayValue($url_params, 't');
+ $item_template = $this->Application->getCache('item_templates', $category_id);
+ if ($template == $item_template || strtolower($template) == '__default__') {
+ unset($url_params['t']);
+ }
+
+ $ret .= $processed_params[$prefix_special.'_id'].'/';
+ }
+
+ if($processed_params[$prefix_special.'_Page'] > 1)
+ {
+ if ($processed_params[$prefix_special.'_Page']) $ret = rtrim($ret, '/');
+ $ret .= '_'.$processed_params[$prefix_special.'_Page'].'/';
+ }
+
+ // post
+ if($processed_params[$prefix_special.'_post_id'])
+ {
+ $ret .= $processed_params[$prefix_special.'_post_id'].'/';
+ }
+
+ if($processed_params[$prefix_special.'_Post_Page'] > 1)
+ {
+ if ($processed_params[$prefix_special.'_post_id']) $ret = rtrim($ret, '/');
+ $ret .= '_'.$processed_params[$prefix_special.'_Post_Page'].'/';
+ }
+
+ // private message
+ if($processed_params[$prefix_special.'_pm_id'])
+ {
+ $ret .= 'pm_'.$processed_params[$prefix_special.'_pm_id'].'/';
+ }
+
+ if($processed_params[$prefix_special.'_pm_Page'] > 1)
+ {
+ if ($processed_params[$prefix_special.'_pm_id']) $ret = rtrim($ret, '/');
+ $ret .= '_'.$processed_params[$prefix_special.'_pm_Page'].'/';
+ }
+
+ $event->setEventParam('url_params', $url_params);
+ $event->setEventParam('env_string', strtolower($ret) );
+ }
+
+ /**
+ * Process mod_rewrite url part left after previous parser
+ *
+ * @param kEvent $event
+ */
+ function ParseEnv(&$event)
+ {
+ // _/_/_
+
+ $url_parts = $event->getEventParam('url_parts');
+
+ $defaults = Array('id' => 0, 'Page' => 1, 'Reviews_Page' => 1, 'post_id' => 0, 'Post_Page' => 1, 'pm_id' => 0, 'pm_Page' => 1);
+ foreach ($defaults as $var_name => $var_value)
+ {
+ $this->Application->SetVar($event->getPrefixSpecial().'_'.$var_name, $var_value);
+ }
+ if (!$url_parts) {
+ return false;
+ }
+
+ $ret = '';
+ $url_part = array_shift($url_parts);
+
+ if($url_part && substr($url_part,0,3) != 'pm_')
+ {
+ // match topic page
+ if( preg_match('/(.*)_([\d]+)$/', $url_part, $rets) )
+ {
+ $url_part = $rets[1];
+ $this->Application->SetVar( $event->getPrefixSpecial().'_Page', $rets[2]);
+ }
+
+ if (is_numeric($url_part)) {
+ // match topic id (we don't use names here)
+ $this->Application->SetVar($event->getPrefixSpecial().'_id', $url_part);
+ $url_part = $url_parts ? array_shift($url_parts) : '';
+ }
+ }
+
+ if($url_part && substr($url_part,0,3) != 'pm_')
+ {
+ // match post page
+ if( preg_match('/(.*)_([\d]+)$/', $url_part, $rets) )
+ {
+ $url_part = $rets[1];
+ $this->Application->SetVar( $event->getPrefixSpecial().'_Post_Page', $rets[2]);
+ }
+
+ if (is_numeric($url_part)) {
+ // match post id
+ $this->Application->SetVar($event->getPrefixSpecial().'_post_id', $url_part);
+ $url_part = $url_parts ? array_shift($url_parts) : '';
+ }
+ }
+
+ if($url_part && substr($url_part,0,3) == 'pm_')
+ {
+ $url_part = substr($url_part, 3, strlen($url_part) );
+ // match private message page
+ if( preg_match('/(.*)_([\d]+)$/', $url_part, $rets) )
+ {
+ $url_part = $rets[1];
+ $this->Application->SetVar( $event->getPrefixSpecial().'_pm_Page', $rets[2]);
+ }
+
+ if (is_numeric($url_part)) {
+ // match private message id
+ $this->Application->SetVar($event->getPrefixSpecial().'_pm_id', $url_part);
+ $url_part = $url_parts ? array_shift($url_parts) : '';
+ }
+ }
+
+ if ($url_part) {
+ array_unshift($url_parts, $url_part);
+ }
+
+ $event->setEventParam('url_parts', $url_parts);
+ }
+
+ /**
+ * Lock or unlock topic
+ *
+ * @param kEvent $event
+ */
+ function OnToggleLock(&$event)
+ {
+ $object =& $event->getObject();
+
+ $new_type = $object->GetDBField('TopicType') ? 0 : 1;
+ $object->SetDBField('TopicType', $new_type);
+ $object->Update();
+ }
+ }
+
+?>
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.19.2/in-bulletin/admin/install.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.19.2/in-bulletin/admin/install.php (revision 0)
+++ branches/unlabeled/unlabeled-1.19.2/in-bulletin/admin/install.php (revision 12744)
@@ -0,0 +1,97 @@
+Init();
+
+ require_once FULL_PATH.'/admin/install/install_lib.php';
+ require_once FULL_PATH.'/kernel/include/tag-class.php';
+ require_once FULL_PATH.'/'.$MODULE_NAME.'/emoticon.php';
+ if( !is_object($objTagList) ) $objTagList = new clsTagList();
+
+ $ado =& GetADODBConnection();
+
+ // create module category
+ $cat =& $application->recallObject('c', null, Array('skip_autoload' => true));
+ $cat_fields = Array('Name' => 'Forums', 'AutomaticFilename' => 1, 'Filename' => 'Forums',
+ 'Description' => 'Discussion Forums', 'Status' => 1, 'ParentId' => 0,
+ 'CategoryTemplate' => 'inbulletin/index', 'ItemTemplate' => 'inbulletin/post_list',
+ 'CachedCategoryTemplate' => 'inbulletin/index', 'CachedItemTemplate' => 'inbulletin/post_list');
+ $cat->SetDBFieldsFromHash($cat_fields);
+ $cat->Create();
+
+ $cat_id = $cat->GetId();
+
+ $filename = FULL_PATH.'/'.$MODULE_NAME.'/admin/install/inportal_schema.sql';
+ if (file_exists($filename)) RunSchemaFile($ado, $filename);
+
+ $filename = FULL_PATH.'/'.$MODULE_NAME.'/admin/install/inportal_data.sql';
+ if (file_exists($filename))
+ {
+ $sql = file($filename);
+ for ($x = 0; $x < count($sql); $x++)
+ {
+ $sql[$x] = str_replace('{TopicCatId}', $cat_id, $sql[$x]);
+ }
+ RunSQLText($ado, $sql);
+
+ $sql = 'SELECT Version FROM '.TABLE_PREFIX.'Modules WHERE Name = '.$ado->qstr('In-Bulletin');
+ $mod_version = $application->Conn->GetOne($sql);
+
+ if ($ini_file == '') {
+ $ini_file = FULL_PATH.'/config.php';
+ $ini_vars = inst_parse_portal_ini($ini_file, true);
+ }
+
+ set_ini_value('Module Versions', 'In-Bulletin', $mod_version);
+ save_values();
+
+ $objTagList->ParseFile(FULL_PATH.'/'.$MODULE_NAME.'/parser.php');
+ }
+
+ $sql = 'DELETE FROM '.TABLE_PREFIX.'Cache WHERE (VarName = "config_files") OR (VarName LIKE "%_parsed")';
+ $application->Conn->Query($sql);
+
+ $objModules->Refresh();
+ $objModules->SetModuleRoot('In-Bulletin', $cat_id);
+
+ $inp_cat =& $objCatList->GetCategory($cat_id);
+ $inp_cat->UpdateCachedPath();
+ $inp_cat->UpdateACL();
+
+ function bb_inst_SmileyImages()
+ {
+ global $MODULE_NAME;
+ $objSmileys = new clsEmoticonList();
+ $objImageList = new clsImageList();
+ $objSmileys->Clear();
+ $objSmileys->Query_Item('SELECT * FROM '.$objSmileys->SourceTable);
+ foreach($objSmileys->Items as $s)
+ {
+ $img =& $objImageList->Add($s->Get('Name'), $s->Get('Name'), 0, 1, 1, '', '', $s->Get('Enabled'), 0, 0, 0,1);
+ $img->Set('LocalPath',$MODULE_NAME.'/images/emoticons/0_'.$s->Get('EmoticonId').'.gif');
+ $img->Set('ThumbPath',$MODULE_NAME.'/images/emoticons/0_'.$s->Get('EmoticonId').'.gif');
+ $img->Update();
+
+ $s->Set('ImageId',$img->Get('ImageId'));
+ $s->Update();
+ }
+ }
+
+ bb_inst_SmileyImages();
+
+ finalizeModuleInstall($MODULE_NAME);
+
+?>
Index: branches/unlabeled/unlabeled-1.1.68/in-bulletin/admin/templates/post_element.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.68/in-bulletin/admin/templates/post_element.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.1.68/in-bulletin/admin/templates/post_element.tpl (revision 12744)
@@ -0,0 +1,16 @@
+>
+
+
+
+
+
+
+
+
+
+
+
+ (Added: Hits: Rating: Votes: Author: )
+
+
+
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.26.2/in-bulletin/admin/import/phpbb_import.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.26.2/in-bulletin/admin/import/phpbb_import.php (revision 0)
+++ branches/unlabeled/unlabeled-1.26.2/in-bulletin/admin/import/phpbb_import.php (revision 12744)
@@ -0,0 +1,582 @@
+GetSection($section);
+
+ //Set Environment Variable
+ $envar = 'env='.BuildEnv();
+
+ $ImportTable = $objSession->GetSessionTable('BBImport','');
+ $sql_type = $objSession->GetVariable("import_sql_type");
+ $db_server = $objSession->GetVariable("import_server");
+ $db_name = $objSession->GetVariable("import_db");
+ $db_user = $objSession->GetVariable("import_user");
+ $db_pass = $objSession->GetVariable("import_pass");
+
+ // made connection to source database
+ $db =& ADONewConnection($sql_type);
+ $db->NConnect($db_server, $db_user, $db_pass, $db_name);
+
+ // get connection to destination database
+ $dst_db =&GetADODBConnection();
+
+ // if connection error occured, then say this
+ if(!$db)
+ {
+ echo "Database connection failed. DB Type: $sql_type, DB Server: $inlink_server, DB User: $inlink_user, DB Name: $inlink_db"; //fatal;
+ echo $db->ErrorMsg();
+ exit;
+ }
+
+ // global vars
+ if( GetVar('bb_prefix') ) $objSession->SetVariable('import_table_prefix', GetVar('bb_prefix') );
+ $bb_prefix = $objSession->GetVariable('import_table_prefix');
+
+ // If script 1st run -> create temporary
+ // import table in destination database
+
+ // define import steps
+ $import_steps = Array();
+ $import_steps['groups'] = Array('id' => 'groups', 'caption' => 'Groups'); // groups
+ $import_steps['groups']['count_sql'] = 'SELECT COUNT(DISTINCT g.group_id) FROM '.$bb_prefix.'groups g, '.$bb_prefix.'auth_access aa WHERE (g.group_id = aa.group_id)';
+ $import_steps['users'] = Array('id' => 'users', 'caption' => 'Users, avatars'); // users + avatars
+ $import_steps['users']['count_sql'] = 'SELECT COUNT(*) FROM '.$bb_prefix.'users';
+ $import_steps['user_banlist'] = Array('id' => 'user_banlist', 'caption' => 'Users Banrules'); // banned users
+ $import_steps['user_banlist']['count_sql'] = 'SELECT COUNT(*) FROM '.$bb_prefix.'banlist';
+ $import_steps['cats'] = Array('id' => 'cats', 'caption' => 'Categories');
+ $import_steps['cats']['count_sql'] = 'SELECT COUNT(*) FROM '.$bb_prefix.'categories';
+ $import_steps['forums'] = Array('id' => 'forums', 'caption' => 'Forums');
+ $import_steps['forums']['count_sql'] = 'SELECT COUNT(*) FROM '.$bb_prefix.'forums';
+ $import_steps['forums_perms'] = Array('id' => 'forums_perms', 'caption' => 'Forum Permissions');
+ $import_steps['forums_perms']['count_sql'] = 'SELECT COUNT(*) FROM '.$bb_prefix.'auth_access';
+ $import_steps['topics'] = Array('id' => 'topics', 'caption' => 'Topics');
+ $import_steps['topics']['count_sql'] = 'SELECT COUNT(*) FROM '.$bb_prefix.'topics';
+ $import_steps['posts'] = Array('id' => 'posts', 'caption' => 'Posts');
+ $import_steps['posts']['count_sql'] = 'SELECT COUNT(*) FROM '.$bb_prefix.'posts';
+
+ $StepIndex = Array( 1 => 'groups', 2 => 'users', 3 => 'user_banlist', 4 => 'cats', 5 => 'forums', 6 => 'forums_perms',
+ 7 => 'topics', 8 => 'posts');
+
+ if( GetVar('Action') == 'Import' )
+ {
+
+ $sql = 'CREATE TABLE '.$ImportTable.'(
+ bbi_id int(11) unsigned NOT NULL auto_increment,
+ bbi_step varchar(20) NOT NULL default \'\',
+ bbi_cache longtext NOT NULL,
+ bbi_percent tinyint(3) NOT NULL default \'0\',
+ bbi_details varchar(100) NOT NULL default \'\',
+ bbi_current tinyint(1) NOT NULL default \'0\',
+ bbi_rec_no int(11) unsigned NOT NULL default \'0\',
+ bbi_recs_count int(11) unsigned NOT NULL default \'0\',
+ PRIMARY KEY (bbi_id)
+ )';
+ $dst_db->Execute($sql);
+
+ // set initial info
+ $sql = 'INSERT INTO '.$ImportTable.'(bbi_step,bbi_cache,bbi_recs_count) VALUES(\'%s\',\''.serialize( Array() ).'\',%s)';
+ foreach ($import_steps as $is_name => $is_data)
+ {
+ $recs_count = $db->GetOne( $is_data['count_sql'] );
+ $tmp = sprintf($sql, $is_name, $recs_count);
+ $dst_db->Execute($tmp);
+ }
+ // set 1st step
+ $dst_db->Execute('UPDATE '.$ImportTable.' SET bbi_current = 1 WHERE bbi_step = \''.$StepIndex[1].'\'');
+ $objSession->SetVariable('import_begins', GetMC() );
+ }
+
+
+ // update import step info with current information
+ $sql = 'SELECT * FROM '.$ImportTable;
+ $rs =& $dst_db->Execute($sql);
+
+ $current_step = Array(); // current step info
+ $cache = Array();
+
+ while(!$rs->EOF)
+ {
+ $rec =& $rs->fields;
+
+ $is =& $import_steps[ $rec['bbi_step'] ];
+ $is['percent'] = $rec['bbi_percent'];
+ $is['details'] = $rec['bbi_details'];
+ $is['rec_no'] = $rec['bbi_rec_no'];
+ $is['recs_count'] = $rec['bbi_recs_count'];
+ $is['current'] = $rec['bbi_current'];
+ $tmp = unserialize( $rec['bbi_cache'] );
+ $cache[ $rec['bbi_step'] ] = $tmp;
+
+ if( $rec['bbi_current'] == 1 )
+ {
+ $is['perpage'] = constant( strtoupper($is['id']).'_PERPAGE' );
+ $current_step = $is;
+ $ImportFunction = 'import_'.$is['id'];
+ }
+ $rs->MoveNext();
+ }
+
+ // Error Reporting
+ if( IsDebugMode() )
+ {
+ error_reporting(E_ALL);
+ ini_set('display_errors', 1);
+ }
+
+ // draw import screen
+ DrawScreen($import_steps);
+
+ // category/forum specific
+ $import_category_id = $objSession->GetVariable('import_category_id');
+
+
+ // user specific
+ define('DT_USER', 6); // user data type
+ $user_regular = $objSession->GetVariable("user_regular_values");
+ $user_group =& new clsPortalGroup($user_regular);
+
+ $perm_mappings = Array( 'CATEGORY.VIEW' => 'auth_view', 'TOPIC.VIEW' => 'auth_read',
+ 'TOPIC.REPLY.VIEW' => 'auth_read', 'TOPIC.ADD' => 'auth_post',
+ 'TOPIC.REPLY.ADD' => 'auth_reply', 'TOPIC.OWNER.MODIFY' => 'auth_edit',
+ 'TOPIC.REPLY.OWNER.MODIFY' => 'auth_edit', 'TOPIC.OWNER.DELETE' => 'auth_delete',
+ 'TOPIC.REPLY.OWNER.DELETE' => 'auth_delete');
+
+ // begin processing
+ $import_steps[ $current_step['id'] ]['rec_no'] += $ImportFunction(); // based on step name
+ $current_step['rec_no'] = $import_steps[ $current_step['id'] ]['rec_no'];
+ StepRedirect($current_step);
+ // end processing
+
+
+ function import_groups()
+ {
+ global $cache, $current_step, $objGroups, $db, $bb_prefix, $import_steps;
+
+ // import administrative & personal groups
+ $sql = 'SELECT DISTINCT g.group_id, g.group_name, g.group_single_user, g.group_description
+ FROM '.$bb_prefix.'groups g, '.$bb_prefix.'auth_access aa
+ WHERE (g.group_id = aa.group_id)
+ LIMIT '.$current_step['rec_no'].','.$current_step['perpage'];
+
+ $rs = $db->Execute($sql);
+ $recs_count = $rs->RecordCount();
+ while(!$rs->EOF)
+ {
+ $rec =& $rs->fields;
+
+ $gprefix = ($rec['group_single_user'] == 1) ? '_' : 'phpbb_';
+ $group = $objGroups->Add_Group($gprefix.$rec['group_name'], $rec['group_description'], 0);
+ $group_id = $group->UniqueId();
+
+ // add created group to cache
+ $cache['groups'][ $rec['group_id'] ] = Array('new_id' => $group_id );
+ unset($group);
+
+ $rs->MoveNext();
+ }
+ return $recs_count;
+ }
+
+
+
+ function import_users()
+ {
+ global $cache, $current_step, $objUsers, $objGroups, $db, $bb_prefix, $import_steps, $user_regular, $user_group;
+
+ $pesistant_vars = Array('my_signature' => 'user_sig', 'bb_posts' => 'user_posts',
+ 'smileys' => 'user_allowsmile', 'bbcode' => 'user_allowbbcode',
+ 'show_sig' => 'user_attachsig');
+
+ $uf_defs = Array( 'user_msn' => 'user_msnm', 'user_icq' => 'user_icq', 'user_aim' => 'user_aim',
+ 'user_yahoo' => 'user_yim', 'user_website' => 'user_website',
+ 'user_occupation' => 'user_occ', 'user_interests' => 'user_interests',
+ 'user_from' => 'user_from');
+
+ if( $current_step['rec_no'] < $current_step['perpage'])
+ {
+ // create custom fields for in-bulletin users (and show them on general tab)
+ $user_fields = new clsCustomFieldList(DT_USER);
+ $user_fields_created = $user_fields->GetFieldNames();
+
+ $application =& kApplication::Instance();
+ $ml_helper =& $application->recallObject('kMultiLanguageHelper');
+
+ foreach ($uf_defs as $pending_uf => $no_in_use) {
+ if (in_array($pending_uf, $user_fields_created)) continue;
+ $user_fields->AddField(DT_USER, $pending_uf, '', 1, 'la_bb', 'lu_fieldcustom__'.$pending_uf, 'text', '');
+ }
+
+ $ml_helper->createFields('u-cdata', true);
+ }
+
+ // get users
+ //$cache['users'] = Array();
+ $sql = 'SELECT * FROM '.$bb_prefix.'users ORDER BY user_id
+ LIMIT '.$current_step['rec_no'].','.$current_step['perpage'];
+ $rs = $db->Execute($sql);
+ $recs_count = $rs->RecordCount();
+
+ // Create Anonymous User
+ $user =& $objUsers->Add_User('Guest', '', 'anonymous@user.com', adodb_mktime(), '', '', 1, '', '', '', '', '', '');
+ $cache['users'][ -1 ] = Array('new_id' => $user->UniqueId(), 'username' => 'Guest');
+ $cache['users'][ 0 ] = Array('new_id' => $user->UniqueId(), 'username' => 'Guest');
+ unset($user);
+
+ $missing_pers_groups = Array();
+ while(!$rs->EOF)
+ {
+ $rec =& $rs->fields;
+ /*$address = explode(',', $rec['user_from']); // state, country
+ foreach($address as $id => $addr_part) $address[$id] = trim($addr_part);
+ $user_state = isset( $address[0] ) ? $address[0] : '';
+ $user_country = isset( $address[1] ) ? $address[1] : '';*/
+
+ $user =& $objUsers->Add_User($rec['username'], $rec['user_password'], $rec['user_email'], $rec['user_regdate'],
+ '', '', $rec['user_active'], '', '', '', '', '', '');
+
+ $user_id = $user->UniqueId();
+
+ // set user pesistant variables (why not custom fields)
+ foreach($pesistant_vars as $dst_field => $src_field)
+ {
+ SetPersistantVariable($user_id, $dst_field, $rec[$src_field]);
+ }
+ SetPersistantVariable($user_id, 'bb_signatures', '1'); // show other signatures
+
+ // set user custom fields
+ foreach($uf_defs as $dst_field => $src_field)
+ $user->SetCustomField($dst_field, $rec[$src_field]);
+ $user->SaveCustomFields();
+
+ // add user to user_group specified (in import step 3)
+ $user_group->AddUser($user_id, 1,false); // make it primary
+ // add user to it's personal group
+ $user_pers_group = $objGroups->GetItemByField('Name','_'.$rec['username']);
+ if( is_object($user_pers_group) )
+ $user_pers_group->AddUser($user_id, 0,false); // make it supplimentary
+ else
+ $missing_pers_groups[] = $rec['username'];
+ unset($user_pers_group);
+
+ // add created user to cache
+ $cache['users'][ $rec['user_id'] ] = Array('new_id' => $user_id, 'username' => $rec['username']);
+ unset($user);
+ $rs->MoveNext();
+ }
+ return $recs_count;
+ }
+
+ function import_user_banlist()
+ {
+ global $cache, $current_step, $objBanList, $db, $dst_db, $bb_prefix, $import_steps;
+
+ // get ban rules
+ $sql = 'SELECT * FROM '.$bb_prefix.'banlist ORDER BY ban_id
+ LIMIT '.$current_step['rec_no'].','.$current_step['perpage'];
+
+ $rs = $db->Execute($sql);
+ $recs_count = $rs->RecordCount();
+ $banrule_priority = $dst_db->GetOne('SELECT MAX(Priority) FROM '.GetTablePrefix().'BanRules');
+
+ while(!$rs->EOF)
+ {
+ $rec =& $rs->fields;
+ if( $rec['ban_userid'] )
+ {
+ $tmp =& $objBanList->AddRule(DT_USER, 0, 'Login',1, $cache['users'][ $rec['ban_userid'] ]['username'], $banrule_priority, 1);
+ unset($tmp);
+ $banrule_priority++;
+ }
+
+ if( $rec['ban_ip'] )
+ {
+ $tmp =& $objBanList->AddRule(DT_USER, 0, 'ip',1, DecodeIP( $rec['ban_ip'] ), $banrule_priority, 1);
+ unset($tmp);
+ $banrule_priority++;
+ }
+
+ if( $rec['ban_email'] )
+ {
+ $tmp =& $objBanList->AddRule(DT_USER, 0, 'Email',1, $rec['ban_email'], $banrule_priority, 1);
+ unset($tmp);
+ $banrule_priority++;
+ }
+ $rs->MoveNext();
+ }
+ return $recs_count;
+ }
+
+
+ function import_cats()
+ {
+ global $cache, $current_step, $objCatList, $db, $bb_prefix, $import_steps, $import_category_id;
+
+ // get categories
+ //$cache['cats'] = Array();
+ $cache['all_cats'] = Array();
+
+ $sql = 'SELECT * FROM '.$bb_prefix.'categories ORDER BY cat_order
+ LIMIT '.$current_step['rec_no'].','.$current_step['perpage'];
+
+ $rs = $db->Execute($sql);
+ $recs_count = $rs->RecordCount();
+
+ while(!$rs->EOF)
+ {
+ $rec =& $rs->fields;
+ $NewOrder = $rec['cat_order'] == 1 ? 0 : $rec['cat_order'] / -10;
+ $fields_hash = Array( 'ParentId' => $import_category_id,
+ 'Name' => $rec['cat_title'],
+ 'Description' => $rec['cat_title'],
+ 'CreatedOn' => adodb_mktime(),
+ 'EditorsPick' => 0,
+ 'Status' => 1,
+ 'HotItem' => 2,
+ 'NewItem' => 2,
+ 'PopItem' => 2,
+ 'Priority' => $NewOrder,
+ 'MetaKeywords' => '',
+ 'MetaDescription' => '',
+ 'AutomaticFilename' => 1,
+ 'Filename' => '',
+ 'CategoryTemplate' => '',
+ 'ItemTemplate' => '',
+ );
+ $category =& $objCatList->Add_NEW($fields_hash);
+ $cache['cats'][ $rec['cat_id'] ] = Array( 'new_id' => $category->UniqueId() );
+ $cache['all_cats'][] = $cache['cats'][ $rec['cat_id'] ]['new_id'];
+
+ unset($category);
+ $rs->MoveNext();
+ }
+ return $recs_count;
+ }
+
+ function import_forums()
+ {
+ global $cache, $current_step, $objCatList, $db, $dst_db, $bb_prefix, $import_steps,
+ $user_regular, $import_category_id, $perm_mappings;
+ // get forums
+ //$cache['forums'] = Array();
+ $sql = 'SELECT * FROM '.$bb_prefix.'forums ORDER BY cat_id
+ LIMIT '.$current_step['rec_no'].','.$current_step['perpage'];
+
+ $rs = $db->Execute($sql);
+ $recs_count = $rs->RecordCount();
+
+ while(!$rs->EOF)
+ {
+ $rec =& $rs->fields;
+ $NewOrder = $rec['forum_order'] == 1 ? 0 : $rec['forum_order'] / -10;
+ $category =& $objCatList->Add( $cache['cats'][ $rec['cat_id'] ]['new_id'], $rec['forum_name'],
+ $rec['forum_desc'], adodb_mktime(), 0, 1, 2, 2, 2, $NewOrder, '', '');
+
+ $category_id = $category->UniqueId();
+ $cache['forums'][ $rec['forum_id'] ] = Array('new_id' => $category_id);
+
+ // set forum permissions to "Member" group or group what user specified
+ $objPermList = new clsPermList($category_id, $user_regular);
+ $objPermList->LoadCategory($category_id);
+ foreach($perm_mappings as $perm_name => $perm_field)
+ {
+ $HasPerm = $rec[$perm_field] == 0 || $rec[$perm_field] == 1;
+ $objPermList->Set_Permission($category_id, $user_regular, $perm_name, $HasPerm, 0);
+ }
+
+ unset($category);
+ $rs->MoveNext();
+ }
+
+ // fix all priorities
+ $all_cats = array($import_category_id);
+
+ foreach($cache['forums'] as $k => $v) {
+ $all_cats[] = $v['new_id'];
+ }
+ foreach($cache['cats'] as $k => $v) {
+ $all_cats[] = $v['new_id'];
+ }
+
+ $sql = 'SELECT ParentId, MIN(Priority) AS MinPri FROM '.$objCatList->SourceTable.' WHERE ParentId IN ('.implode(',', $all_cats) .') GROUP BY ParentId';
+ $rs = $dst_db->Execute($sql);
+ while(!$rs->EOF)
+ {
+ $rec =& $rs->fields;
+ $MinPri = $rec['MinPri'];
+ $sql = 'UPDATE '.$objCatList->SourceTable.' SET Priority = Priority + ABS('.$MinPri.') WHERE ParentId = '.$rec['ParentId'];
+ $dst_db->Execute($sql);
+ $rs->MoveNext();
+ }
+ return $recs_count;
+ }
+
+
+ function import_forums_perms()
+ {
+ global $cache, $current_step, $db, $bb_prefix, $import_steps, $import_category_id, $perm_mappings, $user_regular;
+
+ // get user-per-forum permissions
+ //$cache['forums_perms'] = Array();
+
+ $sql = 'SELECT * FROM '.$bb_prefix.'auth_access
+ LIMIT '.$current_step['rec_no'].','.$current_step['perpage'];
+
+ $rs = $db->Execute($sql);
+ $recs_count = $rs->RecordCount();
+
+ while(!$rs->EOF)
+ {
+ $rec =& $rs->fields;
+ $category_id = $cache['forums'][ $rec['forum_id'] ]['new_id']; // forum category
+ $user_group = $cache['groups'][ $rec['group_id'] ]['new_id'];
+
+ $objPermList = new clsPermList($category_id, $user_group);
+ $objPermList->LoadCategory($category_id);
+
+ foreach($perm_mappings as $perm_name => $perm_field)
+ {
+ $objPermList->Set_Permission($category_id, $user_group, $perm_name, $rec[$perm_field], 0);
+ }
+ $rs->MoveNext();
+ }
+ return $recs_count;
+ }
+
+
+ function import_topics()
+ {
+ global $cache, $current_step, $db, $objTopicList, $bb_prefix, $import_steps, $import_category_id;
+
+ // get topics
+ //$cache['topics'] = Array();
+ $sql = 'SELECT * FROM '.$bb_prefix.'topics ORDER BY forum_id
+ LIMIT '.$current_step['rec_no'].','.$current_step['perpage'];
+ $rs = $db->Execute($sql);
+ $recs_count = $rs->RecordCount();
+
+ while(!$rs->EOF)
+ {
+ $rec =& $rs->fields;
+ $rec['topic_replies'] += 1;
+ $topic =& $objTopicList->Add_Topic( $rec['topic_title'], $cache['forums'][ $rec['forum_id'] ]['new_id'],
+ 1, 0, 0, $rec['topic_time'], GetUserID( $rec['topic_poster'] ),
+ Array( 'Posts' => $rec['topic_replies'], 'Views' => $rec['topic_views'],
+ 'Modified' => $rec['topic_time'], 'PostedBy' => GetUserName($rec['topic_poster']) ) );
+
+ $cache['topics'][ $rec['topic_id'] ] = Array( 'new_id' => $topic->UniqueId() );
+
+ unset($topic);
+ $rs->MoveNext();
+ }
+
+ //unset($objTopicList);
+ return $recs_count;
+ }
+
+
+ function import_posts()
+ {
+ global $cache, $current_step, $db, $dst_db, $bb_prefix, $import_steps, $import_category_id;
+ // get posts
+
+ //$cache['users'] = Array();
+ $sql = 'SELECT * FROM '.$bb_prefix.'posts p LEFT JOIN '.$bb_prefix.'posts_text pt ON pt.post_id = p.post_id ORDER BY topic_id
+ LIMIT '.$current_step['rec_no'].','.$current_step['perpage'];
+ $rs = $db->Execute($sql);
+ $recs_count = $rs->RecordCount();
+ $post =& new clsPosting();
+ while(!$rs->EOF)
+ {
+ $rec =& $rs->fields;
+ $post->Set('ResourceId', 0);
+ $post->Set('PostingId', 0);
+
+ // Map post options (enable_sig, enable_bbcode, enable_smilies)
+ $post->SetPostOption('show_sig', $rec['enable_sig']);
+ $post->SetPostOption('disable_bbcode', !$rec['enable_bbcode']);
+ $post->SetPostOption('disable_smileys', !$rec['enable_smilies']);
+
+ $post->Set( Array('IPAddress', 'PosterAlias', 'Subject', 'PostingText', 'CreatedOn', 'CreatedById', 'TopicId' ),
+ Array(
+ DecodeIP( $rec['poster_ip'] ),
+ GetUserName( $rec['poster_id'] ),
+ $rec['post_subject'],
+ $rec['post_text'],
+ $rec['post_time'],
+ GetUserID( $rec['poster_id'] ),
+ $cache['topics'][ $rec['topic_id'] ]['new_id'] )
+ );
+ $post->Create();
+ //$cache['posts'][ $rec['post_id'] ] = Array( 'new_id' => $post->UniqueId() );
+
+ $size = strlen(serialize($cache));
+
+ //unset($post);
+ $rs->MoveNext();
+ }
+
+ if($current_step['recs_count'] == $current_step['rec_no'] + $recs_count)
+ {
+ // set lastpostid for each topic
+
+ $sql = 'SELECT PostingId, MAX(CreatedOn) AS pt, TopicId FROM '.GetTablePrefix().'Posting GROUP BY TopicId ORDER BY CreatedOn DESC';
+ $rs = $dst_db->Execute($sql);
+ $update_sql = 'UPDATE '.GetTablePrefix().'Topic SET LastPostId = %s, LastPostDate = %s WHERE TopicId = %s';
+ while(!$rs->EOF)
+ {
+ $rec =& $rs->fields;
+
+ $tmp = sprintf($update_sql, $rec['PostingId'], $rec['pt'], $rec['TopicId']);
+ $dst_db->Execute($tmp);
+ $rs->MoveNext();
+ }
+
+
+
+
+ /*$sql = 'SELECT topic_id, MAX(post_time) AS pt, post_id FROM '.$bb_prefix.' posts GROUP BY topic_id ORDER BY post_time DESC';
+ $rs = $db->Execute($sql);
+ $update_sql = 'UPDATE '.GetTablePrefix().'Topic SET LastPostId = %s, LastPostDate = %s WHERE TopicId = %s';
+ while(!$rs->EOF)
+ {
+ $rec =& $rs->fields;
+ $TopicId = $cache['topics'][ $rec['topic_id'] ]['new_id'];
+ $tmp = sprintf($update_sql, $cache['posts'][ $rec['post_id'] ]['new_id'], $rec['pt'], $TopicId);
+ $dst_db->Execute($tmp);
+ $rs->MoveNext();
+ }*/
+ }
+ return $recs_count;
+ }
+
+
+?>
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.2.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.1.6.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.2.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.1.6.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.2.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.1.6.sql (revision 12744)
@@ -0,0 +1,19 @@
+UPDATE ConfigurationValues SET ModuleOwner = 'In-Bulletin', Section = 'in-bulletin:configuration_search' WHERE VariableName LIKE 'SearchRel_%_topics' OR VariableName = 'Search_ShowMultiple_topic';
+UPDATE ConfigurationValues SET ModuleOwner = 'In-Bulletin', Section = 'in-bulletin:configuration_search' WHERE VariableName LIKE 'SearchRel_%_posts';
+UPDATE ConfigurationValues SET VariableName = 'Search_ShowMultiple_topics' WHERE VariableName = 'Search_ShowMultiple_topic';
+
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_topics', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_topics', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_topics', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_topics', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_topics', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 1);
+
+CREATE TABLE TopicCustomData (CustomDataId int(11) NOT NULL auto_increment, ResourceId int(10) unsigned NOT NULL default '0', PRIMARY KEY (CustomDataId));
+
+INSERT INTO ConfigurationAdmin VALUES ('bb_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 1, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 1, 0);
+
+INSERT INTO ConfigurationValues VALUES ('bb_CategoryTemplate', 'inbulletin/index', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES ('bb_ItemTemplate', 'inbulletin/post_list', 'In-Bulletin', 'in-bulletin:configuration_output');
+
+UPDATE Modules SET Version = '1.1.6' WHERE Name = 'In-Bulletin';
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.2.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.2.1.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.2.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.2.1.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.2.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.2.1.sql (revision 12744)
@@ -0,0 +1,35 @@
+UPDATE ConfigurationAdmin SET VariableName = 'Topic_MinPopVotes', prompt = 'la_fld_Topic_MinPopVotes' WHERE VariableName = 'Topic_MinVotes';
+UPDATE ConfigurationAdmin SET VariableName = 'Topic_MinPopRating', prompt = 'la_fld_Topic_MinPopRating' WHERE VariableName = 'Topic_PostsToPop';
+UPDATE ConfigurationAdmin SET VariableName = 'Topic_MaxHotNumber', prompt = 'la_fld_Topic_MaxHotNumber' WHERE VariableName = 'Topic_VotesToHot';
+
+UPDATE ConfigurationAdmin SET DisplayOrder = '10.01', GroupDisplayOrder = 1 WHERE VariableName = 'Topic_SortField';
+UPDATE ConfigurationAdmin SET DisplayOrder = '10.01', GroupDisplayOrder = 2 WHERE VariableName = 'Topic_SortOrder';
+UPDATE ConfigurationAdmin SET DisplayOrder = '10.02', GroupDisplayOrder = 1 WHERE VariableName = 'Topic_SortField2';
+UPDATE ConfigurationAdmin SET DisplayOrder = '10.02', GroupDisplayOrder = 2 WHERE VariableName = 'Topic_SortOrder2';
+UPDATE ConfigurationAdmin SET DisplayOrder = '10.03' WHERE VariableName = 'Perpage_Topics';
+UPDATE ConfigurationAdmin SET DisplayOrder = '10.04' WHERE VariableName = 'Perpage_Topics_Short';
+UPDATE ConfigurationAdmin SET DisplayOrder = '10.05' WHERE VariableName = 'Topic_NewDays';
+UPDATE ConfigurationAdmin SET DisplayOrder = '10.06' WHERE VariableName = 'Topic_MinPopRating';
+UPDATE ConfigurationAdmin SET DisplayOrder = '10.07' WHERE VariableName = 'Topic_MinPopVotes';
+UPDATE ConfigurationAdmin SET DisplayOrder = '10.08' WHERE VariableName = 'Topic_MaxHotNumber';
+UPDATE ConfigurationAdmin SET DisplayOrder = '10.09' WHERE VariableName = 'Topic_EditorPicksAbove';
+UPDATE ConfigurationAdmin SET DisplayOrder = '10.10', GroupDisplayOrder = 1 WHERE VariableName = 'topic_ReviewDelay_Value';
+UPDATE ConfigurationAdmin SET DisplayOrder = '10.10', GroupDisplayOrder = 2 WHERE VariableName = 'topic_ReviewDelay_Interval';
+UPDATE ConfigurationAdmin SET DisplayOrder = '10.11', GroupDisplayOrder = 1 WHERE VariableName = 'topic_RatingDelay_Value';
+UPDATE ConfigurationAdmin SET DisplayOrder = '10.11', GroupDisplayOrder = 2 WHERE VariableName = 'topic_RatingDelay_Interval';
+UPDATE ConfigurationAdmin SET DisplayOrder = '10.12' WHERE VariableName = 'AutoTopicLockPosts';
+UPDATE ConfigurationAdmin SET DisplayOrder = '20.01' WHERE VariableName = 'Perpage_Postings';
+UPDATE ConfigurationAdmin SET DisplayOrder = '20.02' WHERE VariableName = 'Posts_NewDays';
+UPDATE ConfigurationAdmin SET DisplayOrder = '30.01' WHERE VariableName = 'Perpage_TopicReviews';
+UPDATE ConfigurationAdmin SET DisplayOrder = '40.01' WHERE VariableName = 'bb_CategoryTemplate';
+UPDATE ConfigurationAdmin SET DisplayOrder = '40.02' WHERE VariableName = 'bb_ItemTemplate';
+
+UPDATE ConfigurationValues SET VariableName = 'Topic_MinPopVotes' WHERE VariableName = 'Topic_MinVotes';
+UPDATE ConfigurationValues SET VariableName = 'Topic_MinPopRating' WHERE VariableName = 'Topic_PostsToPop';
+UPDATE ConfigurationValues SET VariableName = 'Topic_MaxHotNumber' WHERE VariableName = 'Topic_VotesToHot';
+
+ALTER TABLE Topic CHANGE Status Status TINYINT(4) UNSIGNED NOT NULL DEFAULT '2';
+
+INSERT INTO CustomField (Type, FieldName, FieldLabel, Heading, Prompt, ElementType, ValueList, DisplayOrder, OnGeneralTab, IsSystem) VALUES (1, 'bb_ItemTemplate', 'bb_ItemTemplate', 'la_title_SystemCF', 'bb_ItemTemplate', 'text', NULL, 0, 0, 1);
+
+UPDATE Modules SET Version = '1.2.1' WHERE Name = 'In-Bulletin';
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.2.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.2.0.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.2.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.2.0.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.2.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.2.0.sql (revision 12744)
@@ -0,0 +1,26 @@
+ALTER TABLE TopicCustomData ADD INDEX (ResourceId);
+UPDATE ItemTypes SET ClassName = '' WHERE ItemType = 30;
+
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:inbulletin_general.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:inbulletin_general.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_output.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_output.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_search.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_search.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_email.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_email.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.delete', 11, 1, 1, 0);
+
+UPDATE ConfigurationAdmin SET ValueList = 'TopicText=la_Topic_Text,Posts=la_Number_of_Posts,CreatedOn=la_CreatedOn,LastPostDate=la_LastUpdate,Views=la_Topic_Views,CachedRating=la_Rating,LastPoser=la_Poster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) ' WHERE VariableName IN ('Topic_SortField', 'Topic_SortField2');
+
+UPDATE Modules SET Version = '1.2.0' WHERE Name = 'In-Bulletin';
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.2.2/in-bulletin/units/topics/topics_tag_processor.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.2.2/in-bulletin/units/topics/topics_tag_processor.php (revision 0)
+++ branches/unlabeled/unlabeled-1.2.2/in-bulletin/units/topics/topics_tag_processor.php (revision 12744)
@@ -0,0 +1,27 @@
+ItemLink($params, 'topic');
+ }
+
+ function PostingLink($params)
+ {
+ $item_id = getArrayValue($params, 'posting_id');
+ if (!$item_id) {
+ $item_id = $this->Application->GetVar($this->Prefix.'_post_id');
+ }
+ $params[$this->Prefix.'_post_id'] = $item_id;
+ return $this->TopicLink($params);
+ }
+
+ function PostingDeleteLink($params)
+ {
+ $params['Action'] = 'bb_post_delete';
+ return $this->PostingLink($params);
+ }
+ }
+
+?>
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.6.2/in-bulletin/admin/include/navmenu.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.6.2/in-bulletin/admin/include/navmenu.php (revision 0)
+++ branches/unlabeled/unlabeled-1.6.2/in-bulletin/admin/include/navmenu.php (revision 12744)
@@ -0,0 +1,132 @@
+AddSection("in-bulletin:edittopic_general","la_tab_General", "la_title_Edit_Topic","in-bulletin/admin/",
+ "javascript:edit_submit('topic','TopicEditStatus','in-bulletin/admin/addtopic.php',0);",
+ $admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_navigate.gif",
+ NULL,NULL, NULL, "in-bulletin:edittopic_category",-1);
+
+$objSections->AddSection("in-bulletin:edittopic_category","la_tab_Categories", "la_title_Edit_Topic","in-bulletin/admin/",
+ "javascript:edit_submit('topic','TopicEditStatus','in-bulletin/admin/addtopic_category.php',0);",
+ $admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_navigate.gif",
+ NULL,NULL, "in-bulletin:edittopic_general", "in-bulletin:edittopic_relations",-1);
+
+$objSections->AddSection("in-bulletin:edittopic_relations", "la_tab_Relations","la_title_Edit_Topic","in-bulletin/admin/",
+ "javascript:edit_submit('topic','TopicEditStatus','in-bulletin/admin/addtopic_relations.php',0);",
+ $admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_navigate.gif",
+ NULL, NULL, 'in-bulletin:edittopic_category', "in-bulletin:edittopic_images",-1);
+
+$objSections->AddSection("in-bulletin:edittopic_images","la_tab_Images","la_title_Edit_Topic","in-bulletin/admin/",
+ "javascript:edit_submit('topic','TopicEditStatus','in-bulletin/admin/addtopic_images.php',0);",
+ $admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_navigate.gif",
+ NULL,NULL, "in-bulletin:edittopic_relations","in-bulletin:edittopic_reviews",-1);
+
+$objSections->AddSection("in-bulletin:edittopic_reviews","la_tab_Reviews","la_title_Edit_Topic", "in-bulletin/admin/",
+ "javascript:edit_submit('topic','TopicEditStatus','in-bulletin/admin/addtopic_reviews.php',0);",
+ $admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_navigate.gif",
+ NULL,NULL,'in-bulletin:edittopic_images',"in-bulletin:edittopic_custom",-1);
+
+$objSections->AddSection("in-bulletin:edittopic_custom","la_tab_Custom","la_title_Edit_Topic","in-bulletin/admin/",
+ "javascript:edit_submit('topic','TopicEditStatus','in-bulletin/admin/addtopic_custom.php',0);",
+ $admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_navigate.gif",
+ NULL,NULL,"in-bulletin:edittopic_reviews", NULL,-1);
+
+/* topic edit subitems */
+
+$objSections->AddSection("in-bulletin:edittopic_image","la_tab_Images","la_title_Edit_Topic","in-bulletin/admin/",
+ "javascript:edit_submit('topic','TopicEditStatus','in-bulletin/admin/addimage.php',0);",
+ $admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_navigate.gif",
+ NULL, NULL, NULL,NULL,-1);
+
+$objSections->AddSection("in-bulletin:edittopic_relation","la_tab_Relations","la_title_Edit_Topic","in-bulletin/admin/",
+ "javascript:edit_submit('topic','TopicEditStatus','in-bulletin/admin/addrelation.php',0);",
+ $admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_navigate.gif",
+ NULL, NULL, NULL,NULL,-1);
+
+$objSections->AddSection("in-bulletin:edittopic_review","la_tab_Reviews","la_title_Edit_Topic","in-bulletin/admin/",
+ "javascript:edit_submit('topic','TopicEditStatus','in-bulletin/admin/addreview.php',0);",
+ $admin."/icons/icon46_catalog.gif", $admin."/icons/icon24_navigate.gif",
+ NULL, NULL, NULL,NULL,-1);
+
+/* Tree Items */
+
+// Load In-News module to get it's version
+$mod = $objModules->GetModule("In-Bulletin");
+$ModVersion = $mod ? $mod->Get('Version') : '';
+
+$objSections->AddSection("in-bulletin","la_title_In-Bulletin","la_title_In-Bulletin",$admin."/","subitems.php",
+ "in-bulletin/admin/images/icon46_settings_in-bulletin.gif","in-bulletin/admin/images/icon24_settings_in-bulletin.gif",
+ NULL,"in-portal:modules",NULL,NULL,0,"",1,
+ NULL,NULL,NULL,"in-bulletin/admin/images/icon46_list_settings_in-bulletin.gif","la_Text_Version"," $ModVersion");
+
+$objSections->AddSection("in-bulletin:inbulletin_general", "la_tab_GeneralSettings","la_tab_General",
+ "in-bulletin/admin/","config_general.php",
+ $admin."/icons/icon46_settings_general.gif",$admin."/icons/icon24_settings_general.gif",
+ NULL,"in-bulletin", NULL,"in-bulletin:configuration_output",0,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_list_settings_general.gif","la_updating_config");
+
+$objSections->AddSection("in-bulletin:configuration_output", "la_tab_ConfigOutput","la_tab_ConfigOutput",
+ $admin.'/index4.php?section=in-bulletin:configuration_output&module=In-Bulletin','kernel4:config/config_universal',
+ $admin."/icons/icon46_settings_output.gif",$admin."/icons/icon24_settings_output.gif",
+ NULL, "in-bulletin","in-bulletin:inbulletin_general", "in-bulletin:configuration_search",0,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_list_settings_output.gif","la_updating_config");
+
+$objSections->AddSection("in-bulletin:configuration_search", "la_tab_ConfigSearch", "la_tab_ConfigSearch",
+ $admin.'/index4.php?module=In-Bulletin§ion=in-bulletin:configuration_search&module_key=topics',
+ 'kernel4:config/config_search',
+ $admin."/icons/icon46_settings_search.gif",$admin."/icons/icon24_settings_search.gif",
+ NULL, "in-bulletin", "in-bulletin:configuration_output","in-bulletin:configuration_censorship",0,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_list_settings_search.gif","la_updating_config");
+
+$objSections->AddSection("in-bulletin:configuration_censorship","la_tab_ConfigCensorship","la_tab_ConfigCensorship",
+ "in-bulletin/admin/","censor_config.php",
+ $admin."/icons/icon46_settings_censor.gif",$admin."/icons/icon24_settings_censor.gif",
+ NULL,"in-bulletin", "in-bulletin:configuration_search","in-bulletin:configuration_emoticon",0,"",1,
+ NULL,NULL,NULL,"in-bulletin/admin/images/icon46_list_settings_censor.gif","la_updating_config");
+
+$objSections->AddSection("in-bulletin:configuration_emoticon","la_tab_ConfigSmileys","la_tab_ConfigSmileys",
+ "in-bulletin/admin/","emoticon_config.php",
+ $admin."/icons/icon46_settings_smiley.gif",$admin."/icons/icon24_settings_smiley.gif",
+ NULL, "in-bulletin", "in-bulletin:configuration_censorship","in-bulletin:configuration_email",0,"",1,
+ NULL,NULL,NULL,"in-bulletin/admin/images/icon46_list_settings_smiley.gif","la_updating_config");
+
+$objSections->AddSection("in-bulletin:configuration_email", "la_tab_ConfigE-mail","la_tab_ConfigE-mail",$admin."/config/",
+ "module_email.php?&module=In-Bulletin§ion=in-bulletin:configuration_email&lpn=1",
+ $admin."/icons/icon46_settings_email.gif",$admin."/icons/icon24_settings_email.gif",
+ NULL,"in-bulletin","in-bulletin:configuration_emoticon","in-bulletin:configuration_custom",0,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_list_settings_email.gif","la_updating_config");
+
+$objSections->AddSection("in-bulletin:configuration_custom","la_tab_ConfigCustom","la_tab_ConfigCustom", $admin.'/index4.php',
+ "kernel4:custom_fields/custom_fields_list:cf----3-",
+ $admin."/icons/icon46_settings_custom.gif",$admin."/icons/icon24_settings_custom.gif",
+ NULL,"in-bulletin", "in-bulletin:configuration_email", NULL,0,"",1,
+ NULL,NULL,NULL,$admin."/icons/icon46_list_settings_custom.gif","la_updating_config");
+
+$objSections->SimpleSection('in-bulletin','in-bulletin:phpbb','la_tab_PhpbbImport','la_title_Help','in-bulletin/admin/import/',
+ 'phpbb_import.php',null,null,null,null);
+
+
+
+$name = admin_language("lu_btn_NewTopic");
+
+/*$NewButtons[] = array(
+ "ImagePath" => $rootURL."in-bulletin/admin/images/",
+ "Action" => "new_topic",
+ "Alt" => $name,
+ "Tab" => "topics");
+*/
+
+?>
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/relations_edit.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/relations_edit.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/relations_edit.txt (revision 12744)
@@ -0,0 +1,7 @@
+
+ Relation ID – this is a read-only field, the internal system ID of the relation, guaranteed to be unique throughout the system. It is blank when a new relation is created.
+ Item – this is a read-only field, displaying the name of the item that you are creating a relation to, and its type. In the current version, topics can be related to categories, links (if In-link is installed) and articles (if In-newz is installed).
+ Type – this field designated the type of the relation. A ‘reciprocal' type denotes a two-way relation, and ‘one way' – a one directional relation, from the topic to the item.
+ Enabled – this field is the status flag of the relation.
+ Priority – this field is the numerical priority of the relation.
+
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/config_list_general.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/config_list_general.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/config_list_general.txt (revision 12744)
@@ -0,0 +1,2 @@
+This section contains general In-bulletin settings, which are not related to the topics. In the current version, it has only one setting. �Select Module Root Category' allows the administrator to specify the module root category of In-bulletin. Clicking on the folder shortcut button will pop up a category picker.
+The module root category is used in several ways. On the front-end, in the Default theme, the top menu links each module to its module root category. Therefore, the �Forums' menu item will open this category and its contents. In the Administrative Console, this setting provides a faster way to navigate in the module, as it presets the category for module-specific actions.
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/images_edit.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/images_edit.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/images_edit.txt (revision 12744)
@@ -0,0 +1,14 @@
+This tab contains all images associated with the topic. To create a new image, click on the �New' button (the icon like the Windows GIF icon with a little sun). This will open a new page where you specify the image details.
+
+ Image ID � a read-only field, the internal system ID of the image, guaranteed to be unique throughout the system. It is blank when a new image is created.
+ Name � this field contains the image name, used on the front-end, in side the In-tags to refer to this image.
+ Alt Value � this field contains the text value, which will be displayed in the �alt' tag of the image on the front end, in side the page HTML code, and when a mouse pointer hovers over the image (in Internet Explorer).
+ Status � this field contains the status of the image, enabled or disabled.
+ Primary � this flag designates the primary image. There can be only one primary image per list (for one topic). When you check this box on an image, the previous primary image is unset (if there is more than one image in the list).
+ Priority � this field contains the numerical priority of the image.
+ Thumbnail location (upload from PC) � Using this control, you can upload an image from the workstation you are at to the In-portal server. The image will be stored in the �in-portal/kernel/images' directory.
+ Thumbnail location (remote URL) � Here you can enter a remote URL address of an image. It will be linked from the remote server.
+ Same As Thumbnail � This check box sets the full-size image to be the same as the thumbnail image. When this option is checked, you cannot upload a full-size image.
+ Thumbnail location (upload from PC) - Using this control, you can upload an image from the workstation you are at to the In-portal server. The image will be stored in the �in-portal/kernel/images' directory.
+ Thumbnail location (remote URL) - Here you can enter a remote URL address of an image. It will be linked to from the remote server.
+
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/topics_reviews.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/topics_reviews.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/topics_reviews.txt (revision 12744)
@@ -0,0 +1,12 @@
+This tab lists all reviews of the topic, and allows the administrator to manage them. Reviews are user responses to the topic, they are similar to posts and in some instances they are redundant. However, they can be used to collect feedback from the front-end users, to provide details of the ratings, and for a few other purposes.
+Reviews have their own status, independent from the topic. They can be active, pending or disabled. The idea is very similar to the topic status � only active reviews are displayed on the post listing page, or wherever specified in the theme design. The category permissions specify the status of a new review created on the front-end.
+
+ Enable HTML? � this check box enables or disables HTML code in the review body. When checked, it will render the HTML (for example, a <B> tag will actually make the text bold). When unchecked, it will display the HTML as regular text (the <B> tag will appear exactly as �<B>'). This is a very important setting, since some HTML tags can break the page layout, and in some instances can be a security concern (the Java Script, for example).
+ Review ID -this field is a read-only unique system ID of the review.
+ Created by* - this field contains the name of the user who submitted the review. This information will be displayed, along with the text of the review and the date, on the front-end, unless specified otherwise in the active theme. The administrator may change the review author by entering a different user name in this field, or by selecting it through a user picker (shortcut to a user icon will pop up the picker in a new window).
+ Review Text* - this field contains the main body of the review. To use the online HTML editor, click on the �Editor' button next to this field.
+ Status - this is the status field of the review.
+ Priority � this field contains the numerical priority of the review.
+ Created on � this field contains the creation date of the review. It is automatically set by the system when the review is submitted, however it can be changed by the administrator. The date can be entered directly into the field, or by using the visual calendar tool.
+ Created at - this field contains the creation time of the review. It is automatically set by the system when the review is submitted, however it can be changed by the administrator.
+
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/topics_edit.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/topics_edit.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/topics_edit.txt (revision 12744)
@@ -0,0 +1,21 @@
+This tab contains the main attributes of the topic.
+
+ Enable HTML? - this check box enables or disables HTML code in the topic name. It does not affect the posts in this topic. When checked, it will render the HTML (for example, a <B> tag will actually make the text bold). When unchecked, it will display the HTML as regular text (the <B> tag will appear exactly as �<B>'). This is a very important setting, since some HTML tags can break the page layout, and in some instances can be a security concern (the Java Script, for example).
+ Topic ID � this read-only field displays the unique internal system ID of the topic.
+ Name * - this field contains the topic name, or subject.
+ Posted by* - this field contains the name of the user who started the topic by posting the first message in it. This information will be displayed on the first post of the topic on the front-end, unless specified otherwise in the active theme. The administrator may change the topic author, by entering a different user name or by selecting it through a user pop up (shortcut to a user icon).
+ Topic Locked � this field toggles the topic lock attribute. When a topic is locked, it is not possible to make new posts in it.
+ Status � this field contains the topic status.
+ New � this field controls how the topic �new' status is calculated by In-bulletin.
+ Hot � this field controls how the topic�s �hot� status is calculated by In-bulletin. In automatic mode, In-bulletin will consider as �hot� the X number of topics with the most views. X is defined under the In-bulletin Output options.
+ Popularity � this field controls how the topic�s �pop� status is calculated by In-bulletin. In automatic mode, In-bulletin will consider those topics as �popular�, which have at least X number of votes and have a rating above the predefined threshold. The number of votes and rating threshold are defined in the Output options section.
+ Editor's Pick � this flags sets the Editor's Pick attribute of the topic. This is very similar to the �sticky' feature of other bulletin boards.
+ Priority - this field contains the numeric topic priority.
+ Created on * - this field contains the creation date of the topic. It is automatically set by the system when the topic is created, however it can be changed by the administrator. The date can be entered directly into the field, or by using the visual calendar tool.
+ Created at - this field contains the creation time of the topic. It is automatically set by the system when the first post is submitted, however it can be changed by the administrator.
+ Modified on * - this field contains the modification date of the topic. It is automatically set by the system when the topic is changed, or any posts in it have changed, however it can be changed by the administrator. The date can be entered directly into the field, or by using the visual calendar tool.
+ Modified at - this field contains the modification time of the topic. It is automatically set by the system when the topic is changed, or any posts in it have changed, however it can be changed by the administrator.
+ Rating � this field contains the numeric rating of the topic. The rating is calculated as the average value of all ratings selected by users for this topic. The range of the value is predefined, and displayed to the right as a hint. The administrator can manually change the rating if necessary.
+ Votes � this field contains the number of votes for the topic. Each time a user votes (selects rating) for the topic on the front-end, this value is incremented by one. This value is important for the rating calculating, it is used in the formula to calculate the average. The administrator can manually change the number of votes if necessary.
+ Views � this field contains the number of topic's views. This value is incremented each time a user views the topic. The administrator can manually change the number of views if necessary.
+
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/custom_fields_list.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/custom_fields_list.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/custom_fields_list.txt (revision 12744)
@@ -0,0 +1,12 @@
+
+This section allows the administrator to manage the topic custom fields. The topic custom fields are useful when you need to store additional information about the topics. For example, the topics may have such custom fields, as the language of the topic, the safe audience rating, etc. All custom fields will be automatically used in the Administrative Console, in the Topic Management section. You will need to edit the theme templates for them to appear on the front-end.
+
+ Field Id � this is a read-only field displaying the unique system ID of the custom field.
+ Field Name � sets the internal name of the custom field. This is the name you would use to refer to the custom field in the In-tags when designing templates.
+ Field Label � this is a read-only field, which displays the language variable name associated with the label of that field, and the value of the variable in the current language (after the colon). The label is used on the front end, and in the Administrative Console, to describe the field to the user who is entering information into it.
+ Show on the general tab � this setting controls whether the custom field will be also displayed on the General tab in the Administrative Console, when editing the topics. It is a short cut for frequently used custom fields. All settings below apply only when this is checked.
+ Heading � this field contains the language variable of the section heading, under which the field appear on the general tab.
+ Field Prompt � this field contains the language variable, which text will appear as the hint bind the field.
+ Input Type � this drop down allows the administrator to designate the type of the information stored in the custom field, by specifying the HTML control to be used on the General form.
+ List of Values � this field contains all choices for the above HTML controls of type �radio button' or �drop down'. The choices must be in the format: �value1 = language variabe1, value2=language variable2�. For example, to create a drop down with three choices (One, Two, Three) and their respective numerical values, this field would contain the following: �1=la_one,2=la_two,3=la_three).
+
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/topics_categories.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/topics_categories.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/topics_categories.txt (revision 12744)
@@ -0,0 +1,3 @@
+
+This tab manages the categories of the topic. The list shows all categories to which this topic belongs. The administrator can add and remove additional categories on this list. At least one category must be listed, and exactly one category must be designated as the primary. The primary category determines the permissions for the topic. To designate the primary category of the topic, select the category and click on the Primary Category icon in the toolbar. The �primary' marker will move from the previous Primary Category to the one you have selected.
+The topic will appear in all of the categories it belongs to, in the Administrative Console as well as on the front-end.
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/config_list_output.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/config_list_output.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/config_list_output.txt (revision 12744)
@@ -0,0 +1,17 @@
+This section allows the administrator to specify the default values for various topic and post settings in In-bulletin.
+
+ Sort topics by � this setting specifies the default primary sort order for the topic listings. It applies both on the front-end, and in the Administrative Console � in the catalog. The first dropdown allows to select the field (an attribute of the topic), and the second dropdown � the direction of the sort.
+ And then by � this setting specifies the default secondary sort order. It is set in the same way as the primary, and used when the primary order values are ambiguous. For example, when the primary sort value is �Topic Name', the secondary order will be used to sort among topics with the same name (subject).
+ Number of topics per page � specifies the default number of topics shown per page. This value applies both to the front-end and to the Administrative Console. In the latter, this value can be changed for each session through the View menu.
+ Topics Per Page (Shortlist) � this setting is similar to the � Number of topics per page', but it applies to the front-end short topic lists only. It can be overridden by setting the tag attributes in the appropriate templates.
+ New Topics (Days) � this setting specifies the number of days, from the date of creation, during which the topic will be automatically marked �New' by the system. This setting will only apply to the topics with the �New' flag set to �Automatic'.
+ Minimum rating for a topic to be POP� this setting specifies the minimum rating of a topic for it to be automatically marked �Popular� by the system. This setting will only apply to the topics with the �Popularity� flag set to �Automatic�. Note, that for an article to be �popular� it will need to meet the �minimum votes� requirement set below.
+ Maximum number of HOT topics � this setting specifies the maximum number �hot� topics in the database. A �hot� topic is the one that has more views than the other topics. For example, if this option is set to �2�, the In-portal system will pick the two topics with the most views and mark them as hot. (Of course, this will change real-time as the topics� view counters are updated, or as this setting changes). Please note, if more than one topic has the maximum number of views, the system will still enforce the maximum number requirement; therefore, there may be situations when a topic with the most views is not marked as �hot�.
+ Minimum number of votes to consider a topic to be popular � this setting specifies the minimum number of votes required for the topic rating to be effective. Usually, when only a small number of users have voted on a topic, its rating will not be statistically accurate - it is likely, that only biased users have voted. When a larger number of users vote, the rating becomes more accurate. This setting affects the �popularity� property of a topic � topics with less than required number of votes will not be considered �popular�, even if their rating is high enough.
+ Display editor picks above regular topics � this setting will force all topics, marked as �Editor's pick' to be displayed above the other topics, regardless of their priority or sort order. This is very similar to the �sticky' feature of other bulletin boards. Among themselves, �Editor's pick' articles will be sorted according to the regular rules.
+ Allow Duplicate Reviews � this setting specifies the period during which the same user cannot submit another review on the same topic. The time can be entered in seconds, minutes, hours, days, months or years. If it is set to zero, the users can submit reviews without this limitation. Please note, that regardless of this setting, the same user will be able to submit a review on another topic immediately after the first review.
+ Allow Duplicate Rating Votes - this setting specifies the period during which the same user cannot rate the same topic again. The time can be entered in seconds, minutes, hours, days, months or years. If it is set to zero, the users can rate topics without this limitation. Please note, that regardless of this setting, the same user will be able to rate another topic immediately after the first rating.
+ Posts to lock � this setting specifies how many posts in a single topic will it take to automatically lock that topic. If it is set to zero, the topics will never be locked automatically.
+ Number of posts per page - specifies the number of posts shown per page inside a topic. This value applies only to the front-end.
+ New posts (days) - this setting specifies the number of days, from the date of posting, during which the topic will be automatically marked as having new posts in it.
+
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/topics_relations.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/topics_relations.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/topics_relations.txt (revision 12744)
@@ -0,0 +1,9 @@
+
+This tab contains a list of all relations of this topic. To create a new relation, click the �New' button (two opposite green arrows with a little sun). This will pop up an item picker, where you can choose one category or item of any module that supports relations.
+
+ Relation ID � this is a read-only field, the internal system ID of the relation, guaranteed to be unique throughout the system. It is blank when a new relation is created.
+ Item � this is a read-only field, displaying the name of the item that you are creating a relation to, and its type. In the current version, topics can be related to categories, links (if In-link is installed) and articles (if In-newz is installed).
+ Type � this field designated the type of the relation. A �reciprocal' type denotes a two-way relation, and �one way' � a one directional relation, from the topic to the item.
+ Enabled � this field is the status flag of the relation.
+ Priority � this field is the numerical priority of the relation.
+
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/email_settings_list.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/email_settings_list.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/email_settings_list.txt (revision 12744)
@@ -0,0 +1,2 @@
+
+This section lists all possible In-bulletin events. Each event has a description, a type � �User' or �Admin', a status � �Enabled', �Front-end Only', and a �From/To User'. The description hints about when the event occurs. The type indicates whether the email notification will be sent to the front-end user, or the administrator. The status �Enabled' signifies that the email notifications for this event are enabled for both the front-end and the Administrative Console. The Front-end Only' status means that the notifications will be sent only when the event occurs on the front end. The �Disabled' status means no notifications will be sent when this event occurs. The �From/To User' field specifies the �From' email for front-end user notifications, and the �To' email for the administrative notifications. The other, matching pair of addresses (�To' for the front, and �From' for the admin) is automatically determined by the system based on who initiated the event. The event notification status can be changed by clicking on the toolbar buttons � �Enable' to enable the notification, �Disable' to disable it, and �Front Only' (icon with a monitor) to set to �Front-end Only' status.
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/topics_images.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/topics_images.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/topics_images.txt (revision 12744)
@@ -0,0 +1,14 @@
+This tab contains all images associated with the topic. To create a new image, click on the �New' button (the icon like the Windows GIF icon with a little sun). This will open a new page where you specify the image details.
+
+ Image ID � a read-only field, the internal system ID of the image, guaranteed to be unique throughout the system. It is blank when a new image is created.
+ Name � this field contains the image name, used on the front-end, in side the In-tags to refer to this image.
+ Alt Value � this field contains the text value, which will be displayed in the �alt' tag of the image on the front end, in side the page HTML code, and when a mouse pointer hovers over the image (in Internet Explorer).
+ Status � this field contains the status of the image, enabled or disabled.
+ Primary � this flag designates the primary image. There can be only one primary image per list (for one topic). When you check this box on an image, the previous primary image is unset (if there is more than one image in the list).
+ Priority � this field contains the numerical priority of the image.
+ Thumbnail location (upload from PC) � Using this control, you can upload an image from the workstation you are at to the In-portal server. The image will be stored in the �in-portal/kernel/images' directory.
+ Thumbnail location (remote URL) � Here you can enter a remote URL address of an image. It will be linked from the remote server.
+ Same As Thumbnail � This check box sets the full-size image to be the same as the thumbnail image. When this option is checked, you cannot upload a full-size image.
+ Thumbnail location (upload from PC) - Using this control, you can upload an image from the workstation you are at to the In-portal server. The image will be stored in the �in-portal/kernel/images' directory.
+ Thumbnail location (remote URL) - Here you can enter a remote URL address of an image. It will be linked to from the remote server.
+
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/reviews_edit.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/reviews_edit.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/reviews_edit.txt (revision 12744)
@@ -0,0 +1,12 @@
+This tab lists all reviews of the topic, and allows the administrator to manage them. Reviews are user responses to the topic, they are similar to posts and in some instances they are redundant. However, they can be used to collect feedback from the front-end users, to provide details of the ratings, and for a few other purposes.
+Reviews have their own status, independent from the topic. They can be active, pending or disabled. The idea is very similar to the topic status � only active reviews are displayed on the post listing page, or wherever specified in the theme design. The category permissions specify the status of a new review created on the front-end.
+
+ Enable HTML? � this check box enables or disables HTML code in the review body. When checked, it will render the HTML (for example, a <B> tag will actually make the text bold). When unchecked, it will display the HTML as regular text (the <B> tag will appear exactly as �<B>'). This is a very important setting, since some HTML tags can break the page layout, and in some instances can be a security concern (the Java Script, for example).
+ Review ID -this field is a read-only unique system ID of the review.
+ Created by* - this field contains the name of the user who submitted the review. This information will be displayed, along with the text of the review and the date, on the front-end, unless specified otherwise in the active theme. The administrator may change the review author by entering a different user name in this field, or by selecting it through a user picker (shortcut to a user icon will pop up the picker in a new window).
+ Review Text* - this field contains the main body of the review. To use the online HTML editor, click on the �Editor' button next to this field.
+ Status - this is the status field of the review.
+ Priority � this field contains the numerical priority of the review.
+ Created on � this field contains the creation date of the review. It is automatically set by the system when the review is submitted, however it can be changed by the administrator. The date can be entered directly into the field, or by using the visual calendar tool.
+ Created at - this field contains the creation time of the review. It is automatically set by the system when the review is submitted, however it can be changed by the administrator.
+
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/topics_custom.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/topics_custom.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/module_help/topics_custom.txt (revision 12744)
@@ -0,0 +1 @@
+This tab displays all custom fields configured in In-bulletin, and allows the administrator to edit their information for this topic.
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.2.2.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.2.2.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.2.2.sql (revision 12744)
@@ -0,0 +1 @@
+UPDATE Modules SET Version = '1.2.2' WHERE Name = 'In-Bulletin';
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_1_2_2.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_1_2_2.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_1_2_2.txt (revision 12744)
@@ -0,0 +1,5 @@
+Readme notes for In-bulletin 1.2.2
+Intechnic Corporation, Nov 10, 2006
+
+
+This release is a maintenance release. Please refer to the release notes for In-portal Platform 1.3.1 for more information.
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v4.1.0.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v4.1.0.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v4.1.0.sql (revision 12744)
@@ -0,0 +1,6 @@
+ALTER TABLE Topic CHANGE TodayDate TodayDate DATE NULL DEFAULT NULL, CHANGE AutomaticFilename AutomaticFilename TINYINT(3) UNSIGNED NOT NULL DEFAULT '1', CHANGE OwnerId OwnerId INT(11) NOT NULL DEFAULT '-1', CHANGE TopicType TopicType INT(11) NOT NULL DEFAULT '1', CHANGE LastPostDate LastPostDate INT(11) NULL DEFAULT NULL, CHANGE CachedRating CachedRating VARCHAR(10) NOT NULL DEFAULT '0', CHANGE OrgId OrgId INT(11) NULL DEFAULT NULL;
+ALTER TABLE Topic DROP Filename;
+
+UPDATE Topic SET TodayDate = NULL WHERE TodayDate = '0000-00-00';
+
+UPDATE Modules SET Version = '4.1.0' WHERE Name = 'In-Bulletin';
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.3.0.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.3.0.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.3.0.sql (revision 12744)
@@ -0,0 +1,3 @@
+UPDATE ItemReview SET Module = 'In-Bulletin' WHERE ItemId IN (SELECT ResourceId FROM Topic);
+
+UPDATE Modules SET Version = '1.3.0' WHERE Name = 'In-Bulletin';
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.2.1.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.2.1.php (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.2.1.php (revision 12744)
@@ -0,0 +1,20 @@
+Conn->Query($query);
+
+ moveItemTemplatesToCustom('In-Bulletin', 'bb');
+?>
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_1_2_1.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_1_2_1.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_1_2_1.txt (revision 12744)
@@ -0,0 +1,61 @@
+File in-bulletin/in-bulletin/parser.php changed
+File in-bulletin/in-bulletin/topic.php changed
+File in-bulletin/in-bulletin/admin/install.php changed
+File in-bulletin/in-bulletin/admin/images/tool_new_topic.gif is removed; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin/images/tool_new_topic_f2.gif is removed; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin/images/tool_new_topic_f3.gif is removed; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin/include/help/configuration_custom.txt is removed; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin/include/help/configuration_email.txt is removed; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin/include/help/edittopic_category.txt is removed; release_1_2_0 revision 1.2
+File in-bulletin/in-bulletin/admin/include/help/edittopic_custom.txt is removed; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin/include/help/edittopic_general.txt is removed; release_1_2_0 revision 1.2
+File in-bulletin/in-bulletin/admin/include/help/edittopic_image.txt is removed; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin/include/help/edittopic_images.txt is removed; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin/include/help/edittopic_relations.txt is removed; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin/include/help/edittopic_review.txt is removed; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin/include/help/edittopic_reviews.txt is removed; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin/include/help/inbulletin_general.txt is removed; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin/install/inportal_data.sql changed
+File in-bulletin/in-bulletin/admin/install/inportal_schema.sql changed
+File in-bulletin/in-bulletin/admin/install/langpacks/english.lang changed
+File in-bulletin/in-bulletin/admin/install/upgrades/changelog_1_2_1.txt is new; release_1_2_1 revision 1.1.2.6
+File in-bulletin/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.2.1.php is new; release_1_2_1 revision 1.1.2.1
+File in-bulletin/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.2.1.sql is new; release_1_2_1 revision 1.2.2.1
+File in-bulletin/in-bulletin/admin/install/upgrades/readme_1_2_1.txt is new; release_1_2_1 revision 1.1.2.1
+File in-bulletin/in-bulletin/admin_templates/catalog_tab.tpl is new; release_1_2_1 revision 1.4.2.5
+File in-bulletin/in-bulletin/admin_templates/category_properties.tpl is new; release_1_2_1 revision 1.1.2.1
+File in-bulletin/in-bulletin/admin_templates/img/icons/icon46_topics.gif is new; release_1_2_1 revision 1.1.2.1
+File in-bulletin/in-bulletin/admin_templates/img/itemicons/icon16_topic.gif is new; release_1_2_1 revision 1.2
+File in-bulletin/in-bulletin/admin_templates/img/itemicons/icon16_topic_disabled.gif is new; release_1_2_1 revision 1.2
+File in-bulletin/in-bulletin/admin_templates/img/itemicons/icon16_topic_hot.gif is new; release_1_2_1 revision 1.2
+File in-bulletin/in-bulletin/admin_templates/img/itemicons/icon16_topic_new.gif is new; release_1_2_1 revision 1.2
+File in-bulletin/in-bulletin/admin_templates/img/itemicons/icon16_topic_pick.gif is new; release_1_2_1 revision 1.2
+File in-bulletin/in-bulletin/admin_templates/img/itemicons/icon16_topic_pop.gif is new; release_1_2_1 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/toolbar/tool_new_topic.gif is new; release_1_2_1 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/toolbar/tool_new_topic_f2.gif is new; release_1_2_1 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/toolbar/tool_new_topic_f3.gif is new; release_1_2_1 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/topics/images_edit.tpl is new; release_1_2_1 revision 1.1.2.3
+File in-bulletin/in-bulletin/admin_templates/topics/relations_edit.tpl is new; release_1_2_1 revision 1.1.2.4
+File in-bulletin/in-bulletin/admin_templates/topics/review_edit.tpl is new; release_1_2_1 revision 1.1.2.3
+File in-bulletin/in-bulletin/admin_templates/topics/topics_categories.tpl is new; release_1_2_1 revision 1.1.2.6
+File in-bulletin/in-bulletin/admin_templates/topics/topics_custom.tpl is new; release_1_2_1 revision 1.1.2.4
+File in-bulletin/in-bulletin/admin_templates/topics/topics_edit.tpl is new; release_1_2_1 revision 1.1.2.4
+File in-bulletin/in-bulletin/admin_templates/topics/topics_images.tpl is new; release_1_2_1 revision 1.1.2.3
+File in-bulletin/in-bulletin/admin_templates/topics/topics_relations.tpl is new; release_1_2_1 revision 1.1.2.6
+File in-bulletin/in-bulletin/admin_templates/topics/topics_reviews.tpl is new; release_1_2_1 revision 1.1.2.3
+File in-bulletin/in-bulletin/admin_templates/topics/topics_tabs.tpl is new; release_1_2_1 revision 1.1.2.1
+File in-bulletin/in-bulletin/module_help/config_list_general.txt is new; release_1_2_1 revision 1.1.2.1
+File in-bulletin/in-bulletin/module_help/custom_fields_list.txt is new; release_1_2_1 revision 1.1.2.1
+File in-bulletin/in-bulletin/module_help/email_settings_list.txt is new; release_1_2_1 revision 1.1.2.1
+File in-bulletin/in-bulletin/module_help/images_edit.txt is new; release_1_2_1 revision 1.1.2.1
+File in-bulletin/in-bulletin/module_help/relations_edit.txt is new; release_1_2_1 revision 1.1.2.1
+File in-bulletin/in-bulletin/module_help/reviews_edit.txt is new; release_1_2_1 revision 1.1.2.1
+File in-bulletin/in-bulletin/module_help/topics_categories.txt is new; release_1_2_1 revision 1.1.2.1
+File in-bulletin/in-bulletin/module_help/topics_custom.txt is new; release_1_2_1 revision 1.1.2.1
+File in-bulletin/in-bulletin/module_help/topics_edit.txt is new; release_1_2_1 revision 1.1.2.1
+File in-bulletin/in-bulletin/module_help/topics_images.txt is new; release_1_2_1 revision 1.1.2.1
+File in-bulletin/in-bulletin/module_help/topics_relations.txt is new; release_1_2_1 revision 1.1.2.1
+File in-bulletin/in-bulletin/module_help/topics_reviews.txt is new; release_1_2_1 revision 1.1.2.1
+File in-bulletin/in-bulletin/units/topics/topics_config.php changed
+File in-bulletin/in-bulletin/units/topics/topics_event_handler.php changed
+File in-bulletin/themes/default/inbulletin/post_list/post_element.tpl changed
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_4_1_0.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_4_1_0.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_4_1_0.txt (revision 12744)
@@ -0,0 +1,12 @@
+File in-bulletin/in-bulletin/frontaction.php changed
+File in-bulletin/in-bulletin/privatemessage.php changed
+File in-bulletin/in-bulletin/topic.php changed
+File in-bulletin/in-bulletin/admin/install/inportal_data.sql changed
+File in-bulletin/in-bulletin/admin/install/inportal_schema.sql changed
+File in-bulletin/in-bulletin/admin/install/upgrades/changelog_4_0_1.txt changed
+File in-bulletin/in-bulletin/admin/install/upgrades/changelog_4_1_0.txt is new; release_4_1_0 revision 1.1.2.6
+File in-bulletin/in-bulletin/admin/install/upgrades/inportal_upgrade_v4.1.0.sql is new; release_4_1_0 revision 1.1.2.1
+File in-bulletin/in-bulletin/admin/install/upgrades/readme_4_1_0.txt is new; release_4_1_0 revision 1.1.2.4
+File in-bulletin/in-bulletin/admin/templates/post_element.tpl changed
+File in-bulletin/in-bulletin/units/topics/topics_config.php changed
+File in-bulletin/in-bulletin/units/topics/topics_event_handler.php changed
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_1_2_0.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_1_2_0.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_1_2_0.txt (revision 12744)
@@ -0,0 +1,8 @@
+Readme notes for In-bulletin 1.2.0
+Intechnic Corporation, July 4, 2006
+
+This release is necessary to support the new features introduced in In-portal Platform 1.2.0 (such as Section Permissions in the Administrative Console).
+Please refer to the release notes for In-portal Platform 1.2.0 for more information.
+
+Bug fixes:
+ - The ability to send private messages has been disabled for Guest users
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_1_3_0.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_1_3_0.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_1_3_0.txt (revision 12744)
@@ -0,0 +1,5 @@
+Readme notes for In-bulletin 1.3.0
+Intechnic Corporation, Feb 23, 2007
+
+
+This release is a maintenance release. Please refer to the release notes for In-portal Platform 1.4.0 for more information.
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_1_2_0.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_1_2_0.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_1_2_0.txt (revision 12744)
@@ -0,0 +1,45 @@
+File in-bulletin/in-bulletin/action.php changed
+File in-bulletin/in-bulletin/frontaction.php changed
+File in-bulletin/in-bulletin/parser.php changed
+File in-bulletin/in-bulletin/admin/addcensor_word.php changed
+File in-bulletin/in-bulletin/admin/addemoticon.php changed
+File in-bulletin/in-bulletin/admin/addimage.php changed
+File in-bulletin/in-bulletin/admin/addreview.php changed
+File in-bulletin/in-bulletin/admin/advanced_view.php changed
+File in-bulletin/in-bulletin/admin/censor_config.php changed
+File in-bulletin/in-bulletin/admin/config_general.php is removed; release_1_1_6 revision 1.6
+File in-bulletin/in-bulletin/admin/emoticon_config.php changed
+File in-bulletin/in-bulletin/admin/install.php changed
+File in-bulletin/in-bulletin/admin/images/icon24_settings_in-bulletin.gif is removed; release_1_1_6 revision 1.1
+File in-bulletin/in-bulletin/admin/images/icon46_list_settings_censor.gif is removed; release_1_1_6 revision 1.1
+File in-bulletin/in-bulletin/admin/images/icon46_list_settings_in-bulletin.gif is removed; release_1_1_6 revision 1.1
+File in-bulletin/in-bulletin/admin/images/icon46_list_settings_smiley.gif is removed; release_1_1_6 revision 1.1
+File in-bulletin/in-bulletin/admin/images/icon46_settings_in-bulletin.gif is removed; release_1_1_6 revision 1.1
+File in-bulletin/in-bulletin/admin/include/toolbar/advanced_view.php changed
+File in-bulletin/in-bulletin/admin/install/inportal_data.sql changed
+File in-bulletin/in-bulletin/admin/install/inportal_schema.sql changed
+File in-bulletin/in-bulletin/admin/install/langpacks/english.lang changed
+File in-bulletin/in-bulletin/admin/install/upgrades/changelog_1_2_0.txt is new; release_1_2_0 revision 1.1.2.9
+File in-bulletin/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.2.0.sql is new; release_1_2_0 revision 1.2.2.2
+File in-bulletin/in-bulletin/admin/install/upgrades/readme_1_2_0.txt is new; release_1_2_0 revision 1.1.2.3
+File in-bulletin/in-bulletin/admin_templates/img/icons/icon24_settings_censor.gif is new; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/icons/icon24_settings_custom.gif is new; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/icons/icon24_settings_email.gif is new; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/icons/icon24_settings_general.gif is new; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/icons/icon24_settings_in-bulletin.gif is new; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/icons/icon24_settings_output.gif is new; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/icons/icon24_settings_search.gif is new; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/icons/icon24_settings_smiley.gif is new; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/icons/icon46_list_settings_censor.gif is new; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/icons/icon46_list_settings_custom.gif is new; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/icons/icon46_list_settings_email.gif is new; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/icons/icon46_list_settings_general.gif is new; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/icons/icon46_list_settings_in-bulletin.gif is new; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/icons/icon46_list_settings_output.gif is new; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/icons/icon46_list_settings_search.gif is new; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/icons/icon46_list_settings_smiley.gif is new; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/icons/icon46_settings_in-bulletin.gif is new; release_1_2_0 revision 1.1
+File in-bulletin/in-bulletin/admin_templates/img/itemicons/icon16_topic_pending.gif is new; release_1_2_0 revision 1.2
+File in-bulletin/in-bulletin/units/topics/topics_config.php changed
+File in-bulletin/in-bulletin/units/topics/topics_event_handler.php changed
+File in-bulletin/themes/default/inbulletin/pm_list/new_pm.tpl changed
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v4.0.1.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v4.0.1.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/inportal_upgrade_v4.0.1.sql (revision 12744)
@@ -0,0 +1 @@
+UPDATE Modules SET Version = '4.0.1' WHERE Name = 'In-Bulletin';
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_1_1_6.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_1_1_6.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_1_1_6.txt (revision 12744)
@@ -0,0 +1,5 @@
+Readme notes for In-bulletin 1.1.6
+Intechnic Corporation, May 4, 2006
+
+This is a maintenance release to support new features introduced in In-portal Platform 1.1.8 such as Category and Item Templates and custom field mechanism refactoring.
+Please refer to the release notes for In-portal Platform 1.1.8
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_4_1_0.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_4_1_0.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_4_1_0.txt (revision 12744)
@@ -0,0 +1,11 @@
+Readme notes for In-bulletin 4.1.0
+Intechnic Corporation, May 23, 2007
+
+Fixes:
+
+- Listing of Private Messages
+
+
+****** MySQL 5 database server is fully supported starting with this release ******
+
+Please refer to the release notes for In-portal Platform 4.1.0 for more information.
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_1_2_2.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_1_2_2.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_1_2_2.txt (revision 12744)
@@ -0,0 +1,7 @@
+File in-bulletin/in-bulletin/admin/install/inportal_data.sql changed
+File in-bulletin/in-bulletin/admin/install/upgrades/changelog_1_2_2.txt is new; release_1_2_2 revision 1.1.2.4
+File in-bulletin/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.2.2.sql is new; release_1_2_2 revision 1.1.2.1
+File in-bulletin/in-bulletin/admin/install/upgrades/readme_1_2_2.txt is new; release_1_2_2 revision 1.1.2.1
+File in-bulletin/in-bulletin/admin_templates/catalog_tab.tpl changed
+File in-bulletin/in-bulletin/units/topics/topics_config.php changed
+File in-bulletin/in-bulletin/units/topics/topics_tag_processor.php changed
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_4_0_1.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_4_0_1.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_4_0_1.txt (revision 12744)
@@ -0,0 +1,6 @@
+Readme notes for In-bulletin 4.0.1
+Intechnic Corporation, Apr 5, 2007
+
+
+This is a maintenance release of In-bulletin.
+Please refer to the release notes for In-portal Platform 4.0.1 for more information.
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_1_1_6.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_1_1_6.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_1_1_6.txt (revision 12744)
@@ -0,0 +1,61 @@
+File in-bulletin/in-bulletin/action.php changed
+File in-bulletin/in-bulletin/frontaction.php changed
+File in-bulletin/in-bulletin/parser.php changed
+File in-bulletin/in-bulletin/topic.php changed
+File in-bulletin/in-bulletin/admin/addtopic.php changed
+File in-bulletin/in-bulletin/admin/addtopic_custom.php changed
+File in-bulletin/in-bulletin/admin/install.php changed
+File in-bulletin/in-bulletin/admin/import/phpbb_import.php changed
+File in-bulletin/in-bulletin/admin/include/navmenu.php changed
+File in-bulletin/in-bulletin/admin/include/help/configuration_output.txt is removed; release_1_1_5 revision 1.2
+File in-bulletin/in-bulletin/admin/include/help/configuration_search.txt is removed; release_1_1_5 revision 1.1
+File in-bulletin/in-bulletin/admin/install/inportal_data.sql changed
+File in-bulletin/in-bulletin/admin/install/inportal_schema.sql changed
+File in-bulletin/in-bulletin/admin/install/upgrades/changelog_1_1_6.txt is new; release_1_1_6 revision 1.1.2.8
+File in-bulletin/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.1.6.php is new; release_1_1_6 revision 1.2
+File in-bulletin/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.1.6.sql is new; release_1_1_6 revision 1.2.2.2
+File in-bulletin/in-bulletin/admin/install/upgrades/readme_1_1_6.txt is new; release_1_1_6 revision 1.1.2.2
+File in-bulletin/in-bulletin/admin_templates/img/logo_bg.gif is new; release_1_1_6 revision 1.1.2.1
+File in-bulletin/in-bulletin/module_help/config_list_output.txt is new; release_1_1_6 revision 1.1.2.1
+File in-bulletin/in-bulletin/module_help/config_list_search.txt is new; release_1_1_6 revision 1.1
+File in-bulletin/in-bulletin/units/topics/topics_config.php changed
+File in-bulletin/in-bulletin/units/topics/topics_event_handler.php changed
+File in-bulletin/themes/default/inbulletin/edit_topic.tpl changed
+File in-bulletin/themes/default/inbulletin/favorites_element.tpl changed
+File in-bulletin/themes/default/inbulletin/get_rated.tpl changed
+File in-bulletin/themes/default/inbulletin/index.tpl changed
+File in-bulletin/themes/default/inbulletin/main.tpl changed
+File in-bulletin/themes/default/inbulletin/myitems_element.tpl changed
+File in-bulletin/themes/default/inbulletin/new_topic.tpl changed
+File in-bulletin/themes/default/inbulletin/post_edit.tpl changed
+File in-bulletin/themes/default/inbulletin/post_list.tpl changed
+File in-bulletin/themes/default/inbulletin/post_list_threaded.tpl changed
+File in-bulletin/themes/default/inbulletin/post_reply_quote.tpl changed
+File in-bulletin/themes/default/inbulletin/rate.tpl changed
+File in-bulletin/themes/default/inbulletin/topic_list.tpl changed
+File in-bulletin/themes/default/inbulletin/topic_reply.tpl changed
+File in-bulletin/themes/default/inbulletin/browse/catbrowse_element.tpl changed
+File in-bulletin/themes/default/inbulletin/edit_topic/edit_topic_confirm_pending.tpl changed
+File in-bulletin/themes/default/inbulletin/edit_topic/edit_topic_form.tpl changed
+File in-bulletin/themes/default/inbulletin/index/sitemap_cat_element.tpl changed
+File in-bulletin/themes/default/inbulletin/index/sitemap_subcat_element.tpl changed
+File in-bulletin/themes/default/inbulletin/index/catview/cat_tree_element.tpl changed
+File in-bulletin/themes/default/inbulletin/index/catview/cat_tree_element_first.tpl changed
+File in-bulletin/themes/default/inbulletin/main/favorites_element.tpl changed
+File in-bulletin/themes/default/inbulletin/main/main_element.tpl changed
+File in-bulletin/themes/default/inbulletin/main/main_element_last.tpl changed
+File in-bulletin/themes/default/inbulletin/main/edpick/topic_element.tpl changed
+File in-bulletin/themes/default/inbulletin/my_items/myitems_element.tpl changed
+File in-bulletin/themes/default/inbulletin/new_topic/new_topic_confirm.tpl changed
+File in-bulletin/themes/default/inbulletin/new_topic/new_topic_confirm_pending.tpl changed
+File in-bulletin/themes/default/inbulletin/pick/topic_element.tpl changed
+File in-bulletin/themes/default/inbulletin/post_edit/post_edit_form.tpl changed
+File in-bulletin/themes/default/inbulletin/post_reply/post_reply_form.tpl changed
+File in-bulletin/themes/default/inbulletin/quicklinks/edpick/topic_element.tpl changed
+File in-bulletin/themes/default/inbulletin/quicklinks/new/links_element.tpl changed
+File in-bulletin/themes/default/inbulletin/rate/getting_rated.tpl changed
+File in-bulletin/themes/default/inbulletin/rate/rate_form.tpl changed
+File in-bulletin/themes/default/inbulletin/search_results/search_results_element.tpl changed
+File in-bulletin/themes/default/inbulletin/topic_list/topics/element.tpl changed
+File in-bulletin/themes/default/inbulletin/topic_list/topics/element_last.tpl changed
+File in-bulletin/themes/default/inbulletin/topic_reply/topic_reply_form.tpl changed
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_4_0_1.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_4_0_1.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_4_0_1.txt (revision 12744)
@@ -0,0 +1,5 @@
+File in-bulletin/in-bulletin/admin/install/inportal_data.sql changed
+File in-bulletin/in-bulletin/admin/install/upgrades/changelog_1_3_0.txt changed
+File in-bulletin/in-bulletin/admin/install/upgrades/changelog_4_0_1.txt is new; release_4_0_1 revision 1.1.2.11
+File in-bulletin/in-bulletin/admin/install/upgrades/inportal_upgrade_v4.0.1.sql is new; release_4_0_1 revision 1.1.2.1
+File in-bulletin/in-bulletin/admin/install/upgrades/readme_4_0_1.txt is new; release_4_0_1 revision 1.1.2.1
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_1_1_5.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_1_1_5.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_1_1_5.txt (revision 12744)
@@ -0,0 +1,4 @@
+Readme notes for In-bulletin 1.1.5
+Intechnic Corporation, April 4, 2006
+
+Please refer to release notes for In-portal Platform 1.1.7.
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_1_1_5.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_1_1_5.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_1_1_5.txt (revision 12744)
@@ -0,0 +1,16 @@
+File in-bulletin/in-bulletin/action.php changed
+File in-bulletin/in-bulletin/frontaction.php changed
+File in-bulletin/in-bulletin/module_init.php changed
+File in-bulletin/in-bulletin/parser.php changed
+File in-bulletin/in-bulletin/posting.php changed
+File in-bulletin/in-bulletin/topic.php changed
+File in-bulletin/in-bulletin/admin/addreview.php changed
+File in-bulletin/in-bulletin/admin/include/toolbar/edittopic_reviews.php changed
+File in-bulletin/in-bulletin/admin/install/inportal_data.sql changed
+File in-bulletin/in-bulletin/admin/install/langpacks/english.lang changed
+File in-bulletin/in-bulletin/admin/install/upgrades/changelog_1_1_5.txt is new; release_1_1_5 revision 1.1.2.9
+File in-bulletin/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.1.5.sql is new; release_1_1_5 revision 1.1
+File in-bulletin/in-bulletin/admin/install/upgrades/readme_1_1_5.txt is new; release_1_1_5 revision 1.1.2.1
+File in-bulletin/in-bulletin/units/topics/topics_config.php changed
+File in-bulletin/in-bulletin/units/topics/topics_event_handler.php changed
+File in-bulletin/in-bulletin/units/topics/topics_tag_processor.php is new; release_1_1_5 revision 1.2
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_1_2_1.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_1_2_1.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/readme_1_2_1.txt (revision 12744)
@@ -0,0 +1,5 @@
+Readme notes for In-bulletin 1.2.1
+Intechnic Corporation, July 25, 2006
+
+This release is necessary to support the new features introduced in In-portal Platform 1.2.1 (such as Section Permissions in the Administrative Console).
+Please refer to the release notes for In-portal Platform 1.2.1 for more information.
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_1_3_0.txt
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_1_3_0.txt (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin/install/upgrades/changelog_1_3_0.txt (revision 12744)
@@ -0,0 +1,11 @@
+File in-bulletin/in-bulletin/admin/install/inportal_data.sql changed
+File in-bulletin/in-bulletin/admin/install/upgrades/changelog_1_3_0.txt is new; release_1_3_0 revision 1.1.2.15
+File in-bulletin/in-bulletin/admin/install/upgrades/inportal_upgrade_v1.3.0.sql is new; release_1_3_0 revision 1.1.2.2
+File in-bulletin/in-bulletin/admin/install/upgrades/readme_1_3_0.txt is new; release_1_3_0 revision 1.1.2.1
+File in-bulletin/in-bulletin/admin_templates/catalog_tab.tpl changed
+File in-bulletin/in-bulletin/admin_templates/topics/images_edit.tpl changed
+File in-bulletin/in-bulletin/admin_templates/topics/relations_edit.tpl changed
+File in-bulletin/in-bulletin/admin_templates/topics/topics_custom.tpl changed
+File in-bulletin/in-bulletin/admin_templates/topics/topics_edit.tpl changed
+File in-bulletin/in-bulletin/admin_templates/topics/topics_images.tpl changed
+File in-bulletin/in-bulletin/units/topics/topics_config.php changed
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/relations_edit.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/relations_edit.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/relations_edit.tpl (revision 12744)
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_reviews.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_reviews.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_reviews.tpl (revision 12744)
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ " id=" ">
+ img/itemicons/ ">
+
+
+
+
+
+
+
+
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_images.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_images.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_images.tpl (revision 12744)
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_relations.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_relations.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_relations.tpl (revision 12744)
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ">
+ ">
+
+
+
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_categories.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_categories.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_categories.tpl (revision 12744)
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ " id=" ">
+ ">
+
+
+
+
+
+
+
+
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/images_edit.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/images_edit.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/images_edit.tpl (revision 12744)
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_tabs.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_tabs.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_tabs.tpl (revision 12744)
@@ -0,0 +1,17 @@
+
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_custom.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_custom.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_custom.tpl (revision 12744)
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/review_edit.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/review_edit.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/review_edit.tpl (revision 12744)
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_edit.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_edit.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/topics/topics_edit.tpl (revision 12744)
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ " />
+
+
+
+
+
+
+
+
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/category_properties.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/category_properties.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/category_properties.tpl (revision 12744)
@@ -0,0 +1,2 @@
+
+
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/img/logo_bg.gif
===================================================================
diff -u
Binary files differ
Index: branches/unlabeled/unlabeled-1.1.2/in-bulletin/admin_templates/img/icons/icon46_topics.gif
===================================================================
diff -u
Binary files differ
Index: branches/unlabeled/unlabeled-1.2.44/in-bulletin/admin/include/toolbar/edittopic_reviews.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.2.44/in-bulletin/admin/include/toolbar/edittopic_reviews.php (revision 0)
+++ branches/unlabeled/unlabeled-1.2.44/in-bulletin/admin/include/toolbar/edittopic_reviews.php (revision 12744)
@@ -0,0 +1,219 @@
+Get("TopicRev_View");
+
+if(!is_numeric($RevView))
+{
+ $RevView = $Rev_AllValue;
+}
+else
+{
+ $StatusList = array();
+
+ if($RevView & $Bit_Disabled)
+ $StatusList[] = 0;
+
+ if($RevView & $Bit_Enabled)
+ $StatusList[] = 1;
+
+ if($RevView & $Bit_Pending)
+ $StatusList[] = 2;
+
+ if(count($StatusList))
+ {
+ $status = " r.Status IN (".implode(",",$StatusList).") ";
+ }
+ else
+ $status = " r.Status = -1 ";
+
+ $RevFilter = $status;
+}
+
+$Perpage_Reviews = (int)$objConfig->Get("Perpage_Reviews");
+if(!$Perpage_Reviews)
+ $PerPage_Reviews = 20;
+
+$SortOrder = $objConfig->Get("TopicReview_LV_Sortorder");
+if(!strlen($SortOrder))
+ $SortOrder = "desc";
+
+$SortField = $objConfig->Get("TopicReview_LV_Sortfield");
+if(!strlen($SortField))
+ $SortField = "DatePosted";
+
+$lang_ReviewText = language("la_prompt_ReviewText");
+$lang_Reviewer = language("la_Prompt_ReviewedBy");
+$lang_Reviews = language("la_Text_Reviews");
+
+print<<
+
+
+
+END;
+?>
Index: branches/unlabeled/unlabeled-1.32.2/in-bulletin/units/topics/topics_config.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.32.2/in-bulletin/units/topics/topics_config.php (revision 0)
+++ branches/unlabeled/unlabeled-1.32.2/in-bulletin/units/topics/topics_config.php (revision 12744)
@@ -0,0 +1,308 @@
+ 'bb',
+ 'ItemClass' => Array('class' => 'kCatDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kCatDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'TopicsEventHandler', 'file' => 'topics_event_handler.php', 'require_classes' => Array('kCatDBEventHandler'), 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'TopicsTagProcessor', 'file' => 'topics_tag_processor.php', 'require_classes' => Array('kCatDBTagProcessor'), 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+ 'QueryString' => Array(
+ 1 => 'id', // topic id
+ 2 => 'post_id', // post id
+ 3 => 'Page', // topic page
+ 4 => 'Post_Page', // posts page
+ 5 => 'pm_Page', // private message page
+ 6 => 'pm_id', // private message id
+ 7 => 'Reviews_Page',
+ 8 => 'event',
+ 9 => 'mode',
+ ),
+
+ 'CatalogItem' => true,
+ 'AdminTemplatePath' => 'topics',
+ 'AdminTemplatePrefix' => 'topics_',
+ 'IDField' => 'TopicId',
+ 'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events
+
+ 'TitleField' => 'TopicText', // field, used in bluebar when editing existing item
+ 'TitlePhrase' => 'la_Text_Topic', // phrase used to specify item type in relationship list
+
+ 'TitlePresets' => Array(
+ 'default' => Array( 'new_status_labels' => Array('bb' => '!la_title_AddingTopic!'),
+ 'edit_status_labels' => Array('bb' => '!la_title_EditingTopic!'),
+ 'new_titlefield' => Array('bb' => '!la_title_NewTopic!'),
+ ),
+
+ 'topics_edit' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_General!"),
+ 'topics_categories' => Array('prefixes' => Array('bb','bb-ci_List'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Categories!"),
+ 'topics_relations' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Relations!"),
+ 'topics_images' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Images!"),
+ 'topics_reviews' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Reviews!"),
+ 'topics_custom' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Custom!"),
+
+ 'images_edit' => Array( 'prefixes' => Array('bb', 'bb-img'),
+ 'new_status_labels' => Array('bb-img'=>'!la_title_Adding_Image!'),
+ 'edit_status_labels' => Array('bb-img'=>'!la_title_Editing_Image!'),
+ 'new_titlefield' => Array('bb-img'=>'!la_title_New_Image!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-img_status# '#bb-img_titlefield#'",
+ ),
+
+ 'reviews_edit' => Array( 'prefixes' => Array('bb', 'bb-rev'),
+ 'new_status_labels' => Array('bb-rev'=>"!la_title_Adding_Review! '!la_title_New_Review!'"),
+ 'edit_status_labels' => Array('bb-rev'=>'!la_title_Editing_Review!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-rev_status#",
+ ),
+
+ 'relations_edit' => Array( 'prefixes' => Array('bb', 'bb-rel'),
+ 'new_status_labels' => Array('bb-rel'=>"!la_title_Adding_Relationship! '!la_title_New_Relationship!'"),
+ 'edit_status_labels' => Array('bb-rel'=>'!la_title_Editing_Relationship!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-rel_status#",
+ ),
+
+ 'tree_in-bulletin' => Array('format' => '!la_Text_Version! '.$this->Application->findModule('Name', 'In-Bulletin', 'Version')),
+ ),
+
+ 'PermItemPrefix' => 'TOPIC',
+
+ 'PermTabText' => 'In-Bulletin',
+ 'PermSection' => Array('main' => 'CATEGORY:in-bulletin:topics_list', 'search' => 'in-bulletin:configuration_search', 'email' => 'in-bulletin:configuration_email', 'custom' => 'in-bulletin:configuration_custom'),
+
+ 'Sections' => Array(
+ 'in-bulletin' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'settings_in-bulletin',
+ 'label' => 'la_title_In-Bulletin',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 3.3,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:inbulletin_general' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_general',
+ 'label' => 'la_tab_GeneralSettings',
+ 'url' => Array('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_output' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_output',
+ 'label' => 'la_tab_ConfigOutput',
+ 'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_search' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_search',
+ 'label' => 'la_tab_ConfigSearch',
+ 'url' => Array('t' => 'config/config_search', 'module_key' => 'topics', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_censorship' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_censor',
+ 'label' => 'la_tab_ConfigCensorship',
+ 'url' => Array('index_file' => '../in-bulletin/admin/censor_config.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_emoticon' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_smiley',
+ 'label' => 'la_tab_ConfigSmileys',
+ 'url' => Array('index_file' => '../in-bulletin/admin/emoticon_config.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_email' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_email',
+ 'label' => 'la_tab_ConfigE-mail',
+ 'url' => Array('t' => 'config/config_email', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 6,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_custom' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_custom',
+ 'label' => 'la_tab_ConfigCustom',
+ 'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 3, 'pass_section' => true, 'pass' => 'm,cf'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 7,
+ 'type' => stTREE,
+ ),
+
+ ),
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_new'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_hot'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_pop'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_pick'), 'type' => WHERE_FILTER),
+ ),
+ 'Filters' => Array(
+ 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
+ 'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ),
+ 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
+ 's1' => Array(),
+ 'show_new' => Array('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ),
+ 'show_hot' => Array('label' => 'la_Text_Hot', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ),
+ 'show_pop' => Array('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ),
+ 'show_pick' => Array('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '%1$s.`EditorsPick` != 1' ),
+ )
+ ),
+
+ 'CatalogSelectorName' => 'topiclist',
+
+ 'ItemPropertyMappings' => Array(
+ 'NewDays' => 'Topic_NewDays', // number of days item to be NEW
+ 'MinPopVotes' => 'Topic_MinPopVotes', // minimum number of votes for an item to be POP
+ 'MinPopRating' => 'Topic_MinPopRating', // minimum rating for an item to be POP
+ 'MaxHotNumber' => 'Topic_MaxHotNumber', // maximum number of HOT items
+
+ 'HotLimit' => 'Topic_HotLimit', // variable name in inp_Cache table
+ 'ClickField' => 'Views', // item click count is stored here (in item table)
+ ),
+
+ 'ItemType' => 3, // this is used when relation to product is added from in-portal and via-versa
+
+ 'ViewMenuPhrase' => 'la_title_Topics',
+
+ 'StatisticsInfo' => Array(
+ 'pending' => Array(
+ 'icon' => 'icon16_topic_pending.gif',
+ 'label' => 'la_Text_Topics',
+ 'js_url' => '#url#',
+ 'url' => Array('t' => 'advanced_view', 'SetTab' => 'bb', 'pass' => 'm,bb.showall', 'bb.showall_event' => 'OnSetFilterPattern', 'bb.showall_filters' => 'show_active=0,show_pending=1,show_disabled=0,show_new=1,show_hot=1,show_pop=1,show_pick=1'),
+ 'status' => STATUS_PENDING,
+ ),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'Topic',
+
+ 'CalculatedFields' => Array(
+ '' => Array (
+ 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.OwnerId = -1, "root", IF (%1$s.OwnerId = -2, "Guest", "n/a")), u.Login)',
+ 'CategoryId' => TABLE_PREFIX.'CategoryItems.CategoryId',
+ 'Filename' => TABLE_PREFIX.'CategoryItems.Filename',
+ ),
+ ),
+
+ 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'CategoryItems ON '.TABLE_PREFIX.'CategoryItems.ItemResourceId = %1$s.ResourceId
+ LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'CategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'PermCache perm ON perm.CategoryId = '.TABLE_PREFIX.'CategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.OwnerId = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'%3$sTopicCustomData cust ON %1$s.ResourceId = cust.ResourceId',
+ ), // key - special, value - list select sql
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('EditorsPick' => 'desc', 'Priority' => 'desc'),
+ 'Sorting' => Array('TopicText' => 'asc'),
+ )
+ ),
+ 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'CategoryItems ON '.TABLE_PREFIX.'CategoryItems.ItemResourceId = %1$s.ResourceId
+ LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'CategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.OwnerId = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'%3$sTopicCustomData cust ON %1$s.ResourceId = cust.ResourceId'),
+
+ 'SubItems' => Array('bb-rev', 'bb-ci', 'bb-rel', 'bb-img', 'bb-cdata'),
+
+ 'Fields' => Array (
+ 'TopicId' => Array(),
+ 'NotifyOwnerOnChanges' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Modified' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'not_null' => 1, 'default' => '#NOW#'),
+ 'TopicText' => Array('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'AutomaticFilename' => Array('type' => 'int', 'not_null' => 1, 'default' => 1),
+ 'Posts' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Views' => Array('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%d', 'not_null' => 1, 'default' => 0),
+ 'EditorsPick' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
+ 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
+ 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => ''),
+ 'OwnerId' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'required' => 1, 'default' => -1),
+ 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => 0),
+ 'ResourceId' => Array('type' => 'int', 'default' => ''),
+ 'TopicType' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_Yes', 1 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1),
+ 'CreatedOn' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#', 'not_null' => 1),
+ 'CachedReviewsQty' => Array('type' => 'int' ,'not_null' => 1, 'default' => 0),
+ 'CachedRating' => Array('type' => 'string', 'default' => ''),
+ 'CachedVotesQty' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'PostedBy' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'OrgId' => Array('type' => 'int', 'default' => 0),
+ 'LastPostId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'LastPostDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => 1, 'default' => ''),
+ 'TodayDate' => Array('type' => 'string', 'not_null' => 1, 'default' => '0000-00-00'),
+ 'TodayPosts' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ ),
+
+ 'VirtualFields' => Array(
+ 'UserName' => Array('type'=>'string', 'default' => ''),
+ 'CategoryId' => Array('type' => 'int', 'default' => 0),
+ 'Filename' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'CachedNavbar' => Array('type' => 'string', 'default' => ''),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array(1 => 'icon16_topic.gif', 2 => 'icon16_topic_pending.gif', 0 => 'icon16_topic_disabled.gif', 'HOT' => 'icon16_topic_hot.gif', 'POP' => 'icon16_topic_pop.gif', 'NEW' => 'icon16_topic_new.gif', 'PICK' => 'icon16_topic_pick.gif'),
+ 'Fields' => Array(
+ 'TopicId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td'),
+ 'TopicText' => Array('title' => 'la_col_TopicText', 'data_block' => 'grid_catitem_td'),
+ 'UserName' => Array('title' => 'la_col_PostedBy'),
+ 'Modified_formatted' => Array('title' => 'la_col_ModifiedDate', 'sort_field' => 'Modified'),
+ 'Posts' => Array('title' => 'la_col_Posts'),
+ 'Views' => Array('title' => 'la_col_Views'),
+ ),
+ ),
+
+ 'Radio' => Array(
+ 'Icons' => Array(1 => 'icon16_topic.gif', 2 => 'icon16_topic_pending.gif', 0 => 'icon16_topic_disabled.gif', 'HOT' => 'icon16_topic_hot.gif', 'POP' => 'icon16_topic_pop.gif', 'NEW' => 'icon16_topic_new.gif', 'PICK' => 'icon16_topic_pick.gif'),
+ 'Fields' => Array(
+ 'TopicId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_radio_td'),
+ 'TopicText' => Array('title' => 'la_col_TopicText', 'data_block' => 'grid_catitem_td'),
+ 'UserName' => Array('title' => 'la_col_PostedBy'),
+ 'Modified_formatted' => Array('title' => 'la_col_ModifiedDate', 'sort_field' => 'Modified'),
+ 'Posts' => Array('title' => 'la_col_Posts'),
+ 'Views' => Array('title' => 'la_col_Views'),
+ ),
+ ),
+ ),
+
+ 'ConfigMapping' => Array(
+ 'PerPage' => 'Perpage_Topics',
+ 'ShortListPerPage' => 'Perpage_Topics_Short',
+ 'DefaultSorting1Field' => 'Topic_SortField',
+ 'DefaultSorting2Field' => 'Topic_SortField2',
+ 'DefaultSorting1Dir' => 'Topic_SortOrder',
+ 'DefaultSorting2Dir' => 'Topic_SortOrder2',
+ ),
+ );
+
+
+?>
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.6.38/in-bulletin/admin/include/toolbar/advanced_view.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.6.38/in-bulletin/admin/include/toolbar/advanced_view.php (revision 0)
+++ branches/unlabeled/unlabeled-1.6.38/in-bulletin/admin/include/toolbar/advanced_view.php (revision 12744)
@@ -0,0 +1,207 @@
+Get("Topic_View");
+
+if(!is_numeric($TopicView))
+{
+ $TopicView = $Topics_AllValue;
+}
+
+$Topic_SortField = $objConfig->Get('Topic_SortField');
+if( !strlen($Topic_SortField) ) $Topic_SortField = 'Priority';
+
+$Topic_SortOrder = $objConfig->Get('Topic_SortOrder');
+if( !strlen($Topic_SortOrder) ) $Topic_SortOrder = 'desc';
+
+$Perpage_Topics = (int)$objConfig->Get("Perpage_Topics");
+if(!$Perpage_Topics)
+ $Perpage_Topics="'all'";
+
+
+if($TopicView == $Topics_AllValue)
+{
+ $Topic_ShowAll = 1;
+}
+else
+ $Topic_ShowAll = 0;
+
+if($Topic_ShowAll)
+{
+ $Topic_Filter = "";
+ $Topic_View=$Topics_AllValue;
+}
+else
+{
+ // FILTERING CODE V. 1.2
+ $where_clauses = Array(); $q = '';
+ //Group #1: Topic statuses (active,pending,disabled)
+ $Status = array(-1);
+ if($TopicView & $Bit_Pending) $Status[] = STATUS_PENDING;
+ if($TopicView & $Bit_Active) $Status[] = STATUS_ACTIVE;
+ if($TopicView & $Bit_Disabled) $Status[] = STATUS_DISABLED;
+ if( count($Status) ) $where_clauses[] = 'Status IN ('.implode(',', $Status).')';
+
+
+ //Group #2: Topic statistics (pick,pop,hot)
+ $Status = array();
+ if(!($TopicView & $Bit_New))
+ {
+ $cutoff = adodb_date("U") - ($objConfig->Get("Topic_NewDays") * 86400);
+ if($cutoff > 0) $q = 'CreatedOn > '.$cutoff;
+ $q .= (!empty($q) ? ' OR ' : '').'NewItem = 1';
+ $Status[] = "NOT ($q)";
+ }
+
+ if(!($TopicView & $Bit_Pop))
+ {
+ $cutoff = $objTopicList->GetPopValue();
+ if($cutoff > 0) $q = 'Posts >= '.$cutoff;
+ $q .= (!empty($q) ? ' OR ' : '').'PopItem = 1';
+ $Status[] = "NOT ($q)";
+ }
+
+ if(!($TopicView & $Bit_Hot))
+ {
+ $cutoff = $objTopicList->GetHotValue();
+ if($cutoff > 0) $q = 'Posts >= '.$cutoff;
+ $q .= (!empty($q) ? ' OR ' : '').'HotItem = 1';
+ $Status[] = "NOT ($q)";
+ }
+
+ if(!($TopicView & $Bit_Ed)) $Status[] = 'NOT (EditorsPick = 1)';
+
+ if( count($Status) )
+ {
+ $where_clauses[] = '('.implode(') AND (', $Status).')';
+ }
+ $TopicFilter = count($where_clauses) ? '('.implode(') AND (', $where_clauses).')' : '';
+}
+
+$list = $objSession->GetVariable("bb_adv_view_search");
+
+$objTopicList->Clear();
+
+$objTopicList->EnablePaging = TRUE;
+
+
+ $OrderBy = $objTopicList->QueryOrderByClause(TRUE,TRUE,TRUE);
+ if(strlen($list)==0)
+ {
+ $objTopicList->LoadTopics($TopicFilter,$OrderBy,false,false,'set_last');
+ $SearchQuery = '';
+ }
+ else
+ {
+ $SearchQuery = $objTopicList->AdminSearchWhereClause($list);
+ if(strlen($SearchQuery))
+ {
+ $SearchQuery = " (".$SearchQuery.")".($TopicFilter ? 'AND ('.$TopicFilter.')' : '');
+ $objTopicList->LoadTopics($SearchQuery,$OrderBy,false,false,'set_last');
+ }
+ else
+ $objTopicList->LoadTopics($TopicFilter,$OrderBy,false,false,'set_last');
+ }
+
+ $CatTotal = TableCount($objTopicList->SourceTable,null,TRUE);
+
+ $caption = admin_language("la_ItemTab_Topics");
+ $ItemTabs->AddTab(admin_language("la_ItemTab_Topics"),"topics",$objTopicList->QueryItemCount, $m_tab_Forum_hide,$CatTotal);
+
+ $TotalItemCount += $objTopicList->QueryItemCount;
+ $Topics_Paste = "false";
+
+ if($objTopicList->ItemsOnClipboard()>0)
+ $Topics_Paste = "true";
+
+$lang_Replies = admin_language("la_Text_Replies");
+$lang_PostedBy = admin_language("la_prompt_PostedBy");
+$lang_Topics = admin_language("la_Text_Topics");
+
+
+
+print <<
+var Topic_SortField = '$Topic_SortField';
+var Topic_SortOrder = '$Topic_SortOrder';
+var Topics_Perpage = $Perpage_Topics;
+var TopicView = $TopicView;
+var TopicText = '$caption';
+var lang_Replies = "$lang_Replies";
+var lang_PostedBy = "$lang_PostedBy";
+var lang_Topics = "$lang_Topics";
+var Topics_Paste = $Topics_Paste;
+
+PasteButton = PasteButton || Topics_Paste;
+
+ \$fw_menus['t_view_menu'] = function()
+ {
+ // filtring menu
+ \$Menus['t_filtring_menu'] = new Menu(lang_View);
+ \$Menus['t_filtring_menu'].addMenuItem(lang_All,"config_val('Topic_View', $Topics_AllValue);",TopicView==$Topics_AllValue);
+ \$Menus['t_filtring_menu'].addMenuItem(lang_None,"config_val('Topic_View', 0);",TopicView==0);
+ \$Menus['t_filtring_menu'].addMenuSeparator();
+ \$Menus['t_filtring_menu'].addMenuItem(lang_Active,"FlipBit('Topic_View',TopicView,6);",BitStatus(TopicView,6));
+ \$Menus['t_filtring_menu'].addMenuItem(lang_Pending,"FlipBit('Topic_View',TopicView,5);", BitStatus(TopicView,5));
+ \$Menus['t_filtring_menu'].addMenuItem(lang_Disabled,"FlipBit('Topic_View',TopicView,4);",BitStatus(TopicView,4));
+ \$Menus['t_filtring_menu'].addMenuSeparator();
+ \$Menus['t_filtring_menu'].addMenuItem(lang_New,"FlipBit('Topic_View',TopicView,3);",BitStatus(TopicView,3));
+ \$Menus['t_filtring_menu'].addMenuItem(lang_Hot,"FlipBit('Topic_View',TopicView,1);",BitStatus(TopicView,1));
+ \$Menus['t_filtring_menu'].addMenuItem(lang_Pop,"FlipBit('Topic_View',TopicView,2);",BitStatus(TopicView,2));
+ \$Menus['t_filtring_menu'].addMenuItem(lang_EdPick,"FlipBit('Topic_View',TopicView,0);",BitStatus(TopicView,0));
+
+ // sorting menu
+ \$Menus['t_sorting_menu'] = new Menu(lang_Sort);
+ \$Menus['t_sorting_menu'].addMenuItem(lang_Asc,"config_val('Topic_SortOrder','asc');",RadioIsSelected(Topic_SortOrder,'asc'));
+ \$Menus['t_sorting_menu'].addMenuItem(lang_Desc,"config_val('Topic_SortOrder','desc');",RadioIsSelected(Topic_SortOrder,'desc'));
+ \$Menus['t_sorting_menu'].addMenuSeparator();
+ \$Menus['t_sorting_menu'].addMenuItem(lang_Default,"config_val('Topic_SortField','Name');","");
+ \$Menus['t_sorting_menu'].addMenuItem(lang_Name,"config_val('Topic_SortField','TopicText');",RadioIsSelected(Topic_SortField,'TopicText'));
+ \$Menus['t_sorting_menu'].addMenuItem(lang_PostedBy,"config_val('Topic_SortField','PostedBy');",RadioIsSelected(Topic_SortField,'PostedBy'));
+ \$Menus['t_sorting_menu'].addMenuItem(lang_CreatedOn,"config_val('Topic_SortField','CreatedOn');",RadioIsSelected(Topic_SortField,'CreatedOn'));
+ \$Menus['t_sorting_menu'].addMenuItem(lang_Replies,"config_val('Topic_SortField','Posts');",RadioIsSelected(Topic_SortField,'Posts'));
+ \$Menus['t_sorting_menu'].addMenuItem(lang_Hits,"config_val('Topic_SortField','Views');",RadioIsSelected(Topic_SortField,'Views'));
+
+ // perpage menu
+ \$Menus['t_perpage_menu'] = new Menu(lang_PerPage);
+ \$Menus['t_perpage_menu'].addMenuItem("10","config_val('Perpage_Topics', '10');",RadioIsSelected(Topics_Perpage,10));
+ \$Menus['t_perpage_menu'].addMenuItem("20","config_val('Perpage_Topics', '20');",RadioIsSelected(Topics_Perpage,20));
+ \$Menus['t_perpage_menu'].addMenuItem("50","config_val('Perpage_Topics', '50');",RadioIsSelected(Topics_Perpage,50));
+ \$Menus['t_perpage_menu'].addMenuItem("100","config_val('Perpage_Topics', '100');",RadioIsSelected(Topics_Perpage,100));
+ \$Menus['t_perpage_menu'].addMenuItem("500","config_val('Perpage_Topics', '500');",RadioIsSelected(Topics_Perpage,500));
+
+ // select menu
+ \$Menus['t_select_menu'] = new Menu(lang_Select);
+ \$Menus['t_select_menu'].addMenuItem(lang_All,"javascript:selectAllC('"+activeTab.id+"');","");
+ \$Menus['t_select_menu'].addMenuItem(lang_Unselect,"javascript:unselectAll('"+activeTab.id+"');","");
+ \$Menus['t_select_menu'].addMenuItem(lang_Invert,"javascript:invert('"+activeTab.id+"');","");
+
+ // view menu
+ \$Menus['t_view_menu'] = new Menu(lang_Topics);
+ \$Menus['t_view_menu'].addMenuItem( \$Menus['t_filtring_menu'] );
+ \$Menus['t_view_menu'].addMenuItem( \$Menus['t_sorting_menu'] );
+ \$Menus['t_view_menu'].addMenuItem( \$Menus['t_perpage_menu'] );
+ \$Menus['t_view_menu'].addMenuItem( \$Menus['t_select_menu'] );
+ }
+
+
+
+END;
+?>
Index: branches/unlabeled/unlabeled-1.38.2/in-bulletin/admin/install/inportal_data.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.38.2/in-bulletin/admin/install/inportal_data.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.38.2/in-bulletin/admin/install/inportal_data.sql (revision 12744)
@@ -0,0 +1,237 @@
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 1,1)
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'TopicText=la_Topic_Text,Posts=la_Number_of_Posts,CreatedOn=la_CreatedOn,LastPostDate=la_LastUpdate,Views=la_Topic_Views,SELECT FieldLabel as OptionName, FieldName as OptionValue FROM CustomField WHERE Type=3 ', 0,1)
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '','TopicText=la_Topic_Text,Posts=la_Number_of_Posts,CreatedOn=la_CreatedOn,CachedRating=la_Rating,Views=la_Topic_Views,LastPoser=la_Poster,SELECT FieldLabel as OptionName, FieldName as OptionValue FROM CustomField WHERE Type=3 ', 2,1)
+INSERT INTO ConfigurationAdmin VALUES ('Topic_NewDays', 'la_Text_Topics', 'la_topic_newdays_prompt', 'text', '', 'asc=la_common_ascending,desc=la_common_descending', 4,1)
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 3,1)
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics', 'la_Text_Topics', 'la_topic_perpage_prompt', 'text', '', '', 3,1)
+INSERT INTO ConfigurationAdmin VALUES ('Topic_PostsToPop', 'la_Text_Topics', 'la_topic_poststopop_prompt', 'text', '', '', 4,1)
+INSERT INTO ConfigurationAdmin VALUES ('Topic_VotesToHot', 'la_Text_Topics', 'la_topic_votestohot_prompt', 'text', '', '', 4,1)
+INSERT INTO ConfigurationAdmin VALUES ('Topic_EditorPicksAbove', 'la_Text_Topics', 'la_topic_editorpicksabove_prompt', 'checkbox', '', '', 5,1)
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Postings', 'la_posts_subheading', 'la_posts_perpage_prompt', 'text', '', '', 6,1)
+INSERT INTO ConfigurationAdmin VALUES ('Posts_NewDays', 'la_posts_subheading', 'la_posts_newdays_prompt', 'text', '', '', 6,1)
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MinVotes', 'la_Text_Topics', 'la_topic_MinVotes_prompt', 'text', '', '', 4,1)
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics_Short', 'la_Text_Topics', 'la_topic_perpage_short_prompt', 'text', '', '', 3,1)
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Value', 'la_Text_Topics', 'la_prompt_DupReviews', 'text', '', '', 14, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Interval', 'la_Text_Topics', 'la_prompt_DupReviews', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 15, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Value', 'la_Text_Topics', 'la_prompt_DupRating', 'text', '', '', 16, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Interval', 'la_Text_Topics', 'la_prompt_DupRating', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 17, 1);
+INSERT INTO ConfigurationAdmin VALUES ('AutoTopicLockPosts', 'la_Text_Topics', 'la_prompt_PostsToLock', 'text', NULL , NULL , '18', '0')
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_TopicReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL , NULL , '5', '1')
+INSERT INTO ConfigurationAdmin VALUES ('bb_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 1, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 1, 0);
+
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_topics', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_topics', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_topics', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_topics', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_topics', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 1);
+
+INSERT INTO ConfigurationValues VALUES ('Perpage_Postings', '25', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES ('Perpage_Topics', '5', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES ('Posting_SortOrder', 'CreatedOn asc, PostingText', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES ('Posts_NewDays', '5', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES ('Bulletin_TopCount', '2', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES ('Bulletin_CatNewDays', '10', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES ('Bulletin_Pick_First', '1', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES ('Topic_SortOrder', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES ('Topic_SortField', 'LastPostDate', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES ('Topic_SortOrder2', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES ('Topic_SortField2', 'Posts', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES ('Topic_NewDays', '6', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES ('Topic_PostsToPop', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES ('Topic_VotesToHot', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES ('Topic_EditorPicksAbove', '1', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES ('Topic_MinVotes', '8', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES ('Topic_Root', '{TopicCatId}', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES ('Post_Sortfield', NULL, 'In-Bulletin', '')
+INSERT INTO ConfigurationValues VALUES ('Post_SortOrder', NULL, 'In-Bulletin', '')
+INSERT INTO ConfigurationValues VALUES ('BBTags', 'b:;i:;u:;ul:type|align;font:color|face|size;url:href;img:src|border', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES ('Post_Background1', '#cccccc', 'In-Portal', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES ('Post_Background2', '#bbbbbb', 'In-Portal', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES ('Topic_Background1', '#FAEBD7', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES ('Topic_Background2', '#F5F5DC', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES ('AutoTopicLockPosts', '0', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES ('bb_CategoryTemplate', 'inbulletin/index', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES ('bb_ItemTemplate', 'inbulletin/post_list', 'In-Bulletin', 'in-bulletin:configuration_output');
+
+INSERT INTO ConfigurationValues VALUES ('Topic_Highlight_OpenTag', '', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES ('Topic_Highlight_CloseTag', ' ', 'In-Bulletin', 'in-bulletin:configuration_output')
+
+INSERT INTO ConfigurationValues VALUES ('Perpage_Topics_Short', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES ('topic_RatingDelay_Interval', '3600', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES ('topic_RatingDelay_Value', '1', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES ('topic_ReviewDelay_Interval', '60', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES ('topic_ReviewDelay_Value', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+
+INSERT INTO ConfigurationValues VALUES ('SearchRel_Increase_topics', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES ('SearchRel_Keyword_topics', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES ('SearchRel_Pop_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES ('SearchRel_Rating_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES ('SearchRel_Increase_posts', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES ('SearchRel_Keyword_posts', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES ('SearchRel_Pop_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES ('SearchRel_Rating_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES ('Search_ShowMultiple_topics', '0', 'In-Bulletin', 'in-bulletin:configuration_search');
+
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_PrivateMessages', 'la_text_PrivateMessages', 'la_text_PrivateMessages_PerPage', 'text', NULL , NULL , '0', '1');
+INSERT INTO ConfigurationValues VALUES ('Perpage_PrivateMessages', '20', 'In-Bulletin', '');
+INSERT INTO ConfigurationValues VALUES ('Perpage_TopicReviews', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (1, 'Happy Smile', 0, ':)', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (2, 'Big Grin', 0, ':grin:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (3, 'Wink', 0, ';)', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (4, 'Scared', 0, ':scared:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (5, 'Teasing', 0, ':eek:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (6, 'Cool', 0, ':cool:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (7, 'Angry', 0, ':@', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (8, 'Squint', 0, ':squint:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (9, 'Oops', 0, ':o', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (10, 'Sad', 0, ':(', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (11, 'Cry', 0, ':cry:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (12, 'Smirk', 0, ';]', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (13, 'Happy sleep', 0, ':sleep:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (14, 'Very angry', 0, ':x', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (15, 'Geek', 0, ':geek:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (16, 'Upset', 0, ';(', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (17, 'LOL', 0, ':lol:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (18, 'Yawn', 0, ':O', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (19, 'Thinking', 0, ':hm:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (20, 'Secret', 0, ':|', 1);
+
+INSERT INTO Events VALUES (1, 'TOPIC.ADD', 2, 0, 'In-Bulletin', 'la_event_topic.add', 1)
+INSERT INTO Events VALUES (2, 'POST.ADD', 2, 0, 'In-Bulletin', 'la_event_post.add', 1)
+INSERT INTO Events VALUES (3, 'POST.MODIFY', 2, 0, 'In-Bulletin', 'la_event_post.modify', 1)
+INSERT INTO Events VALUES (4, 'POST.ADD', 1, 0, 'In-Bulletin', 'la_event_post.add', 0)
+INSERT INTO Events VALUES (66, 'PM.ADD', 1, 0, 'In-Bulletin', 'la_event_pm.add', 0);
+
+INSERT INTO ItemTypes VALUES (3, 'In-Bulletin', 'bb', 'Topic', 'TopicText', 'OwnerId', 'Views', 'CachedRating', 'la_ItemTab_Topics', 1, '', 'clsTopic', 'Topic');
+INSERT INTO ItemTypes VALUES (30, 'In-Bulletin', 'posting', 'Posting', 'Subject', 'CreatedById', NULL, NULL, 'la_ItemTab_Posts', 0, '', 'clsPosting', 'Post');
+
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.VIEW', 'lu_PermName_Topic.View_desc', 'lu_PermName_Topic.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.ADD', 'lu_PermName_Topic.Add_desc', 'lu_PermName_Topic.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.ADD.PENDING', 'lu_PermName_Topic.Add.Pending_desc', 'lu_PermName_Topic.Add.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.DELETE', 'lu_PermName_Topic.Delete_desc', 'lu_PermName_Topic.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.MODIFY', 'lu_PermName_Topic.Modify_desc', 'lu_PermName_Topic.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.DELETE', 'lu_PermName_Topic.Reply.Delete_desc', 'lu_PermName_Topic.Reply.Delete_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.VIEW', 'lu_PermName_Topic.Reply.View_desc', 'lu_PermName_Topic.Reply.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.ADD', 'lu_PermName_Topic.Reply.Add_desc', 'lu_PermName_Topic.Reply.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.MODIFY', 'lu_PermName_Topic.Reply.Modify_desc', 'lu_PermName_Topic.Reply.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.RATE', 'lu_PermName_Topic.Rate_desc', 'lu_PermName_Topic.Rate_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REVIEW', 'lu_PermName_Topic.Review_desc', 'lu_PermName_Topic.Review_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 'lu_PermName_Topic.Reply.Owner.Modify_desc', 'lu_PermName_Topic.Reply.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 'lu_PermName_Topic.Reply.Owner.Delete_desc', 'lu_PermName_Topic.Reply.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.OWNER.DELETE', 'lu_PermName_Topic.Owner.Delete_desc', 'lu_PermName_Topic.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.MODIFY.PENDING', 'lu_PermName_Topic.Modify.Pending_desc', 'lu_PermName_Topic.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.OWNER.MODIFY.PENDING', 'lu_PermName_Topic.Owner.Modify.Pending_desc', 'lu_PermName_Topic.Owner.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.OWNER.MODIFY', 'lu_PermName_Topic.Owner.Modify_desc', 'lu_PermName_Topic.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.LOCK', 'lu_PermName_Topic.Lock_desc', 'lu_PermName_Topic.Lock_error', 'In-Bulletin');
+
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT count(*) FROM <%prefix%>Topic WHERE Status=1', NULL, 'la_prompt_ActiveTopics', 0, 1);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS TotalTopics FROM <%prefix%>Topic', NULL, 'la_prompt_TopicsTotal', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS ActiveTopics FROM <%prefix%>Topic WHERE Status = 1', NULL, 'la_prompt_TopicsActive', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS PendingTopics FROM <%prefix%>Topic WHERE Status = 2', NULL, 'la_prompt_TopicsPending', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS DisabledTopics FROM <%prefix%>Topic WHERE Status = 0', NULL, 'la_prompt_TopicsDisabled', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS NewTopics FROM <%prefix%>Topic WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Topic_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>Topic WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS HotTopics FROM <%prefix%>Topic WHERE (HotItem = 1) OR (Posts >= <%m:config name="Topic_VotesToHot"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS PopularTopics FROM <%prefix%>Topic WHERE (PopItem = 1) OR ( (CachedRating >= <%topic:hit_count type="top"%>) AND <%topic:hit_count type="top"%> AND (PopItem = 2) )', NULL, '(*) la_prompt_PopularTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Topic WHERE CachedRating > 0', NULL, 'la_prompt_TopicAverageRating', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT MAX(Views) AS MaxTopicHits FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicHits', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT MAX(CachedVotesQty) AS MaxTopicVotes FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicVotes', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_TopicReviews', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS TotalPosts FROM <%prefix%>Posting', NULL, 'la_prompt_PostsTotal', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostTime', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostTime', 0, 2);
+
+INSERT INTO SearchConfig VALUES ('Topic', 'NotifyOwnerOnChanges', 0, 1, 'lu_fielddesc_topic_notifyowneronchanges', 'lu_field_notifyowneronchanges', 'In-Bulletin', 'la_text_topic', 1, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicId', 0, 1, 'lu_fielddesc_topic_topicid', 'lu_field_topicid', 'In-Bulletin', 'la_text_topic', 0, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Priority', 0, 1, 'lu_fielddesc_topic_priority', 'lu_field_priority', 'In-Bulletin', 'la_text_topic', 8, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OwnerId', 0, 1, 'lu_fielddesc_topic_ownerid', 'lu_field_ownerid', 'In-Bulletin', 'la_text_topic', 9, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Modified', 0, 1, 'lu_fielddesc_topic_modified', 'lu_field_modified', 'In-Bulletin', 'la_text_topic', 2, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicText', 1, 1, 'lu_fielddesc_topic_topictext', 'lu_field_topictext', 'In-Bulletin', 'la_text_topic', 3, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Posts', 0, 1, 'lu_fielddesc_topic_posts', 'lu_field_posts', 'In-Bulletin', 'la_text_topic', 4, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Views', 0, 1, 'lu_fielddesc_topic_views', 'lu_field_views', 'In-Bulletin', 'la_text_topic', 5, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'EditorsPick', 0, 1, 'lu_fielddesc_topic_editorspick', 'lu_field_editorspick', 'In-Bulletin', 'la_text_topic', 6, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Status', 0, 1, 'lu_fielddesc_topic_status', 'lu_field_status', 'In-Bulletin', 'la_text_topic', 7, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ModifiedById', 0, 1, 'lu_fielddesc_topic_modifiedbyid', 'lu_field_modifiedbyid', 'In-Bulletin', 'la_text_topic', 10, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ResourceId', 0, 1, 'lu_fielddesc_topic_resourceid', 'lu_field_resourceid', 'In-Bulletin', 'la_text_topic', 11, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicType', 0, 1, 'lu_fielddesc_topic_topictype', 'lu_field_topictype', 'In-Bulletin', 'la_text_topic', 12, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CreatedOn', 0, 1, 'lu_fielddesc_topic_createdon', 'lu_field_createdon', 'In-Bulletin', 'la_text_topic', 13, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedReviewsQty', 0, 1, 'lu_fielddesc_topic_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Bulletin', 'la_text_topic', 14, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedRating', 0, 1, 'lu_fielddesc_topic_cachedrating', 'lu_field_cachedrating', 'In-Bulletin', 'la_text_topic', 15, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedVotesQty', 0, 1, 'lu_fielddesc_topic_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Bulletin', 'la_text_topic', 16, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'NewItem', 0, 1, 'lu_fielddesc_topic_newitem', 'lu_field_newitem', 'In-Bulletin', 'la_text_topic', 17, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PopItem', 0, 1, 'lu_fielddesc_topic_popitem', 'lu_field_popitem', 'In-Bulletin', 'la_text_topic', 18, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'HotItem', 0, 1, 'lu_fielddesc_topic_hotitem', 'lu_field_hotitem', 'In-Bulletin', 'la_text_topic', 19, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PostedBy', 0, 1, 'lu_fielddesc_topic_postedby', 'lu_field_postedby', 'In-Bulletin', 'la_text_topic', 20, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OrgId', 0, 1, 'lu_fielddesc_topic_orgid', 'lu_field_orgid', 'In-Bulletin', 'la_text_topic', 21, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'LastPostId', 0, 1, 'lu_fielddesc_topic_lastpostid', 'lu_field_lastpostid', 'In-Bulletin', 'la_text_topic', 22, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY.PENDING', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD.PENDING', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.RATE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REVIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.RATE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REVIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.RATE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REVIEW', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.LOCK', 15, 0, 0, 0);
+
+INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('phpbb', 'In-Bulletin', 'phpbb_import', 'phpBB 2.x', 'phpBB', 'user_regular,init_cat', 1, 'db');
+
+INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('In-Bulletin', 'in-bulletin/', 'bb', '1.1.6', 1, 3, 'inbulletin/', {TopicCatId}, '1054738405');
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.4.2/in-bulletin/admin_templates/catalog_tab.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.4.2/in-bulletin/admin_templates/catalog_tab.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.4.2/in-bulletin/admin_templates/catalog_tab.tpl (revision 12744)
@@ -0,0 +1,48 @@
+
+
+
+ a_toolbar.AddButton( new ToolBarButton('in-bulletin:new_topic', ' ', function() {
+ std_precreate_item(' ', 'in-bulletin/topics/topics_edit');
+ }, true
+ ) );
+
+
+
+
" view_template="in-bulletin/catalog_tab" edit_template="in-bulletin/topics/topics_edit" category_id="-1" dep_buttons="new_topic" class="catalog-tab">
+
+
+
+
+
+
+ $Catalog.setItemCount(' ', ' ');
+ $Catalog.setCurrentCategory(' ', );
+
+
+
+
+ Grids[' '].AddAlternativeGrid(' ', true);
+
+ Grids[' '].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','sep3','cut','copy','move_up','move_down','sep6'));
+ $Catalog.reflectPasteButton( );
+ $Catalog.setViewMenu(' ');
+
+ Grids[' '].RadioMode = true;
+ Grids[' '].DblClick = function() {return false};
+
+ #separator#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.49.2/in-bulletin/admin/install/inportal_data.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.49.2/in-bulletin/admin/install/inportal_data.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.49.2/in-bulletin/admin/install/inportal_data.sql (revision 12744)
@@ -0,0 +1,254 @@
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.01, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'TopicText=la_Topic_Text,Posts=la_Number_of_Posts,CreatedOn=la_CreatedOn,LastPostDate=la_LastUpdate,Views=la_Topic_Views,CachedRating=la_Rating,LastPoser=la_Poster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) ', 10.01, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '', 'TopicText=la_Topic_Text,Posts=la_Number_of_Posts,CreatedOn=la_CreatedOn,LastPostDate=la_LastUpdate,Views=la_Topic_Views,CachedRating=la_Rating,LastPoser=la_Poster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) ', 10.02, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_NewDays', 'la_Text_Topics', 'la_topic_newdays_prompt', 'text', '', 'asc=la_common_ascending,desc=la_common_descending', 10.05, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.02, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics', 'la_Text_Topics', 'la_topic_perpage_prompt', 'text', '', '', 10.03, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MinPopRating', 'la_Text_Topics', 'la_fld_Topic_MinPopRating', 'text', '', '', 10.06, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MaxHotNumber', 'la_Text_Topics', 'la_fld_Topic_MaxHotNumber', 'text', '', '', 10.08, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_EditorPicksAbove', 'la_Text_Topics', 'la_topic_editorpicksabove_prompt', 'checkbox', '', '', 10.09, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Postings', 'la_posts_subheading', 'la_posts_perpage_prompt', 'text', '', '', 20.01, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Posts_NewDays', 'la_posts_subheading', 'la_posts_newdays_prompt', 'text', '', '', 20.02, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MinPopVotes', 'la_Text_Topics', 'la_fld_Topic_MinPopVotes', 'text', '', '', 10.07, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics_Short', 'la_Text_Topics', 'la_topic_perpage_short_prompt', 'text', '', '', 10.04, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Value', 'la_Text_Topics', 'la_prompt_DupReviews', 'text', '', '', 10.1, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Interval', 'la_Text_Topics', 'la_prompt_DupReviews', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.1, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Value', 'la_Text_Topics', 'la_prompt_DupRating', 'text', '', '', 10.11, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Interval', 'la_Text_Topics', 'la_prompt_DupRating', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.11, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('AutoTopicLockPosts', 'la_Text_Topics', 'la_prompt_PostsToLock', 'text', NULL, NULL, 10.12, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_TopicReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL, NULL, 30.01, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('bb_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 40.01, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 40.02, 0, 0);
+
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_topics', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_topics', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_topics', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_topics', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_topics', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_PrivateMessages', 'la_text_PrivateMessages', 'la_text_PrivateMessages_PerPage', 'text', NULL, NULL, 0, 0, 1);
+
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Postings', '25', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Topics', '5', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Posting_SortOrder', 'CreatedOn asc, PostingText', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Posts_NewDays', '5', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Bulletin_TopCount', '2', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Bulletin_CatNewDays', '10', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Bulletin_Pick_First', '1', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortOrder', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortField', 'LastPostDate', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortOrder2', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortField2', 'Posts', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_NewDays', '6', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_MinPopRating', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_MaxHotNumber', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_EditorPicksAbove', '1', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_MinPopVotes', '8', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Root', '{TopicCatId}', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_Sortfield', NULL, 'In-Bulletin', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_SortOrder', NULL, 'In-Bulletin', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'BBTags', 'b:;i:;u:;ul:type|align;font:color|face|size;url:href;img:src|border', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_Background1', '#cccccc', 'In-Portal', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_Background2', '#bbbbbb', 'In-Portal', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Background1', '#FAEBD7', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Background2', '#F5F5DC', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'AutoTopicLockPosts', '0', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'bb_CategoryTemplate', 'inbulletin/index', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'bb_ItemTemplate', 'inbulletin/post_list', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Highlight_OpenTag', '', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Highlight_CloseTag', ' ', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Topics_Short', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_RatingDelay_Interval', '3600', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_RatingDelay_Value', '1', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_ReviewDelay_Interval', '60', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_ReviewDelay_Value', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Increase_topics', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Keyword_topics', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Pop_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Rating_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Increase_posts', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Keyword_posts', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Pop_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Rating_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'Search_ShowMultiple_topics', '0', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_PrivateMessages', '20', 'In-Bulletin', '');
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_TopicReviews', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (1, 'Happy Smile', 0, ':)', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (2, 'Big Grin', 0, ':grin:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (3, 'Wink', 0, ';)', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (4, 'Scared', 0, ':scared:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (5, 'Teasing', 0, ':eek:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (6, 'Cool', 0, ':cool:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (7, 'Angry', 0, ':@', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (8, 'Squint', 0, ':squint:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (9, 'Oops', 0, ':o', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (10, 'Sad', 0, ':(', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (11, 'Cry', 0, ':cry:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (12, 'Smirk', 0, ';]', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (13, 'Happy sleep', 0, ':sleep:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (14, 'Very angry', 0, ':x', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (15, 'Geek', 0, ':geek:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (16, 'Upset', 0, ';(', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (17, 'LOL', 0, ':lol:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (18, 'Yawn', 0, ':O', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (19, 'Thinking', 0, ':hm:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (20, 'Secret', 0, ':|', 1);
+
+INSERT INTO Events VALUES (1, 'TOPIC.ADD', 2, 0, 'In-Bulletin', 'la_event_topic.add', 1)
+INSERT INTO Events VALUES (2, 'POST.ADD', 2, 0, 'In-Bulletin', 'la_event_post.add', 1)
+INSERT INTO Events VALUES (3, 'POST.MODIFY', 2, 0, 'In-Bulletin', 'la_event_post.modify', 1)
+INSERT INTO Events VALUES (4, 'POST.ADD', 1, 0, 'In-Bulletin', 'la_event_post.add', 0)
+INSERT INTO Events VALUES (66, 'PM.ADD', 1, 0, 'In-Bulletin', 'la_event_pm.add', 0);
+
+INSERT INTO ItemTypes VALUES (3, 'In-Bulletin', 'bb', 'Topic', 'TopicText', 'OwnerId', 'Views', 'CachedRating', 'la_ItemTab_Topics', 1, '', 'clsTopic', 'Topic');
+INSERT INTO ItemTypes VALUES (30, 'In-Bulletin', 'posting', 'Posting', 'Subject', 'CreatedById', NULL, NULL, 'la_ItemTab_Posts', 0, '', '', 'Post');
+
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.VIEW', 'lu_PermName_Topic.View_desc', 'lu_PermName_Topic.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.ADD', 'lu_PermName_Topic.Add_desc', 'lu_PermName_Topic.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.ADD.PENDING', 'lu_PermName_Topic.Add.Pending_desc', 'lu_PermName_Topic.Add.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.DELETE', 'lu_PermName_Topic.Delete_desc', 'lu_PermName_Topic.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.MODIFY', 'lu_PermName_Topic.Modify_desc', 'lu_PermName_Topic.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.DELETE', 'lu_PermName_Topic.Reply.Delete_desc', 'lu_PermName_Topic.Reply.Delete_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.VIEW', 'lu_PermName_Topic.Reply.View_desc', 'lu_PermName_Topic.Reply.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.ADD', 'lu_PermName_Topic.Reply.Add_desc', 'lu_PermName_Topic.Reply.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.MODIFY', 'lu_PermName_Topic.Reply.Modify_desc', 'lu_PermName_Topic.Reply.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.RATE', 'lu_PermName_Topic.Rate_desc', 'lu_PermName_Topic.Rate_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REVIEW', 'lu_PermName_Topic.Review_desc', 'lu_PermName_Topic.Review_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 'lu_PermName_Topic.Reply.Owner.Modify_desc', 'lu_PermName_Topic.Reply.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 'lu_PermName_Topic.Reply.Owner.Delete_desc', 'lu_PermName_Topic.Reply.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.OWNER.DELETE', 'lu_PermName_Topic.Owner.Delete_desc', 'lu_PermName_Topic.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.MODIFY.PENDING', 'lu_PermName_Topic.Modify.Pending_desc', 'lu_PermName_Topic.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.OWNER.MODIFY.PENDING', 'lu_PermName_Topic.Owner.Modify.Pending_desc', 'lu_PermName_Topic.Owner.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.OWNER.MODIFY', 'lu_PermName_Topic.Owner.Modify_desc', 'lu_PermName_Topic.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.LOCK', 'lu_PermName_Topic.Lock_desc', 'lu_PermName_Topic.Lock_error', 'In-Bulletin');
+
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT count(*) FROM <%prefix%>Topic WHERE Status=1', NULL, 'la_prompt_ActiveTopics', 0, 1);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS TotalTopics FROM <%prefix%>Topic', NULL, 'la_prompt_TopicsTotal', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS ActiveTopics FROM <%prefix%>Topic WHERE Status = 1', NULL, 'la_prompt_TopicsActive', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS PendingTopics FROM <%prefix%>Topic WHERE Status = 2', NULL, 'la_prompt_TopicsPending', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS DisabledTopics FROM <%prefix%>Topic WHERE Status = 0', NULL, 'la_prompt_TopicsDisabled', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS NewTopics FROM <%prefix%>Topic WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Topic_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>Topic WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS HotTopics FROM <%prefix%>Topic WHERE (HotItem = 1) OR (Posts >= <%m:config name="Topic_MaxHotNumber"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS PopularTopics FROM <%prefix%>Topic WHERE (PopItem = 1) OR ( (CachedRating >= <%topic:hit_count type="top"%>) AND <%topic:hit_count type="top"%> AND (PopItem = 2) )', NULL, '(*) la_prompt_PopularTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Topic WHERE CachedRating > 0', NULL, 'la_prompt_TopicAverageRating', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT MAX(Views) AS MaxTopicHits FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicHits', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT MAX(CachedVotesQty) AS MaxTopicVotes FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicVotes', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_TopicReviews', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS TotalPosts FROM <%prefix%>Posting', NULL, 'la_prompt_PostsTotal', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostTime', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostTime', 0, 2);
+
+INSERT INTO SearchConfig VALUES ('Topic', 'NotifyOwnerOnChanges', 0, 1, 'lu_fielddesc_topic_notifyowneronchanges', 'lu_field_notifyowneronchanges', 'In-Bulletin', 'la_text_topic', 1, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicId', 0, 1, 'lu_fielddesc_topic_topicid', 'lu_field_topicid', 'In-Bulletin', 'la_text_topic', 0, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Priority', 0, 1, 'lu_fielddesc_topic_priority', 'lu_field_priority', 'In-Bulletin', 'la_text_topic', 8, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OwnerId', 0, 1, 'lu_fielddesc_topic_ownerid', 'lu_field_ownerid', 'In-Bulletin', 'la_text_topic', 9, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Modified', 0, 1, 'lu_fielddesc_topic_modified', 'lu_field_modified', 'In-Bulletin', 'la_text_topic', 2, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicText', 1, 1, 'lu_fielddesc_topic_topictext', 'lu_field_topictext', 'In-Bulletin', 'la_text_topic', 3, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Posts', 0, 1, 'lu_fielddesc_topic_posts', 'lu_field_posts', 'In-Bulletin', 'la_text_topic', 4, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Views', 0, 1, 'lu_fielddesc_topic_views', 'lu_field_views', 'In-Bulletin', 'la_text_topic', 5, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'EditorsPick', 0, 1, 'lu_fielddesc_topic_editorspick', 'lu_field_editorspick', 'In-Bulletin', 'la_text_topic', 6, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Status', 0, 1, 'lu_fielddesc_topic_status', 'lu_field_status', 'In-Bulletin', 'la_text_topic', 7, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ModifiedById', 0, 1, 'lu_fielddesc_topic_modifiedbyid', 'lu_field_modifiedbyid', 'In-Bulletin', 'la_text_topic', 10, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ResourceId', 0, 1, 'lu_fielddesc_topic_resourceid', 'lu_field_resourceid', 'In-Bulletin', 'la_text_topic', 11, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicType', 0, 1, 'lu_fielddesc_topic_topictype', 'lu_field_topictype', 'In-Bulletin', 'la_text_topic', 12, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CreatedOn', 0, 1, 'lu_fielddesc_topic_createdon', 'lu_field_createdon', 'In-Bulletin', 'la_text_topic', 13, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedReviewsQty', 0, 1, 'lu_fielddesc_topic_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Bulletin', 'la_text_topic', 14, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedRating', 0, 1, 'lu_fielddesc_topic_cachedrating', 'lu_field_cachedrating', 'In-Bulletin', 'la_text_topic', 15, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedVotesQty', 0, 1, 'lu_fielddesc_topic_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Bulletin', 'la_text_topic', 16, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'NewItem', 0, 1, 'lu_fielddesc_topic_newitem', 'lu_field_newitem', 'In-Bulletin', 'la_text_topic', 17, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PopItem', 0, 1, 'lu_fielddesc_topic_popitem', 'lu_field_popitem', 'In-Bulletin', 'la_text_topic', 18, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'HotItem', 0, 1, 'lu_fielddesc_topic_hotitem', 'lu_field_hotitem', 'In-Bulletin', 'la_text_topic', 19, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PostedBy', 0, 1, 'lu_fielddesc_topic_postedby', 'lu_field_postedby', 'In-Bulletin', 'la_text_topic', 20, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OrgId', 0, 1, 'lu_fielddesc_topic_orgid', 'lu_field_orgid', 'In-Bulletin', 'la_text_topic', 21, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'LastPostId', 0, 1, 'lu_fielddesc_topic_lastpostid', 'lu_field_lastpostid', 'In-Bulletin', 'la_text_topic', 22, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY.PENDING', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD.PENDING', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.RATE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REVIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.RATE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REVIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.RATE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REVIEW', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.LOCK', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:inbulletin_general.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:inbulletin_general.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_output.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_output.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_search.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_search.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_email.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_email.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.delete', 11, 1, 1, 0);
+
+INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('phpbb', 'In-Bulletin', 'phpbb_import', 'phpBB 2.x', 'phpBB', 'user_regular,init_cat', 1, 'db');
+
+INSERT INTO CustomField (Type, FieldName, FieldLabel, Heading, Prompt, ElementType, ValueList, DisplayOrder, OnGeneralTab, IsSystem) VALUES (1, 'bb_ItemTemplate', 'bb_ItemTemplate', 'la_title_SystemCF', 'bb_ItemTemplate', 'text', NULL, 0, 0, 1);
+
+INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('In-Bulletin', 'in-bulletin/', 'bb', '1.2.2', 1, 3, 'inbulletin/', {TopicCatId}, '1054738405');
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.7.24/in-bulletin/admin/advanced_view.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.7.24/in-bulletin/admin/advanced_view.php (revision 0)
+++ branches/unlabeled/unlabeled-1.7.24/in-bulletin/admin/advanced_view.php (revision 12744)
@@ -0,0 +1,86 @@
+Get("Site_Path");
+$localURL=$rootURL."in-bulletin/";
+
+//$imagesURL = $rootURL."admin/images";
+
+//admin only util
+
+$pathtolocal = $pathtoroot."in-bulletin/";
+
+//require_once ($pathtoroot."admin/include/elements.php");
+//require_once ($pathtoroot."kernel/admin/include/navmenu.php");
+require_once ($pathtolocal."admin/include/navmenu.php");
+require_once($pathtoroot.$admin."/listview/columnheader.php");
+
+//Set Section
+$section = 'in-bulletin:advanced_view';
+//Set Environment Variable
+$envar = "env=" . BuildEnv($mod_prefixes);
+
+$localImageURL = $localURL."admin/images";
+
+?>
+
+
+
+
+
+
+
+
+ GetAdminPageLinkList($_SERVER["PHP_SELF"]); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+ Get('Topic_SortField');
+ $SortOrder=0;
+ if($objConfig->Get("Topic_SortOrder") == 'asc')
+ $SortOrder=1;
+
+ $cols->Add("TopicText",admin_language("la_ColHeader_Topic"),1,0,$order,"width=\"40%\"","Topic_SortField","Topic_SortOrder","TopicText");
+ $cols->Add("PostedBy",admin_language("la_ColHeader_Poster"),1,0,$order,"width=\"39%\"","Topic_SortField","Topic_SortOrder","PostedBy");
+ $cols->Add("ModifiedDate",admin_language("la_ColHeader_Date"),1,0,$order,"width=\"10%\"","Topic_SortField","Topic_SortOrder","Modified");
+ $cols->Add("Posts",admin_language("la_ColHeader_Reply"),1,0,$order,"width=\"10%\"","Topic_SortField","Topic_SortOrder","Posts");
+ $cols->Add("Views",admin_language("la_ColHeader_Views"),1,0,$order,"width=\"10%\"","Topic_SortField","Topic_SortOrder","Views");
+ $cols->SetSort($objConfig->Get("Topic_SortField"),$objConfig->Get("Topic_SortOrder"));
+
+ print $cols ->PrintColumns();
+ print adListTopics($pathtoroot."in-bulletin/admin/templates/topic_element_av.tpl");
+ ?>
+
+
+
+
+
+
+
+
Index: branches/unlabeled/unlabeled-1.7.2/in-bulletin/admin_templates/catalog_tab.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.7.2/in-bulletin/admin_templates/catalog_tab.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.7.2/in-bulletin/admin_templates/catalog_tab.tpl (revision 12744)
@@ -0,0 +1,50 @@
+
+
+
+ a_toolbar.AddButton( new ToolBarButton('in-bulletin:new_topic', ' ', function() {
+ std_precreate_item(' ', 'in-bulletin/topics/topics_edit');
+ }, true
+ ) );
+
+
+
+
" view_template="in-bulletin/catalog_tab" edit_template="in-bulletin/topics/topics_edit" category_id="-1" dep_buttons="new_topic" class="catalog-tab">
+
+
+
+
+
+
+
+
+ $Catalog.setItemCount(' ', ' ');
+ $Catalog.setCurrentCategory(' ', );
+
+
+
+
+ Grids[' '].AddAlternativeGrid(' ', true);
+
+ Grids[' '].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','sep3','cut','copy','move_up','move_down','sep6'));
+ $Catalog.reflectPasteButton( );
+ $Catalog.setViewMenu(' ');
+
+ Grids[' '].EnableRadioMode();
+ Grids[' '].DblClick = function() {return false};
+
+ #separator#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.4.10/themes/default/inbulletin/post_list/post_element.tpl
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.4.10/themes/default/inbulletin/post_list/post_element.tpl (revision 0)
+++ branches/unlabeled/unlabeled-1.4.10/themes/default/inbulletin/post_list/post_element.tpl (revision 12744)
@@ -0,0 +1,106 @@
+
+
+
+
+ ">
+
+
+
+
+
+ " height=60 width=60 ALIGN="left">
+
+
+ :
+
+
+ :
+
+
+ :
+
+
+
+
+
+
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: branches/unlabeled/unlabeled-1.4.10/in-bulletin/admin/install/langpacks/english.lang
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.4.10/in-bulletin/admin/install/langpacks/english.lang (revision 0)
+++ branches/unlabeled/unlabeled-1.4.10/in-bulletin/admin/install/langpacks/english.lang (revision 12744)
@@ -0,0 +1,14 @@
+
+ m/d/Y g:i:s A m/d/Y g:i:s A . , iso-8859-1 2
+
+ UG9zdGVy
+
+
+ WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogTmV3IFByaXZhdGUgTWVzc2FnZQoKQSBuZXcgcHJpdmF0ZSBtZXNzYWdlIGhhcyBhcnJpdmVkLiA=
+ WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IE5ldyByZXBseSBoYXMgYmVlbiBhZGRlZAoKTmV3IHJlcGx5IGhhcyBiZWVuIGFkZGVkIHRvIG9uZSBvZiB5b3VyIHBvc3RzOg0KDQo8aW5wOnRvcGljIF9maWVsZD0idGV4dCIgLz4gLSA8aW5wOnRvcGljIF9maWVsZD0ibGluayIgX1RlbXBsYXRlPSJpbmJ1bGxldGluL3Bvc3RfbGlzdCIgLz4=
+ WC1Qcmlvcml0eTogMQpYLU1TTWFpbC1Qcmlvcml0eTogSGlnaApYLU1haWxlcjogSW4tUG9ydGFsClN1YmplY3Q6IE5ldyByZXBseSBoYXMgYmVlbiBhZGRlZAoKTmV3IHJlcGx5IGhhcyBiZWVuIGFkZGVkIHRvIG9uZSBvZiB5b3VyIHBvc3RzOg0KDQo8aW5wOnRvcGljIF9maWVsZD0idGV4dCIgLz4gLSA8aW5wOnRvcGljIF9maWVsZD0ibGluayIgX1RlbXBsYXRlPSJpbmJ1bGxldGluL3Bvc3RfbGlzdCIgLz4=
+ WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogUG9zIG1vZGlmaWVkCgpBIHBvc3QgaGFzIGJlZW4gbW9kaWZpZWQu
+ WC1Qcmlvcml0eTogMQ0KWC1NU01haWwtUHJpb3JpdHk6IEhpZ2gNClgtTWFpbGVyOiBJbi1Qb3J0YWwKU3ViamVjdDogVG9waWMgYWRkZGUKCkEgdG9waWMgaGFzIGJlZW4gYWRkZWQu
+
+
+
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.48.2/in-bulletin/admin/install/inportal_data.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.48.2/in-bulletin/admin/install/inportal_data.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.48.2/in-bulletin/admin/install/inportal_data.sql (revision 12744)
@@ -0,0 +1,254 @@
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.01, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'TopicText=la_Topic_Text,Posts=la_Number_of_Posts,CreatedOn=la_CreatedOn,LastPostDate=la_LastUpdate,Views=la_Topic_Views,CachedRating=la_Rating,LastPoser=la_Poster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) ', 10.01, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '', 'TopicText=la_Topic_Text,Posts=la_Number_of_Posts,CreatedOn=la_CreatedOn,LastPostDate=la_LastUpdate,Views=la_Topic_Views,CachedRating=la_Rating,LastPoser=la_Poster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) ', 10.02, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_NewDays', 'la_Text_Topics', 'la_topic_newdays_prompt', 'text', '', 'asc=la_common_ascending,desc=la_common_descending', 10.05, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.02, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics', 'la_Text_Topics', 'la_topic_perpage_prompt', 'text', '', '', 10.03, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MinPopRating', 'la_Text_Topics', 'la_fld_Topic_MinPopRating', 'text', '', '', 10.06, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MaxHotNumber', 'la_Text_Topics', 'la_fld_Topic_MaxHotNumber', 'text', '', '', 10.08, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_EditorPicksAbove', 'la_Text_Topics', 'la_topic_editorpicksabove_prompt', 'checkbox', '', '', 10.09, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Postings', 'la_posts_subheading', 'la_posts_perpage_prompt', 'text', '', '', 20.01, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Posts_NewDays', 'la_posts_subheading', 'la_posts_newdays_prompt', 'text', '', '', 20.02, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MinPopVotes', 'la_Text_Topics', 'la_fld_Topic_MinPopVotes', 'text', '', '', 10.07, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics_Short', 'la_Text_Topics', 'la_topic_perpage_short_prompt', 'text', '', '', 10.04, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Value', 'la_Text_Topics', 'la_prompt_DupReviews', 'text', '', '', 10.1, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Interval', 'la_Text_Topics', 'la_prompt_DupReviews', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.1, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Value', 'la_Text_Topics', 'la_prompt_DupRating', 'text', '', '', 10.11, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Interval', 'la_Text_Topics', 'la_prompt_DupRating', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.11, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('AutoTopicLockPosts', 'la_Text_Topics', 'la_prompt_PostsToLock', 'text', NULL, NULL, 10.12, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_TopicReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL, NULL, 30.01, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('bb_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 40.01, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 40.02, 0, 0);
+
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_topics', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_topics', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_topics', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_topics', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_topics', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_PrivateMessages', 'la_text_PrivateMessages', 'la_text_PrivateMessages_PerPage', 'text', NULL, NULL, 0, 0, 1);
+
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Postings', '25', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Topics', '5', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Posting_SortOrder', 'CreatedOn asc, PostingText', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Posts_NewDays', '5', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Bulletin_TopCount', '2', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Bulletin_CatNewDays', '10', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Bulletin_Pick_First', '1', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortOrder', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortField', 'LastPostDate', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortOrder2', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortField2', 'Posts', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_NewDays', '6', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_MinPopRating', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_MaxHotNumber', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_EditorPicksAbove', '1', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_MinPopVotes', '8', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Root', '{TopicCatId}', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_Sortfield', NULL, 'In-Bulletin', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_SortOrder', NULL, 'In-Bulletin', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'BBTags', 'b:;i:;u:;ul:type|align;font:color|face|size;url:href;img:src|border', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_Background1', '#cccccc', 'In-Portal', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_Background2', '#bbbbbb', 'In-Portal', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Background1', '#FAEBD7', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Background2', '#F5F5DC', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'AutoTopicLockPosts', '0', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'bb_CategoryTemplate', 'inbulletin/index', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'bb_ItemTemplate', 'inbulletin/post_list', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Highlight_OpenTag', '', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Highlight_CloseTag', ' ', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Topics_Short', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_RatingDelay_Interval', '3600', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_RatingDelay_Value', '1', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_ReviewDelay_Interval', '60', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_ReviewDelay_Value', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Increase_topics', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Keyword_topics', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Pop_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Rating_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Increase_posts', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Keyword_posts', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Pop_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Rating_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'Search_ShowMultiple_topics', '0', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_PrivateMessages', '20', 'In-Bulletin', '');
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_TopicReviews', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (1, 'Happy Smile', 0, ':)', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (2, 'Big Grin', 0, ':grin:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (3, 'Wink', 0, ';)', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (4, 'Scared', 0, ':scared:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (5, 'Teasing', 0, ':eek:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (6, 'Cool', 0, ':cool:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (7, 'Angry', 0, ':@', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (8, 'Squint', 0, ':squint:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (9, 'Oops', 0, ':o', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (10, 'Sad', 0, ':(', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (11, 'Cry', 0, ':cry:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (12, 'Smirk', 0, ';]', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (13, 'Happy sleep', 0, ':sleep:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (14, 'Very angry', 0, ':x', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (15, 'Geek', 0, ':geek:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (16, 'Upset', 0, ';(', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (17, 'LOL', 0, ':lol:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (18, 'Yawn', 0, ':O', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (19, 'Thinking', 0, ':hm:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (20, 'Secret', 0, ':|', 1);
+
+INSERT INTO Events VALUES (1, 'TOPIC.ADD', 2, 0, 'In-Bulletin', 'la_event_topic.add', 1)
+INSERT INTO Events VALUES (2, 'POST.ADD', 2, 0, 'In-Bulletin', 'la_event_post.add', 1)
+INSERT INTO Events VALUES (3, 'POST.MODIFY', 2, 0, 'In-Bulletin', 'la_event_post.modify', 1)
+INSERT INTO Events VALUES (4, 'POST.ADD', 1, 0, 'In-Bulletin', 'la_event_post.add', 0)
+INSERT INTO Events VALUES (66, 'PM.ADD', 1, 0, 'In-Bulletin', 'la_event_pm.add', 0);
+
+INSERT INTO ItemTypes VALUES (3, 'In-Bulletin', 'bb', 'Topic', 'TopicText', 'OwnerId', 'Views', 'CachedRating', 'la_ItemTab_Topics', 1, '', 'clsTopic', 'Topic');
+INSERT INTO ItemTypes VALUES (30, 'In-Bulletin', 'posting', 'Posting', 'Subject', 'CreatedById', NULL, NULL, 'la_ItemTab_Posts', 0, '', '', 'Post');
+
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.VIEW', 'lu_PermName_Topic.View_desc', 'lu_PermName_Topic.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.ADD', 'lu_PermName_Topic.Add_desc', 'lu_PermName_Topic.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.ADD.PENDING', 'lu_PermName_Topic.Add.Pending_desc', 'lu_PermName_Topic.Add.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.DELETE', 'lu_PermName_Topic.Delete_desc', 'lu_PermName_Topic.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.MODIFY', 'lu_PermName_Topic.Modify_desc', 'lu_PermName_Topic.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.DELETE', 'lu_PermName_Topic.Reply.Delete_desc', 'lu_PermName_Topic.Reply.Delete_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.VIEW', 'lu_PermName_Topic.Reply.View_desc', 'lu_PermName_Topic.Reply.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.ADD', 'lu_PermName_Topic.Reply.Add_desc', 'lu_PermName_Topic.Reply.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.MODIFY', 'lu_PermName_Topic.Reply.Modify_desc', 'lu_PermName_Topic.Reply.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.RATE', 'lu_PermName_Topic.Rate_desc', 'lu_PermName_Topic.Rate_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REVIEW', 'lu_PermName_Topic.Review_desc', 'lu_PermName_Topic.Review_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 'lu_PermName_Topic.Reply.Owner.Modify_desc', 'lu_PermName_Topic.Reply.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 'lu_PermName_Topic.Reply.Owner.Delete_desc', 'lu_PermName_Topic.Reply.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.OWNER.DELETE', 'lu_PermName_Topic.Owner.Delete_desc', 'lu_PermName_Topic.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.MODIFY.PENDING', 'lu_PermName_Topic.Modify.Pending_desc', 'lu_PermName_Topic.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.OWNER.MODIFY.PENDING', 'lu_PermName_Topic.Owner.Modify.Pending_desc', 'lu_PermName_Topic.Owner.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.OWNER.MODIFY', 'lu_PermName_Topic.Owner.Modify_desc', 'lu_PermName_Topic.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.LOCK', 'lu_PermName_Topic.Lock_desc', 'lu_PermName_Topic.Lock_error', 'In-Bulletin');
+
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT count(*) FROM <%prefix%>Topic WHERE Status=1', NULL, 'la_prompt_ActiveTopics', 0, 1);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS TotalTopics FROM <%prefix%>Topic', NULL, 'la_prompt_TopicsTotal', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS ActiveTopics FROM <%prefix%>Topic WHERE Status = 1', NULL, 'la_prompt_TopicsActive', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS PendingTopics FROM <%prefix%>Topic WHERE Status = 2', NULL, 'la_prompt_TopicsPending', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS DisabledTopics FROM <%prefix%>Topic WHERE Status = 0', NULL, 'la_prompt_TopicsDisabled', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS NewTopics FROM <%prefix%>Topic WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Topic_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>Topic WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS HotTopics FROM <%prefix%>Topic WHERE (HotItem = 1) OR (Posts >= <%m:config name="Topic_VotesToHot"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS PopularTopics FROM <%prefix%>Topic WHERE (PopItem = 1) OR ( (CachedRating >= <%topic:hit_count type="top"%>) AND <%topic:hit_count type="top"%> AND (PopItem = 2) )', NULL, '(*) la_prompt_PopularTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Topic WHERE CachedRating > 0', NULL, 'la_prompt_TopicAverageRating', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT MAX(Views) AS MaxTopicHits FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicHits', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT MAX(CachedVotesQty) AS MaxTopicVotes FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicVotes', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_TopicReviews', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS TotalPosts FROM <%prefix%>Posting', NULL, 'la_prompt_PostsTotal', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostTime', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostTime', 0, 2);
+
+INSERT INTO SearchConfig VALUES ('Topic', 'NotifyOwnerOnChanges', 0, 1, 'lu_fielddesc_topic_notifyowneronchanges', 'lu_field_notifyowneronchanges', 'In-Bulletin', 'la_text_topic', 1, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicId', 0, 1, 'lu_fielddesc_topic_topicid', 'lu_field_topicid', 'In-Bulletin', 'la_text_topic', 0, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Priority', 0, 1, 'lu_fielddesc_topic_priority', 'lu_field_priority', 'In-Bulletin', 'la_text_topic', 8, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OwnerId', 0, 1, 'lu_fielddesc_topic_ownerid', 'lu_field_ownerid', 'In-Bulletin', 'la_text_topic', 9, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Modified', 0, 1, 'lu_fielddesc_topic_modified', 'lu_field_modified', 'In-Bulletin', 'la_text_topic', 2, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicText', 1, 1, 'lu_fielddesc_topic_topictext', 'lu_field_topictext', 'In-Bulletin', 'la_text_topic', 3, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Posts', 0, 1, 'lu_fielddesc_topic_posts', 'lu_field_posts', 'In-Bulletin', 'la_text_topic', 4, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Views', 0, 1, 'lu_fielddesc_topic_views', 'lu_field_views', 'In-Bulletin', 'la_text_topic', 5, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'EditorsPick', 0, 1, 'lu_fielddesc_topic_editorspick', 'lu_field_editorspick', 'In-Bulletin', 'la_text_topic', 6, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Status', 0, 1, 'lu_fielddesc_topic_status', 'lu_field_status', 'In-Bulletin', 'la_text_topic', 7, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ModifiedById', 0, 1, 'lu_fielddesc_topic_modifiedbyid', 'lu_field_modifiedbyid', 'In-Bulletin', 'la_text_topic', 10, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ResourceId', 0, 1, 'lu_fielddesc_topic_resourceid', 'lu_field_resourceid', 'In-Bulletin', 'la_text_topic', 11, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicType', 0, 1, 'lu_fielddesc_topic_topictype', 'lu_field_topictype', 'In-Bulletin', 'la_text_topic', 12, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CreatedOn', 0, 1, 'lu_fielddesc_topic_createdon', 'lu_field_createdon', 'In-Bulletin', 'la_text_topic', 13, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedReviewsQty', 0, 1, 'lu_fielddesc_topic_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Bulletin', 'la_text_topic', 14, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedRating', 0, 1, 'lu_fielddesc_topic_cachedrating', 'lu_field_cachedrating', 'In-Bulletin', 'la_text_topic', 15, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedVotesQty', 0, 1, 'lu_fielddesc_topic_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Bulletin', 'la_text_topic', 16, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'NewItem', 0, 1, 'lu_fielddesc_topic_newitem', 'lu_field_newitem', 'In-Bulletin', 'la_text_topic', 17, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PopItem', 0, 1, 'lu_fielddesc_topic_popitem', 'lu_field_popitem', 'In-Bulletin', 'la_text_topic', 18, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'HotItem', 0, 1, 'lu_fielddesc_topic_hotitem', 'lu_field_hotitem', 'In-Bulletin', 'la_text_topic', 19, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PostedBy', 0, 1, 'lu_fielddesc_topic_postedby', 'lu_field_postedby', 'In-Bulletin', 'la_text_topic', 20, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OrgId', 0, 1, 'lu_fielddesc_topic_orgid', 'lu_field_orgid', 'In-Bulletin', 'la_text_topic', 21, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'LastPostId', 0, 1, 'lu_fielddesc_topic_lastpostid', 'lu_field_lastpostid', 'In-Bulletin', 'la_text_topic', 22, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY.PENDING', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD.PENDING', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.RATE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REVIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.RATE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REVIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.RATE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REVIEW', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.LOCK', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:inbulletin_general.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:inbulletin_general.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_output.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_output.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_search.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_search.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_email.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_email.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.delete', 11, 1, 1, 0);
+
+INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('phpbb', 'In-Bulletin', 'phpbb_import', 'phpBB 2.x', 'phpBB', 'user_regular,init_cat', 1, 'db');
+
+INSERT INTO CustomField (Type, FieldName, FieldLabel, Heading, Prompt, ElementType, ValueList, DisplayOrder, OnGeneralTab, IsSystem) VALUES (1, 'bb_ItemTemplate', 'bb_ItemTemplate', 'la_title_SystemCF', 'bb_ItemTemplate', 'text', NULL, 0, 0, 1);
+
+INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('In-Bulletin', 'in-bulletin/', 'bb', '1.2.1', 1, 3, 'inbulletin/', {TopicCatId}, '1054738405');
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.51.2/in-bulletin/topic.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.51.2/in-bulletin/topic.php (revision 0)
+++ branches/unlabeled/unlabeled-1.51.2/in-bulletin/topic.php (revision 12744)
@@ -0,0 +1,1823 @@
+clsCatItem(TRUE);
+ $this->tablename=GetTablePrefix()."Topic";
+ $this->type=TYPE_TOPIC;
+ $this->BasePermission="TOPIC";
+ $this->id_field = "TopicId";
+ $this->TagPrefix = "topic";
+ $this->TitleField = 'TopicText';
+ if(isset($TopicId))
+ $this->LoadFromDatabase($TopicId);
+ if($objSession->HasSystemPermission("DEBUG.ITEM"))
+ {
+ $this->SetDebugLevel(1);
+ }
+
+ $this->OpenTagVar = "Topic_Highlight_OpenTag";
+ $this->CloseTagVar = "Topic_Highlight_CloseTag";
+ }
+
+ function ClearCacheData()
+ {
+ DeleteModuleTagCache('inbulletin');
+ /* $cats = explode(",",$this->CategoryMemberList());
+ if(is_array($cats))
+ {
+ foreach($cats as $c)
+ {
+ if(is_numeric($c))
+ {
+ $evar = "'%:m".$c."%'";
+ DeleteTagCache("bb_topic_list","",$evar);
+ DeleteTagCache("bb_topic_more","",$evar);
+ }
+ }
+ }
+ DeleteTagCache("bb_topic_modified%","");
+ DeleteTagCache("TopicPopValue","","");
+ DeleteTagCache("TopicHotValue","","");
+ DeleteTagCache("TopicNewValue","","");*/
+ }
+
+ function Validate()
+ {
+ global $Errors;
+
+ $dataValid = true;
+
+
+ if(!strlen($this->Get("TopicText")))
+ {
+ $objSession->AddError("error.fieldIsRequired",'TopicText',"","",get_class($this),"Validate");
+ $dataValid = false;
+ }
+
+ if(!(int)($this->Get("OwnerId")))
+ {
+ $Errors->AddError("error.fieldIsRequired",'Owner',"","",get_class($this),"Validate");
+ $dataValid = false;
+ }
+ return $dataValid;
+ }
+
+
+ function Update($UpdatedBy=NULL,$modificationDate=null)
+ {
+ parent::Update($UpdatedBy,$modificationDate);
+ if($this->tablename==GetTablePrefix()."Topic")
+ {
+ $this->ClearCacheData();
+ }
+ }
+
+ function Create()
+ {
+ parent::Create();
+ if($this->tablename==GetTablePrefix()."Topic")
+ {
+ $this->ClearCacheData();
+ DeleteTagCache("m_itemcount","Topic%");
+ }
+ }
+
+ function Delete()
+ {
+ global $objPostingList, $objCatList;
+
+ $PostCount = $this->Get("Posts");
+ $objPostingList->DeleteTopicPosts($this->Get("TopicId"));
+ $CategoryId = $this->Get("CategoryId");
+ if(!is_numeric($CategoryId))
+ $CategoryId = $objCatList->CurrentCategoryID();
+
+ if($this->tablename==GetTablePrefix()."Topic")
+ {
+ $this->ClearCacheData();
+ DeleteTagCache("m_itemcount","Topic%");
+
+ if($this->Get("NotifyOwnerOnChanges"))
+ {
+ $this->SendUserEventMail("TOPIC.DELETE",$this->Get('OwnerId') );
+ }
+ $this->SendAdminEventMail("TOPIC.DELETE");
+ }
+ parent::Delete();
+
+ $this->refreshLastUpdate($CategoryId);
+
+ $this->UpdateCategoryPostCount();
+ }
+
+ function UpdateModified($UserId)
+ {
+ $this->Set(array("Modified", "ModifiedById"), array(adodb_mktime(), $UserId));
+ $this->Update();
+ }
+
+ function UpdateNumPosts()
+ {
+ global $objSession;
+
+ $sql = "SELECT COUNT(PostingId) as PostCount FROM ".GetTablePrefix()."Posting WHERE TopicId=" . $this->Get("TopicId");
+ $result = $this->adodbConnection->Execute($sql);
+
+ if($result && !$result->EOF)
+ {
+ $sql = "UPDATE ".$this->tablename." SET Posts=".$result->fields["PostCount"]." WHERE TopicId=" . $this->Get("TopicId");
+ $result = $this->adodbConnection->Execute($sql);
+ if ($result === false)
+ {
+ $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"UpdateNumPosts");
+ return false;
+ }
+ }
+ }
+
+ function SetNewItem()
+ {
+ global $objConfig;
+
+ $value = $this->Get("CreatedOn");
+
+ $cutoff = adodb_date("U") - ($objConfig->Get("Topic_NewDays") * 86400);
+ $this->IsNew = FALSE;
+ if($value>$cutoff)
+ $this->IsNew = TRUE;
+ return $this->IsNew;
+ }
+
+ function SetPopItem()
+ {
+ global $objConfig, $objTopicList;
+
+ $cutoff = $objTopicList->GetPopValue();
+ if($cutoff > 0)
+ {
+ $this->IsPop = FALSE;
+ if($this->Get('Posts') >= $cutoff)
+ {
+ $this->IsPop = TRUE;
+ }
+ }
+ else
+ $this->IsPop = FALSE;
+ return $this->IsPop;
+ }
+
+ function SetHotItem()
+ {
+ global $objConfig, $objTopicList;
+
+ $this->IsHot = FALSE;
+ $cutoff = $objTopicList->GetHotValue();
+ if($cutoff>0)
+ {
+ if($this->Get("Views") >= $cutoff)
+ $this->IsHot = TRUE;
+ }
+ return $this->IsHot;
+ }
+
+ function Approve()
+ {
+ $this->Set("Status", 1);
+ $this->Update();
+ $this->SendUserEventMail("TOPIC.APPROVE",$this->Get("OwnerId"));
+ $this->SendAdminEventMail("TOPIC.APPROVE");
+ }
+
+ function Deny()
+ {
+ $this->Set("Status", 0);
+ $this->Update();
+ $this->SendUserEventMail("TOPIC.DENY",$this->Get("OwnerId"));
+ $this->SendAdminEventMail("TOPIC.DENY");
+ }
+
+ function LoadFromDatabase($Id)
+ {
+ global $Errors;
+
+ if(!isset($Id))
+ {
+ $Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromDatabase");
+ return false;
+ }
+ if($Id>0)
+ {
+ $sql = sprintf("SELECT * FROM ".$this->tablename." WHERE ".$this->IdField()." = '%s'",$Id);
+ $result = $this->adodbConnection->Execute($sql);
+ if ($result === FALSE)
+ {
+ $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromDatabase");
+ return FALSE;
+ }
+
+ $data = $result->fields;
+
+ $this->SetFromArray($data);
+ return TRUE;
+ }
+ else
+ return FALSE;
+ }
+ function LoadFromResourceId($Id)
+ {
+ global $objSession, $Errors;
+ if(!isset($Id))
+ {
+ $Errors->AddError("error.AppError",NULL,'Internal error: LoadFromDatabase id',"",get_class($this),"LoadFromResourceId");
+ return false;
+ }
+ $sql = sprintf("SELECT * FROM ".$this->tablename." WHERE ResourceId = '%s'",$Id);
+ $result = $this->adodbConnection->Execute($sql);
+ if ($result === false)
+ {
+ $Errors->AddError("error.DatabaseError",NULL,$adodbConnection->ErrorMsg(),"",get_class($this),"LoadFromResourceId");
+ return false;
+ }
+ $data = $result->fields;
+ if(is_array($data))
+ $this->SetFromArray($data);
+ }
+
+
+ function GetPostsSince($time_stamp)
+ {
+ global $Errors;
+
+ $Id = $this->Get("TopicId"); //get cur cat id
+ settype($time_stamp,"integer");
+ $sql = "SELECT count(PostingId) as pcount FROM ".GetTablePrefix()."Posting WHERE TopicId = $Id AND Posting.ModifiedOn >= $time_stamp ";
+ $result = $this->adodbConnection->Execute($sql);
+ if($result && !$result->EOF)
+ return $result->fields["pcount"];
+ else
+ {
+ $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"",get_class($this),"GetPostsSince");
+ return false;
+ }
+
+ }
+
+ function GetPosts()
+ {
+ global $Errors;
+
+/* if(!is_numeric($this->Get("Posts"))<1)
+ {
+ $Id = $this->Get("TopicId"); //get cur cat id
+
+ $sql = "SELECT count(PostingId) FROM ".GetTablePrefix()."Posting WHERE TopicId = $Id";
+ $result = $this->adodbConnection->Execute($sql);
+ if($result && !$result->EOF)
+ $this->Set("Posts",$result->fields[0]);
+ else
+ {
+ $Errors->AddError("error.DatabaseError",NULL,$this->adodbConnection->ErrorMsg(),"","clsTopic","GetPosts");
+ return false;
+ }
+ }*/
+ return $this->Get("Posts");
+ }
+
+ function StatusIcon()
+ {
+ global $rootURL;
+
+ $ret = $rootURL."/in-bulletin/admin/images/";
+
+ switch($this->Get("Status"))
+ {
+ case STATUS_DISABLED:
+ $ret .= "icon16_topic_disabled.gif";
+ break;
+ case STATUS_PENDING:
+ $ret .= "icon16_topic_pending.gif";
+ break;
+ case STATUS_ACTIVE:
+ $img = "icon16_topic.gif";
+ if($this->IsPopItem())
+ $img = "icon16_topic_top.gif";
+ if($this->IsHotItem())
+ $img = "icon16_topic_hot.gif";
+ if($this->IsNewItem())
+ $img = "icon16_topic_new.gif";
+ if($this->Is("EditorsPick"))
+ $img = "icon16_topic_pick.gif";
+ $ret .= $img;
+ break;
+ }
+ return $ret;
+ }
+
+ function ItemURL($Template=NULL,$SetCat=FALSE,$Action=NULL)
+ {
+ global $var_list_update,$var_list,$bb_var_list_update,$m_var_list_update;
+
+ $url_params = Array();
+ $var_list_update["t"] = $Template ? $Template : $var_list["t"];
+
+// if($SetCat || (int)$this->Get("CategoryId")>0)
+// {
+ $cat = $this->Get("CategoryId");
+ if(!is_numeric($cat))
+ $cat = $this->GetPrimaryCategory();
+ $m_var_list_update["cat"] = $cat;
+// }
+
+ $bb_var_list_update["top"] = $this->Get("TopicId");
+ $bb_var_list_update["pp"] = 1;
+
+ if( isset($Action) && $Action ) $url_params['Action'] = $Action;
+ $ret = HREF_Wrapper('', $url_params);
+
+ unset($m_var_list_update["cat"],$bb_var_list_update["top"],$bb_var_list_update["tp"],$bb_var_list_update["pp"], $var_list_update["t"]);
+ return $ret;
+ }
+
+ function ParseObject($element)
+ {
+ global $objConfig, $objSession, $objUsers, $objCatList, $var_list_update, $var_list,
+ $bb_var_list_update, $m_var_list_update,$objCensorList;
+
+ //print_pre($element);
+
+ $extra_attribs = ExtraAttributes($element->attributes);
+ if(strtolower($element->name)==$this->TagPrefix)
+ {
+ $field = strtolower($element->attributes["_field"]);
+ switch($field)
+ {
+
+ /*
+ @field:topic.text
+ @description: Returns the topic title (or subject)
+ */
+ case "text":
+ $topic_text = inp_unescape($objCensorList->CensorText($this->Get("TopicText")));
+ $num_chars = $element->GetAttributeByName('_numchars');
+ if ($num_chars && strlen($topic_text) > $num_chars) {
+ $ret = substr($topic_text, 0, $num_chars)."...";
+ }
+ else {
+ $ret = $topic_text;
+ }
+ $ret = $this->HighlightText($ret);
+ break;
+ /*
+ @field:topic.replies
+ @description: Returns the number of posts for the topic (The first post is not counted)
+ */
+ case "replies":
+ $ret = $this->GetPosts() - 1;
+ break;
+ /*
+ @field:topic.views
+ @description: Returns the number of times the topic has been viewed
+ */
+ case "views":
+ return round($this->Get("Views"));
+ break;
+ /*
+ @field:topic.category
+ @description:Return a category field from the link's category
+ @attrib:_cattag::Category field to parse
+ */
+
+ case "lastposter":
+ /*
+ @field:topic.lastposter
+ @description:Returns the login name of the last poster in this topic
+ */
+ if(strlen($this->Get("LastPoster")))
+ {
+ $ret = $this->Get("LastPoster");
+ }
+ else
+ {
+ $id = $this->Get("LastPostId");
+ if (!is_numeric($id)) {
+ $id = $this->GetLastPostId();
+ }
+
+ if ($id) {
+ $post = new clsPosting($id);
+ if (is_object($post)) {
+ $ret = $post->Get('PosterAlias');
+ if (!$ret && ($post->Get('CreatedById') < 0)) {
+ $ret = language('lu_Guest');
+ }
+ }
+ }
+ }
+ break;
+ case "lastpostdate":
+ /*
+ @field:topic.lastpostdate
+ @description:Returns the date/time a post was made to this topic
+ @attrib:_tz:bool:Convert the date to the user's local time
+ @attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr
+ */
+ $d = $this->Get("LastPostDate");
+ if (!$element->GetAttributeByName('_tz')) {
+ $element->SetAttributeByName('_tz', 'auto');
+ }
+ $ret = $this->ParseTimeStamp($d, $element->attributes);
+ break;
+ /*
+ @field:topic.image
+ @description:Return an image associated with the topic
+ @attrib:_primary:bool:If true, will return the default image if the requested image does not exist
+ @attrib:_name::Return the image with this name
+ @attrib:_thumbnail:bool:If true, return the thumbnail version of the image
+ @attrib:_imagetag:bool:If true, returns a complete image tag. exta html attributes are passed to the image tag
+ */
+ case "modifiedby":
+ /*
+ @field:topic.modifiedby
+ @description:parse a user field of the user that last modified the topic
+ @attrib:_usertag::User field to return (defaults to login ID)
+ */
+ $field = $element->attributes["_usertag"];
+ if(!strlen($field))
+ {
+ $field = "user_login";
+ }
+ $u =& $objUsers->GetItem($this->Get("ModifiedById"));
+ $ret = $u->parsetag($field);
+ break;
+ case "owner":
+ /*
+ @field:topic.owner
+ @description:parse a user field of the user that is the topic owner
+ @attrib:_usertag::User field to return (defaults to login ID)
+ */
+ $field = $element->attributes["_usertag"];
+ if(!strlen($field))
+ {
+ $field = "user_login";
+ }
+ $u =& $objUsers->GetItem($this->Get("OwnerId"));
+ $ret = $u->parsetag($field);
+ break;
+
+ /*
+ @field:topic.custom
+ @description:Returns a custom field
+ @attrib:_customfield::field name to return
+ @attrib:_default::default value
+ */
+ case "date":
+ /*
+ @field:topic.date
+ @description:Returns the date/time the topic was created
+ @attrib:_tz:bool:Convert the date to the user's local time
+ @attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr
+ */
+ $d = $this->Get('CreatedOn');
+ if (!$element->GetAttributeByName('_tz')) {
+ $element->SetAttributeByName('_tz', 'auto');
+ }
+ $ret = $this->ParseTimeStamp($d,$element->attributes);
+ break;
+ case "modifieddate":
+ /*
+ @field:link.modifieddate
+ @description:Returns the date/time the topic was last modified
+ @attrib:_tz:bool:Convert the date to the user's local time
+ @attrib:_part::Returns part of the date. The following options are available: month,day,year,time_24hr,time_12hr
+ */
+ $d = $this->Get('Modified');
+ if (!$element->GetAttributeByName('_tz')) {
+ $element->SetAttributeByName('_tz', 'auto');
+ }
+ $ret = $this->ParseTimeStamp($d,$element->attributes);
+ break;
+ /*
+ @field:topic.fullpath
+ @description:The full category path of the item
+ */
+ //break;
+ case "locked":
+ /*
+ @field:topic.locked
+ @description: Returns a value if the topic is locked
+ @attrib:_text:lang:Language tag to display as the link text
+ @attrib:_plaintext:: Plain text to use instead of language tag
+ @attrib:image::Image URL to display
+ */
+
+ if($this->Get("TopicType")==0)
+ {
+ $text = $element->attributes["_text"];
+ if(!strlen($text))
+ {
+ $text = $element->attributes["_plaintext"];
+ if(!strlen($text))
+ {
+ if(strlen($element->attributes["_image"]))
+ {
+ $text = " attributes["_image"]."\" BORDER=\"0\" alt=\"\">";
+ }
+ }
+ $ret .= $text."";
+ }
+ else
+ $ret .= language($text)."";
+ if(!strlen($ret)) $ret = "locked";
+ }
+ else {
+ $ret = '';
+ }
+
+ break;
+ /*
+ @field:topic.cat_link
+ @description:Returns a URL setting the topic to the current topic and the topic's category to the current category
+ @attrib:_template:tpl:Template URL should point to
+ */
+ /*
+ @field:topic.link
+ @description:Returns a URL setting the topic to the current topic
+ @attrib:_template:tpl:Template URL should point to
+ */
+ case "perm_link":
+ /*
+ @field:topic.perm_link
+ @description: Returns a link to the current topic if permissions are set for the user
+ @attrib:_permission::Comma-separated permission list to check, any one permission granted to the user will create the link
+ @attrib:_system:bool:Set this to true if any one permission in the list is a system permission
+ @attrib:_noaccess:tpl:Template to link to if access is denied
+ @attrib:_template:tpl:Tempalte to link to if access is granted
+ @attrib:_text:lang:Language tag to display as the link text
+ @attrib:_plaintext:: Plain text to use instead of language tag
+ @attrib:image::Image URL to display in the anchor tag
+ */
+ $p = $element->attributes["_permission"];
+ $sys = $element->attributes["_system"];
+ $cat = $this->Get("CategoryId");
+ if(!is_numeric($cat))
+ $cat = $this->GetPrimaryCategory();
+
+ $HasPerm = $objSession->HasCatPermInList($p,$cat, $sys);
+ if(!$HasPerm && strlen($element->attributes["_noaccess"])>0)
+ {
+ $t = $element->attributes["_noaccess"];
+ $ret = $this->ItemURL($t,FALSE,"");
+ }
+ if($HasPerm)
+ {
+ $t = $element->attributes["_template"];
+ $ret = "ItemURL($t)."\">";
+ $text = $element->attributes["_text"];
+ if(!strlen($text))
+ {
+ $text = $element->attributes["_plaintext"];
+ if(!strlen($text))
+ {
+ if(strlen($element->attributes["_image"]))
+ {
+ $text = " attributes["_image"]."\" BORDER=\"0\" alt=\"\">";
+ }
+ }
+ $ret .= $text." ";
+ }
+ else
+ $ret .= language($text)."";
+ }
+ else
+ $ret = '';
+ break;
+ case "link_lock":
+ /*
+ @field:topic.link_lock
+ @description: Returns a link to lock or unlock the topic. A complete anchor tag is returned, and the tag class is set to 'topic_reply'
+ @attrib:_template:tpl:Template link should point to
+ @attrib:_text:lang:Language tag to display as the link text
+ @attrib:_plaintext:: Plain text to use instead of language tag
+ @attrib:image::Image URL to display in the anchor tag
+ */
+ $cat = $this->Get("CategoryId");
+ if(!is_numeric($cat))
+ $cat = $this->GetPrimaryCategory();
+
+ if($objSession->HasCatPermission("TOPIC.LOCK",$cat))
+ {
+ $t = $element->attributes["_template"];
+ if(strlen($t))
+ {
+ $var_list_update["t"] = $t;
+ }
+ else
+ $var_list_update["t"] = $var_list["t"];
+
+ $bb_var_list_update["top"] = $this->Get("TopicId");
+ if($this->Get("TopicType")==1)
+ {
+ $ret = " 'bb_lock_topic') )."\">";
+ }
+ else
+ $ret = " 'bb_unlock_topic') )."\">";
+ $text = $element->attributes["_text"];
+ if(!strlen($text))
+ {
+ $text = $element->attributes["_plaintext"];
+ if(!strlen($text))
+ {
+ if(strlen($element->attributes["_image"]))
+ {
+ $text = " attributes["_image"]."\" BORDER=\"0\" alt=\"\">";
+ }
+ }
+ $ret .= $text." ";
+ }
+ else
+ $ret .= language($text)."";
+ }
+ else
+ $ret = "";
+ unset($bb_var_list_update["top"], $m_var_list_update["cat"],$var_list_update["t"]);
+ break;
+
+ case "link_delete":
+ /*
+ @field:topic.link_delete
+ @description: Returns a link to delete the topic.
+ @attrib:_template:tpl:Template link should point to
+ @attrib:_text:lang:Language tag to display as the link text
+ @attrib:_plaintext:: Plain text to use instead of language tag
+ @attrib:image::Image URL to display in the anchor tag
+ */
+ $cat = $this->Get("CategoryId");
+ if(!is_numeric($cat))
+ $cat = $this->GetPrimaryCategory();
+
+ $OwnerPerm = ($objSession->HasCatPermission("TOPIC.OWNER.DELETE", $cat) &&
+ $objSession->Get("PortalUserId")==$this->Get("OwnerId"));
+
+ if($objSession->HasCatPermission("TOPIC.DELETE",$cat) || $OwnerPerm)
+ {
+ $bb_var_list_update["top"] = $this->Get("TopicId");
+ $m_var_list_update["cat"] = $cat;
+ $ret = " 'bb_topic_delete') ) ."\">";
+ $text = $element->attributes["_text"];
+ if(!strlen($text))
+ {
+ $text = $element->attributes["_plaintext"];
+ if(!strlen($text))
+ {
+ if(strlen($element->attributes["_image"]))
+ {
+ $text = " attributes["_image"]."\" BORDER=\"0\" alt=\"\">";
+ }
+ }
+ $ret .= $text." ";
+ }
+ else
+ $ret .= language($text)."";
+ }
+ else
+ $ret = "";
+
+ unset($bb_var_list_update["top"], $m_var_list_update["cat"]);
+ break;
+
+ case "link_edit":
+ /*
+ @field:topic.link_edit
+ @description: Rturns a link edit the topic. A complete anchor tag is returned, and the tag class is set to 'topic_reply'
+ @attrib:_template:tpl:Template link should point to
+ @attrib:_text:lang:Language tag to display as the link text
+ @attrib:_plaintext:: Plain text to use instead of language tag
+ @attrib:image::Image URL to display in the anchor tag
+ */
+ $cat = $this->Get("CategoryId");
+ if (!is_numeric($cat)) {
+ $cat = $this->GetPrimaryCategory();
+ }
+
+ $perms[1] = $objSession->HasCatPermission('TOPIC.MODIFY', $cat) || $objSession->HasCatPermission("TOPIC.MODIFY.PENDING", $cat);
+ $perms[2] = $objSession->Get("PortalUserId") == $this->Get("OwnerId") && $objSession->HasCatPermission("TOPIC.OWNER.MODIFY", $cat);
+ $perms[3] = $objSession->Get("PortalUserId") == $this->Get("OwnerId") && $objSession->HasCatPermission("TOPIC.OWNER.MODIFY.PENDING", $cat);
+
+ if ( ($perms[1] || $perms[2] || $perms[3]) && ($this->Get("TopicType") == 1) ) {
+
+ $bb_var_list_update["top"] = $this->Get("TopicId");
+ $m_var_list_update["cat"] = $cat;
+ $var_list_update["t"] = $element->attributes["_template"];
+ if(strlen($element->attributes["_template"]))
+ {
+ $ret = "";
+ $text = $element->attributes["_text"];
+ if(!strlen($text))
+ {
+ $text = $element->attributes["_plaintext"];
+ if(!strlen($text))
+ {
+ if(strlen($element->attributes["_image"]))
+ {
+ $text = " attributes["_image"]."\" BORDER=\"0\" alt=\"\">";
+ }
+ }
+ $ret .= $text." ";
+ }
+ else
+ $ret .= language($text)."";
+ }
+ else
+ $ret = "[no template]";
+ }
+ else
+ $ret = "";
+ unset($bb_var_list_update["top"], $var_list_update["t"],$m_var_list_update["cat"]);
+ break;
+
+ case "link_reply":
+ /*
+ @field:topic.link_reply
+ @description: Rturns a link to post a reply to the topic. A complete anchor tag is returned, and the tag class is set to 'topic_reply'
+ @attrib:_template:tpl:Template link should point to
+ @attrib:_text:lang:Language tag to display as the link text
+ @attrib:_plaintext:: Plain text to use instead of language tag
+ @attrib:image::Image URL to display in the anchor tag
+ */
+ if(($objSession->HasCatPermission("TOPIC.REPLY.ADD") ||
+ $objSession->Get("PortalUserId")==$this->Get("OwnerId"))
+ && $this->Get("TopicType")==1)
+ {
+ $bb_var_list_update["top"] = $this->Get("TopicId");
+ $var_list_update["t"] = $element->attributes["_template"];
+ if(strlen($element->attributes["_template"]))
+ {
+ $ret = "";
+ $text = $element->attributes["_text"];
+ if(!strlen($text))
+ {
+ $text = $element->attributes["_plaintext"];
+ if(!strlen($text))
+ {
+ if(strlen($element->attributes["_image"]))
+ {
+ $text = " attributes["_image"]."\" BORDER=\"0\" alt=\"\">";
+ }
+ }
+ $ret .= $text." ";
+ }
+ else
+ $ret .= language($text)."";
+ }
+ else
+ $ret = "";
+ }
+ else
+ $ret = "";
+ unset($bb_var_list_update["top"],$var_list_update["t"]);
+ break;
+
+ case "add_favorite_link":
+ /*
+ @field:topic.add_favorite_link
+ @description:Returns a URL to add this topic to the user's favorites
+ @attrib:_template:tpl:Template URL should point to
+ */
+ $t = $element->attributes["_template"];
+ if(!strlen($t))
+ $t = $var_list["t"];
+ $ret = $this->ItemURL($t,FALSE,"bb_add_favorite");
+ break;
+ case "del_favorite_link":
+ /*
+ @field:topic.del_favorite_link
+ @description:Returns a URL to remove this link from the user's favorites
+ @attrib:_template:tpl:Template URL should point to
+ */
+ $t = $element->attributes["_template"];
+ if(!strlen($t))
+ $t = $var_list["t"];
+ $ret = $this->ItemURL($t,FALSE,"bb_del_favorite");
+ break;
+ /*
+ @field:topic.favorite_toggle
+ @description: Returns a link to set or reset the favorite flag for the current user
+ @attrib: _template:tpl:Template to link to if user has the FAVORITES permission (defaults to current template)
+ @attrib: _denytemplate:tpl: Template to link to if user does not have favorites permission (ie Guest) Defaults to current template
+ @attrib: _addlabel:lang:Language tag to display if link is to add favorite
+ @attrib: _addimage::Image url to include in link if adding favorite
+ @attrib: _dellabel:lang:Language tag to display if item is already a favorite
+ @attrib: _delimage::Image url to include in link if removing the favorite
+ */
+ case "favorite_toggle":
+
+ $t = $element->attributes["_template"];
+ if(!strlen($t))
+ $t = $var_list["t"];
+
+ if(!$this->IsFavorite())
+ {
+ $action = "bb_add_favorite";
+ if (!strlen($element->attributes["_addlabel"])) {
+ $text = " attributes["_addimage"]."\" BORDER=\"0\" alt=\"\">";
+ }
+ else {
+ $label = $element->attributes["_addlabel"];
+ }
+ }
+ else
+ {
+ $action = "bb_del_favorite";
+ if (!strlen($element->attributes["_dellabel"])) {
+ $text = " attributes["_delimage"]."\" BORDER=\"0\" alt=\"\">";
+ }
+ else {
+ $label = $element->attributes["_dellabel"];
+ }
+ }
+ if (strlen($label)) {
+ $text = language($label);
+ }
+ $ret = "ItemURL($t,FALSE,$action)."\">".$text." ";
+ break;
+ case "admin_icon":
+ if( $element->GetAttributeByName('_fulltag') )
+ {
+ $ret = " StatusIcon()."\" alt=\"\">";
+ }
+ else
+ $ret = $this->StatusIcon();
+ break;
+ case "admin_modified":
+ if($this->Get("Modified")<=0)
+ return "-";
+ return LangDate($this->Get("Modified"))." ".LangTime($this->Get("Modified"));
+ break;
+ case "post_pagelist":
+ /*
+ @field:topic.post_pagelist
+ @description: Returns a page navigation link set for this topic, assuming the current page of the post list is page 1. If less that one page full of posts exists, nothing is returned
+ @attrib:_DestTemplate:tpl: Template the links should point to
+ @attrib:_PagesToList:int: Number of pages listed in the bar
+ */
+ $plist = new clsPostingList();
+ $plist->TopicID = $this->Get('TopicId'); //$this->TopicID;
+ $where = 'TopicId = '.$this->Get('TopicId');
+ $plist->QueryItemCount = $this->GetPosts();
+ $plist->Page = 0;
+ $t = $element->attributes['_desttemplate'];
+ $PagesToList = $element->attributes['_pagestolist'];
+ if (!is_numeric($PagesToList)) $PagesToList = 10;
+ if ($plist->QueryItemCount > $objConfig->Get('Perpage_Postings'))
+ {
+ $ret = $plist->GetPageLinkList($t,'',$PagesToList, $extra_attribs);
+ }
+ else
+ {
+ $ret = '';
+ }
+ break;
+ case "postedby":
+ /*
+ @field:topic.postedby
+ @description:Returns the login name of the last poster in this topic
+ */
+ $ret = $this->Get("PostedBy");
+
+ if ($ret == '') {
+ $ret = admin_language("lu_Guest");
+ }
+ break;
+ case "admin_cell_back":
+ $ret = int_table_color_ret();
+ break;
+ /*
+ @field:topic.rating
+ @description:Displays the topic rating
+ @attrib:_displaymode:: How the rating should be displayed
+
+ "Numerical": Show the decimal value
+ "Text": Show the text version
+ "Graphical":Show images representing the rating
+
+ @attrib:_onimage::on image tick shown in graphical display mode
+ @attrib:_offimage::off image tick shown in graphical display mode
+ @attrib:_separator::In graphical display mode, this html is placed between each tick image
+ */
+ /*
+ @field:topic.reviews
+ @description:Return the number of reviews for think link
+ @attrib:_today:bool:Count reviews added today only
+ */
+ case "votes":
+ /*
+ @field:topic.votes
+ @description:Return the number of rating votes for this topic
+ */
+ $ret = $this->Get("CachedVotesQty");
+ break;
+
+
+ case 'icon':
+ $icons = Array();
+ $icons['new'] = $element->GetAttributeByName('_new_icon');
+ $icons['no_new'] = $element->GetAttributeByName('_no_new_icon');
+ $icons['locked'] = $element->GetAttributeByName('_locked_icon');
+
+
+ if ($this->Get('TopicType') == 0 || $objSession->Get('PortalUserId') <= 0) {
+ $ret = $icons['locked'];
+ break;
+ }
+
+ $topic_modified = $this->Get('Modified');
+ if (!$topic_modified) {
+ $topic_modified = $this->Get('CreatedOn');
+ }
+
+ $last_login = $objSession->GetPersistantVariable('LastLogin');
+
+ if ($last_login < $topic_modified) {
+ $ret = $icons['new'];
+ }
+ else {
+ $ret = $icons['no_new'];
+ }
+ break;
+
+ /*
+ @field:topic.new
+ @description:returns text if topic's status is "new"
+ @attrib:_label:lang: Text to return if status is new
+ */
+ /*
+ @field:topic.pop
+ @description:returns text if topic's status is "popular"
+ @attrib:_label:lang: Text to return if status is popular
+ */
+ /*
+ @field:topic.hot
+ @description:returns text if topic's status is "hot"
+ @attrib:_label:lang: Text to return if status is "hot"
+ */
+ /*
+ @field:topic.pick
+ @description:returns text if topic's status is "hot"
+ @attrib:_label:lang: Text to return if status is "hot"
+ */
+ }
+ if(!isset($ret))
+ $ret = parent::ParseObject($element);
+ }
+ else
+ {
+ $ret = $this->parsetag($element->name);
+ }
+ return $ret;
+ }
+
+ function parsetag($tagname)
+ {
+ global $objConfig, $objSession, $objUsers, $var_list_update, $bb_var_list_update, $bb_var_list;
+
+ switch($tagname)
+ {
+ case "topic_admin_icon":
+ return $this->StatusIcon();
+ break;
+ case "topic_id":
+ return $this->Get("TopicId");
+ break;
+ case "topic_resourceid":
+ return $this->Get("ResourceId");
+ break;
+ case "topic_modified":
+ if ($this->Get('Modified') <= 0) {
+ return '';
+ }
+ return LangDate($this->Get('Modified'), 0, true);
+ break;
+
+ case "topic_modified_time":
+ if ($this->Get('Modified') <= 0) {
+ return '';
+ }
+ return LangTime($this->Get('Modified'), 0, true);
+ break;
+
+ case "topic_admin_modified":
+ if($this->Get("Modified")<=0)
+ return "-";
+ return LangDate($this->Get("Modified"))." ".LangTime($this->Get("Modified"));
+ break;
+ case "topic_created":
+ if ($this->Get('CreatedOn') <= 0) {
+ return '';
+ }
+ return LangDate($this->Get('CreatedOn'), 0, true);
+ break;
+
+ case "topic_created_time":
+ if ($this->Get('CreatedOn') <= 0) {
+ return '';
+ }
+ return LangTime($this->Get('CreatedOn'), 0, true);
+ break;
+
+ case "topic_text":
+ return inp_unescape($this->Get("TopicText"));
+ break;
+ case "topic_delete":
+ if($this->CheckPermission("DELETE"))
+ {
+ $bb_var_list_update["top"] = $this->Get("TopicId");
+ return " 'bb_topic_delete') ) ."\">".language("delete")." ";
+ }
+ else
+ return "";
+ break;
+ case "topic_name":
+ return inp_unescape($this->Get("TopicText"));
+ break;
+ case "topic_views":
+ return $this->Get("Views");
+ break;
+ case "topic_posts":
+ return $this->GetPosts();
+ break;
+ case "topic_replies":
+ return $this->GetPosts() - 1;
+ break;
+ case "topic_priority":
+ if($this->Get("Priority")>0)
+ {
+ return (int)$this->Get("Priority");
+ }
+ else
+ return "";
+ break;
+ case "topic_pick":
+ if ($this->Is("EditorsPick"))
+ return "pick";
+ break;
+ case "topic_new":
+ if ($this->IsNewItem())
+ return "new";
+ break;
+ case "topic_pop":
+ if ($this->IsPopItem())
+ return "pop";
+ break;
+ case "topic_hot":
+ if ($this->IsHotItem())
+ return "hot";
+ break;
+ case "topic_poster":
+ return $this->Get("PostedBy");
+ break;
+ case "topic_category":
+ return $this->Get("CategoryId");
+ break;
+ case "topic_last_post":
+ return LangDate($this->Get("Modified"));
+ break;
+ case "topic_link":
+ $var_list_update["t"] = "inbulletin/bb_post_list";
+ $bb_var_list_update["top"] = $this->Get("TopicId");
+ $bb_var_list_update["cat"] = $this->Get("CategoryId");
+ $bb_var_list_update["pp"]=1;
+ $ret = HREF_Wrapper();
+ unset($var_list_update["t"], $bb_var_list_update["top"]);
+
+ return $ret;
+ break;
+ case "topic_review_link":
+ $var_list_update["t"] = "inbulletin/bb_reviews";
+ $bb_var_list_update["top"] = $this->Get("TopicId");
+ $bb_var_list_update["cat"] = $this->Get("CategoryId");
+ $bb_var_list_update["pp"]=1;
+ $ret = HREF_Wrapper();
+ unset($var_list_update["t"], $bb_var_list_update["top"]);
+
+ return $ret;
+ break;
+
+ case "topic_rate_link":
+ $var_list_update["t"] = "inbulletin/bb_rate";
+ $bb_var_list_update["top"] = $this->Get("TopicId");
+ $bb_var_list_update["cat"] = $this->Get("CategoryId");
+ $bb_var_list_update["pp"]=1;
+ $ret = HREF_Wrapper();
+ unset($var_list_update["t"], $bb_var_list_update["top"]);
+
+ return $ret;
+ break;
+ case "topic_num_reviews":
+ $ret = $this->ReviewCount();
+ return $ret;
+ break;
+ case "topic_votes":
+ return $this->Get("CachedVotesQty");
+ break;
+ case "topic_rating":
+ return round($this->Get("CachedRating"),1);
+ break;
+ case "topic_rating_txt":
+ return RatingText($this->Get("CachedRating"));
+ break;
+ case "topic_type_img":
+ $last_login = $objSession->GetPersistantVariable("LastLogin");
+
+ if ($objSession->Get("PortalUserId") == -2)
+ {
+ $n = $this->GetPosts();
+ if ($n > 25)
+ return "inbulletin/images/hot_folder.gif";
+ else
+ return "inbulletin/images/folder.gif";
+
+ }
+
+ $n = $this->GetPostsSince($last_login);
+ if ($n > 25)
+ return "inbulletin/images/hot_red_folder.gif";
+ elseif ($n > 0)
+ return "inbulletin/images/red_folder.gif";
+ else
+ {
+ $n2 = $this->GetPosts();
+ if ($n2 > 25)
+ return "inbulletin/images/hot_folder.gif";
+ else
+ return "inbulletin/images/folder.gif";
+ }
+ break;
+
+ case "topic_admin_cell_back":
+ return int_table_color_ret();
+ default:
+ return "Undefined:$tagname";
+ break;
+ }
+ }
+
+ function UpdateCategoryPostCount($CatId=NULL)
+ {
+ global $objCatList,$objCountCache;
+
+ if(!is_numeric($CatId))
+ $CatId = $objCatList->CurrentCategoryID();
+
+ $PostCount = 0;
+ $sql = "SELECT SUM(Posts) as PostCount,count(TopicId) as TopicCount FROM ".$this->tablename." INNER JOIN ".GetTablePrefix()."CategoryItems ON ";
+ $sql .= "(".$this->tablename.".ResourceId=".GetTablePrefix()."CategoryItems.ItemResourceId) WHERE CategoryId=$CatId AND Status=1";
+ $rs = $this->adodbConnection->Execute($sql);
+ if($rs && !$rs->EOF)
+ $PostCount = $rs->fields["PostCount"];
+
+ if($PostCount>0)
+ $PostCount = $PostCount - (int)$rs->fields["TopicCount"];
+ $sql = "UPDATE ".$objCountCache->SourceTable." SET Value=".(int)$PostCount.",LastUpdate=".adodb_date("U")." WHERE ItemType=30 AND ListType=30 AND ExtraId=$CatId";
+ $this->adodbConnection->Execute($sql);
+ }
+
+ function &AddPost($PosterAlias,$Pending, $PostingText, $Subject="")
+ {
+ global $objUsers,$objSession, $objCatList;
+
+ $u =& $objSession->CurrentUser;
+
+ if (is_object($u)) {
+ $posts = (int)$u->GetPersistantVariable("bb_posts");
+ $posts++;
+ $u->SetPersistantVariable("bb_posts",$posts);
+ }
+
+ $p = New clsPosting(NULL);
+ $p->Set(array("PosterAlias", "Pending", "PostingText", "TopicId"),
+ array($PosterAlias, $Pending, str_replace("env=".$objSession->GetSessionKey(), "env=",$PostingText), $this->Get("TopicId")));
+ $p->Set("IPAddress",$_SERVER["REMOTE_ADDR"]);
+ $p->Set("CreatedOn",adodb_date("U"));
+ if (is_object($u)) {
+ $p->Set("CreatedById",$u->Get("PortalUserId"));
+ }
+ if(strlen($Subject))
+ {
+ $p->Set("Subject",$Subject);
+ }
+ $p->Create();
+
+
+ $this->Increment("Posts");
+ $this->Set(array("Modified", "ModifiedById"), array(adodb_mktime(), $objSession->Get("PortalUserId")));
+ $this->Set("LastPostId",$p->Get("PostingId"));
+ $this->Set("LastPostDate",$p->Get("CreatedOn"));
+ $this->Update();
+
+ $this->UpdateCategoryPostCount();
+ if($this->Get("NotifyOwnerOnChanges"))
+ {
+ $this->SendUserEventMail("POST.ADD",$this->Get("OwnerId"));
+ }
+
+ if (is_object($u)) {
+ $this->SendUserEventMail("POST.ADD",$u->Get("PortalUserId"));
+ }
+ $this->SendAdminEventMail("POST.ADD");
+
+ $CategoryId = $this->Get("CategoryId");
+ if(!is_numeric($CategoryId))
+ $CategoryId = $objCatList->CurrentCategoryID();
+
+ return $p;
+ }
+
+ function GetLastPostId()
+ {
+
+ $sql = "SELECT PostingId FROM ".GetTablePrefix()."Posting WHERE TopicId=".$this->Get("TopicId");
+ $sql .= " ORDER BY CreatedOn DESC LIMIT 1";
+ $rs = $this->adodbConnection->Execute($sql);
+ if($rs && !$rs->EOF)
+ {
+ $ret = $rs->fields["PostingId"];
+ }
+ else
+ $ret = 0;
+ return $ret;
+ }
+
+ function CopyToNewResource($TargetCat = NULL,$NameField="")
+ {
+ $OldTopicId = $this->Get("TopicId");
+
+ parent::CopyToNewResource($TargetCat,$NameField);
+ $p = new clsPostingList();
+ $p->TopicID = $OldTopicId;
+ $sql = "SELECT * FROM ".$p->SourceTable." WHERE TopicId=$OldTopicId ";
+ $p->Query_Item($sql,-1,-1);
+ if($p->NumItems()>0)
+ {
+ foreach($p->Items as $post)
+ {
+ $post->Set("TopicId",$this->Get("TopicId"));
+ $post->UnsetIdField();
+ $post->Create();
+ }
+ $this->Set("Posts",$p->NumItems());
+ }
+ }
+
+ function SetTodayPosts($IncrementBy)
+ {
+ $DateNow = adodb_date('Y-m-d', adodb_mktime() );
+ $LastTodayDate = $this->Get('TodayDate');
+ $TodayPosts = ($DateNow == $LastTodayDate) ? $this->Get('TodayPosts') : 0;
+ $TodayPosts += $IncrementBy;
+ $this->Set('TodayDate', $DateNow);
+ $this->Set('TodayPosts', $TodayPosts);
+ $this->Update();
+ }
+
+}
+
+class _clsTopicList extends clsCatItemList {
+ //var $Page;
+ var $CategoryID;
+ var $Permissions;
+ // var $PerPageVar;
+
+ function _clsTopicList($CatID=NULL)
+ {
+ global $objSession,$bb_var_list;
+
+ $this->clsCatItemList();
+ $this->classname="clsTopic";
+ $this->SourceTable = GetTablePrefix()."Topic";
+ $this->Page = $bb_var_list["tp"];
+ $this->BasePermission="TOPIC";
+ $this->PerPageVar = "Perpage_Topics";
+ $this->PageEnvar="bb_var_list_update";
+ $this->PageEnvarIndex = "tp";
+
+ $this->PerPageVarLong = "Perpage_Topics";
+ $this->PerPageShortVar = "Perpage_Topics_Short";
+
+ $this->AddSortField('Topic_SortField','Topic_SortOrder');
+ $this->AddSortField('Topic_SortField2','Topic_SortOrder2');
+
+ $this->ItemType = TYPE_TOPIC;
+
+ if( isset($CatID) ) $this->CategoryID = $CatID;
+ $this->AdminSearchFields = array('TopicText','PostedBy');
+ }
+
+ function SaveNewPage()
+ {
+ global $bb_var_list;
+ $bb_var_list["tp"] = $this->Page;
+ }
+
+ function GetHotValue()
+ {
+ global $objConfig;
+
+ $ado = &GetADODBConnection();
+ $sql = "SELECT Views FROM ".GetTablePrefix()."Topic ORDER BY Views DESC LIMIT 0,".$objConfig->Get("Topic_VotesToHot");
+ $rs = $ado->Execute($sql);
+
+ $hot_val = 0;
+ while ($rs && !$rs->EOF) {
+ if ($rs->fields['Views'] > 0) {
+ $hot_val = $rs->fields['Views'];
+ }
+ $rs->MoveNext();
+ }
+
+ return $hot_val;
+ }
+
+ function GetPopValue()
+ {
+ global $PopValues,$objConfig, $objSystemCache;
+
+ if( isset($PopValues['topic']) && is_numeric($PopValues['topic']) )
+ {
+ return $PopValues['topic'];
+ }
+ else
+ {
+ $PopValues['topic'] = $objConfig->Get('Topic_PostsToPop');
+ /*$CachedValue = $objSystemCache->GetValue("TopicPopValue","inbulletin","");
+ if(strlen($CachedValue))
+ {
+ $PopValues["topic"] = $CachedValue;
+ return $CachedValue;
+ }
+ $ado = &GetADODBConnection();
+ $sql = "SELECT CachedRating FROM ".GetTablePrefix()."Topic WHERE CachedVotesQty > ".(int)$objConfig->Get("Topic_MinVotes")." ORDER BY CachedRating DESC,CachedVotesQty DESC LIMIT 0,".(int)$objConfig->Get("Topic_PostsToPop");
+
+ $rs = $ado->Execute($sql);
+ $PopValues["topic"] = 0;
+ while($rs && !$rs->EOF)
+ {
+ $PopValues["topic"] = $rs->fields["Views"];
+ $rs->MoveNext();
+ }*/
+ $objSystemCache->EditCacheItem('TopicPopValue',$PopValues['topic'],'inbulletin',adodb_mktime()+3600,'');
+ return $PopValues['topic'];
+ }
+ }
+
+
+ function HasPermission($PermissionName)
+ {
+ global $objSession,$objCatList;
+
+ if($this->CategoryID==0)
+ {
+ $this->CategoryID=$objCatList->CurrentCategoryID();
+ }
+ $cat =& $objCatList->GetCategory($this->CategoryID);
+ if(is_object($cat))
+ {
+ return ($cat->HasPermission($PermissionName,$objSession->Get("GroupId")));
+ }
+ else
+ return FALSE;
+ }
+
+ function &Add_Topic($TopicText, $CategoryId, $Status, $Pick, $OwnerNotify,$CreatedOn, $UserID = null, $add_fields = null, $auto_filename = 1, $filename = '')
+ {
+ // $add_fields - additional fields
+ global $objSession,$objUsers;
+
+ $t = new clsTopic(NULL);
+ $filename = $t->StripDisallowed($filename);
+
+ $t->tablename = $this->SourceTable;
+ $u = $objUsers->GetItem( isset($UserID) ? $UserID : $objSession->Get("PortalUserId") );
+ $t->Set(array("TopicText", "OwnerId", "TopicType","Status","PostedBy","EditorsPick",
+ "NotifyOwnerOnChanges","CreatedOn", 'AutomaticFilename', 'Filename'),
+ array(str_replace("env=".$objSession->GetSessionKey(), "env=",$TopicText), $u->Get("PortalUserId"), 1,$Status,$u->Get("Login"),$Pick,
+ $OwnerNotify, $CreatedOn, $auto_filename, $filename));
+
+ if( isset($add_fields) )
+ foreach($add_fields as $field => $value)
+ $t->Set($field, $value);
+
+ $t->Create();
+ $t->AddToCategory($CategoryId);
+ $t->SendUserEventMail("TOPIC.ADD",$u->Get("PortalUserId"));
+ $t->SendAdminEventMail("TOPIC.ADD");
+ return $t;
+ }
+
+ function LockTopic($TopicId)
+ {
+ $p = $this->GetItem($TopicId);
+ $p->Set("TopicType", 0);
+ $p->Update();
+
+ return $p;
+ }
+
+ function &Edit_Topic($TopicId,$TopicSubject,$User,$Status,$Pick, $New,$Hot,$Pop,
+ $OwnerNotify,$CreatedOn,$ModifiedOn, $Rating, $Votes, $Views, $Priority=0,$PostedBy="",
+ $IsLocked = 0, $auto_filename = 1, $filename = '')
+ {
+ global $objUsers, $objSession;
+ $p = $this->GetItem($TopicId);
+ $filename = $p->StripDisallowed($filename);
+
+ if(!strlen($PostedBy))
+ {
+ $PostedByUser = $objUsers->GetUser($User);
+ if(is_object($PostedByUser))
+ {
+ $PostedBy = $PostedByUser->Get("Login");
+ }
+ else
+ {
+ if($User==-1)
+ {
+ $PostedBy="Admin";
+ }
+ else
+ $PostedBy="";
+ }
+ }
+ if ($IsLocked == 1) {
+ $TopicType = 0;
+ }
+ else {
+ $TopicType = 1;
+ }
+
+ $p->Set(array("TopicText","ModifiedById","Status", "EditorsPick","NewItem","HotItem","PopItem",
+ "NotifyOwnerOnChanges","CreatedOn","Modified", "CachedRating","CachedVotesQty",
+ "Views","Priority","PostedBy", "TopicType", 'AutomaticFilename', 'Filename'),
+ array(str_replace("env=".$objSession->GetSessionKey(), "env=", $TopicSubject),$User,$Status,$Pick,$New,$Hot,$Pop,
+ $OwnerNotify,$CreatedOn,$ModifiedOn,$Rating,$Votes,$Views, $Priority,$PostedBy, $TopicType, $auto_filename,
+ $filename));
+ $p->Update();
+ if($p->Get("NotifyOwnerOnChanges"))
+ {
+ $p->SendUserEventMail("TOPIC.MODIFY",$p->Get("OwnerId"));
+ }
+ $p->SendAdminEventMail("TOPIC.MODIFY");
+ return $p;
+ }
+
+
+ function PasteFromClipboard($TargetCat)
+ {
+ global $objSession,$objCatList, $objPostingList;
+
+ $clip = $objSession->GetVariable("ClipBoard");
+ if(strlen($clip))
+ {
+ $ClipBoard = ParseClipboard($clip);
+ $IsCopy = (substr($ClipBoard["command"],0,4)=="COPY") || ($ClipBoard["source"] == $TargetCat);
+
+ $item_ids = explode(",",$ClipBoard["ids"]);
+ for($i=0;$iGetItem($item_ids[$i]);
+ if(!$IsCopy)
+ {
+ $item->MoveToCategory($ClipBoard["source"],$TargetCat);
+ $clip = str_replace("CUT","COPY",$clip);
+ $objSession->SetVariable("ClipBoard",$clip);
+ }
+ else
+ {
+ if($ClipBoard["source"]==$TargetCat)
+ {
+ $item->CopyToNewResource($TargetCat,"TopicText");
+ $item->AddToCategory($TargetCat);
+
+ }
+ else
+ {
+ $CatCount = $item->CategoryMemberCount();
+ if($CatCount==0)
+ {
+ $item->AddToCategory($TargetCat);
+ }
+ else
+ {
+ $item->CopyToNewResource($TargetCat,"TopicText");
+ $item->AddToCategory($TargetCat);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ function CountPending()
+ {
+ return TableCount($this->SourceTable,"Status=".STATUS_PENDING,0);
+ }
+
+ function LoadTopics($where="",$orderBy = "", $JoinCats=TRUE,$SkipClear=FALSE,$fix_method = 'set_first')
+ {
+ global $objConfig;
+
+ if(!$SkipClear)
+ $this->Clear();
+
+ $limit = $this->GetPageLimitSQL();
+
+ $this->QueryItemCount=TableCount($this->SourceTable,$where,$JoinCats);
+
+ return $this->Query_Topic($where,$orderBy,$limit, $JoinCats, $fix_method);
+ }
+
+ function Query_Topic($whereClause,$orderByClause=NULL,$limit=NULL, $JoinCats=TRUE, $fix_method = 'set_first')
+ {
+ global $objSession, $Errors;
+
+ if($JoinCats)
+ {
+ $sql = "SELECT * FROM ".$this->SourceTable." INNER JOIN ".GetTablePrefix()."CategoryItems ON ".GetTablePrefix()."CategoryItems.ItemResourceId=".
+ $this->SourceTable.".ResourceId";
+ }
+ else
+ {
+ $sql = "SELECT * FROM ".$this->SourceTable;
+ }
+
+ if(isset($whereClause))
+ $sql = sprintf('%s WHERE %s',$sql,$whereClause);
+ if(isset($orderByClause) && strlen(trim($orderByClause))>0)
+ {
+ $sql .= " ".$orderByClause;
+ }
+
+ if($objSession->HasSystemPermission("DEBUG.LIST"))
+ echo htmlentities($sql,ENT_NOQUOTES)." \n";
+
+ return $this->Query_Item($sql,null, $fix_method);
+ }
+
+ function &GetCurrentTopic()
+ {
+ global $bb_var_list;
+
+ $t =& $this->GetItem($bb_var_list["top"]);
+ return $t;
+ }
+
+ function CurrentTopicID()
+ {
+ global $bb_var_list;
+
+ return $bb_var_list["top"];
+ }
+
+ function LoadTopicsCategory($attribs)
+ {
+ global $objCatList, $objSession, $objConfig, $objPermissions;
+
+ $OrderBy ='';
+ $CatId = $attribs['_catid'];
+ if(!is_numeric($CatId))
+ $CatId = $objCatList->CurrentCategoryID();
+
+ if(!$CatId && (int)$attribs['_useroot'])
+ $CatId = (int)$objConfig->Get('Topic_Root');
+
+ $this->CategoryID=$CatId;
+ $this->Clear();
+
+ $limit = $this->GetPageLimitSQL();
+
+ if($objSession->HasCatPermission('TOPIC.VIEW',$CatId))
+ {
+ $sort_field = trim( $objSession->GetPersistantVariable('Topic_SortField') );
+ if( !strlen($sort_field) ) $sort_field = trim($objConfig->Get('Topic_SortField'));
+
+ if($sort_field)
+ {
+ $OrderBy = 'Priority DESC, '.$sort_field.' '.
+ $objSession->GetPersistantVariable('Topic_SortOrder');
+ }
+ else
+ $OrderBy = 'Priority DESC';
+
+ $pre = GetTablePrefix();
+ $s = $this->SourceTable;
+ $sql = 'SELECT '.$s.'.*,lp.PosterAlias as LastPoster,lp.CreatedOn as PLastPostDate FROM '.$s.' INNER JOIN '.$pre.'CategoryItems ON ('.$pre.'CategoryItems.ItemResourceId='.$s.'.ResourceId) ';
+ $sql .= ' LEFT JOIN '.$pre.'Posting as lp ON (lp.PostingId='.$s.'.LastPostId) WHERE ';
+
+ $where = 'CategoryId = '.$CatId.' AND '.$s.'.Status = 1 ';
+
+ $sql .= $where;
+ $this->QueryItemCount=QueryCount($sql);
+
+ if (($sort_field != 'LastPoster') && ($sort_field != 'LastPostDate')) {
+ $use_table = TRUE;
+ }
+ else {
+ $use_table = FALSE;
+ }
+ //echo "$sort_field: $use_table ";
+ $OrderBy = $this->QueryOrderByClause(TRUE, TRUE, $use_table);
+ $sql .= " ".$OrderBy;
+ //echo 'TopicList SQL : '.$sql.' ';
+
+ return $this->Query_Item($sql);
+ }
+ }
+
+ function CategoryCount($attribs=array())
+ {
+ global $objItemTypes;
+
+ if(is_numeric($attribs["_itemtype"]))
+ {
+ $item = $objItemTypes->GetItem($attribs["_itemtype"]);
+ }
+ else
+ $item = $objItemTypes->GetTypeByName($attribs["_itemtype"]);
+
+ if($item->Get("ItemType") != 30)
+ {
+ return parent::CategoryCount($attribs);
+ }
+ else
+ {
+ global $objPostingList;
+
+ return $objPostingList->CategoryCount($attribs);
+ }
+ }
+
+ function SqlGlobalCount($attribs=array())
+ {
+ global $objSession, $objItemTypes,$objPermissions, $objCatList;
+
+ //$old_cat=$objCatList->CurrentCategoryID()
+
+ if(is_numeric($attribs['_itemtype']))
+ {
+ $item = $objItemTypes->GetItem($attribs['_itemtype']);
+ }
+ else
+ {
+ $item = $objItemTypes->GetTypeByName($attribs['_itemtype']);
+ }
+
+ $t = $this->SourceTable;
+ $acl = $objSession->GetACLClause();
+ $cattable = GetTablePrefix().'CategoryItems';
+ $CategoryTable = GetTablePrefix().'Category';
+ $ptable = GetTablePrefix().'PermCache';
+ $VIEW = $objPermissions->GetPermId('TOPIC.VIEW');
+
+ $where = '';
+ $today = adodb_mktime(0,0,0,adodb_date('m'),adodb_date('d'),adodb_date('Y'));
+
+ if($item->Get('ItemType') == $this->ItemType)
+ {
+ // count topics in current category & it's subcategories
+
+ if($attribs['_today'])
+ {
+ $where = 'AND ('.$t.'.CreatedOn >= '.$today.')';
+ }
+ $sql = "SELECT count(*) as CacheVal FROM $t
+ INNER JOIN $cattable ON ($cattable.ItemResourceId=$t.ResourceId)
+ INNER JOIN $CategoryTable ON ($CategoryTable.CategoryId=$cattable.CategoryId)
+ INNER JOIN $ptable ON ($cattable.CategoryId=$ptable.CategoryId)
+ WHERE ($acl AND PermId=$VIEW AND $cattable.PrimaryCat=1 AND $CategoryTable.Status=1) AND
+ FIND_IN_SET(".$objCatList->CurrentCategoryID().", REPlACE(ParentPath,'|',',')) $where";
+ return $sql;
+
+ }
+ elseif($item->Get('ItemType') == 30)
+ {
+ // counting post here
+ if (getArrayValue($attribs, '_today'))
+ {
+ $where = 'AND ('.$t.'. TodayDate = \''.adodb_date('Y-m-d', $today).'\')';
+ $CountField = 'TodayPosts';
+ }
+ else
+ {
+ $CountField = 'Posts';
+ }
+
+ $sql = "SELECT SUM($CountField) as CachedVal FROM $t ";
+ $sql .="INNER JOIN $cattable ON ($cattable.ItemResourceId=$t.ResourceId) ";
+ $sql .="INNER JOIN $CategoryTable ON ($CategoryTable.CategoryId=$cattable.CategoryId) ";
+ $sql .="INNER JOIN $ptable ON ($cattable.CategoryId=$ptable.CategoryId) ";
+ $sql .="WHERE ($acl AND PermId=$VIEW AND $cattable.PrimaryCat=1 AND $CategoryTable.Status=1) ";
+ $sql .=" AND ($t.Status=1) AND FIND_IN_SET(".$objCatList->CurrentCategoryID().", REPlACE(ParentPath,'|',',')) $where";
+ //echo "Posts count sql: $sql ";
+ return $sql;
+ }
+ }
+
+ function DoGlobalCount($attribs)
+ {
+ global $objItemTypes;
+
+ if(is_numeric($attribs["_itemtype"]))
+ {
+ $item = $objItemTypes->GetItem($attribs["_itemtype"]);
+ }
+ else
+ $item = $objItemTypes->GetTypeByName($attribs["_itemtype"]);
+
+ // ItemType: 30 - Posts, 3 - Topics
+
+ if($item->Get("ItemType") != 30)
+ {
+ return parent::DoGlobalCount($attribs);
+ }
+ else
+ {
+ global $objPostingList;
+ //echo "PostsCount: ".$objPostingList->DoGlobalCount($attribs)." ";
+ return $objPostingList->DoGlobalCount($attribs);
+ }
+ }
+
+ function CacheListExtraId($ListType)
+ {
+ if( !strlen($ListType) ) $ListType = '_';
+ switch($ListType)
+ {
+ case '_':
+ global $objCatList;
+ return $objCatList->CurrentCategoryID();
+ break;
+
+ default:
+ return parent::CacheListExtraId($ListType);
+ break;
+ }
+ return $ExtraId;
+ }
+
+ function SqlMyItems($attribs=array())
+ {
+ global $objSession;
+
+ if(getArrayValue($attribs,'_shortlist'))
+ {
+ $this->PerPageVar = $this->PerPageShortVar;
+ }
+ else
+ $this->PerPageVar = $this->PerPageVarLong;
+
+ $TableName = $this->SourceTable;
+ $where = " ".$TableName.".Status>0 AND ".$TableName.".OwnerId=".$objSession->Get("PortalUserId");
+ if(getArrayValue($attribs,'_today'))
+ {
+ $today = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d"),adodb_date("Y"));
+ $where .= " AND ($TableName.CreatedOn>=$today)";
+ }
+ $CategoryTable = GetTablePrefix()."Category";
+ $sql = "SELECT $TableName.*,$CategoryTable.CategoryId,$CategoryTable.CachedNavBar FROM $TableName ";
+ $p = $this->BasePermission.".VIEW";
+ $sql .= $this->GetJoinedSQL($p,null,$where); // maybe null will be CategoryId someday
+
+ $OrderBy = $this->QueryOrderByClause(TRUE,TRUE,TRUE);
+ $sql .= " ".$OrderBy;
+
+ return $sql;
+ }
+
+ function ResetCache($CategoryId)
+ {
+ global $objCountCache;
+ $db =& GetADODBConnection();
+ $sql = 'SELECT ParentPath FROM '.GetTablePrefix().'Category WHERE CategoryId = '.$CategoryId;
+ $parents = $db->GetOne($sql);
+ $parents = substr($parents,1,strlen($parents)-2);
+ $parents = explode('|',$parents);
+ foreach($parents as $ParentCategoryId)
+ {
+ $objCountCache->DeleteValue('_', TYPE_TOPIC, $ParentCategoryId, 0); // total topic count
+ $objCountCache->DeleteValue('_', TYPE_TOPIC, $ParentCategoryId, 1); // total
+ }
+ }
+
+} /*clsTopicList*/
+
+
+?>
Index: branches/unlabeled/unlabeled-1.51.2/in-bulletin/parser.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.51.2/in-bulletin/parser.php (revision 0)
+++ branches/unlabeled/unlabeled-1.51.2/in-bulletin/parser.php (revision 12744)
@@ -0,0 +1,1813 @@
+CurrentCategoryID();
+
+ $cat_count = (int)getArrayValue($attribs,'_maxlistcount');
+ /* validation */
+ if(strlen($attribs["_itemtemplate"])==0)
+ {
+ if($attribs["dataexists"])
+ $content_set = 0;
+ return "";
+ }
+
+ $GroupList = $objSession->Get("GroupList");
+ if(strlen($GroupList))
+ {
+ $Groups = explode(",",$GroupList);
+ }
+ $acl_where = "";
+ if(@count($Groups)>0 && is_array($Groups))
+ {
+ $acl_where = array();
+ for($i=0;$iClear();
+ $OrderBy = $objCatList->QueryOrderByClause(TRUE,TRUE,TRUE);
+ $objCatList->LoadCategories("ParentId=$CategoryId AND Status=1",$OrderBy);
+ if ($objCatList->NumItems() == 0)
+ {
+ if($attribs["_dataexists"])
+ $content_set = 0;
+ return "";
+ }
+
+ $html_attr = ExtraAttributes($attribs);
+
+ $o="";
+ $notable = $attribs["_notable"];
+
+ $count=0;
+ $row=0;
+ $var_list_update["t"] = $var_list["t"];
+
+ if(!$notable)
+ {
+ $per_row = ceil($objCatList->NumItems()/$cols);
+ $o = "";
+ $o .= "";
+ $CatCount = $objCatList->NumItems();
+ foreach($objCatList->Items as $cat)
+ {
+ $parsed=0;
+ if($count==$per_row)
+ {
+ $o .= " ";
+ $count=0;
+ }
+ if($row==0 && strlen($attribs["_firstitemtemplate"]))
+ {
+ $o.= $cat->ParseTemplate($attribs["_firstitemtemplate"]);
+ $parsed=1;
+ }
+ if($row==$CatCount-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0)
+ {
+ $o .= $cat->ParseTemplate($attribs["_lastitemtemplate"]);
+ $parsed=1;
+ }
+ if(!$parsed)
+ $o.= $cat->ParseTemplate($attribs["_itemtemplate"]);
+ $count++;
+ $row++;
+ }
+ if($count != $per_row)
+ $o .= " ";
+ $o .= "\n
\n";
+ }
+ else
+ {
+ $CatCount = $objCatList->NumItems();
+ foreach($objCatList->Items as $cat)
+ {
+ if($cat->Get("ParentId")==$CategoryId)
+ {
+
+ if($row==0 && strlen($attribs["_firstitemtemplate"]))
+ {
+ //echo 'Saving ID in m_sub_cats [ first ] '.$cat->UniqueId().' ';
+ //$GLOBALS['cat_ID'] = $cat->UniqueId();
+ $o.= $cat->ParseTemplate($attribs["_firstitemtemplate"]);
+ $parsed=1;
+ }
+ if($row==$CatCount-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0)
+ {
+ //echo 'Saving ID in m_sub_cats [ last ] '.$cat->UniqueId().' ';
+ //$GLOBALS['cat_ID'] = $cat->UniqueId();
+ $o .= $cat->ParseTemplate($attribs["_lastitemtemplate"]);
+ $parsed=1;
+ }
+ if(!$parsed)
+ {
+ //echo 'Saving ID in m_sub_cats [ each ] '.$cat->UniqueId().' ';
+ //$GLOBALS['cat_ID'] = $cat->UniqueId();
+ $o .= $cat->ParseTemplate($attribs["_itemtemplate"]);
+ }
+ $row++;
+ $i++;
+ $count++;
+ if($count>=$cat_count && $cat_count>0)
+ break;
+ }
+ }
+ }
+ unset($var_list_update["t"]);
+ SaveTagCache("kernel","m_list_cats",$attribs,m_BuildEnv(),$o);
+ return $o;
+
+}
+
+function bb_ParseEnv($str = "")
+{
+ global $bb_var_list, $objTopicList, $objConfig, $objCatList, $objPostingList;
+
+ if ($str != "")
+ {
+ if( substr($str,0,3) == 'bb-' )
+ {
+ $str = preg_replace('/^([a-zA-Z]+)-([0-9]+)-(.*)/','\\1\\2-\\3', $str);
+ }
+
+ $str = substr($str,2);
+ $pieces = explode("-", $str);
+
+ $bb_var_list["top"] = $pieces[0]; // topic id
+ $bb_var_list["post"] = $pieces[1]; // post id
+ $bb_var_list["tp"] = $pieces[2]; // topic page
+ $bb_var_list["pp"] = $pieces[3]; // posts page
+ $bb_var_list["pmp"] = $pieces[4]; // private message page
+ $bb_var_list["pm_id"] = $pieces[5]; // private message id
+ $bb_var_list['rp'] = $pieces[6]; // reviews page
+ ResetPage('bb','tp');
+ }
+ else
+ {
+ $bb_var_list["top"] = 0;
+ $bb_var_list["post"] = 0;
+ $bb_var_list["tp"] = 1;
+ $bb_var_list["pp"] = 1;
+ $bb_var_list["pmp"] = 1;
+ $bb_var_list["pm_id"] = 0;
+ $bb_var_list['rp'] = 1;
+ }
+ //echo ""; print_r($bb_var_list); echo " ";
+if ($bb_var_list["tp"] == "") $bb_var_list["tp"] = 1;
+if ($bb_var_list["pp"] == "") $bb_var_list["pp"] = 1;
+if ($bb_var_list["pmp"] == "") $bb_var_list["pmp"] = 1;
+}
+
+function bb_LoadEnv()
+{
+ global $objSession;
+
+ $str = $objSession->GetVariable("Env_Bulletin");
+ bb_ParseEnv($str);
+}
+
+function bb_SaveEnv($str="")
+{
+ global $objSession;
+
+ $str = $objSession->SetVariable("Env_Bulletin",$str);
+}
+
+function bb_BuildEnv()
+{
+ // rp - reviews page
+ $module_vars = Array( 'top','post','tp','pp','pmp','pm_id','rp');
+ return GenerateModuleEnv('bb', $module_vars);
+}
+
+function bb_BuildEnv_NEW()
+{
+ // rp - reviews page
+ $module_vars = Array( 'top' => 'bb_id', 'post' => 'bb_post_id', 'tp' => 'bb_Page',
+ 'pp' => 'bb_Post_Page', 'pmp' => 'bb_pm_Page', 'pm_id' => 'bb_pm_id',
+ 'rp' => 'bb_Reviews_Page');
+ return GenerateModuleEnv_NEW('bb', $module_vars);
+}
+
+function LoadTopics($attribs = array())
+{
+ global $objTopicList, $objSession, $objCatList, $bb_var_list, $bb_var_list_update;
+
+ static $PagingList;
+
+ $ListType = strtolower(getArrayValue($attribs,'_listtype'));
+ $force_paging = getArrayValue($attribs,'_forcepaging');
+ if( !$ListType ) $ListType = 'category';
+ $LastList = $objSession->GetVariable('TopicListType');
+ $LastShortType = $objSession->GetVariable('TopicShortList');
+ $LastCat = $objSession->GetVariable('TopicLastCategory');
+ $NoPaging = ( getArrayValue($attribs,'_paging')=='0' || getArrayValue($attribs,'_paging')=='false');
+ if(!$NoPaging && !strlen($PagingList))
+ {
+ $PagingList=$ListType;
+ }
+ //echo "Last: $LastList, Short: $LastShortType Current: $ListType, Short:".$attribs["_shortlist"]." PageList: $PagingList \n";
+
+ if($ListType == $PagingList)
+ {
+ $objTopicList->EnablePaging = TRUE;
+ if($LastList != $ListType || $LastShortType != $attribs['_shortlist'] || $LastCat != $objCatList->CurrentCategoryID())
+ {
+ //echo 'Resetting Page.. \n';
+ $bb_var_list_update['tp'] = 1;
+ $bb_var_list_update['pp'] = 1;
+ $bb_var_list['tp'] = 1;
+ $bb_var_list['pp'] = 1;
+ $objTopicList->Page=1;
+ $objPostingList->Page=1;
+ $objSession->SetVariable('TopicListType',$ListType);
+ $objSession->SetVariable('TopicShortList',$attribs['_shortlist']);
+ $objSession->SetVariable('TopicLastCategory',$objCatList->CurrentCategoryID());
+ }
+ else
+ {
+ $objTopicList->Page = $bb_var_list['tp'];
+ }
+ }
+ else
+ {
+ if(is_numeric( getArrayValue($attribs,'_maxcount') ))
+ {
+ $objTopicList->MaxListCount = $attribs['_maxcount'];
+ }
+ else
+ $objTopicList->MaxListCount = 10;
+
+ $objTopicList->EnablePaging = FALSE;
+ }
+ //echo "ForcePaging = $force_paging ";
+ if ($force_paging == 1)
+ {
+ $objTopicList->EnablePaging = TRUE;
+ $objTopicList->Page = $bb_var_list["tp"];
+ $objSession->SetVariable('TopicListType',$ListType);
+ $objSession->SetVariable('TopicShortList',$attribs['_shortlist']);
+ }
+
+ $objTopicList->ListType=$ListType;
+ switch($ListType)
+ {
+ case 'category':
+ $objTopicList->LoadTopicsCategory($attribs);
+ break;
+ case 'new':
+ $objTopicList->LoadNewItems($attribs);
+ break;
+ case "my_new":
+ $scope = $objSession->CurrentUser->Vars["LastLogin"];
+ $attribs["_scope"] = $scope;
+ $attribs["_show_since_last"] = 1;
+ //echo "Scope: $scope ";
+ //print_pre($objSession->CurrentUser);
+ if (is_numeric($scope) && $scope > 0) {
+ $objTopicList->LoadNewItems($attribs);
+ }
+ break;
+ case 'hot':
+ $objTopicList->LoadHotItems($attribs);
+ break;
+ case 'pick':
+ $objTopicList->LoadPickItems($attribs);
+ break;
+ case 'myitems':
+ $objTopicList->LoadMyItems($attribs);
+ break;
+ case 'favorites':
+ $objTopicList->LoadFavorites($attribs);
+ break;
+ case 'search':
+ $attribs['multiple'] = 'topics';
+ $objTopicList->LoadSearchItems($attribs);
+ break;
+
+ }
+}
+
+/*
+ @description: Return post icon
+ @attrib: _posts_icon:: icon source
+ @attrib: _no_post_icon:: no post icon source
+ @attrib: _locked_post_icon:: locked post icon
+*/
+
+function bb_post_icon($attribs)
+{
+ global $objConfig, $objCatList, $objSession;
+
+ $post_icon = $attribs['_posts_icon'];
+ $no_post_icon = $attribs['_no_post_icon'];
+ $locked_post_icon = $attribs['_locked_post_icon'];
+
+ $ado = &GetADODBConnection();
+ //echo 'Retrieving CatID in bb_post_icon '.$GLOBALS['cat_ID'].' ';
+ $current_cat = $GLOBALS['cat_ID'];
+ $prefix = GetTablePrefix();
+
+
+ /*if( !$objSession->HasCatPermission('TOPIC.ADD', $current_cat) || !$objSession->HasCatPermission('TOPIC.ADD.PENDING', $current_cat) )
+ {
+ return " ";
+ }*/
+
+
+ if($attribs["_local"] && $objCatList->CurrentCategoryID() != 0)
+ {
+ $c = $objCatList->GetItem($objCatList->CurrentCategoryID());
+ $catlist = $c->GetSubCatIds();
+
+ $catwhere = "CategoryId IN (".explode(",",$catlist).")";
+ $sql = "SELECT MAX(Modified) as ModDate, ".$prefix."Topic.Status AS tStatus FROM ".$prefix."Topic ";
+ $sql .= "INNER JOIN ".$prefix."CategoryItems ON (".$prefix."Topic.ResourceId=".$prefix."CategoryItems.ItemResourceId) ";
+ $sql .= "WHERE Status=1 AND $catwhere LIMIT 1";
+ }
+ else {
+ $sql = "SELECT MAX(Modified) as Modified FROM ".$prefix."Topic WHERE Status = 1 LIMIT 1";
+ }
+ $rs = $ado->Execute($sql);
+
+ $Last = $objSession->GetPersistantVariable('LastLogin');
+
+ if ($Last < $rs->fields['Modified'])
+ {
+ return " ";
+ }
+ else
+ {
+ return " ";
+ }
+}
+
+/*
+ @description: returns the date of the last modification to a topic
+ @attrib: _Part:: part of the date to display
+ @example:
+*/
+function bb_topic_modified($attribs)
+{
+ global $objConfig, $objCatList;
+ $ret='';
+ $CachedValue = GetTagCache("inbulletin","bb_topic_modified",$attribs,"");
+ if(strlen($CachedValue)) return $CachedValue;
+
+ $ado = &GetADODBConnection();
+ if( getArrayValue($attribs,'_local') && $objCatList->CurrentCategoryID() != 0)
+ {
+ $c = $objCatList->GetItem($objCatList->CurrentCategoryID());
+ $catlist = $c->GetSubCatIds();
+
+ $catwhere = "CategoryId IN (".explode(",",$catlist).")";
+ $sql = "SELECT MAX(Modified) as ModDate FROM ".GetTablePrefix()."Topic ";
+ $sql .= "INNER JOIN ".GetTablePrefix()."CategoryItems ON (".GetTablePrefix()."Topic.ResourceId=".GetTablePrefix()."CategoryItems.ItemResourceId) ";
+ $sql .= "WHERE Status=1 AND $catwhere LIMIT 1";
+ }
+ else
+ {
+ $sql = "SELECT MAX(Modified) as ModDate FROM ".GetTablePrefix()."Topic WHERE Status=1 LIMIT 1";
+ }
+ $rs = $ado->Execute($sql);
+ if($rs && ! $rs->EOF)
+ {
+ $mod = $rs->fields["ModDate"];
+ if($mod)
+ {
+ $part = strtolower($attribs["_part"]);
+ $ret = $part?ExtractDatePart($part,$mod):LangDate($mod);
+ }
+ }
+ if($ret) SaveTagCache("inbulletin","bb_topic_modified",$attribs,"",$ret);
+ return $ret;
+}
+
+/*
+ @description: returns a link to the forum root category
+ @attrib: _Category:int: Override the forum root category
+ @attrib: _Template:tpl: The template to link to
+ @example:
+*/
+function bb_root_link($attribs = array())
+{
+ global $objTopicList, $objConfig, $var_list_update, $bb_var_list_update, $var_list, $objModules;
+
+ //$RootCat = (int)$objConfig->Get("Topic_Root");
+ $RootCat = $objModules->GetModuleRoot("In-Bulletin");
+ if($RootCat != -1)
+ $attribs["_category"] = $RootCat;
+
+ $bb_var_list_update["top"] = 0;
+ $bb_var_list_update["post"] = 0;
+ $bb_var_list_update["tp"] = 0;
+ $bb_var_list_update["pp"] = 0;
+
+ unset($bb_var_list_update["top"],$bb_var_list_update["post"],$bb_var_list_update["tp"],$bb_var_list_update["pp"]);
+ $o =m_template_link($attribs);
+ unset($bb_var_list_update["top"],$bb_var_list_update["post"],$bb_var_list_update["tp"],$bb_var_list_update["pp"]);
+
+ return $o;
+}
+
+/*
+ @description: returns a list of topics
+ @attrib: _CatId:int: Override the current category
+ @attrib: _useroot:bool: If set, the current category is changed to In-Bulletin's root category
+ @attrib: _ShortList:bool: If set, the Perpage_Topics_Short setting is used instead of Perpage_topics
+ @attrib: _Paging:bool: If set to 0 or false, paging will not be allowed for this list (only one paging list is allowed per item type per page load)
+ @attrib: _maxcount:int: If paging is not used on this list, this value determines how many items to load
+ @attrib: _ListType::Determines the type of list to generate
+ Possible values:
+ Category: List topics from the current category
+ New: List new topics
+ Hot: List topics with the most replies
+ myitems: List topics created by the current user
+ favorites: List topics marked as favorites by the current user
+ search: List search results
+
+ @attrib: _FirstItemTemplate:tpl: Template used for the first topic listed
+ @attrib: _LastItemTemplate:tpl: Template used for the last topic listed
+ @attrib: _EdItemTemplate:tpl: Editors Pick template used for topic list items
+ @attrib: _ItemTemplate:tpl: default template used for topic list items
+ @example:
+*/
+function bb_topic_list($attribs = array())
+{
+ global $objSession, $objConfig, $objCatList, $bb_var_list, $CatId, $objTopicList, $content_set;
+
+ $CatId = getArrayValue($attribs,'_catid');
+ if(!is_numeric($CatId))
+ $CatId = $objCatList->CurrentCategoryID();
+
+ if((int)getArrayValue($attribs,'_useroot')) $CatId = (int)$objConfig->Get("Topic_Root");
+
+ $attribs["_catid"] = $CatId;
+
+ $t = getArrayValue($attribs,'_itemtemplate');
+
+ if(!strlen($t))
+ {
+ $content_set=0;
+ return "";
+ }
+
+ $ListType=getArrayValue($attribs,'_listtype');
+
+ if(!strlen($ListType)) $ListType="category";
+
+ if ( getArrayValue($attribs,'_shortlist') && $objConfig->Get('Perpage_Topics_Short') ) {
+ $objTopicList->PerPageVar = 'Perpage_Topics_Short';
+ }
+ else {
+ $objTopicList->PerPageVar = 'Perpage_Topics';
+ }
+
+ if($objTopicList->ListType != $ListType) LoadTopics($attribs);
+
+ //if($objTopicList->NumItems()==0)
+ //{
+ // LoadTopics($attribs);
+ //}
+
+ if ($objTopicList->NumItems()==0)
+ {
+ $content_set=0;
+ return ""; //language("la_no_topics");
+ }
+
+ $total_topics = min($objTopicList->NumItems(), $objConfig->Get($objTopicList->PerPageVar));
+
+ $html_attribs = ExtraAttributes($attribs);
+ $row=0;
+ for($x=0; $x<$total_topics; $x++)
+ {
+ $topic =& $objTopicList->Items[$x];
+ $parsed=0;
+ if($row==0 && strlen($attribs["_firstitemtemplate"]))
+ {
+ $o .= $topic->ParseTemplate($attribs["_firstitemtemplate"]);
+ $parsed=1;
+ }
+ if($row==$objTopicList->NumItems()-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0)
+ {
+ $o .= $topic->ParseTemplate($attribs["_lastitemtemplate"]);
+ $parsed=1;
+ }
+ if(!$parsed)
+ {
+ if (getArrayValue($attribs, '_editemtemplate') && (int)$topic->Get('EditorsPick'))
+ {
+ $o .= $topic->ParseTemplate($attribs["_editemtemplate"]);
+ }
+ else
+ {
+ $o .= $topic->ParseTemplate($attribs['_itemtemplate']);
+ }
+ }
+ $row++;
+ }
+
+ return $o;
+}
+
+/*
+ @description: returns a counter of topics
+ @attrib: _CatId:int: Override the current category
+ @attrib: _useroot:bool: If set, the current category is changed to In-Bulletin's root category
+ @attrib: _ShortList:bool: If set, the Perpage_Topics_Short setting is used instead of Perpage_topics
+
+ @attrib: _ListType::Determines the type of list to generate
+ Possible values:
+ Category: List topics from the current category
+ New: List new topics
+ Hot: List topics with the most replies
+ myitems: List topics created by the current user
+ favorites: List topics marked as favorites by the current user
+ search: List search results
+
+
+ @example:
+*/
+function bb_list_count($attribs = array())
+{
+ global $objConfig, $objCatList, $CatId, $objTopicList;
+
+ $CatId = getArrayValue($attribs,'_catid');
+ if(!is_numeric($CatId))
+ $CatId = $objCatList->CurrentCategoryID();
+
+ if((int)getArrayValue($attribs,'_useroot')) $CatId = (int)$objConfig->Get("Topic_Root");
+
+ $attribs["_catid"] = $CatId;
+
+ $ListType=getArrayValue($attribs,'_listtype');
+ if(!strlen($ListType)) $ListType="category";
+
+ if ( getArrayValue($attribs,'_shortlist') && $objConfig->Get('Perpage_Topics_Short') ) {
+ $objTopicList->PerPageVar = 'Perpage_Topics_Short';
+ }
+ else {
+ $objTopicList->PerPageVar = 'Perpage_Topics';
+ }
+
+ if(!getArrayValue($attribs,'_today'))
+ {
+ if($objTopicList->ListType != $ListType)
+ LoadTopics($attribs);
+
+ $o = $objTopicList->QueryItemCount;
+ }
+ else
+ {
+ $o = $objTopicList->PerformItemCount($attribs);
+ }
+
+ if ($o == '') {
+ $o = 0;
+ }
+
+ return $o;
+}
+
+
+/*
+ @description: Used in conjuction with bb_topic_list. This function generates the page navigation
+ for the list. If this tag is called before the list tag, this function will load
+ the topic list. For that reason, the _ListType attribute is required if the pagnav
+ tag preceeds the bb_topic_list tag in the template. Generally, it is good practice to
+ duplicate all attributes set for bb_topic_list.
+ @attrib: _PagesToList:int: Number of pages to list (default is 10)
+ @attrib: _label:lang: language tag to include in the output if there are pages to list. If there are no pages
+ listed, this text will not be included (resulting in an empty output)
+*/
+function bb_topic_pagenav($attribs = array())
+{
+ global $objTopicList, $objCatList, $objSession, $objConfig;
+
+ $DestTemplate = getArrayValue($attribs,'_template');
+ $PagesToList = getArrayValue($attribs,'_pagestolist');
+ $image = getArrayValue($attribs,'_PageIcon');
+ if(!is_numeric($PagesToList))
+ $PagesToList = 10;
+
+ $CatId = getArrayValue($attribs,'_catid');
+ if(!is_numeric($CatId))
+ $CatId = $objCatList->CurrentCategoryID();
+
+ if ( getArrayValue($attribs,'_shortlist') && $objConfig->Get('Perpage_Topics_Short') ) {
+ $objTopicList->PerPageVar = 'Perpage_Topics_Short';
+ }
+ else {
+ $objTopicList->PerPageVar = 'Perpage_Topics';
+ }
+
+ $ListType=getArrayValue($attribs,'_listtype');
+ if(!strlen($ListType)) $ListType="category";
+
+ if($objTopicList->ListType != $ListType)
+ LoadTopics($attribs);
+
+ $o = $objTopicList->GetPageLinkList($DestTemplate, '', 10, true, '', ExtraAttributes($attribs));
+ if (strlen($image)) {
+ $o_i = ' ';
+ }
+ if(strlen($o) && strlen($attribs["_label"]))
+ $o = $o_i.language($attribs["_label"]).' '.$o;
+ return $o;
+}
+
+/*
+ @description: Used in conjuction with bb_topic_list. This function generates a navigation link which is
+ used to switch from a short list to a longer list. The page number is not changed.
+ If this tag is called before the list tag, this function will load the topic list.
+ For that reason, the _ListType attribute is required if the pagnav
+ tag preceeds the bb_topic_list tag in the template. Generally, it is good practice to
+ duplicate all attributes set for bb_topic_list.
+ @attrib: _root:bool: If set, the current category is set to In-Bulletin's root category
+ @attrib: _text:lang: language tag to include as text for the anchor tag
+ @attrib: _plaintext:: plain text to include as text for the anchor tag. The _text attribute takes presedence
+ if both are included.
+ @attrib: _image:: URL to an image to include inside the anchor tag.
+*/
+function bb_topic_more($attribs = array())
+{
+ global $objTopicList, $objConfig, $bb_var_list_update;
+
+ $bb_var_list_update['top_id'] = 0;
+
+ $html_attribs = ExtraAttributes($attribs);
+ $DestTemplate = $attribs["_template"];
+
+ if ( getArrayValue($attribs,'_shortlist') && $objConfig->Get('Perpage_Topics_Short') ) {
+ $objTopicList->PerPageVar = 'Perpage_Topics_Short';
+ }
+ else {
+ $objTopicList->PerPageVar = 'Perpage_Topics';
+ }
+
+ $ListType=$attribs["_listtype"];
+ if(!strlen($ListType))
+ $ListType="category";
+
+ if($objTopicList->ListType != $ListType)
+ LoadTopics($attribs);
+
+ if($objTopicList->QueryItemCount > $objConfig->Get($objTopicList->PerPageVar))
+ {
+ if($attribs["_root"])
+ {
+ $url = bb_root_link($attribs);
+ }
+ else
+ {
+ $bb_var_list_update["tp"]=1;
+ $bb_var_list_update["pp"]=1;
+ $url = m_template_link($attribs);
+ unset($bb_var_list_update["tp"],$bb_var_list_update["pp"]);
+ }
+ $o = "";
+ $text = $attribs["_text"];
+ if(!strlen($text))
+ {
+ $text = $attribs["_plaintext"];
+ if(!strlen($text))
+ {
+ }
+ $o .= $text." ";
+ }
+ else
+ $o .= language($text);
+ if(strlen($attribs["_image"]))
+ {
+ $o .= " ";
+ }
+ $o .= "";
+ }
+ return $o;
+}
+
+/*
+ @description: Generates a link to set a topic column to the sort column for the user
+ @attrib: _column:: column name to set
+ @example: ">
+*/
+function bb_topic_list_sortlink($attribs)
+{
+ return HREF_Wrapper('', Array('Action' => 'bb_sort', 'col' => $attribs['_column']) );
+}
+
+/*
+ @description: Creates a URL to an image used to indicate the sorting status of a topic column.
+ Extra HTML attributes are passed to the image tag.
+ @attrib: _column:: column name to check
+ @attrib: _selected_asc:: if the column is the current sort column, and the order is ascending, this url is used
+ @attrib: _selected_desc:: if the column is the current sort column, and the order is descending, this url is used
+ @attrib: _selected:: if the column is the current sort column, and no other _selected URL is set, this URL is used
+ @attrib: _unselected:: if the column is not the current sort column, this URL is used
+ @attrib: _default:: if no other URL is returned, this URL is used
+ @example: " width="7" height="7" title="" border="0" />
+*/
+function bb_topic_list_sorticon($attribs)
+{
+ global $objSession, $objConfig;
+
+ $fields[] = $objSession->GetPersistantVariable('Topic_SortField');
+ $orders[] = $objSession->GetPersistantVariable('Topic_SortOrder');
+ if( !$orders[0] ) $orders[0] = 'asc';
+ // if user haven't specified sorting
+
+ /*// first sorting
+ $fields[] = $objConfig->Get('Topic_SortField');
+ $orders[] = $objConfig->Get('Topic_SortOrder');
+ // second sorting
+ $fields[] = $objConfig->Get('Topic_SortField2');
+ $orders[] = $objConfig->Get('Topic_SortOrder2');*/
+
+ $url = '';
+
+ $i = 0;
+ $f_count = count($fields);
+ $match_index = -1;
+ while($i < $f_count)
+ {
+ if($fields[$i] == $attribs['_column'])
+ {
+ $match_index = $i;
+ break;
+ }
+ $i++;
+ }
+
+ if($match_index > -1)
+ {
+ $key = '_selected'.strtolower($orders[$match_index]);
+ $url = $attribs[$key];
+ if( !strlen($url) ) $url = $attribs['_selected'];
+ }
+ else
+ {
+ $url = $attribs['_unselected'];
+ }
+
+ if(!strlen($url))
+ {
+ $url = $attribs['_default'];
+ }
+ return $url;
+}
+
+/*
+ @description: Generates a url containing the action to delete a user's avatar image
+ @example:
+*/
+function bb_delete_avatar($attribs = array())
+{
+ return HREF_Wrapper('', Array('Action' => 'bb_delete_avatar') );
+}
+
+function bb_form_load_values($FormName,$IdValue)
+{
+ global $FormValues, $objTopicList, $objPostingList, $objUsers, $objSession;
+
+ switch($FormName)
+ {
+ case 'post_edit':
+ $p =& $objPostingList->GetItem($IdValue);
+ $body = _unhtmlentities( $p->Get('PostingText') );
+ $body = str_replace(' ','',$body);
+ $FormValues[$FormName]["bb_post_reply_body"] = $body;
+ $FormValues[$FormName]["subject"] = $p->Get("Subject");
+ $FormValues[$FormName]["topic_bbcode"] = (int)$p->PostOption("disable_bbcode"); // (int)$objSession->GetPersistantVariable("bbcode");
+ $FormValues[$FormName]["topic_smile"] = (int)$p->PostOption("disable_smileys");
+ $FormValues[$FormName]["topic_sig"] = (int)$p->PostOption("show_sig");
+ $p->LoadCustomFields();
+ if(is_array($p->CustomFields))
+ {
+ foreach($p->CustomFields as $f=>$v)
+ {
+ $FormValues[$FormName][$f] = $v;
+ }
+ }
+ break;
+ case "topic_reply":
+ $FormValues[$FormName]["owner_notify"] = (int)$objSession->GetPersistantVariable("owner_notify");
+ $FormValues[$FormName]["topic_bbcode"] = !(int)$objSession->GetPersistantVariable("bbcode");
+ $FormValues[$FormName]["topic_smile"] = !(int)$objSession->GetPersistantVariable("smileys");
+ $FormValues[$FormName]["topic_sig"] = (int)$objSession->GetPersistantVariable("show_sig");
+
+ if($FormName=="topic_reply")
+ $FormValues[$FormName]["replyto"] = $objPostingList->CurrentPostID();
+
+ $p = $objPostingList->GetItem($objPostingList->CurrentPostID());
+ if(strlen($p->Get("Subject")))
+ {
+ $FormValues[$FormName]["subject"] = "Re: ".$p->Get("Subject");
+ }
+ break;
+ case "new_topic":
+ $FormValues[$FormName]["owner_notify"] = (int)$objSession->GetPersistantVariable("owner_notify");
+ $FormValues[$FormName]["topic_bbcode"] = !(int)$objSession->GetPersistantVariable("bbcode");
+ $FormValues[$FormName]["topic_smile"] = !(int)$objSession->GetPersistantVariable("smileys");
+ $FormValues[$FormName]["topic_sig"] = (int)$objSession->GetPersistantVariable("show_sig");
+ if($FormName=="topic_reply")
+ $FormValues[$FormName]["replyto"] = $objPostingList->CurrentPostID();
+ break;
+
+ case "new_pm":
+ $FormValues[$FormName]["pm_to"] = GetVar('ToUser');
+ $FormValues[$FormName]["pm_bbcode"] = !(int)$objSession->GetPersistantVariable("bbcode");
+ $FormValues[$FormName]["pm_smile"] = !(int)$objSession->GetPersistantVariable("smileys");
+ $FormValues[$FormName]["pm_sig"] = (int)$objSession->GetPersistantVariable("show_sig");
+
+ if( GetVar('IsReply') == 1 )
+ {
+ global $objPMList;
+ $pm = $objPMList->GetCurrentItem();
+ if( is_object($pm) )
+ {
+ $FormValues[$FormName]['pm_subject'] = 'Re: '.$pm->Get('Subject');
+ }
+ }
+
+ break;
+
+ case "edit_topic":
+ $t =& $objTopicList->GetItem($IdValue);
+ if(is_object($t))
+ {
+ $FormValues[$FormName]["topic_subject"] = $t->Get("TopicText");
+ $FormValues[$FormName]["owner_notify"] = $t->Get("NotifyOwnerOnChanges");
+ $t->LoadCustomFields();
+ if(is_array($t->CustomFields))
+ {
+ foreach($t->CustomFields as $f=>$v)
+ {
+ $FormValues[$FormName][$f] = $v;
+ }
+ }
+ }
+ break;
+ case "bb_profile":
+ $u = $objUsers->GetItem($IdValue);
+ if(is_object($u))
+ {
+ $FormValues[$FormName]["perpage_topics"] = $objSession->GetPersistantVariable("Perpage_Topics");
+ $FormValues[$FormName]["perpage_posts"] = $objSession->GetPersistantVariable("Perpage_Postings");
+ $FormValues[$FormName]["owner_notify"] = (int)$objSession->GetPersistantVariable("owner_notify");
+ $FormValues[$FormName]["bbcode"] = (int)$objSession->GetPersistantVariable("bbcode");
+ $FormValues[$FormName]["show_sig"] = (int)$objSession->GetPersistantVariable("show_sig");
+ $FormValues[$FormName]["smileys"] = $objSession->GetPersistantVariable("smileys");
+ $FormValues[$FormName]["user_signatures"] = $objSession->GetPersistantVariable("bb_signatures");
+ $FormValues[$FormName]["my_signature"] = $objSession->GetPersistantVariable("my_signature");
+ $FormValues[$FormName]["pm_notify"] = $objSession->GetPersistantVariable("bb_pm_notify");
+ $u->LoadCustomFields();
+ if(is_array($u->CustomFields))
+ {
+ foreach($u->CustomFields as $f=>$v)
+ {
+ $FormValues[$FormName][$f] = $v;
+ }
+ }
+
+ }
+ break;
+ }
+}
+
+/*
+ @description: Generates the ACTTION property for a FORM tag used by In-Bulletin
+ @attrib: _Template:tpl: If set, this is the template the form submits to (default is the current template)
+ @attrib: _Form:: The form name Possible Values:
+
+ bb_profile: In-Bulletin section of User Profile Edit
+ new_topic: Add a topic to a category
+ new_topic_confirm: Simple form displayed when a new_topic confirmation page is displayed
+ topic_reply: Add a post to a topic
+ post_edit: Modify an existing post
+ edit_topic: Modify an existing topic
+ edit_topic_confirm: Simple form displayed when a topic modification confirmation is shown
+ getting_rated: Form for remote rating
+
+ @example: ">
+*/
+function bb_form_action($attribs = array())
+{
+ global $var_list_update, $var_list, $objSession, $objTopicList, $objPostingList, $bb_var_list, $bb_var_list_update;
+
+ $var_list_update['t'] = getArrayValue($attribs, '_template') ? $attribs['_template'] : $var_list['t'];
+
+ if( is_object($objTopicList) && $bb_var_list['top'] ) $bb_var_list_update['top'] = $bb_var_list['top'];
+
+ $ret = '';
+ $form = strtolower( $attribs['_form'] );
+ $url_params = Array();
+
+ switch($form)
+ {
+ case 'bb_rate':
+ if( !$objSession->SessionEnabled() )
+ {
+ $var_list_update['t'] = 'error_session';
+ }
+ else
+ {
+ $url_params = Array( 'Action' => 'bb_rate_topic', 'DestTemplate' => $attribs['_finishtemplate'] );
+ if ( $objSession->HasCatPermission('TOPIC.RATE') && getArrayValue($attribs, '_confirm') ) $url_params['Confirm'] = $attribs['_confirm'];
+
+// $bb_var_list_update['top'] = $objTopicList->CurrentItem;
+ if( getArrayValue($attribs, '_duplicate') ) $url_params['Duplicate'] = $attribs['_duplicate'];
+ }
+ break;
+
+ case 'bb_getting_rated':
+ if( !$objSession->SessionEnabled() )
+ {
+ $var_list_update['t'] = 'error_session';
+ }
+ else
+ {
+ $var_list_update['t'] = 'inbulletin/rate';
+ $url_params = Array( 'Action' => 'bb_rate_topic', 'DestTemplate' => $attribs['_finishtemplate'] );
+
+ if ( $objSession->HasCatPermission('TOPIC.RATE') && getArrayValue($attribs, '_confirm') ) $url_params['Confirm'] = $attribs['_confirm'];
+// $bb_var_list_update['top'] = $objTopicList->CurrentItem;
+ if( getArrayValue($attribs, '_duplicate') ) $url_params['Duplicate'] = $attribs['_duplicate'];
+ }
+ break;
+
+ case 'bb_rate_confirm':
+ $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t'];
+// $bb_var_list_update['top'] = $objTopicList->CurrentItem;
+ break;
+
+ /*case 'addreview':
+ break;*/
+
+ case 'bb_profile':
+ $url_params = Array('Action' => 'bb_pref');
+ bb_form_load_values('bb_profile', $objSession->Get('PortalUserId') );
+ break;
+
+ case 'new_topic':
+ $url_params = Array( 'Action' => 'bb_new_topic', 'DestTemplate' => $attribs['_finishtemplate'] );
+
+ if ( $objSession->HasCatPermission('TOPIC.ADD.PENDING') )
+ {
+ $url_params['Confirm'] = $attribs[ getArrayValue($attribs, '_confirmpending') ? '_confirmpending' : '_confirm' ];
+ }
+
+ if ($objSession->HasCatPermission('TOPIC.ADD'))
+ {
+ $url_params['Confirm'] = $attribs['_confirm'];
+ }
+ if( !$url_params['Confirm'] ) unset($url_params['Confirm']);
+
+ bb_form_load_values('new_topic', $objSession->Get('PortalUserId') );
+ break;
+
+ case 'new_pm':
+ $url_params = Array( 'Action' => 'bb_new_pm', 'DestTemplate' => $attribs['_finishtemplate'] );
+ if( getArrayValue($attribs, '_confirm') ) $url_params['Confirm'] = $attribs['_confirm'];
+ bb_form_load_values('new_pm', $objSession->Get('PortalUserId') );
+ break;
+
+ case 'new_pm_confirm':
+ $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t'];
+ $url_params = Array('ResetPage' => '1');
+ break;
+
+ case 'new_topic_confirm':
+ $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t'];
+ break;
+
+ case 'topic_reply':
+ $url_params = Array('Action' => 'bb_topic_reply', 'next_template' => $attribs['_template']);
+ bb_form_load_values('topic_reply', $objSession->Get('PortalUserId') );
+ break;
+
+ case 'post_edit':
+ $url_params = Array('Action' => 'bb_post_edit');
+ bb_form_load_values('post_edit', $objPostingList->CurrentPostID() );
+ break;
+
+ case 'edit_topic':
+ $url_params = Array( 'Action' => 'bb_edit_topic', 'DestTemplate' => $attribs['_finishtemplate'] );
+
+ $t =& $objTopicList->GetCurrentTopic();
+ $IsOwner = ( $t->Get('OwnerId') == $objSession->Get('PortalUserId') );
+
+ if ( $objSession->HasCatPermission('TOPIC.MODIFY.PENDING') || ($IsOwner && $objSession->HasCatPermission('TOPIC.OWNER.MODIFY.PENDING')) )
+ {
+ $url_params['Confirm'] = $attribs[ getArrayValue($attribs, '_confirmpending') ? '_confirmpending' : '_confirm' ];
+ }
+
+ if ( $objSession->HasCatPermission('TOPIC.MODIFY') || ($IsOwner && $objSession->HasCatPermission('TOPIC.OWNER.MODIFY')) )
+ {
+ $url_params['Confirm'] = $attribs['_confirm'];
+ }
+
+ if( !$url_params['Confirm'] ) unset($url_params['Confirm']);
+ bb_form_load_values('edit_topic', $t->Get('TopicId') );
+ break;
+
+ case 'edit_topic_confirm':
+ $var_list_update['t'] = getArrayValue($_GET, 'DestTemplate') ? $_GET['DestTemplate'] : $var_list['t'];
+ break;
+ }
+
+ return HREF_Wrapper('', $url_params);
+}
+
+/*
+ @description: Parse a topic item template
+ @attrib: _ItemTemplate:tpl: Topic template to parse
+ @attrib: _TopicId:int: Topic ID to parse (uses current topic if not set)
+*/
+function bb_topic_detail($attribs = array())
+{
+ global $objTopicList;
+
+ $t = $attribs["_itemtemplate"];
+ if(strlen($t))
+ {
+ $TopicId = (int)$attribs["_topicid"];
+ if($TopicId)
+ {
+ $topic = $objTopicList->GetItem($TopicId);
+ }
+ else
+ $topic =& $objTopicList->GetCurrentTopic();
+ if(is_object($topic))
+ {
+ $o = $topic->ParseTemplate($t);
+ }
+ }
+ return $o;
+}
+
+/*
+ @description: Parse a topic field and return the value
+ @attrib: _Field:: Topic field to parse
+ @attrib: _TopicId:int: Topic ID to parse (uses current topic if not set)
+*/
+function bb_topic_field($attribs = array())
+{
+ global $objTopicList, $bb_var_list;
+
+ $TopicId = $attribs["_topicid"];
+ if ( is_numeric($TopicId) )
+ {
+ $topic =& $objTopicList->GetItem($TopicId);
+ }
+ else
+ {
+ if(!$objTopicList->CurrentItem && $bb_var_list['id'] > 0)
+ {
+ $objTopicList->SetCurrentItem($bb_var_list['id']);
+ }
+ $topic =& $objTopicList->GetCurrentTopic();
+ }
+
+ if(is_object($topic))
+ {
+ $element = new clsHtmlTag();
+ $element->name = $topic->TagPrefix;
+ $element->attributes = $attribs;
+ $o = $topic->ParseObject($element);
+ }
+ else
+ $o = "";
+ return $o;
+}
+
+/*
+ @description: Returns the number of items related to the current topic
+ @attrib: _ItemId:int: the article to use (If not set, the current topic is used)
+ @attrib: _ItemType:: Name of item to count (ie: _ItemType="Category,Topic")
+ @example:
+*/
+function bb_related_count($attribs)
+{
+ global $objItemTypes, $objTopicList, $content_set;
+ global $TopicRelations;
+
+ $id = $attribs["_itemid"];
+ $item_type = strtolower($attribs["_itemtype"]);
+ $count = 0;
+ if(!is_numeric($id))
+ {
+ $c =& $objTopicList->GetCurrentItem();
+ }
+ else
+ $c =& $objTopicList->GetItem($id);
+
+ if(is_object($c))
+ {
+ $ResourceId = $c->Get("ResourceId");
+ if(!is_object($TopicRelations))
+ {
+ $TopicRelations = new clsMultiTypeList();
+ LoadRelatedItems($Related, $TopicRelations,$c->Get("ResourceId"));
+ }
+
+ if(strlen($attribs["_itemtype"]))
+ {
+ $objType = $objItemTypes->GetTypeByName($item_type);
+ if(is_object($objType))
+ {
+ $TargetType = $objType->Get("ItemType");
+ }
+ else
+ $TargetType="";
+ }
+
+ if($TopicRelations->NumItems()>0)
+ {
+ for($x=0;$x<$TopicRelations->NumItems();$x++)
+ {
+ $a = $TopicRelations->GetItemByIndex($x);
+ if($a->type == $TargetType || !strlen($TargetType))
+ {
+ $count++;
+ }
+ }
+ }
+ }
+ return $count;
+}
+
+
+
+/*
+ @description: List items related to the current topic
+ @attrib: _ItemId:int: the topic to use (If not set, the current topic is used)
+ @attrib: _ListItems:: List of item types to include (ie: _ListItems="Category,Link")
+ @attrib: _*Template:none: For each item type lsted in _ListItems, an item type template must be included
+ (ie: _CategoryTemplate=".." _LinkTemplate="..")
+ @example:
+*/
+function bb_related_items($attribs)
+{
+ global $objItemTypes, $objTopicList, $objCatList, $content_set;
+
+ $id = $attribs["_itemid"];
+ if(!is_numeric($id))
+ {
+ $c =& $objTopicList->GetCurrentTopic();
+ }
+ else
+ $c =& $objTopicList->GetItem($id);
+
+ $data_sent=0;
+
+ $tpath = GetModuleArray("template");
+
+ if(is_object($c))
+ {
+ $ResourceId = $c->Get("ResourceId");
+ $IncludeList = explode(",",trim(strtolower($attribs["_listitems"])));
+ $o = "";
+ if(!is_object($TopicRelations))
+ {
+ $TopicRelations = new clsMultiTypeList();
+ LoadRelatedItems($Related, $TopicRelations,$c->Get("ResourceId"));
+ }
+
+ if($TopicRelations->NumItems()>0)
+ {
+ for($inc=0;$incGetTypeByName($item_type);
+ if(is_object($objType))
+ {
+ foreach($TopicRelations->Items as $item)
+ {
+ if(is_object($item))
+ {
+ if(strtolower($objType->Get("ItemName")) == strtolower($item_type) && $item->type==$objType->Get("ItemType"))
+ {
+ if(strlen($item->BasePermissionName))
+ {
+ $perm = $item->BasePermissionName.".VIEW";
+ $haspem = $objSession->HasCatPermission($perm,$item->Get("CategoryId"));
+ }
+ else
+ $hasperm = 1;
+
+ if($hasperm)
+ {
+ $data_sent =1;
+ $classname = $objType->Get("ClassName");
+ if(strlen($classname))
+ {
+ $l = new $classname;
+ $l->Data = $item->Data;
+ $o .= $l->ParseTemplate($t);
+ }
+ }
+ }
+ }
+ $item = NULL;
+ }
+ }
+ else
+ echo $item_type." not found \n";
+ }
+ }
+ if($data_sent)
+ {
+ return $o;
+ }
+ else
+ {
+ $content_set=0;
+ return "";
+ }
+ }
+ else
+ {
+ $content_set = 0;
+ return "";
+ }
+ }
+ else
+ {
+ $content_set = 0;
+ return "";
+ }
+}
+
+/* loads post lists */
+function LoadPosts($attribs=array())
+{
+ global $objTopicList, $objPostingList, $objSession, $objCatList;
+
+ $ListType = strtolower($attribs["_listtype"]);
+ if(!strlen($ListType))
+ $ListType="category";
+ $objPostingList->ListType=$ListType;
+ switch($ListType)
+ {
+ case "category":
+ $objPostingList->LoadTopicPosts($attribs);
+ break;
+ }
+}
+
+
+/*
+ @description: Outputs a list of topic posts
+ @attrib: _TopicId:int: Override the current topic
+ @attrib: _ListType::Determines the type of list to generate
+ Possible values:
+ Category: List topics from the current category (default)
+
+
+ @attrib: _ItemTemplate:tpl: default template used for topic list items
+ @attrib: _AltItemTemplate:tpl: used on every other post in the list (optional)
+ @attrib: _FirstItemTemplate:tpl: Template used for the first topic listed (optional)
+ @attrib: _LastItemTemplate:tpl: Template used for the last topic listed (optional)
+ @attrib: _AltLastItemTemplate:tpl: Template used for the last topic listed if it ends on an alternate row (optional)
+ @example:
+*/
+function bb_list_posts($attribs=array())
+{
+ global $var_list, $bb_var_list,$objCatList, $objTopicList, $objPostingList, $objSession;
+
+ $o=""; //prepare output
+ if($objSession->HasCatPermission("TOPIC.REPLY.VIEW"))
+ {
+ $objSession->SetVariable("topic_viewmode","0");
+ $objSession->SetVariable("topic_list",$var_list["t"]);
+ $TopicId=$attribs["_topicid"];
+ if(is_numeric($TopicId))
+ {
+ $topic =& $objTopicList->GetItem($TopicId);
+ }
+ else
+ $topic =& $objTopicList->GetCurrentTopic();
+ $t = $attribs["_itemtemplate"];
+ if(is_object($topic) && strlen($t))
+ {
+ $topic->Increment("Views", true);
+ if($objPostingList->TopicID != $topic->Get("TopicId") || $objPostingList->NumItems()==0)
+ {
+ LoadPosts($attribs);
+ //$objPostingList->Clear();
+ //$objPostingList->TopicID=$topic->Get("TopicId");
+ //$objPostingList->LoadTopicPosts();
+ }
+
+ $application =& kApplication::Instance();
+
+ if($objPostingList->NumItems()>0)
+ {
+ $row = 0;
+ for($x=0;$x<$objPostingList->NumItems();$x++)
+ {
+ $post =& $objPostingList->Items[$x];
+ $application->SetVar('bb_post_id', $post->UniqueId());
+
+ $even = (($row+1) % 2 == 0);
+ $parsed=0;
+ if($row==0 && strlen($attribs["_firstitemtemplate"]))
+ {
+ $o .= $post->ParseTemplate($attribs["_firstitemtemplate"]);
+ $parsed=1;
+ }
+ if($row==$objPostingList->NumItems()-1 && $even && !$parsed && strlen($attribs["_altlastitemtemplate"])>0)
+ {
+ $o .= $post->ParseTemplate($attribs["_altlastitemtemplate"]);
+ $parsed=1;
+ }
+ if($row==$objPostingList->NumItems()-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0)
+ {
+ $o .= $post->ParseTemplate($attribs["_lastitemtemplate"]);
+ $parsed=1;
+ }
+ if(!$parsed)
+ {
+ if($even && strlen($attribs["_altitemtemplate"])>0)
+ {
+ $o .= $post->ParseTemplate($attribs["_altitemtemplate"]);
+ }
+ else
+ $o .= $post->ParseTemplate($attribs["_itemtemplate"]);
+ }
+ $row++;
+ }
+ $o.="\n";
+ }
+ else
+ {
+ $content_set = 0;
+ $o = "no posts";
+ }
+ }
+ else
+ {
+ $content_set = 0;
+ $o = "bot a topic";
+ }
+ }
+ return $o;
+}
+
+/*
+ @description: Outputs a list of topic posts in a threaded (tree) format
+ @attrib: _TopicId:int: Override the current topic
+ @attrib: _ListType::Determines the type of list to generate
+ Possible values:
+ Category: List topics from the current category (default)
+
+
+ @attrib: _ItemTemplate:tpl: default template used for topic list items
+ @attrib: _AltItemTemplate:tpl: used on every other post in the list (optional)
+ @attrib: _FirstItemTemplate:tpl: Template used for the first topic listed (optional)
+ @attrib: _LastItemTemplate:tpl: Template used for the last topic listed (optional)
+ @attrib: _AltLastItemTemplate:tpl: Template used for the last topic listed if it ends on an alternate row (optional)
+ @example:
+*/
+function bb_list_posts_threaded($attribs = array(), $parent=0, $depth=0)
+{
+ global $objSession,$bb_var_list, $objPostingList,$ThreadRow;
+ $o=""; //prepare output
+ if($objSession->HasCatPermission("TOPIC.REPLY.VIEW"))
+ {
+ $objSession->SetVariable("topic_viewmode","1");
+ $objSession->SetVariable("topic_list",$var_list["t"]);
+ $plist = new clsPostingList();
+ $TopicId=$attribs["_topicid"];
+ if(!is_numeric($TopicId))
+ {
+ $TopicId = $bb_var_list["top"];
+ }
+ $depth++;
+ $t = $attribs["_itemtemplate"];
+ $CurrentPost = $objPostingList->CurrentPostID();
+ if(!is_numeric($ThreadRow))
+ $ThreadRow=0;
+ if(strlen($t))
+ {
+ $plist->TopicID = $TopicId;
+ $sql = "SELECT * FROM ".GetTablePrefix()."Posting WHERE TopicId=".$TopicId." AND ReplyTo=$parent ORDER BY CreatedOn ASC";
+ //echo $sql." \n";
+ $plist->Query_Item($sql);
+ for($x=0;$x<$plist->NumItems();$x++)
+ {
+ $plist->Items[$x]->Set("Depth",$depth);
+ $post =& $plist->Items[$x];
+ $even = (($ThreadRow+1) % 2 == 0);
+ $parsed=0;
+ if($post->Get("PostingId")==$CurrentPost && strlen($attribs["_currentitemtemplate"]))
+ {
+ $o .= $post->ParseTemplate($attribs["_currentitemtemplate"]);
+ $parsed=1;
+ }
+ if($ThreadRow==0 && strlen($attribs["_firstitemtemplate"]))
+ {
+ $o .= $post->ParseTemplate($attribs["_firstitemtemplate"]);
+ $parsed=1;
+ }
+ if($ThreadRow==$plist->NumItems()-1 && $even && !$parsed && strlen($attribs["_altlastitemtemplate"])>0)
+ {
+ $o .= $post->ParseTemplate($attribs["_altlastitemtemplate"]);
+ $parsed=1;
+ }
+ if($ThreadRow==$plist->NumItems()-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0)
+ {
+ $o .= $post->ParseTemplate($attribs["_lastitemtemplate"]);
+ $parsed=1;
+ }
+ if(!$parsed)
+ {
+ if($even && strlen($attribs["_altitemtemplate"])>0)
+ {
+ $o .= $post->ParseTemplate($attribs["_altitemtemplate"]);
+ }
+ else
+ $o .= $post->ParseTemplate($attribs["_itemtemplate"]);
+ }
+ $ThreadRow++;
+ $o .= bb_list_posts_threaded($attribs, $plist->Items[$x]->Get("PostingId"),$depth);
+ }
+ }
+ unset($plist);
+ }
+ return $o;
+}
+/*
+ @description: Used in conjuction with bb_list_posts. This function generates the page navigation
+ for the list. If this tag is called before the list tag, this function will load
+ the post list. For that reason, the _ListType attribute is required if the pagnav
+ tag preceeds the bb_topic_list tag in the template. Generally, it is good practice to
+ duplicate all attributes set for bb_post_list (other than templates).
+ @attrib: _PagesToList:int: Number of pages to list (default is 10)
+ @attrib: _Tempalte:tpl: Template to be used in the page links. Defaults to current template if not set
+ @attrib: _label:lang: language tag to include in the output if there are pages to list. If there are no pages
+ listed, this text will not be included (resulting in an empty output)
+*/
+function bb_post_pagenav($attribs = array())
+{
+ global $objPostingList, $objTopicList, $objSession, $content_set;
+
+ $DestTemplate = $attribs["_template"];
+ $PagesToList = $attribs["_pagestolist"];
+ $image = $attribs["_PageIcon"];
+
+ if(!is_numeric($PagesToList))
+ $PagesToList = 10;
+
+ $TopicId = $attribs["_topicid"];
+ if(!is_numeric($TopicId))
+ $TopicId = $objTopicList->CurrentTopicID();
+
+ if($objPostingList->TopicID != $TopicId || ($objPostingList->NumItems()==0))
+ {
+ LoadPosts($attribs);
+ }
+ $extra = ExtraAttributes($attribs);
+
+ if($objPostingList->NumItems()>0)
+ {
+ $o = $objPostingList->GetPageLinkList($DestTemplate,'',$PagesToList, true, $extra);
+ }
+// echo "TEST: "; print_r($o); echo " ";
+ if (strlen($image)) {
+ $o_i = ' ';
+ }
+ if(strlen($o) && strlen($attribs["_label"]))
+ $o = $o_i.language($attribs["_label"]).' '.$o;
+ elseif (!strlen($o))
+ {
+ $content_set = 0;
+ return "";
+ }
+
+ return $o;
+}
+/*
+ @description: Parse a post field and return the value.
+ @attrib: _Field:: Post Field to parse
+ @attrib: _TopicId:int: Topic ID (if not set, the current topic is used)
+ @attrib: _PostId:int: Post ID to parse (uses current topic if not set)
+*/
+function bb_post_field($attribs = array())
+{
+ global $objPostingList;
+
+ $PostId=$attribs["_postid"];
+ $TopicId=$attribs["_topicid"];
+ if(!is_numeric($TopicId))
+ {
+ $TopicId=$bb_var_list["top"];
+ }
+ $objPostingList->TopicId = $TopicId;
+
+ if(!is_numeric($PostId))
+ {
+ $PostId = $objPostingList->CurrentPostID();
+ }
+ $p = $objPostingList->GetItem($PostId);
+ if(is_object($p))
+ {
+
+ $element = new clsHtmlTag();
+ $element->name = $p->TagPrefix;
+ $element->attributes = $attribs;
+ $o = $p->ParseObject($element);
+ }
+ else
+ $o = "";
+ unset($PostList);
+ return $o;
+}
+
+/*
+ @description: Parse a post item template
+ @attrib: _ItemTemplate:tpl: Post template to parse
+ @attrib: _TopicId:int: Topic ID (if not set, the current topic is used)
+ @attrib: _PostId:int: Post ID to parse (uses current topic if not set)
+*/
+function bb_post_detail($attribs = array())
+{
+ global $objTopicList, $objPostingList;
+
+ $o = "";
+ $t = $attribs["_itemtemplate"];
+ if(strlen($t))
+ {
+ $PostId=$attribs["_postid"];
+ $TopicId=$attribs["_topicid"];
+ if(!is_numeric($TopicId))
+ {
+ $TopicId=$bb_var_list["top"];
+ }
+ $objPostingList->TopicId = $TopicId;
+
+ if(!is_numeric($PostId))
+ {
+ $PostId = $objPostingList->CurrentPostID();
+ }
+ $p =& $objPostingList->GetItem($PostId);
+ if(is_object($p))
+ {
+ $o = $p->ParseTemplate($t);
+ }
+ }
+ return $o;
+}
+
+/*
+ @description: List all active smileys
+ @attrib: _ItemTemplate: Smiley template to parse
+*/
+function bb_list_emoticons($attribs=array())
+{
+ global $objSmileys, $content_set;
+
+ if($objSmileys->NumItems()==0)
+ {
+ $objSmileys->LoadActiveEmoticons();
+ }
+
+ if($objSmileys->NumItems()==0)
+ {
+ $content_set=0;
+ return "";
+ }
+
+ $t = $attribs["_itemtemplate"];
+ if(!strlen($t))
+ {
+ $content_set=0;
+ return "";
+ }
+ foreach($objSmileys->Items as $s)
+ {
+ $o .= $s->ParseTemplate($t);
+ }
+ return $o;
+}
+
+function bb_pm_list($attribs = array())
+{
+ global $content_set, $objPMList;
+
+ $t = $attribs['_itemtemplate'];
+
+ if(!strlen($t))
+ {
+ $content_set = 0;
+ return '';
+ }
+
+ LoadPMs($attribs);
+
+ if ($objPMList->NumItems()==0)
+ {
+ $content_set=0;
+ return ''; //language("la_no_topics");
+ }
+
+ $html_attribs = ExtraAttributes($attribs);
+ $row=0;
+ for($x=0;$x<$objPMList->NumItems();$x++)
+ {
+ $pm =& $objPMList->Items[$x];
+ $parsed=0;
+ if($row==0 && strlen($attribs["_firstitemtemplate"]))
+ {
+ $o .= $pm->ParseTemplate($attribs["_firstitemtemplate"]);
+ $parsed=1;
+ }
+ if($row==$objPMList->NumItems()-1 && !$parsed && strlen($attribs["_lastitemtemplate"])>0)
+ {
+ $o .= $pm->ParseTemplate($attribs["_lastitemtemplate"]);
+ $parsed=1;
+ }
+ if(!$parsed)
+ $o .= $pm->ParseTemplate($attribs["_itemtemplate"]);
+ $row++;
+ }
+
+ return $o;
+}
+
+function bb_pm_pagenav($attribs = array())
+{
+ global $objPMList;
+
+ $DestTemplate = $attribs["_template"];
+ $PagesToList = $attribs["_pagestolist"];
+ $image = $attribs["_PageIcon"];
+ if(!is_numeric($PagesToList))
+ $PagesToList = 10;
+
+ LoadPMs($attribs);
+ $o = $objPMList->GetPageLinkList($DestTemplate,'',10,true,'&FolderId='.$objPMList->FolderId);
+ if (strlen($image)) {
+ $o_i = ' ';
+ }
+ if(strlen($o) && strlen($attribs["_label"]))
+ $o = $o_i.language($attribs["_label"]).$o;
+ return $o;
+}
+
+function LoadPMs($attribs = array())
+{
+ global $objPMList, $bb_var_list;
+
+ $objPMList->Page = GetVar('ResetPage') == 1 ? 1 : $bb_var_list['pmp'];
+ $objPMList->LoadUserPMs($attribs);
+}
+
+function bb_pm_list_count($attribs = array())
+{
+ global $objPMList;
+ LoadPMs($attribs);
+ $o = $objPMList->QueryItemCount;
+ if($o == '') $o = 0;
+ return $o;
+}
+
+function bb_pm_list_sortlink($attribs = array())
+{
+ return HREF_Wrapper('', Array('Action' => 'bb_pm_sort', 'col' => $attribs['_column'], 'FolderId' => (int)GetVar('FolderId')) );
+}
+
+function bb_pm_list_sorticon($attribs = array())
+{
+ global $objSession;
+
+ $field = $objSession->GetPersistantVariable("PMs_Sortfield");
+ $order = $objSession->GetPersistantVariable("PMs_SortOrder");
+ if(!strlen($order))
+ $order = "asc";
+ $url="";
+ if($field==$attribs["_column"])
+ {
+ $key ="_selected".strtolower($order);
+ $url = $attribs[$key];
+ if(!strlen($url))
+ $url = $attribs["_selected"];
+ }
+ else
+ $url = $attribs["_unselected"];
+ if(!strlen($url))
+ $url = $attribs["_default"];
+ return $url;
+}
+
+function bb_show_folder($attribs = array())
+{
+ return $attribs['_folderid'] == (int)GetVar('FolderId') ? 'yes' : '';
+}
+
+function bb_not_sent()
+{
+ global $objPMList, $objSession;
+ $pm =& $objPMList->GetCurrentItem();
+ if( is_object($pm) )
+ {
+ return $objSession->Get('PortalUserId') == $pm->Get('FromId') ? '' : 'yes';
+ }
+}
+
+function bb_phrase_by_folder($attribs = array())
+{
+ return language( GetVar('FolderId') == -1 ? 'lu_to' : 'lu_from' );
+}
+
+
+function bb_phrase_by_pm($attribs = array())
+{
+ global $objPMList;
+ $pm =& $objPMList->GetCurrentItem();
+ return language( $pm->Get('FolderId') == -1 ? 'lu_to' : 'lu_from' );
+}
+function bb_pm_field($attribs = array())
+{
+ global $objPMList;
+ $pm =& $objPMList->GetCurrentItem();
+ if( is_object($pm) )
+ {
+ $element = new clsHtmlTag();
+ $element->name = $pm->TagPrefix;
+ $element->attributes = $attribs;
+ $o = $pm->ParseObject($element);
+ $o = get_magic_quotes_gpc() ? $o : stripslashes($o);
+ }
+ else
+ {
+ $o = '';
+ }
+ return $o;
+}
+
+function bb_pm_setmark($attribs = array())
+{
+ global $objPMList;
+ $pm =& $objPMList->GetCurrentItem();
+ if( is_object($pm) )
+ {
+ // set read mark
+ if( $pm->Get('Status') < 2 )
+ {
+ $pm->Set('Status', 2);
+ $pm->Update();
+ }
+ }
+}
+
+function bb_new_pm_count()
+{
+ global $objSession;
+ $db =& GetADODBConnection();
+ $sql = 'SELECT COUNT(*)
+ FROM '.GetTablePrefix().'PrivateMessages
+ WHERE ToId = '.$objSession->Get('PortalUserId').' AND Status < 2';
+ return $db->GetOne($sql);
+}
+
+
+function bb_popup_notify($attribs = array())
+{
+
+
+}
+
+?>
Index: branches/unlabeled/unlabeled-1.51.2/in-bulletin/admin/install/inportal_data.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.51.2/in-bulletin/admin/install/inportal_data.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.51.2/in-bulletin/admin/install/inportal_data.sql (revision 12744)
@@ -0,0 +1,254 @@
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.01, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'TopicText=la_Topic_Text,Posts=la_Number_of_Posts,CreatedOn=la_CreatedOn,LastPostDate=la_LastUpdate,Views=la_Topic_Views,CachedRating=la_Rating,LastPoser=la_Poster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) ', 10.01, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '', 'TopicText=la_Topic_Text,Posts=la_Number_of_Posts,CreatedOn=la_CreatedOn,LastPostDate=la_LastUpdate,Views=la_Topic_Views,CachedRating=la_Rating,LastPoser=la_Poster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) ', 10.02, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_NewDays', 'la_Text_Topics', 'la_topic_newdays_prompt', 'text', '', 'asc=la_common_ascending,desc=la_common_descending', 10.05, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.02, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics', 'la_Text_Topics', 'la_topic_perpage_prompt', 'text', '', '', 10.03, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MinPopRating', 'la_Text_Topics', 'la_fld_Topic_MinPopRating', 'text', '', '', 10.06, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MaxHotNumber', 'la_Text_Topics', 'la_fld_Topic_MaxHotNumber', 'text', '', '', 10.08, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_EditorPicksAbove', 'la_Text_Topics', 'la_topic_editorpicksabove_prompt', 'checkbox', '', '', 10.09, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Postings', 'la_posts_subheading', 'la_posts_perpage_prompt', 'text', '', '', 20.01, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Posts_NewDays', 'la_posts_subheading', 'la_posts_newdays_prompt', 'text', '', '', 20.02, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MinPopVotes', 'la_Text_Topics', 'la_fld_Topic_MinPopVotes', 'text', '', '', 10.07, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics_Short', 'la_Text_Topics', 'la_topic_perpage_short_prompt', 'text', '', '', 10.04, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Value', 'la_Text_Topics', 'la_prompt_DupReviews', 'text', '', '', 10.1, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Interval', 'la_Text_Topics', 'la_prompt_DupReviews', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.1, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Value', 'la_Text_Topics', 'la_prompt_DupRating', 'text', '', '', 10.11, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Interval', 'la_Text_Topics', 'la_prompt_DupRating', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.11, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('AutoTopicLockPosts', 'la_Text_Topics', 'la_prompt_PostsToLock', 'text', NULL, NULL, 10.12, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_TopicReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL, NULL, 30.01, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('bb_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 40.01, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 40.02, 0, 0);
+
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_topics', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_topics', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_topics', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_topics', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_topics', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_PrivateMessages', 'la_text_PrivateMessages', 'la_text_PrivateMessages_PerPage', 'text', NULL, NULL, 0, 0, 1);
+
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Postings', '25', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Topics', '5', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Posting_SortOrder', 'CreatedOn asc, PostingText', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Posts_NewDays', '5', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Bulletin_TopCount', '2', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Bulletin_CatNewDays', '10', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Bulletin_Pick_First', '1', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortOrder', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortField', 'LastPostDate', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortOrder2', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortField2', 'Posts', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_NewDays', '6', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_MinPopRating', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_MaxHotNumber', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_EditorPicksAbove', '1', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_MinPopVotes', '8', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Root', '{TopicCatId}', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_Sortfield', NULL, 'In-Bulletin', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_SortOrder', NULL, 'In-Bulletin', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'BBTags', 'b:;i:;u:;ul:type|align;font:color|face|size;url:href;img:src|border', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_Background1', '#cccccc', 'In-Portal', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_Background2', '#bbbbbb', 'In-Portal', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Background1', '#FAEBD7', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Background2', '#F5F5DC', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'AutoTopicLockPosts', '0', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'bb_CategoryTemplate', 'inbulletin/index', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'bb_ItemTemplate', 'inbulletin/post_list', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Highlight_OpenTag', '', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Highlight_CloseTag', ' ', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Topics_Short', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_RatingDelay_Interval', '3600', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_RatingDelay_Value', '1', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_ReviewDelay_Interval', '60', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_ReviewDelay_Value', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Increase_topics', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Keyword_topics', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Pop_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Rating_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Increase_posts', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Keyword_posts', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Pop_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Rating_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'Search_ShowMultiple_topics', '0', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_PrivateMessages', '20', 'In-Bulletin', '');
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_TopicReviews', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (1, 'Happy Smile', 0, ':)', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (2, 'Big Grin', 0, ':grin:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (3, 'Wink', 0, ';)', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (4, 'Scared', 0, ':scared:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (5, 'Teasing', 0, ':eek:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (6, 'Cool', 0, ':cool:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (7, 'Angry', 0, ':@', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (8, 'Squint', 0, ':squint:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (9, 'Oops', 0, ':o', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (10, 'Sad', 0, ':(', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (11, 'Cry', 0, ':cry:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (12, 'Smirk', 0, ';]', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (13, 'Happy sleep', 0, ':sleep:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (14, 'Very angry', 0, ':x', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (15, 'Geek', 0, ':geek:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (16, 'Upset', 0, ';(', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (17, 'LOL', 0, ':lol:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (18, 'Yawn', 0, ':O', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (19, 'Thinking', 0, ':hm:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (20, 'Secret', 0, ':|', 1);
+
+INSERT INTO Events VALUES (1, 'TOPIC.ADD', 2, 0, 'In-Bulletin', 'la_event_topic.add', 1)
+INSERT INTO Events VALUES (2, 'POST.ADD', 2, 0, 'In-Bulletin', 'la_event_post.add', 1)
+INSERT INTO Events VALUES (3, 'POST.MODIFY', 2, 0, 'In-Bulletin', 'la_event_post.modify', 1)
+INSERT INTO Events VALUES (4, 'POST.ADD', 1, 0, 'In-Bulletin', 'la_event_post.add', 0)
+INSERT INTO Events VALUES (66, 'PM.ADD', 1, 0, 'In-Bulletin', 'la_event_pm.add', 0);
+
+INSERT INTO ItemTypes VALUES (3, 'In-Bulletin', 'bb', 'Topic', 'TopicText', 'OwnerId', 'Views', 'CachedRating', 'la_ItemTab_Topics', 1, '', 'clsTopic', 'Topic');
+INSERT INTO ItemTypes VALUES (30, 'In-Bulletin', 'posting', 'Posting', 'Subject', 'CreatedById', NULL, NULL, 'la_ItemTab_Posts', 0, '', '', 'Post');
+
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.VIEW', 'lu_PermName_Topic.View_desc', 'lu_PermName_Topic.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.ADD', 'lu_PermName_Topic.Add_desc', 'lu_PermName_Topic.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.ADD.PENDING', 'lu_PermName_Topic.Add.Pending_desc', 'lu_PermName_Topic.Add.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.DELETE', 'lu_PermName_Topic.Delete_desc', 'lu_PermName_Topic.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.MODIFY', 'lu_PermName_Topic.Modify_desc', 'lu_PermName_Topic.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.DELETE', 'lu_PermName_Topic.Reply.Delete_desc', 'lu_PermName_Topic.Reply.Delete_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.VIEW', 'lu_PermName_Topic.Reply.View_desc', 'lu_PermName_Topic.Reply.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.ADD', 'lu_PermName_Topic.Reply.Add_desc', 'lu_PermName_Topic.Reply.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.MODIFY', 'lu_PermName_Topic.Reply.Modify_desc', 'lu_PermName_Topic.Reply.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.RATE', 'lu_PermName_Topic.Rate_desc', 'lu_PermName_Topic.Rate_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REVIEW', 'lu_PermName_Topic.Review_desc', 'lu_PermName_Topic.Review_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 'lu_PermName_Topic.Reply.Owner.Modify_desc', 'lu_PermName_Topic.Reply.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 'lu_PermName_Topic.Reply.Owner.Delete_desc', 'lu_PermName_Topic.Reply.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.OWNER.DELETE', 'lu_PermName_Topic.Owner.Delete_desc', 'lu_PermName_Topic.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.MODIFY.PENDING', 'lu_PermName_Topic.Modify.Pending_desc', 'lu_PermName_Topic.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.OWNER.MODIFY.PENDING', 'lu_PermName_Topic.Owner.Modify.Pending_desc', 'lu_PermName_Topic.Owner.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.OWNER.MODIFY', 'lu_PermName_Topic.Owner.Modify_desc', 'lu_PermName_Topic.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.LOCK', 'lu_PermName_Topic.Lock_desc', 'lu_PermName_Topic.Lock_error', 'In-Bulletin');
+
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT count(*) FROM <%prefix%>Topic WHERE Status=1', NULL, 'la_prompt_ActiveTopics', 0, 1);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS TotalTopics FROM <%prefix%>Topic', NULL, 'la_prompt_TopicsTotal', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS ActiveTopics FROM <%prefix%>Topic WHERE Status = 1', NULL, 'la_prompt_TopicsActive', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS PendingTopics FROM <%prefix%>Topic WHERE Status = 2', NULL, 'la_prompt_TopicsPending', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS DisabledTopics FROM <%prefix%>Topic WHERE Status = 0', NULL, 'la_prompt_TopicsDisabled', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS NewTopics FROM <%prefix%>Topic WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Topic_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>Topic WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS HotTopics FROM <%prefix%>Topic WHERE (HotItem = 1) OR (Posts >= <%m:config name="Topic_MaxHotNumber"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS PopularTopics FROM <%prefix%>Topic WHERE (PopItem = 1) OR ( (CachedRating >= <%topic:hit_count type="top"%>) AND <%topic:hit_count type="top"%> AND (PopItem = 2) )', NULL, '(*) la_prompt_PopularTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Topic WHERE CachedRating > 0', NULL, 'la_prompt_TopicAverageRating', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT MAX(Views) AS MaxTopicHits FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicHits', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT MAX(CachedVotesQty) AS MaxTopicVotes FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicVotes', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_TopicReviews', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS TotalPosts FROM <%prefix%>Posting', NULL, 'la_prompt_PostsTotal', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostTime', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostTime', 0, 2);
+
+INSERT INTO SearchConfig VALUES ('Topic', 'NotifyOwnerOnChanges', 0, 1, 'lu_fielddesc_topic_notifyowneronchanges', 'lu_field_notifyowneronchanges', 'In-Bulletin', 'la_text_topic', 1, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicId', 0, 1, 'lu_fielddesc_topic_topicid', 'lu_field_topicid', 'In-Bulletin', 'la_text_topic', 0, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Priority', 0, 1, 'lu_fielddesc_topic_priority', 'lu_field_priority', 'In-Bulletin', 'la_text_topic', 8, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OwnerId', 0, 1, 'lu_fielddesc_topic_ownerid', 'lu_field_ownerid', 'In-Bulletin', 'la_text_topic', 9, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Modified', 0, 1, 'lu_fielddesc_topic_modified', 'lu_field_modified', 'In-Bulletin', 'la_text_topic', 2, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicText', 1, 1, 'lu_fielddesc_topic_topictext', 'lu_field_topictext', 'In-Bulletin', 'la_text_topic', 3, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Posts', 0, 1, 'lu_fielddesc_topic_posts', 'lu_field_posts', 'In-Bulletin', 'la_text_topic', 4, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Views', 0, 1, 'lu_fielddesc_topic_views', 'lu_field_views', 'In-Bulletin', 'la_text_topic', 5, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'EditorsPick', 0, 1, 'lu_fielddesc_topic_editorspick', 'lu_field_editorspick', 'In-Bulletin', 'la_text_topic', 6, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Status', 0, 1, 'lu_fielddesc_topic_status', 'lu_field_status', 'In-Bulletin', 'la_text_topic', 7, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ModifiedById', 0, 1, 'lu_fielddesc_topic_modifiedbyid', 'lu_field_modifiedbyid', 'In-Bulletin', 'la_text_topic', 10, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ResourceId', 0, 1, 'lu_fielddesc_topic_resourceid', 'lu_field_resourceid', 'In-Bulletin', 'la_text_topic', 11, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicType', 0, 1, 'lu_fielddesc_topic_topictype', 'lu_field_topictype', 'In-Bulletin', 'la_text_topic', 12, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CreatedOn', 0, 1, 'lu_fielddesc_topic_createdon', 'lu_field_createdon', 'In-Bulletin', 'la_text_topic', 13, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedReviewsQty', 0, 1, 'lu_fielddesc_topic_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Bulletin', 'la_text_topic', 14, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedRating', 0, 1, 'lu_fielddesc_topic_cachedrating', 'lu_field_cachedrating', 'In-Bulletin', 'la_text_topic', 15, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedVotesQty', 0, 1, 'lu_fielddesc_topic_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Bulletin', 'la_text_topic', 16, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'NewItem', 0, 1, 'lu_fielddesc_topic_newitem', 'lu_field_newitem', 'In-Bulletin', 'la_text_topic', 17, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PopItem', 0, 1, 'lu_fielddesc_topic_popitem', 'lu_field_popitem', 'In-Bulletin', 'la_text_topic', 18, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'HotItem', 0, 1, 'lu_fielddesc_topic_hotitem', 'lu_field_hotitem', 'In-Bulletin', 'la_text_topic', 19, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PostedBy', 0, 1, 'lu_fielddesc_topic_postedby', 'lu_field_postedby', 'In-Bulletin', 'la_text_topic', 20, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OrgId', 0, 1, 'lu_fielddesc_topic_orgid', 'lu_field_orgid', 'In-Bulletin', 'la_text_topic', 21, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'LastPostId', 0, 1, 'lu_fielddesc_topic_lastpostid', 'lu_field_lastpostid', 'In-Bulletin', 'la_text_topic', 22, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY.PENDING', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD.PENDING', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.RATE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REVIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.RATE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REVIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.RATE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REVIEW', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.LOCK', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:inbulletin_general.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:inbulletin_general.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_output.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_output.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_search.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_search.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_email.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_email.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.delete', 11, 1, 1, 0);
+
+INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('phpbb', 'In-Bulletin', 'phpbb_import', 'phpBB 2.x', 'phpBB', 'user_regular,init_cat', 1, 'db');
+
+INSERT INTO CustomField (Type, FieldName, FieldLabel, Heading, Prompt, ElementType, ValueList, DisplayOrder, OnGeneralTab, IsSystem) VALUES (1, 'bb_ItemTemplate', 'bb_ItemTemplate', 'la_title_SystemCF', 'bb_ItemTemplate', 'text', NULL, 0, 0, 1);
+
+INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('In-Bulletin', 'in-bulletin/', 'bb', '4.0.1', 1, 3, 'inbulletin/', {TopicCatId}, '1054738405');
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.15.2/in-bulletin/admin/install/inportal_schema.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.15.2/in-bulletin/admin/install/inportal_schema.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.15.2/in-bulletin/admin/install/inportal_schema.sql (revision 12744)
@@ -0,0 +1,109 @@
+
+CREATE TABLE Posting (
+ PostingId int(11) NOT NULL auto_increment,
+ IPAddress varchar(255) NOT NULL default '',
+ PosterAlias varchar(255) NOT NULL default '',
+ Pending tinyint(4) NOT NULL default '0',
+ Subject varchar(255) default NULL,
+ PostingText text,
+ GraphicsUrl varchar(255) default NULL,
+ CreatedOn int(11) NOT NULL default '0',
+ Modified int(11) NOT NULL default '0',
+ ModifiedById int(11) default NULL,
+ CreatedById int(11) default NULL,
+ TopicId int(11) NOT NULL default '0',
+ ResourceId int(11) NOT NULL default '0',
+ ReplyTo int(11) NOT NULL default '0',
+ Options int(11) NOT NULL default '0',
+ PRIMARY KEY (PostingId),
+ KEY TopicId (TopicId),
+ KEY Pending (Pending),
+ KEY CreatedById (CreatedById),
+ KEY CreatedOn (CreatedOn),
+ KEY ModifiedOn (Modified),
+ KEY ModifiedById (ModifiedById)
+)
+# --------------------------------------------------------
+CREATE TABLE Topic (
+ TopicId int(11) NOT NULL auto_increment,
+ NotifyOwnerOnChanges tinyint(4) NOT NULL default '0',
+ Modified int(11) NOT NULL default '0',
+ TopicText varchar(255) NOT NULL default '',
+ Filename varchar(255) NOT NULL,
+ AutomaticFilename tinyint(3) unsigned NOT NULL default '0',
+ Posts int(11) NOT NULL default '0',
+ Views double(20,6) NOT NULL default '0',
+ EditorsPick tinyint(4) NOT NULL default '0',
+ Status tinyint(4) default '0',
+ Priority int(11) NOT NULL default '0',
+ OwnerId int(11) NOT NULL default '0',
+ ModifiedById int(11) NOT NULL default '0',
+ ResourceId int(11) default NULL,
+ TopicType int(11) NOT NULL default '0',
+ CreatedOn int(11) NOT NULL default '0',
+ CachedReviewsQty int(11) NOT NULL default '0',
+ CachedRating varchar(10) default NULL,
+ CachedVotesQty int(11) NOT NULL default '0',
+ NewItem tinyint(4) NOT NULL default '2',
+ PopItem tinyint(4) NOT NULL default '2',
+ HotItem tinyint(4) NOT NULL default '2',
+ PostedBy varchar(255) NOT NULL default '',
+ OrgId int(11) default '0',
+ LastPostId int(11) NOT NULL default '0',
+ LastPostDate int(11) NOT NULL default '0',
+ TodayDate date NOT NULL default '0000-00-00',
+ TodayPosts int(11) NOT NULL default '0',
+ PRIMARY KEY (TopicId),
+ KEY OwnerId (OwnerId),
+ UNIQUE KEY ResourceId (ResourceId),
+ KEY ModifiedById (ModifiedById),
+ KEY Posts (Posts),
+ KEY Modified (Modified),
+ KEY Filename (Filename(5))
+)
+# --------------------------------------------------------
+CREATE TABLE Censorship (
+ CensorshipId int(11) NOT NULL auto_increment,
+ BadWord varchar(80) NOT NULL default '',
+ Replacement varchar(80) NOT NULL default '',
+ PRIMARY KEY (CensorshipId)
+)
+# --------------------------------------------------------
+CREATE TABLE Emoticon (
+ EmoticonId int(11) NOT NULL auto_increment,
+ Name varchar(20) NOT NULL default '',
+ ImageId int(11) NOT NULL default '0',
+ KeyStroke varchar(20) NOT NULL default '',
+ Enabled int(11) NOT NULL default '1',
+ PRIMARY KEY (EmoticonId)
+)
+# --------------------------------------------------------
+CREATE TABLE PrivateMessageBody (
+ PMBodyId int(11) unsigned NOT NULL auto_increment,
+ Subject varchar(255) NOT NULL default '',
+ Body text NOT NULL,
+ Options tinyint(3) unsigned NOT NULL default '0',
+ ReferenceCount smallint(5) unsigned NOT NULL default '0',
+ PRIMARY KEY (PMBodyId)
+)
+# --------------------------------------------------------
+CREATE TABLE PrivateMessages (
+ PmId int(11) unsigned NOT NULL auto_increment,
+ FromId int(11) unsigned NOT NULL default '0',
+ ToId int(11) unsigned NOT NULL default '0',
+ FolderId tinyint(3) NOT NULL default '0',
+ Status tinyint(1) unsigned NOT NULL default '0',
+ PMBodyId int(11) unsigned NOT NULL default '0',
+ CreatedOn int(11) unsigned NOT NULL default '0',
+ PRIMARY KEY (PmId),
+ KEY FromId (FromId),
+ KEY CreatedOn (CreatedOn),
+ KEY ToId (ToId)
+)
+# --------------------------------------------------------
+CREATE TABLE TopicCustomData (
+ CustomDataId int(11) NOT NULL auto_increment,
+ ResourceId int(10) unsigned NOT NULL default '0',
+ PRIMARY KEY (CustomDataId)
+)
+# --------------------------------------------------------
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.6.24/in-bulletin/admin/censor_config.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.6.24/in-bulletin/admin/censor_config.php (revision 0)
+++ branches/unlabeled/unlabeled-1.6.24/in-bulletin/admin/censor_config.php (revision 12744)
@@ -0,0 +1,193 @@
+GetSection($section);
+$envar = "env=".BuildEnv();
+
+$SortFieldVar = "CensorConfig_LV_Sortfield";
+$SortOrderVar = "CensorConfig_LV_Sortorder";
+$DefaultSortField = "BadWord";
+$PerPageVar = "Perpage_Censorship";
+$CurrentPageVar = "Page_Censorship";
+$CurrentFilterVar = "";
+
+$ListForm = "configform";
+$CheckClass = "FieldChecks";
+
+$formaction = $_SERVER["PHP_SELF"]."?".$envar;
+
+/* ------------------------------------- Configure the toolbar ------------------------------------------- */
+$objListToolBar = new clsToolBar();
+$objListToolBar->Set("section",$section);
+$objListToolBar->Set("load_menu_func","");
+$objListToolBar->Set("CheckClass",$CheckClass);
+$objListToolBar->Set("CheckForm",$ListForm);
+
+$listImages = array();
+
+$highURL = $rootURL."in-bulletin/admin/images/tool_forum_new_censor_f2.gif";
+$lowURL = $rootURL."in-bulletin/admin/images/tool_forum_new_censor.gif";
+
+$objListToolBar->Add("new_word", "la_ToolTip_New_CensorWord",$rootURL."in-bulletin/admin/addcensor_word.php?$envar&new=1","swap('new_word','$highURL');",
+ "swap('new_word', '$lowURL');","",$lowURL);
+
+$objListToolBar->Add("word_edit","la_ToolTip_Edit","#", "if (FieldChecks.itemChecked()) swap('word_edit','toolbar/tool_edit_f2.gif');",
+ "if (FieldChecks.itemChecked()) swap('word_edit', 'toolbar/tool_edit.gif');","if (FieldChecks.itemChecked()) FieldChecks.check_submit('addcensor_word', '');",
+ "tool_edit.gif",TRUE,TRUE);
+$listImages[] = "FieldChecks.addImage('word_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); ";
+
+$objListToolBar->Add("word_del","la_ToolTip_Delete","#", "if (FieldChecks.itemChecked()) swap('word_del','toolbar/tool_delete_f2.gif');",
+ "if (FieldChecks.itemChecked()) swap('word_del', 'toolbar/tool_delete.gif');","if (FieldChecks.itemChecked()) FieldChecks.check_submit('censor_config', 'bb_censorship_delete');",
+ "tool_delete.gif",FALSE,TRUE);
+$listImages[] = "FieldChecks.addImage('word_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); ";
+
+$objListToolBar->Add("divider");
+
+$objListToolBar->Add("viewmenubutton", "la_ToolTip_View","#","swap('viewmenubutton','toolbar/tool_view_f2.gif'); ",
+ "swap('viewmenubutton', 'toolbar/tool_view.gif');",
+ "ShowViewMenu();","tool_view.gif");
+
+
+$objListToolBar->AddToInitScript($listImages);
+$objListToolBar->AddToInitScript("fwLoadMenus(); \n");
+
+$SearchWords = $objSession->GetVariable("CensorSearchWord");
+
+/* ------------------------------------ Build the SQL statement to populate the list ---------------------------*/
+
+$objCensor = new clsCensorship();
+
+if(!strlen($objConfig->Get($SortFieldVar)))
+{
+ $objConfig->Set($SortFieldVar,"BadWord");
+ $objConfig->Get($SortOrderVar,"desc");
+}
+
+$order = trim($objConfig->Get($SortFieldVar)." ".$objConfig->Get($SortOrderVar));
+
+if(strlen($SearchWords))
+{
+ $where .= $objCensor->AdminSearchWhereClause($SearchWords);
+}
+
+$sql = "SELECT * FROM ".$objCensor->SourceTable." ";
+if(strlen($where))
+ $sql .= "WHERE $where ";
+
+if($_GET["lpn"])
+ $objSession->SetVariable($CurrentPageVar,(int)$_GET["lpn"]);
+
+if((int)$objSession->GetVariable($CurrentPageVar)==0)
+ $objSession->SetVariable($CurrentPageVar,"1");
+
+$Limit = GetLimitSQL($objSession->GetVariable($CurrentPageVar),$objConfig->Get($PerPageVar));
+
+$objCensor->Page = $objSession->GetVariable($CurrentPageVar);
+
+$sql .= "ORDER BY ".$order." ";
+$sql .= $Limit;
+
+if($objSession->HasSystemPermission("DEBUG.LIST"))
+ echo htmlentities($sql,ENT_NOQUOTES)." \n";
+
+$itemcount = TableCount(GetTablePrefix()."Censorship", $where,0);
+$objCensor->Query_Item($sql);
+
+$objListView = new clsListView($objListToolBar,$objCensor);
+$objListView->IdField = "CensorshipId";
+
+$order = $objConfig->Get($SortFieldVar);
+$objListView->ColumnHeaders->Add("BadWord",admin_language("la_ColHeader_BadWord"),1,0,$order,"width=\"30%\"","CensorConfig_LV_Sortfield","CensorConfig_LV_Sortorder","BadWord");
+$objListView->ColumnHeaders->Add("Replacement",admin_language("la_ColHeader_Replacement"),1,0,$order,"width=\"30%\"","CensorConfig_LV_Sortfield","CensorConfig_LV_Sortorder","Replacement");
+
+$objListView->ColumnHeaders->SetSort($objConfig->Get("CensorConfig_LV_Sortfield"), $objConfig->Get("CensorConfig_LV_Sortorder"));
+
+$objListView->PrintToolBar = FALSE;
+$objListView->checkboxes = TRUE;
+$objListView->SearchBar = TRUE;
+$objListView->SearchKeywords = $SearchWords;
+$objListView->SearchAction="bb_censor_search";
+$objListView->TotalItemCount = $itemcount;
+$objListView->CurrentPageVar = $CurrentPageVar;
+$objListView->PerPageVar =$PerPageVar;
+$objListView->CheckboxName = "itemlist[]";
+
+$objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField,"","",0);
+
+$filter = false;
+if ($SearchWords != '') {
+ $filter = true;
+}
+
+//$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Censorship");
+$h = "\n\n\n";
+int_header($objListToolBar,NULL, $title,NULL,$h);
+if ($filter) { ?>
+
+
+" method=POST>
+
+
+PageLinks = $objListView->PrintPageLinks(); /* call this before we slice! */
+ $objListView->SliceItems();
+ print $objListView->PrintList();
+?>
+
+
+
+
+
+
+">
+
+
+
+
+
+
Index: branches/unlabeled/unlabeled-1.6.24/in-bulletin/admin/emoticon_config.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.6.24/in-bulletin/admin/emoticon_config.php (revision 0)
+++ branches/unlabeled/unlabeled-1.6.24/in-bulletin/admin/emoticon_config.php (revision 12744)
@@ -0,0 +1,176 @@
+GetSection($section);
+
+$SortFieldVar = "Emoticon_LV_Sortfield";
+$SortOrderVar = "Emoticon_LV_Sortorder";
+$DefaultSortField = "Name";
+$PerPageVar = "Perpage_Emoticon";
+$CurrentPageVar = "Page_Emoticon";
+$CurrentFilterVar = "";
+
+$ListForm = "configform";
+$CheckClass = "FieldChecks";
+
+$formaction = $_SERVER["PHP_SELF"]."?".$envar;
+
+/* ------------------------------------- Configure the toolbar ------------------------------------------- */
+$objListToolBar = new clsToolBar();
+$objListToolBar->Set("section",$section);
+$objListToolBar->Set("load_menu_func","");
+$objListToolBar->Set("CheckClass",$CheckClass);
+$objListToolBar->Set("CheckForm",$ListForm);
+
+$listImages = array();
+
+$highURL = $rootURL."in-bulletin/admin/images/tool_forum_new_smiley_f2.gif";
+$lowURL = $rootURL."in-bulletin/admin/images/tool_forum_new_smiley.gif";
+
+$objListToolBar->Add("new_icon", "la_ToolTip_New_Emoticon",$rootURL."in-bulletin/admin/addemoticon.php?$envar&new=1","swap('new_icon','$highURL');",
+ "swap('new_icon', '$lowURL');","",$lowURL);
+
+$objListToolBar->Add("icon_edit","la_ToolTip_Edit","#", "if (FieldChecks.itemChecked()) swap('icon_edit','toolbar/tool_edit_f2.gif');",
+ "if (FieldChecks.itemChecked()) swap('icon_edit', 'toolbar/tool_edit.gif');","if (FieldChecks.itemChecked()) FieldChecks.check_submit('addemoticon', '');",
+ "tool_edit.gif",TRUE,TRUE);
+$listImages[] = "FieldChecks.addImage('icon_edit','$imagesURL/toolbar/tool_edit.gif','$imagesURL/toolbar/tool_edit_f3.gif',1); ";
+
+$objListToolBar->Add("icon_del","la_ToolTip_Delete","#", "if (FieldChecks.itemChecked()) swap('icon_del','toolbar/tool_delete_f2.gif');",
+ "if (FieldChecks.itemChecked()) swap('icon_del', 'toolbar/tool_delete.gif');","if (FieldChecks.itemChecked()) FieldChecks.check_submit('emoticon_config', 'bb_emoticon_delete');",
+ "tool_delete.gif",FALSE,TRUE);
+$listImages[] = "FieldChecks.addImage('icon_del','$imagesURL/toolbar/tool_delete.gif','$imagesURL/toolbar/tool_delete_f3.gif',1); ";
+
+$objListToolBar->AddToInitScript($listImages);
+$objListToolBar->AddToInitScript("fwLoadMenus(); \n");
+
+$SearchWords = $objSession->GetVariable("EmoticonSearchWord");
+
+$objEmoticons = new clsEmoticonList();
+
+$order = trim($objConfig->Get("Emoticon_LV_Sortfield")." ".$objConfig->Get("Emoticon_LV_Sortorder"));
+
+if(strlen($SearchWords))
+{
+ $where .= $objEmoticons->AdminSearchWhereClause($SearchWords);
+}
+
+if(!strlen($objConfig->Get($SortFieldVar)))
+ $objConfig->Set($SortFieldVar,$DefaultSortField);
+
+$orderBy = trim($objConfig->Get($SortFieldVar)." ".$objConfig->Get($SortOrderVar));
+if(strlen($orderBy))
+ $objEmoticons->LoadEmoticons($where, $orderBy);
+else
+ $objEmoticons->LoadEmoticons($where);
+
+$count = $objEmoticons->NumItems();
+for($i=0;$i<$count;$i++)
+{
+ $e =& $objEmoticons->GetItemRefByIndex($i);
+ $img = $e->GetImageObject();
+
+ $e->Set("Image"," FullURL()."\">");
+}
+
+$objListView = new clsListView($objListToolBar,$objEmoticons);
+$objListView->IdField = "EmoticonId";
+
+$order = $objConfig->Get("Emoticon_LV_Sortfield");
+$objListView->ColumnHeaders->Add("Name",admin_language("la_prompt_Name"),1,0,$order,"width=\"30%\"","Emoticon_LV_Sortfield","Emoticon_LV_Sortorder","Name");
+$objListView->ColumnHeaders->Add("KeyStroke",admin_language("la_prompt_KeyStroke"),1,0,$order,"width=\"30%\"","Emoticon_LV_Sortfield","Emoticon_LV_Sortorder","KeyStroke");
+$objListView->ColumnHeaders->Add("Image",admin_language("la_prompt_Image"),1,0,$order,"width=\"30%\"","Emoticon_LV_Sortfield","Emoticon_LV_Sortorder","ImageId");
+
+$objListView->ColumnHeaders->SetSort($objConfig->Get("Emoticon_LV_Sortfield"), $objConfig->Get("Emoticon_LV_Sortorder"));
+
+$objListView->PrintToolBar = FALSE;
+$objListView->checkboxes = TRUE;
+$objListView->SearchBar = TRUE;
+$objListView->SearchKeywords = $SearchWords;
+$objListView->SearchAction="bb_emoticon_search";
+$objListView->CurrentPageVar = "Page_Emoticon";
+$objListView->PerPageVar = "Perpage_Emoticon";
+$objListView->CheckboxName = "itemlist[]";
+
+$objListView->ConfigureViewMenu($SortFieldVar,$SortOrderVar,$DefaultSortField,"","",0);
+
+$filter = false;
+if ($SearchWords != '') {
+ $filter = true;
+}
+
+$title = prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Emoticons");
+$h = "\n\n\n";
+
+int_header($objListToolBar,NULL,$title, NULL, $h);
+if ($filter) { ?>
+
+
+" method=POST>
+
+
+PageLinks = $objListView->PrintPageLinks(); /* call this before we slice! */
+$objListView->SliceItems();
+print $objListView->PrintList();
+?>
+
+
+
+
+">
+
+
+
+
+
+
+
+
Index: branches/unlabeled/unlabeled-1.6.24/in-bulletin/units/posts/posts_config.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.6.24/in-bulletin/units/posts/posts_config.php (revision 0)
+++ branches/unlabeled/unlabeled-1.6.24/in-bulletin/units/posts/posts_config.php (revision 12744)
@@ -0,0 +1,98 @@
+ 'bb-post',
+ 'ItemClass' => Array('class' => 'kDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'PostEventHandler', 'file' => 'post_eh.php', 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'PostTagProcessor', 'file' => 'post_tp.php', 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+
+ 'QueryString' => Array (
+ 1 => 'id',
+ 2 => 'Page',
+ 3 => 'event',
+ ),
+
+ 'IDField' => 'PostingId',
+ 'StatusField' => Array('Pending'),
+
+ 'TitleField' => 'Subject',
+
+ 'TableName' => TABLE_PREFIX.'Posting',
+
+ 'ForeignKey' => 'TopicId',
+ 'ParentTableKey' => 'TopicId',
+ 'ParentPrefix' => 'bb',
+ 'AutoDelete' => true,
+ 'AutoClone' => true,
+
+ 'ListSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'Images img ON (img.ResourceId = u.ResourceId) AND (img.DefaultImg = 1 OR img.Name = "avatar")',
+ ),
+
+ 'ItemSQLs' => Array (
+ '' => ' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.CreatedById = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'Images img ON (img.ResourceId = u.ResourceId) AND (img.DefaultImg = 1 OR img.Name = "avatar")',
+ ),
+
+ 'ListSortings' => Array (
+ '' => Array (
+ 'ForcedSorting' => Array ('CreatedOn' => 'asc',),
+ ),
+ ),
+
+ 'CalculatedFields' => Array (
+ '' => Array (
+ 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.CreatedById = -1, "root", IF (%1$s.CreatedById = -2, "Guest", "n/a")), u.Login)',
+
+ 'SameImages' => 'img.SameImages',
+ 'LocalThumb' => 'img.LocalThumb',
+ 'ThumbPath' => 'img.ThumbPath',
+ 'ThumbUrl' => 'img.ThumbUrl',
+ 'LocalImage' => 'img.LocalImage',
+ 'LocalPath' => 'img.LocalPath',
+ 'FullUrl' => 'img.Url',
+ ),
+ ),
+
+ 'Fields' => Array (
+ 'PostingId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'IPAddress' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'PosterAlias' => Array ('type' => 'string', 'max_len' => 255, 'not_null' => 1, 'default' => ''),
+ 'Pending' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Subject' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL),
+ 'PostingText' => Array ('type' => 'string', 'allow_html' => 1, 'default' => NULL),
+ 'GraphicsUrl' => Array ('type' => 'string', 'max_len' => 255, 'default' => NULL),
+ 'CreatedOn' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => 1, 'default' => 0),
+ 'Modified' => Array ('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => 1, 'default' => 0),
+ 'ModifiedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'default' => NULL),
+ 'CreatedById' => Array ('type' => 'int', 'formatter' => 'kLEFTFormatter', 'error_msgs' => Array ('invalid_option' => '!la_error_UserNotFound!'), 'options' => Array(-1 => 'root', -2 => 'Guest'), 'left_sql' => 'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'default' => NULL),
+ 'TopicId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'ResourceId' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'ReplyTo' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Options' => Array ('type' => 'int', 'not_null' => 1, 'default' => 0),
+ ),
+
+ 'VirtualFields' => Array (
+ 'DisableBBCodes' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'DisableSmileys' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'default' => 0),
+ 'ShowSignatures' => Array ('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (0 => 'la_No', 1 => 'la_Yes'), 'use_phrases' => 1, 'default' => 1),
+
+ // for avatar image
+ 'SameImages' => Array('type' => 'string', 'default' => ''),
+ 'LocalThumb' => Array('type' => 'string', 'default' => ''),
+ 'ThumbPath' => Array('type' => 'string', 'default' => ''),
+ 'ThumbUrl' => Array('type' => 'string', 'default' => ''),
+ 'LocalImage' => Array('type' => 'string', 'default' => ''),
+ 'LocalPath' => Array('type' => 'string', 'default' => ''),
+ 'FullUrl' => Array('type' => 'string', 'default' => ''),
+ ),
+ );
+
+?>
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.14.20/in-bulletin/privatemessage.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.14.20/in-bulletin/privatemessage.php (revision 0)
+++ branches/unlabeled/unlabeled-1.14.20/in-bulletin/privatemessage.php (revision 12744)
@@ -0,0 +1,369 @@
+tablename = GetTablePrefix().'PrivateMessages';
+ $this->type = TYPE_MESSAGE;
+ $this->NoResourceId = 1;
+ //$this->BasePermission = 'PM';
+ $this->id_field = 'PmId';
+ $this->TagPrefix = 'pm';
+ $prefix = GetTablePrefix();
+ $this->SelectSQL = 'SELECT pm.*, pmb.Subject, pmb.Body, pmb.Options, pu.Login
+ FROM %s AS pm
+ LEFT JOIN '.$prefix.'PrivateMessageBody AS pmb ON pm.PMBodyId = pmb.PMBodyId
+ LEFT JOIN '.$prefix.'PortalUser AS pu ON pu.PortalUserId = pm.FromId
+ WHERE %s';
+ }
+
+ function ParseObject($element)
+ {
+ global $objSession, $objUsers, $var_list_update, $bb_var_list_update;
+
+ $extra_attribs = ExtraAttributes($element->attributes);
+ if(strtolower($element->name) == $this->TagPrefix)
+ {
+ $field = strtolower( $element->attributes['_field'] );
+ switch($field)
+ {
+ case 'id':
+ $ret = $this->UniqueId();
+ break;
+
+ case 'body':
+ global $objCensorList, $objSmileys;
+ $ret = $this->Get('Body');
+ $ret = str_replace( "[/code]\r\n",'[/code]', $ret);
+ $ret = str_replace('"', '"', $ret);
+ $ret = $objCensorList->CensorText($ret);
+ if(!$this->GetOption("disable_smileys"))
+ {
+ $ret = $objSmileys->ParseText($ret);
+ }
+
+ if(!$this->GetOption("disable_bbcode"))
+ {
+ $ret = ReplaceBBCode($ret);
+ }
+ $ret = nl2br($ret);
+
+ if( $this->GetOption("show_sig") && $element->GetAttributeByName('_signature') > 0 )
+ {
+ $Sender =& $objUsers->GetItem($this->Get('FromId'));
+
+ $showsig = $this->GetOption("show_sig"); // show post creator signature in this post
+ $UserSig = (int)$objSession->GetPersistantVariable("bb_signatures"); // viewing user wishes to see other signatures
+ if($showsig == 1 && $UserSig == 1)
+ {
+ $sig = $Sender->GetPersistantVariable("my_signature");
+
+ if( !$this->GetOption("disable_smileys") ) $sig = $objSmileys->ParseText($sig);
+ if( !$this->GetOption("disable_bbcode") ) $sig = ReplaceBBCode($sig);
+ $ret .= " ".nl2br($sig);
+ }
+ }
+ break;
+
+ case 'reply_link':
+ $var_list_update['t'] = $element->GetAttributeByName('_PMTemplate');
+ $bb_var_list_update['pm_id'] = $this->UniqueId();
+
+ $ToUser =& $objUsers->GetItem($this->Get('FromId'));
+ if( is_object($ToUser) )
+ {
+ $ret = HREF_Wrapper('', Array('ToUser' => $ToUser->Get('Login'), 'IsReply' => 1) );
+ }
+ else
+ {
+ $ret = '';
+ }
+ break;
+
+ case 'delete_link':
+ $var_list_update['t'] = 'inbulletin/pm_list';
+ $bb_var_list_update['pm_id'] = $this->UniqueId();
+ $ret = HREF_Wrapper('', Array('Action' => 'bb_delete_pm', 'FolderId' => (int)GetVar('FolderId') ) );
+ break;
+
+ case 'fromlogin':
+ $Me = $objUsers->GetItem( $objSession->Get('PortalUserId') );
+ if( is_object($Me) )
+ {
+ $ret = $Me->Get('Login');
+ }
+ break;
+
+ case 'fromuser':
+ $ret = $this->Get('SenderUser');
+ break;
+
+ case 'senderuser':
+ $UserID = $this->Get('FromId') != $objSession->Get('PortalUserId') ? $this->Get('FromId') : $this->Get('ToId');
+ $FromUser = $objUsers->GetItem($UserID);
+ if( is_object($FromUser) )
+ {
+ $ret = $FromUser->Get('Login');
+ }
+ else
+ {
+ $ret = '';
+ }
+
+ break;
+
+ case 'link':
+ $var_list_update['t'] = $element->GetAttributeByName('_PMTemplate');
+ $bb_var_list_update['pm_id'] = $this->UniqueId();
+ $ret = HREF_Wrapper('', Array('FolderId' => (int)GetVar('FolderId') ) );
+ break;
+
+ case 'datecreated':
+ $ret = adodb_date($element->GetAttributeByName('_Format'), $this->Get('CreatedOn') );
+ break;
+
+ case 'subject':
+ // PM Statuses = {0 - Unread, 1 - Viewed, 2 - Read, 3 - Replyed, 4 - Sent}
+ $subject = $this->Get('Subject') ? $this->Get('Subject') : '['.language('no_subject').']';
+ $ret = $this->Get('Status') < 2 ? ''.$subject.' ' : $subject;
+ $ret = get_magic_quotes_gpc() ? $ret : stripslashes($ret);
+ break;
+
+ default:
+ $ret = parent::ParseObject($element);
+ break;
+ }
+ }
+ return $ret;
+ }
+
+ function GetOption($name)
+ {
+ $opt = decbin($this->Get('Options'));
+ $opt = str_pad($opt, 8, '0');
+
+ if($opt == 0) return false;
+ switch($name)
+ {
+ case "show_sig":
+ $option = $opt[0];
+ break;
+ case "disable_bbcode":
+ $option = $opt[1];
+ break;
+ case "disable_smileys":
+ $option = $opt[2];
+ break;
+ }
+ return $option;
+ }
+
+ function Delete()
+ {
+ // if all references to pm body were deleted -> also delete message body
+ $db =& GetADODBConnection();
+ $BodyID = $this->Get('PMBodyId');
+ $BodyTable = GetTablePrefix().'PrivateMessageBody';
+
+ $ret = parent::Delete();
+ if($ret)
+ {
+ $db->Execute('UPDATE '.$BodyTable.' SET ReferenceCount = ReferenceCount - 1 WHERE PMBodyId = '.$BodyID);
+ }
+ $db->Execute('DELETE FROM '.$BodyTable.' WHERE PMBodyId = '.$BodyID.' AND ReferenceCount = 0');
+ }
+
+ function SetOption($name,$value)
+ {
+ $opt = str_pad(decbin($this->Get('Options')),8,"0");
+
+ switch($name)
+ {
+ case "show_sig":
+ $option = 0;
+ break;
+ case "disable_bbcode":
+ $option = 1;
+ break;
+ case "disable_smileys":
+ $option = 2;
+ break;
+ }
+ if(is_numeric($option))
+ {
+ if($value)
+ {
+ $opt[$option] =1;
+ }
+ else
+ $opt[$option]=0;
+ }
+ $this->Set('Options', bindec($opt) );
+ return $option;
+ }
+
+ function UpdateOptions()
+ {
+ $db =& GetADODBConnection();
+ $sql = 'UPDATE '.GetTablePrefix().'PrivateMessageBody SET Options = '.$this->get('Options').' WHERE PMBodyId = '.$this->Get('PMBodyId');
+ $db->Execute($sql);
+ }
+
+}
+
+class clsPrivateMessageList extends clsItemList
+{
+ var $FolderId = 0; // folder id to get private messages from
+
+ function clsPrivateMessageList()
+ {
+ global $bb_var_list;
+ parent::clsItemList();
+ $this->classname = 'clsPrivateMessage';
+ $this->SetTable('live', GetTablePrefix().'PrivateMessages');
+ $this->Page = $bb_var_list['pmp'];
+ $this->PerPageVar = 'Perpage_PrivateMessages';
+ $this->PageEnvar = 'bb_var_list_update';
+ $this->PageEnvarIndex = 'pmp';
+ $this->EnablePaging = true;
+ //$this->AddSortField('PMs_Sortfield','PMs_SortOrder');
+ $this->ItemType = TYPE_MESSAGE;
+ }
+
+ /**
+ * @return void
+ * @param int $ToId
+ * @param string $Subject
+ * @param string $Text
+ * @desc Create new private mesage
+ */
+ function &Add_PrivateMessage($ToId, $Subject, $Text)
+ {
+ global $objSession, $objUsers;
+
+ // PM Statuses = {0 - Unread, 1 - Viewed, 2 - Read, 3 - Replyed, 4 - Sent}
+ // PM Folders = {0 - Inbox, -1 - Sent}
+
+ $db =& GetADODBConnection();
+ $sql = 'INSERT INTO '.GetTablePrefix().'PrivateMessageBody(Subject,Body,ReferenceCount) VALUES (%s,%s,2)';
+ $db->Execute( sprintf($sql, $db->qstr($Subject, get_magic_quotes_gpc() ), $db->qstr($Text, get_magic_quotes_gpc() ) ) );
+ if( $db->ErrorNo() == 0 )
+ {
+ // pm body was inserted
+ $pm =& $this->GetDummy();
+ $FromId = $objSession->Get('PortalUserId');
+ $BodyId = $db->Insert_ID();
+ $CreatedOn = adodb_date("U");
+ // create message in sender "Sent" folder
+ $pm->Set( Array('FromId', 'ToId', 'CreatedOn','FolderId','Status','PMBodyId','PmId'),
+ Array($FromId, $ToId, $CreatedOn, -1, 2, $BodyId,0) );
+ $pm->Create();
+
+ // create message in recipient "Inbox" folder
+ $pm->Set( Array('FromId', 'ToId', 'CreatedOn','FolderId','Status','PMBodyId','PmId'),
+ Array($FromId, $ToId, $CreatedOn, 0, 0, $BodyId,0) );
+ $pm->Create();
+
+ $Recipient =& $objUsers->GetItem($ToId);
+ if( is_object($Recipient) )
+ {
+ // send email to recipient that pm were created (if he allowed this)
+ if($Recipient->GetPersistantVariable('bb_pm_notify') == 1)
+ {
+ $pm->Set('SenderUser', $Recipient->Get('Login') );
+ $objSession->SetVariable('ToUser', $pm->Get('SenderUser') );
+ $pm->SendUserEventMail('PM.ADD', $ToId);
+ }
+ }
+ }
+ return $pm;
+ }
+
+ function LoadUserPMs($attribs=array())
+ {
+ global $objSession, $objConfig;
+
+ $this->SetFolderId( GetVar('FolderId') );
+ $OrderBy ='';
+
+ //$this->Clear();
+
+ $limit = $this->GetPageLimitSQL();
+
+ // apply sorting
+ $sort_field = trim($objSession->GetPersistantVariable('PMs_Sortfield'));
+ if( !strlen($sort_field) )
+ {
+ $sort_field = trim( $objConfig->Get('PMs_Sortfield') );
+ }
+ if($sort_field)
+ {
+ $OrderBy = 'ORDER BY '.$sort_field.' '.$objSession->GetPersistantVariable('PMs_SortOrder');
+ }
+ else
+ {
+ $OrderBy = 'ORDER BY CreatedOn DESC';
+ }
+
+ $where = 'pm.FolderId = '.$this->FolderId;
+ $ThisUserId = $objSession->Get('PortalUserId');
+ switch($this->FolderId)
+ {
+ case 0: // inbox
+ $where .= ' AND pm.ToId = '.$ThisUserId;
+ break;
+
+ case -1: // sent
+ $where .= ' AND pm.FromId = '.$ThisUserId;
+ break;
+ }
+ $prefix = GetTablePrefix();
+ if($this->FolderId == -1)
+ {
+ $field_list = 'pm.ToId AS FromId, pm.FromId AS ToId';
+ $join_clause = 'pu.PortalUserId = pm.ToId';
+ }
+ else
+ {
+ $field_list = 'pm.ToId AS ToId, pm.FromId AS FromId';
+ $join_clause = 'pu.PortalUserId = pm.FromId';
+ }
+
+ $sql = 'SELECT pm.PmId, pm.FolderId, pm.Status, pm.PMBodyId, pm.CreatedOn, pmb.Subject, pmb.Body, pu.Login AS SenderUser, '.$field_list.'
+ FROM '.$this->SourceTable.' AS pm LEFT JOIN '.$prefix.'PrivateMessageBody AS pmb ON pm.PMBodyId = pmb.PMBodyId LEFT JOIN '.$prefix.'PortalUser AS pu ON '.$join_clause.'
+ WHERE '.$where;
+
+ $this->QueryItemCount = QueryCount($sql);
+
+ $sql .= " ".$OrderBy;
+
+ return $this->Query_Item($sql, $limit);
+ }
+
+ function Query_Item($sql,$limit = null, $fix_method = 'set_first')
+ {
+ if($sql !== $this->LastQuerySQL && $limit !== $this->LastLimitClause)
+ {
+ $ret = parent::Query_Item($sql,$limit,$fix_method);
+ $this->LastQuerySQL = $sql;
+ $this->LastLimitClause = $limit;
+ return $ret;
+ }
+ else
+ {
+ return $this->Items;
+ }
+ }
+
+ function SetFolderId($NewId)
+ {
+ $this->FolderId = (int)$NewId;
+ }
+}
+
+?>
Index: branches/unlabeled/unlabeled-1.26.20/in-bulletin/action.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.26.20/in-bulletin/action.php (revision 0)
+++ branches/unlabeled/unlabeled-1.26.20/in-bulletin/action.php (revision 12744)
@@ -0,0 +1,528 @@
+HasSystemPermission("SYSTEM_ACCESS.READONLY");
+
+// Session expiration related
+
+require_login( !admin_login() && $Action, 'expired=1', true );
+
+// End session exipration related
+
+ switch($Action)
+ {
+ case "m_cat_delete":
+ if($ro_perm) break;
+ if(isset($_POST["catlist"]))
+ {
+
+ $CatList = $_POST["catlist"];
+ if(is_array($CatList))
+ {
+ for($i=0;$iClearCategoryItems($c,"CategoryItems");
+ }
+ }
+ else
+ if(is_numeric($CatList))
+ $objTopicList->ClearCategoryItems($CatList,"CategoryItems");
+ }
+ break;
+
+ case "m_paste": /* category paste */
+ if($ro_perm) break;
+ if($PastedCatIds)
+ {
+ foreach($PastedCatIds as $SourceCat => $DestCat)
+ {
+ $objTopicList->Clear();
+ $objTopicList->Query_Topic("CategoryId=$SourceCat");
+ if($objTopicList->NumItems()>0)
+ {
+ foreach($objTopicList->Items as $item)
+ {
+ /* fields from categoryitems table */
+ $item->UnsetField("CategoryId");
+ $item->UnsetField("ItemResourceId");
+ $item->UnsetField("PrimaryCat");
+ $item->UnsetField("CachedNavBar");
+ $item->CopyToNewResource($DestCat);
+ $item->AddToCategory($DestCat);
+ }
+ }
+ }
+ }
+ break;
+
+ /* censorship admin action handlers */
+ case "bb_censorword_edit":
+ if($ro_perm) break;
+ $WordId = $_POST["CensorshipId"];
+ $objCensor = new clsCensorship();
+ if(strlen($_POST["badword"]))
+ $objCensor->EditWord($WordId,$_POST["badword"],$_POST["replacement"]);
+ break;
+ case "bb_censorword_add":
+ if($ro_perm) break;
+ $objCensor = new clsCensorship();
+ if(strlen($_POST["badword"]))
+ $objCensor->AddWord($_POST["badword"],$_POST["replacement"]);
+ break;
+ case "bb_censorship_delete":
+ if($ro_perm) break;
+ $objCensor = new clsCensorship();
+ foreach($_POST["itemlist"] as $wordid)
+ {
+ $objCensor->DeleteWord($wordid);
+ }
+ break;
+
+ /* emoticon action handlers */
+ case "bb_emoticon_add":
+ if($ro_perm) break;
+ //$objSmileys = new clsEmoticonList();
+ $file = $_FILES["EmoticonFile"];
+ if(is_array($file))
+ {
+ if($file["size"]>0)
+ {
+ $objSmileys->UploadEmoticon($file,$_POST["Name"],$_POST["KeyStroke"],(int)$_POST["Enabled"]);
+ }
+ }
+ break;
+ case "bb_emoticon_edit":
+ if($ro_perm) break;
+ //$objEmoticons = new clsEmoticonList();
+ $file = $_FILES["EmoticonFile"];
+
+ $e = $objSmileys->EditEmoticon($_POST["EmoticonId"],$_POST["Name"],$_POST["KeyStroke"],-1,$_POST["Enabled"]);
+ $img = $e->GetImageObject();
+ if(is_array($file))
+ {
+ if($file["size"]>0)
+ {
+ $localpath = $img->StoreUploadedImage($file,1, "in-bulletin/images/emoticons/",0);
+ $img->Set("LocalPath",$localpath);
+ $img->Set("ThumbPath",$localpath);
+ $img->Update();
+ }
+ }
+ $e->Update();
+ break;
+ case "bb_emoticon_delete":
+ if($ro_perm) break;
+ //$objEmoticons = new clsEmoticonList();
+ foreach($_POST["itemlist"] as $id)
+ {
+ $objSmileys->DeleteEmoticon($id);
+ }
+ break;
+
+ case "bb_topic_delete":
+ if($ro_perm) break;
+ $thiscat =& $objCatList->GetItem($objCatList->CurrentCategoryID());
+ $perm = $objSession->HasCatPermission("TOPIC.DELETE");
+ if(is_array($_POST["topiclist"]))
+ {
+ $cat_ids = Array();
+ foreach($_POST["topiclist"] as $topicid)
+ {
+ $t =& $objTopicList->GetItem($topicid);
+ $cat_ids[$t->GetPrimaryCategory()] = $t->GetPrimaryCategory();
+ if (($objSession->Get("PortalUserId") == $t->Get("OwnerId")) || ($perm==1))
+ {
+ if(is_object($t))
+ {
+ $objTopicList->Delete_Item($topicid);
+ }
+ }
+ }
+ }
+ else
+ {
+ $t = $objTopicList->GetCurrentTopic();
+ $cat_ids = $t->GetPrimaryCategory();
+ if(is_object($t))
+ {
+ $objTopicList->Delete_Item($t->Get("TopicId"));
+ unset($t);
+ }
+ }
+
+ /*foreach($cat_ids as $cat_id)
+ {
+ $t->refreshLastUpdate($cat_id);
+ }*/
+
+ UpdateCategoryCount('topic', $cat_ids, $objTopicList->GetListTypes());
+// UpdateCategoryCount('posting', $cat_ids, $objPostingList->GetListTypes());
+// $objTopicList->ResetCache( $objCatList->CurrentCategoryID() );
+ $objPostingList->ResetCache( $objCatList->CurrentCategoryID() );
+ break;
+
+ case "bb_topic_move_up":
+ if($ro_perm) break;
+ if (isset($_POST["topiclist"]))
+ foreach($_POST["topiclist"] as $id)
+ {
+ $a = $objTopicList->GetItem($id);
+ $a->MoveUp();
+ }
+ break;
+
+ case "bb_topic_move_down":
+ if($ro_perm) break;
+ if (isset($_POST["topiclist"]))
+ {
+ $topiclist=array_reverse($_POST["topiclist"]);
+ foreach($topiclist as $id)
+ {
+ $a = $objTopicList->GetItem($id);
+ $a->MoveDown();
+ }
+ }
+ break;
+
+ case "bb_topic_approve":
+ if($ro_perm) break;
+ if (isset($_POST["topiclist"]))
+ {
+ foreach($_POST["topiclist"] as $id)
+ {
+ $a = $objTopicList->GetItem($id);
+ $a->Approve();
+ }
+ }
+ break;
+ case "bb_topic_decline":
+ if($ro_perm) break;
+ if (isset($_POST["topiclist"]))
+ {
+ foreach($_POST["topiclist"] as $id)
+ {
+ $a = $objTopicList->GetItem($id);
+ $a->Deny();
+ }
+ }
+ break;
+
+ case "bb_topic_cut":
+ if($ro_perm) break;
+ if(isset($_POST["topiclist"]))
+ {
+ $objTopicList->CopyToClipboard("CUT","ResourceId",$_POST["topiclist"]);
+ }
+ break;
+
+ case "bb_topic_copy":
+ if($ro_perm) break;
+ if(isset($_POST["topiclist"]))
+ {
+ $objTopicList->CopyToClipboard("COPY","ResourceId",$_POST["topiclist"]);
+ }
+ break;
+
+ // Used from JS
+ case "topic_paste":
+ if($ro_perm) break;
+ if($objTopicList->ItemsOnClipboard()>0)
+ {
+ $objTopicList->PasteFromClipboard($objCatList->CurrentCategoryID(),"TopicText");
+ UpdateCategoryCount("Topic",0);
+ }
+ break;
+
+ case "bb_admin_edit_topic":
+ $objEditItems = new clsTopicList($_POST["CategoryId"]);
+ $objEditItems->SourceTable = $objSession->GetEditTable("Topic");
+ $html = (int)$_POST["html_enable"];
+
+ $Status = (int)$_POST["status"];
+ $Hot=(int)$_POST["itemhot"];
+ $Pop = (int)$_POST["itempop"];
+ $New = (int)$_POST["itemnew"];
+ $Pick = (int)$_POST["topic_pick"];
+
+ $Notify = (int)$_POST["topic_notify_owner"];
+ $CreatedOn = DateTimestamp($_POST["topic_created"],GetDateFormat(0, true));
+ $CreatedOn += SecondsSinceMidnight($_POST["topic_created_time"]);
+
+ $ModifiedOn = DateTimestamp($_POST["topic_modified"],GetDateFormat(0, true));
+ $ModifiedOn += SecondsSinceMidnight($_POST["topic_modified_time"]);
+ $Priority = (int)$_POST["Priority"];
+
+ $posted_hits = $_POST['topic_views_show'];
+
+ $posted_hits_arr = explode('.', $_POST['topic_views']);
+
+
+ $save_hits = $_POST['topic_views'];
+ if ($posted_hits_arr[0] != $posted_hits) {
+ $save_hits = $posted_hits;
+ }
+
+ //$TopicId,$TopicSubject,$User,$CategoryId,$Pending,$Visible,$Pick,$OwnerNotify,$CreatedOn,$ModifedOn
+ $l = $objEditItems->Edit_Topic($_POST["TopicId"],inp_escape($_POST["bb_topic_subject"],$html),
+ $objSession->Get("PortalUserId"),$Status,$Pick, $New, $Hot,
+ $Pop, $Notify,$CreatedOn,$ModifiedOn,$_POST["topic_rating"],
+ (int)$_POST["topic_votes"],$save_hits, $Priority,$_POST["topic_poster"], $_POST['lock_topic'],
+ GetVar('auto_filename'), GetVar('filename') );
+
+ $objCustomEdit = new clsCustomDataList($objSession->GetEditTable("CustomMetaData"));
+ $objCustomEdit->LoadResource($l->Get("ResourceId"));
+ $CustomFields = new clsCustomFieldList(3);
+ $DataChanged = FALSE;
+ foreach($_POST as $key=>$value)
+ {
+ if(substr($key,0,1)=="_")
+ {
+ $field = substr($key,1);
+ $cvalue = $CustomFields->GetItemByField("FieldName",$field,FALSE);
+
+ if(is_object($cvalue))
+ {
+ $objCustomEdit->SetFieldValue($cvalue->Get("CustomFieldId"),$l->Get("ResourceId"),$value);
+ $DataChanged = TRUE;
+ }
+ }
+ }
+ if($DataChanged)
+ $objCustomEdit->SaveData();
+
+ if($_POST["EditStatus"]==1)
+ {
+ $objTopicList->CopyFromEditTable("TopicId");
+ $objTopicList->Clear();
+ }
+ /* user hit the cancel button */
+ if($_POST["EditStatus"]==2)
+ {
+ $objTopicList->PurgeEditTable("TopicId");
+ $objTopicList->Clear();
+ }
+ break;
+ case "bb_add_category":
+ $objEditItems = new clsTopicList();
+ $objEditItems->SourceTable = $objSession->GetEditTable("Topic");
+ $r = $_POST["ResourceId"];
+ $i = $objEditItems->GetItemByField("ResourceId",$_POST["ResourceId"]);
+ $Primary = $i->GetPrimaryCategory($objSession->GetEditTable("CategoryItems"));
+ $objSession->SetVariable("HasChanges", 1);
+ if(is_object($i))
+ {
+ $table = $objSession->GetEditTable("CategoryItems");
+ $CatList = explode(",",$_POST["CatList"]);
+
+ // Get List of currect categories article is in
+ $link_cats = $i->CategoryMemberList($table);
+ $link_cats_arr = explode(",", $link_cats);
+
+ if (count($CatList))
+ {
+ for($j=0; $j < count($CatList);$j++)
+ {
+ if($CatList[$j])
+ {
+ $c = $objCatList->GetByResource($CatList[$j]);
+ $cat = $c->Get("CategoryId");
+
+ if(($cat>0) && !in_array($cat, $link_cats_arr))
+ {
+ $i->AddToCategory($cat,$table);
+ }
+ }
+ }
+ }
+ }
+ break;
+ case "bb_cat_delete":
+ $objSession->SetVariable("HasChanges", 1);
+ $objEditItems = new clsTopicList();
+ $objEditItems->SourceTable = $objSession->GetEditTable("Topic");
+ $table = $objSession->GetEditTable("CategoryItems");
+ $r = $_POST["ResourceId"];
+ $i = $objEditItems->GetItemByField("ResourceId",$_POST["ResourceId"]);
+ if(is_object($i))
+ {
+ $CatCount = $i->CategoryMemberCount($table);
+ $Primary = $i->GetPrimaryCategory();
+ if($CatCount==count($CatList))
+ {
+ $sql = "DELETE FROM $table WHERE CategoryId=$cat AND ItemResourceId=$r AND PrimaryCat=0";
+ $ado->Execute($sql);
+ }
+ else
+ {
+ $CatList = $_POST["itemlist"];
+ $ado = &GetADODBConnection();
+ for($x=0;$xExecute($sql);
+ $CatCount--;
+ }
+ }
+ }
+
+ for($x=0;$x0))
+ {
+ if($cat==$Primary && $CatCount>1)
+ {
+ $sql = "DELETE FROM $table WHERE CategoryId=$cat AND ItemResourceId=$r";
+ if((int)$_GLOBALS["debuglevel"])
+ echo $sql;
+ $ado->Execute($sql);
+ $CatCount--;
+ }
+ }
+ }
+ }
+ }
+ break;
+
+ case 'bb_primary_cat':
+ // change primary category of the link
+ $objEditItems = new clsTopicList();
+ $objEditItems->SourceTable = $objSession->GetEditTable("Topic");
+ $topic = $objEditItems->GetItemByField('ResourceId', $_REQUEST['ResourceId']);
+ if( is_object($topic) )
+ {
+ $new_cat = array_shift($_REQUEST['itemlist']);
+ $ci_table = $objSession->GetEditTable('CategoryItems');
+ $topic->SetPrimaryCategory($new_cat, $ci_table);
+ }
+ break;
+
+ case "pm_new":
+ if($ro_perm) break;
+ $ToId = $objUsers->GetUserId($_POST["pm_to"]);
+ if ($ToId != "" || $ToId != 0)
+ {
+ if($sig)
+ {
+ //$u = new $objUsers->GetUser(PortalUser($currentUserSession->Get("UserId"));
+ $sig_text = $objCurrentUser->GetCustom("Signature");
+ $pm_text.="\n\n".$sig_text;
+ }
+
+ Add_PrivateMessage(inp_escape($_POST["pm_subject"]), inp_escape($_POST["pm_text"]), $ToId, $_POST["sendbody"]);
+ }
+ else
+ Permission_Error("The User Name you specified cannot be found. Please hit back and correct the name.");
+
+ break;
+ case "pm_reply":
+ if($ro_perm) break;
+ $TopicId = $bb_var_list["top"];
+ $pmtext = $_POST["pm_text"];
+ if ($TopicId)
+ {
+ if($_POST["sig"])
+ {
+ //$u = new PortalUser($currentUserSession->Get("UserId"));
+ $sig_text = $objCurrentUser->GetCustom("Signature");
+ $pmtext.="\n\n".$sig_text;
+ }
+
+ Reply_PrivateMessage(inp_escape($pmtext), GetMessageId($TopicId), GetToId($TopicId), $_POST["sendbody"]);
+ }
+ else
+ Permission_Error("Error:");
+ break;
+
+ case "pm_delete":
+ if($ro_perm) break;
+ Delete_PrivateMessage($bb_var_list["post"]);
+ break;
+
+ case "bb_jump_forum":
+ $m_var_list["cat"]=$forum;
+ $m_var_list_update["cat"]=$forum;
+ $env=BuildEnv();
+ break;
+
+ case "bb_viewsetting":
+ $objSession->SetPersistantVariable($fieldname, $varvalue);
+ break;
+ case "bb_search_simple_topics":
+ m_category_SimpleSearch($_POST["keywords"],$_POST["cat_scope"],$_POST["sortorder"]);
+ bb_Search_SimpleQuery($_POST["keywords"],$_POST["cat_scope"],$_POST["sortorder"]);
+ break;
+ case "bb_add_review":
+ if($ro_perm) break;
+ $CreatedOn = adodb_mktime(0,0,0,adodb_date("m"),adodb_date("d"),adodb_date("Y"));
+ $Pending = 0;
+ $ReviewText = inl_escape($_POST["reviewtext"]);
+ $id = $bb_var_list["top"];
+ $userid = $objSession->Get("PortalUserId");
+
+ $n = $objTopicList->GetItem($id);
+ $n->Reviews->Add(0,$CreatedOn,$ReviewText,$Pending,$REMOTE_ADDR,$id,3,$userid);
+ break;
+
+ case "bb_rate_topic":
+ if($ro_perm) break;
+ $id = $bb_var_list["top"];
+ $vote = $_POST["form_rate_vote"];
+ $n = $objTopicList->GetItem($id);
+ $notes = $_POST["form_rate_notes"];
+ $n->SubmitVote($vote,$notes);
+ break;
+
+ case "bb_config_general":
+ if($ro_perm) break;
+ $init = $_POST["init_cat"];
+ $newcat = (int)$_POST["rootcat"];
+ if($init != $newcat)
+ {
+ if($newcat != 0)
+ {
+ $c = $objCatList->GetItemByField('ResourceId',$newcat);
+ $newcat = is_object($c) ? $c->UniqueId() : 0;
+ }
+// $objConfig->Set("Topic_Root", $newcat);
+ $objModules->SetModuleRoot("In-Bulletin", $newcat);
+ }
+ break;
+ }
+
+if( ! $objSession->HasSystemPermission("SYSTEM_ACCESS.READONLY") )
+{
+ if( GetVar('TopicEditStatus') == 1 )
+ {
+ $topic_ids = $objTopicList->CopyFromEditTable("TopicId");
+ if($topic_ids)
+ {
+ $db =& GetADODBConnection();
+ $sql = 'SELECT ResourceId FROM '.$objTopicList->SourceTable.' WHERE TopicId IN ('.implode(',', $topic_ids).')';
+ $rids = $db->GetCol($sql);
+ $objCustomDataList->CopyFromEditTable("CustomDataId", $rids);
+ }
+ $objTopicList->Clear();
+ $objImages = new clsImageList();
+ $objImages->CopyFromEditTable("ImageId");
+ UpdateCategoryCount("Topic",0);
+ }
+ /* user hit the cancel button */
+ if( GetVar('TopicEditStatus') == 2 )
+ {
+ $objTopicList->PurgeEditTable("TopicId");
+ $objTopicList->PurgeCatListEditTable();
+ $objCustomDataList->PurgeEditTable("CustomDataId");
+ $objTopicList->Clear();
+ $objImages = new clsImageList();
+ $objImages->PurgeEditTable("ImageId");
+ }
+}
+?>
Index: branches/unlabeled/unlabeled-1.33.2/in-bulletin/units/topics/topics_config.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.33.2/in-bulletin/units/topics/topics_config.php (revision 0)
+++ branches/unlabeled/unlabeled-1.33.2/in-bulletin/units/topics/topics_config.php (revision 12744)
@@ -0,0 +1,308 @@
+ 'bb',
+ 'ItemClass' => Array('class' => 'kCatDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kCatDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'TopicsEventHandler', 'file' => 'topics_event_handler.php', 'require_classes' => Array('kCatDBEventHandler'), 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'TopicsTagProcessor', 'file' => 'topics_tag_processor.php', 'require_classes' => Array('kCatDBTagProcessor'), 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+ 'QueryString' => Array(
+ 1 => 'id', // topic id
+ 2 => 'post_id', // post id
+ 3 => 'Page', // topic page
+ 4 => 'Post_Page', // posts page
+ 5 => 'pm_Page', // private message page
+ 6 => 'pm_id', // private message id
+ 7 => 'Reviews_Page',
+ 8 => 'event',
+ 9 => 'mode',
+ ),
+
+ 'CatalogItem' => true,
+ 'AdminTemplatePath' => 'topics',
+ 'AdminTemplatePrefix' => 'topics_',
+ 'IDField' => 'TopicId',
+ 'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events
+
+ 'TitleField' => 'TopicText', // field, used in bluebar when editing existing item
+ 'TitlePhrase' => 'la_Text_Topic', // phrase used to specify item type in relationship list
+
+ 'TitlePresets' => Array(
+ 'default' => Array( 'new_status_labels' => Array('bb' => '!la_title_AddingTopic!'),
+ 'edit_status_labels' => Array('bb' => '!la_title_EditingTopic!'),
+ 'new_titlefield' => Array('bb' => '!la_title_NewTopic!'),
+ ),
+
+ 'topics_edit' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_General!"),
+ 'topics_categories' => Array('prefixes' => Array('bb','bb-ci_List'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Categories!"),
+ 'topics_relations' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Relations!"),
+ 'topics_images' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Images!"),
+ 'topics_reviews' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Reviews!"),
+ 'topics_custom' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Custom!"),
+
+ 'images_edit' => Array( 'prefixes' => Array('bb', 'bb-img'),
+ 'new_status_labels' => Array('bb-img'=>'!la_title_Adding_Image!'),
+ 'edit_status_labels' => Array('bb-img'=>'!la_title_Editing_Image!'),
+ 'new_titlefield' => Array('bb-img'=>'!la_title_New_Image!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-img_status# '#bb-img_titlefield#'",
+ ),
+
+ 'reviews_edit' => Array( 'prefixes' => Array('bb', 'bb-rev'),
+ 'new_status_labels' => Array('bb-rev'=>"!la_title_Adding_Review! '!la_title_New_Review!'"),
+ 'edit_status_labels' => Array('bb-rev'=>'!la_title_Editing_Review!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-rev_status#",
+ ),
+
+ 'relations_edit' => Array( 'prefixes' => Array('bb', 'bb-rel'),
+ 'new_status_labels' => Array('bb-rel'=>"!la_title_Adding_Relationship! '!la_title_New_Relationship!'"),
+ 'edit_status_labels' => Array('bb-rel'=>'!la_title_Editing_Relationship!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-rel_status#",
+ ),
+
+ 'tree_in-bulletin' => Array('format' => '!la_Text_Version! '.$this->Application->findModule('Name', 'In-Bulletin', 'Version')),
+ ),
+
+ 'PermItemPrefix' => 'TOPIC',
+
+ 'PermTabText' => 'In-Bulletin',
+ 'PermSection' => Array('main' => 'CATEGORY:in-bulletin:topics_list', 'search' => 'in-bulletin:configuration_search', 'email' => 'in-bulletin:configuration_email', 'custom' => 'in-bulletin:configuration_custom'),
+
+ 'Sections' => Array(
+ 'in-bulletin' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'settings_in-bulletin',
+ 'label' => 'la_title_In-Bulletin',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 3.3,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:inbulletin_general' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_general',
+ 'label' => 'la_tab_GeneralSettings',
+ 'url' => Array('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_output' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_output',
+ 'label' => 'la_tab_ConfigOutput',
+ 'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_search' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_search',
+ 'label' => 'la_tab_ConfigSearch',
+ 'url' => Array('t' => 'config/config_search', 'module_key' => 'topics', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_censorship' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_censor',
+ 'label' => 'la_tab_ConfigCensorship',
+ 'url' => Array('index_file' => '../in-bulletin/admin/censor_config.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_emoticon' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_smiley',
+ 'label' => 'la_tab_ConfigSmileys',
+ 'url' => Array('index_file' => '../in-bulletin/admin/emoticon_config.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_email' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_email',
+ 'label' => 'la_tab_ConfigE-mail',
+ 'url' => Array('t' => 'config/config_email', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 6,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_custom' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_custom',
+ 'label' => 'la_tab_ConfigCustom',
+ 'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 3, 'pass_section' => true, 'pass' => 'm,cf'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 7,
+ 'type' => stTREE,
+ ),
+
+ ),
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_new'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_hot'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_pop'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_pick'), 'type' => WHERE_FILTER),
+ ),
+ 'Filters' => Array(
+ 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
+ 'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ),
+ 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
+ 's1' => Array(),
+ 'show_new' => Array('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ),
+ 'show_hot' => Array('label' => 'la_Text_Hot', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ),
+ 'show_pop' => Array('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ),
+ 'show_pick' => Array('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '%1$s.`EditorsPick` != 1' ),
+ )
+ ),
+
+ 'CatalogSelectorName' => 'topiclist',
+
+ 'ItemPropertyMappings' => Array(
+ 'NewDays' => 'Topic_NewDays', // number of days item to be NEW
+ 'MinPopVotes' => 'Topic_MinPopVotes', // minimum number of votes for an item to be POP
+ 'MinPopRating' => 'Topic_MinPopRating', // minimum rating for an item to be POP
+ 'MaxHotNumber' => 'Topic_MaxHotNumber', // maximum number of HOT items
+
+ 'HotLimit' => 'Topic_HotLimit', // variable name in inp_Cache table
+ 'ClickField' => 'Views', // item click count is stored here (in item table)
+ ),
+
+ 'ItemType' => 3, // this is used when relation to product is added from in-portal and via-versa
+
+ 'ViewMenuPhrase' => 'la_title_Topics',
+
+ 'StatisticsInfo' => Array(
+ 'pending' => Array(
+ 'icon' => 'icon16_topic_pending.gif',
+ 'label' => 'la_Text_Topics',
+ 'js_url' => '#url#',
+ 'url' => Array('t' => 'in-portal/advanced_view', 'SetTab' => 'bb', 'pass' => 'm,bb.showall', 'bb.showall_event' => 'OnSetFilterPattern', 'bb.showall_filters' => 'show_active=0,show_pending=1,show_disabled=0,show_new=1,show_hot=1,show_pop=1,show_pick=1'),
+ 'status' => STATUS_PENDING,
+ ),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'Topic',
+
+ 'CalculatedFields' => Array(
+ '' => Array (
+ 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.OwnerId = -1, "root", IF (%1$s.OwnerId = -2, "Guest", "n/a")), u.Login)',
+ 'CategoryId' => TABLE_PREFIX.'%3$sCategoryItems.CategoryId',
+ 'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename',
+ ),
+ ),
+
+ 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId
+ LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'PermCache perm ON perm.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.OwnerId = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'%3$sTopicCustomData cust ON %1$s.ResourceId = cust.ResourceId',
+ ), // key - special, value - list select sql
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('EditorsPick' => 'desc', 'Priority' => 'desc'),
+ 'Sorting' => Array('TopicText' => 'asc'),
+ )
+ ),
+ 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId
+ LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.OwnerId = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'%3$sTopicCustomData cust ON %1$s.ResourceId = cust.ResourceId'),
+
+ 'SubItems' => Array('bb-rev', 'bb-ci', 'bb-rel', 'bb-img', 'bb-cdata'),
+
+ 'Fields' => Array (
+ 'TopicId' => Array(),
+ 'NotifyOwnerOnChanges' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Modified' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'not_null' => 1, 'default' => '#NOW#'),
+ 'TopicText' => Array('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'AutomaticFilename' => Array('type' => 'int', 'not_null' => 1, 'default' => 1),
+ 'Posts' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Views' => Array('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%d', 'not_null' => 1, 'default' => 0),
+ 'EditorsPick' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
+ 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
+ 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => ''),
+ 'OwnerId' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'required' => 1, 'default' => -1),
+ 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => 0),
+ 'ResourceId' => Array('type' => 'int', 'default' => ''),
+ 'TopicType' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_Yes', 1 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1),
+ 'CreatedOn' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#', 'not_null' => 1),
+ 'CachedReviewsQty' => Array('type' => 'int' ,'not_null' => 1, 'default' => 0),
+ 'CachedRating' => Array('type' => 'string', 'default' => ''),
+ 'CachedVotesQty' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'PostedBy' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'OrgId' => Array('type' => 'int', 'default' => 0),
+ 'LastPostId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'LastPostDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => 1, 'default' => ''),
+ 'TodayDate' => Array('type' => 'string', 'not_null' => 1, 'default' => '0000-00-00'),
+ 'TodayPosts' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ ),
+
+ 'VirtualFields' => Array(
+ 'UserName' => Array('type'=>'string', 'default' => ''),
+ 'CategoryId' => Array('type' => 'int', 'default' => 0),
+ 'Filename' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'CachedNavbar' => Array('type' => 'string', 'default' => ''),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array(1 => 'icon16_topic.gif', 2 => 'icon16_topic_pending.gif', 0 => 'icon16_topic_disabled.gif', 'HOT' => 'icon16_topic_hot.gif', 'POP' => 'icon16_topic_pop.gif', 'NEW' => 'icon16_topic_new.gif', 'PICK' => 'icon16_topic_pick.gif'),
+ 'Fields' => Array(
+ 'TopicId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td'),
+ 'TopicText' => Array('title' => 'la_col_TopicText', 'data_block' => 'grid_catitem_td'),
+ 'UserName' => Array('title' => 'la_col_PostedBy'),
+ 'Modified_formatted' => Array('title' => 'la_col_ModifiedDate', 'sort_field' => 'Modified'),
+ 'Posts' => Array('title' => 'la_col_Posts'),
+ 'Views' => Array('title' => 'la_col_Views'),
+ ),
+ ),
+
+ 'Radio' => Array(
+ 'Icons' => Array(1 => 'icon16_topic.gif', 2 => 'icon16_topic_pending.gif', 0 => 'icon16_topic_disabled.gif', 'HOT' => 'icon16_topic_hot.gif', 'POP' => 'icon16_topic_pop.gif', 'NEW' => 'icon16_topic_new.gif', 'PICK' => 'icon16_topic_pick.gif'),
+ 'Fields' => Array(
+ 'TopicId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_radio_td'),
+ 'TopicText' => Array('title' => 'la_col_TopicText', 'data_block' => 'grid_catitem_td'),
+ 'UserName' => Array('title' => 'la_col_PostedBy'),
+ 'Modified_formatted' => Array('title' => 'la_col_ModifiedDate', 'sort_field' => 'Modified'),
+ 'Posts' => Array('title' => 'la_col_Posts'),
+ 'Views' => Array('title' => 'la_col_Views'),
+ ),
+ ),
+ ),
+
+ 'ConfigMapping' => Array(
+ 'PerPage' => 'Perpage_Topics',
+ 'ShortListPerPage' => 'Perpage_Topics_Short',
+ 'DefaultSorting1Field' => 'Topic_SortField',
+ 'DefaultSorting2Field' => 'Topic_SortField2',
+ 'DefaultSorting1Dir' => 'Topic_SortOrder',
+ 'DefaultSorting2Dir' => 'Topic_SortOrder2',
+ ),
+ );
+
+
+?>
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.30.2/in-bulletin/units/topics/topics_config.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.30.2/in-bulletin/units/topics/topics_config.php (revision 0)
+++ branches/unlabeled/unlabeled-1.30.2/in-bulletin/units/topics/topics_config.php (revision 12744)
@@ -0,0 +1,308 @@
+ 'bb',
+ 'ItemClass' => Array('class' => 'kCatDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kCatDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'TopicsEventHandler', 'file' => 'topics_event_handler.php', 'require_classes' => Array('kCatDBEventHandler'), 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'TopicsTagProcessor', 'file' => 'topics_tag_processor.php', 'require_classes' => Array('kCatDBTagProcessor'), 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+ 'QueryString' => Array(
+ 1 => 'id', // topic id
+ 2 => 'post_id', // post id
+ 3 => 'Page', // topic page
+ 4 => 'Post_Page', // posts page
+ 5 => 'pm_Page', // private message page
+ 6 => 'pm_id', // private message id
+ 7 => 'Reviews_Page',
+ 8 => 'event',
+ 9 => 'mode',
+ ),
+
+ 'CatalogItem' => true,
+ 'AdminTemplatePath' => 'topics',
+ 'AdminTemplatePrefix' => 'topics_',
+ 'IDField' => 'TopicId',
+ 'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events
+
+ 'TitleField' => 'TopicText', // field, used in bluebar when editing existing item
+ 'TitlePhrase' => 'la_Text_Topic', // phrase used to specify item type in relationship list
+
+ 'TitlePresets' => Array(
+ 'default' => Array( 'new_status_labels' => Array('bb' => '!la_title_AddingTopic!'),
+ 'edit_status_labels' => Array('bb' => '!la_title_EditingTopic!'),
+ 'new_titlefield' => Array('bb' => '!la_title_NewTopic!'),
+ ),
+
+ 'topics_edit' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_General!"),
+ 'topics_categories' => Array('prefixes' => Array('bb','bb-ci_List'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Categories!"),
+ 'topics_relations' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Relations!"),
+ 'topics_images' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Images!"),
+ 'topics_reviews' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Reviews!"),
+ 'topics_custom' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Custom!"),
+
+ 'images_edit' => Array( 'prefixes' => Array('bb', 'bb-img'),
+ 'new_status_labels' => Array('bb-img'=>'!la_title_Adding_Image!'),
+ 'edit_status_labels' => Array('bb-img'=>'!la_title_Editing_Image!'),
+ 'new_titlefield' => Array('bb-img'=>'!la_title_New_Image!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-img_status# '#bb-img_titlefield#'",
+ ),
+
+ 'reviews_edit' => Array( 'prefixes' => Array('bb', 'bb-rev'),
+ 'new_status_labels' => Array('bb-rev'=>"!la_title_Adding_Review! '!la_title_New_Review!'"),
+ 'edit_status_labels' => Array('bb-rev'=>'!la_title_Editing_Review!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-rev_status#",
+ ),
+
+ 'relations_edit' => Array( 'prefixes' => Array('bb', 'bb-rel'),
+ 'new_status_labels' => Array('bb-rel'=>"!la_title_Adding_Relationship! '!la_title_New_Relationship!'"),
+ 'edit_status_labels' => Array('bb-rel'=>'!la_title_Editing_Relationship!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-rel_status#",
+ ),
+
+ 'tree_in-bulletin' => Array('format' => '!la_Text_Version! '.$this->Application->findModule('Name', 'In-Bulletin', 'Version')),
+ ),
+
+ 'PermItemPrefix' => 'TOPIC',
+
+ 'PermTabText' => 'In-Bulletin',
+ 'PermSection' => Array('main' => 'CATEGORY:in-bulletin:topics_list', 'search' => 'in-bulletin:configuration_search', 'email' => 'in-bulletin:configuration_email', 'custom' => 'in-bulletin:configuration_custom'),
+
+ 'Sections' => Array(
+ 'in-bulletin' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'settings_in-bulletin',
+ 'label' => 'la_title_In-Bulletin',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 3.3,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:inbulletin_general' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_general',
+ 'label' => 'la_tab_GeneralSettings',
+ 'url' => Array('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_output' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_output',
+ 'label' => 'la_tab_ConfigOutput',
+ 'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_search' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_search',
+ 'label' => 'la_tab_ConfigSearch',
+ 'url' => Array('t' => 'config/config_search', 'module_key' => 'topics', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_censorship' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_censor',
+ 'label' => 'la_tab_ConfigCensorship',
+ 'url' => Array('index_file' => '../in-bulletin/admin/censor_config.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_emoticon' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_smiley',
+ 'label' => 'la_tab_ConfigSmileys',
+ 'url' => Array('index_file' => '../in-bulletin/admin/emoticon_config.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_email' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_email',
+ 'label' => 'la_tab_ConfigE-mail',
+ 'url' => Array('t' => 'config/config_email', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 6,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_custom' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_custom',
+ 'label' => 'la_tab_ConfigCustom',
+ 'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 3, 'pass_section' => true, 'pass' => 'm,cf'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 7,
+ 'type' => stTREE,
+ ),
+
+ ),
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_new'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_hot'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_pop'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_pick'), 'type' => WHERE_FILTER),
+ ),
+ 'Filters' => Array(
+ 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => 'Status != 1' ),
+ 'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => 'Status != 2' ),
+ 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => 'Status != 0' ),
+ 's1' => Array(),
+ 'show_new' => Array('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ),
+ 'show_hot' => Array('label' => 'la_Text_Hot', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ),
+ 'show_pop' => Array('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ),
+ 'show_pick' => Array('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '`EditorsPick` != 1' ),
+ )
+ ),
+
+ 'CatalogSelectorName' => 'topiclist',
+
+ 'ItemPropertyMappings' => Array(
+ 'NewDays' => 'Topic_NewDays', // number of days item to be NEW
+ 'MinPopVotes' => 'Topic_MinPopVotes', // minimum number of votes for an item to be POP
+ 'MinPopRating' => 'Topic_MinPopRating', // minimum rating for an item to be POP
+ 'MaxHotNumber' => 'Topic_MaxHotNumber', // maximum number of HOT items
+
+ 'HotLimit' => 'Topic_HotLimit', // variable name in inp_Cache table
+ 'ClickField' => 'Views', // item click count is stored here (in item table)
+ ),
+
+ 'ItemType' => 3, // this is used when relation to product is added from in-portal and via-versa
+
+ 'ViewMenuPhrase' => 'la_title_Topics',
+
+ 'StatisticsInfo' => Array(
+ 'pending' => Array(
+ 'icon' => 'icon16_topic_pending.gif',
+ 'label' => 'la_Text_Topics',
+ 'js_url' => "set_persistant_var('Topic_View', 47, 'advanced_view', '#url#')",
+ 'url' => Array('t' => 'advanced_view', 'index_file' => 'advanced_view.php', 'SetTab' => 'topics', 'pass' => 'm'),
+ 'status' => STATUS_PENDING,
+ ),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'Topic',
+
+ 'CalculatedFields' => Array(
+ '' => Array (
+ 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.OwnerId = -1, "root", IF (%1$s.OwnerId = -2, "Guest", "n/a")), u.Login)',
+ 'CategoryId' => TABLE_PREFIX.'CategoryItems.CategoryId',
+ 'Filename' => TABLE_PREFIX.'CategoryItems.Filename',
+ ),
+ ),
+
+ 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'CategoryItems ON '.TABLE_PREFIX.'CategoryItems.ItemResourceId = %1$s.ResourceId
+ LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'CategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'PermCache perm ON perm.CategoryId = '.TABLE_PREFIX.'CategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.OwnerId = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'%3$sTopicCustomData cust ON %1$s.ResourceId = cust.ResourceId',
+ ), // key - special, value - list select sql
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('EditorsPick' => 'desc', 'Priority' => 'desc'),
+ 'Sorting' => Array('TopicText' => 'asc'),
+ )
+ ),
+ 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'CategoryItems ON '.TABLE_PREFIX.'CategoryItems.ItemResourceId = %1$s.ResourceId
+ LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'CategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.OwnerId = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'%3$sTopicCustomData cust ON %1$s.ResourceId = cust.ResourceId'),
+
+ 'SubItems' => Array('bb-rev', 'bb-ci', 'bb-rel', 'bb-img', 'bb-cdata'),
+
+ 'Fields' => Array (
+ 'TopicId' => Array(),
+ 'NotifyOwnerOnChanges' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Modified' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'not_null' => 1, 'default' => '#NOW#'),
+ 'TopicText' => Array('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'AutomaticFilename' => Array('type' => 'int', 'not_null' => 1, 'default' => 1),
+ 'Posts' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Views' => Array('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%d', 'not_null' => 1, 'default' => 0),
+ 'EditorsPick' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
+ 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
+ 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => ''),
+ 'OwnerId' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'required' => 1, 'default' => -1),
+ 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => 0),
+ 'ResourceId' => Array('type' => 'int', 'default' => ''),
+ 'TopicType' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_Yes', 1 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1),
+ 'CreatedOn' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#', 'not_null' => 1),
+ 'CachedReviewsQty' => Array('type' => 'int' ,'not_null' => 1, 'default' => 0),
+ 'CachedRating' => Array('type' => 'string', 'default' => ''),
+ 'CachedVotesQty' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'PostedBy' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'OrgId' => Array('type' => 'int', 'default' => 0),
+ 'LastPostId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'LastPostDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'not_null' => 1, 'default' => ''),
+ 'TodayDate' => Array('type' => 'string', 'not_null' => 1, 'default' => '0000-00-00'),
+ 'TodayPosts' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ ),
+
+ 'VirtualFields' => Array(
+ 'UserName' => Array('type'=>'string', 'default' => ''),
+ 'CategoryId' => Array('type' => 'int', 'default' => 0),
+ 'Filename' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'CachedNavbar' => Array('type' => 'string', 'default' => ''),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array(1 => 'icon16_topic.gif', 2 => 'icon16_topic_pending.gif', 0 => 'icon16_topic_disabled.gif', 'HOT' => 'icon16_topic_hot.gif', 'POP' => 'icon16_topic_pop.gif', 'NEW' => 'icon16_topic_new.gif', 'PICK' => 'icon16_topic_pick.gif'),
+ 'Fields' => Array(
+ 'TopicId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td'),
+ 'TopicText' => Array('title' => 'la_col_TopicText', 'data_block' => 'grid_catitem_td'),
+ 'UserName' => Array('title' => 'la_col_PostedBy'),
+ 'Modified_formatted' => Array('title' => 'la_col_ModifiedDate', 'sort_field' => 'Modified'),
+ 'Posts' => Array('title' => 'la_col_Posts'),
+ 'Views' => Array('title' => 'la_col_Views'),
+ ),
+ ),
+
+ 'Radio' => Array(
+ 'Icons' => Array(1 => 'icon16_topic.gif', 2 => 'icon16_topic_pending.gif', 0 => 'icon16_topic_disabled.gif', 'HOT' => 'icon16_topic_hot.gif', 'POP' => 'icon16_topic_pop.gif', 'NEW' => 'icon16_topic_new.gif', 'PICK' => 'icon16_topic_pick.gif'),
+ 'Fields' => Array(
+ 'TopicId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_radio_td'),
+ 'TopicText' => Array('title' => 'la_col_TopicText', 'data_block' => 'grid_catitem_td'),
+ 'UserName' => Array('title' => 'la_col_PostedBy'),
+ 'Modified_formatted' => Array('title' => 'la_col_ModifiedDate', 'sort_field' => 'Modified'),
+ 'Posts' => Array('title' => 'la_col_Posts'),
+ 'Views' => Array('title' => 'la_col_Views'),
+ ),
+ ),
+ ),
+
+ 'ConfigMapping' => Array(
+ 'PerPage' => 'Perpage_Topics',
+ 'ShortListPerPage' => 'Perpage_Topics_Short',
+ 'DefaultSorting1Field' => 'Topic_SortField',
+ 'DefaultSorting2Field' => 'Topic_SortField2',
+ 'DefaultSorting1Dir' => 'Topic_SortOrder',
+ 'DefaultSorting2Dir' => 'Topic_SortOrder2',
+ ),
+ );
+
+
+?>
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.11.2/in-bulletin/admin/addemoticon.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.11.2/in-bulletin/admin/addemoticon.php (revision 0)
+++ branches/unlabeled/unlabeled-1.11.2/in-bulletin/admin/addemoticon.php (revision 12744)
@@ -0,0 +1,153 @@
+EnablePaging = FALSE;
+
+if(isset($_POST["itemlist"]))
+{
+ if(is_array($_POST["itemlist"]))
+ {
+ $EmoticonId = $_POST["itemlist"][0];
+ }
+ else
+ {
+ $EmoticonId = $_POST["itemlist"];
+ }
+ $img = $objEditItems->GetItem($EmoticonId);
+ $action = "bb_emoticon_edit";
+ $name = $img->Get("Name");
+}
+else
+{
+ $img = new clsEmoticon();
+ $action = "bb_emoticon_add";
+ $name = "'New Emoticon'";
+
+}
+
+$envar = "env=" . BuildEnv() . "&en=$en";
+$section = "in-bulletin:configuration_emoticon";
+
+$ado = &GetADODBConnection();
+
+/* page header */
+$charset = GetRegionalOption('Charset');
+print <<
+
+ In-portal
+
+
+
+
+
+
+
+
+
+
+
+END;
+
+
+$title = GetTitle("la_Text_Smiley", "", $EmoticonId, $name);//prompt_language("la_Text_Editing")." ".prompt_language("la_Text_Smiley");
+//$title .= " '".$name."'";
+$sec = $objSections->GetSection($section);
+ $objCatToolBar = new clsToolBar();
+ $objCatToolBar->Add("img_save", "la_Save","#","swap('img_save','toolbar/tool_select_f2.gif');", "swap('img_save', 'toolbar/tool_select.gif');","do_edit_save('config','','in-bulletin/admin/emoticon_config.php',0);",$imagesURL."/toolbar/tool_select.gif");
+ $objCatToolBar->Add("img_cancel", "la_Cancel","#","swap('img_cancel','toolbar/tool_cancel_f2.gif');", "swap('img_cancel', 'toolbar/tool_cancel.gif');","jump_to_url('in-bulletin/admin/emoticon_config.php');",$imagesURL."/toolbar/tool_cancel.gif");
+
+int_header($objCatToolBar,NULL,$title);
+?>
+
+
+
+
+ " name="viewmenu">
+
+
+
+
+
+
+
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.10.4/in-bulletin/units/topics/topics_event_handler.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.10.4/in-bulletin/units/topics/topics_event_handler.php (revision 0)
+++ branches/unlabeled/unlabeled-1.10.4/in-bulletin/units/topics/topics_event_handler.php (revision 12744)
@@ -0,0 +1,230 @@
+getPrefixSpecial();
+ $url_params = $event->getEventParam('url_params');
+ $pass_events = $event->getEventParam('pass_events');
+
+ $query_vars = $this->Application->getUnitOption($event->Prefix, 'QueryString');
+
+ $event_key = array_search('event', $query_vars);
+ if ($event_key) {
+ // pass through event of this prefix
+ unset($query_vars[$event_key]);
+ }
+
+ if (!getArrayValue($url_params, $prefix_special.'_event')) {
+ // if empty event, then remove it from url
+ unset( $url_params[$prefix_special.'_event'] );
+ }
+
+ //if pass events is off and event is not implicity passed
+ if ( !$pass_events && !isset($url_params[$prefix_special.'_event']) )
+ {
+ unset($url_params[$prefix_special.'_event']); // remove event from url if requested
+ //otherwise it will use value from get_var
+ }
+
+ if(!$query_vars) return true;
+
+ $processed_params = Array();
+ foreach($query_vars as $index => $var_name)
+ {
+ //if value passed in params use it, otherwise use current from application
+ $var_name = $prefix_special.'_'.$var_name;
+ $processed_params[$var_name] = isset( $url_params[$var_name] ) ? $url_params[$var_name] : $this->Application->GetVar($var_name);
+ if ( isset($url_params[$var_name]) ) unset( $url_params[$var_name] );
+ }
+
+ $ret = '';
+
+ // topic
+ if($processed_params[$prefix_special.'_id'])
+ {
+ // this allows to fill 3 cache records with one query (see this method for details)
+ $category_id = isset($url_params['m_cat_id']) ? $url_params['m_cat_id'] : $this->Application->GetVar('m_cat_id');
+ $category_filename = $this->Application->getFilename('c', $category_id);
+
+ // if template is also item template of category, then remove template
+ $template = getArrayValue($url_params, 't');
+ $item_template = $this->Application->getCache('item_templates', $category_id);
+ if ($template == $item_template || strtolower($template) == '__default__') {
+ unset($url_params['t']);
+ }
+
+ $ret .= $processed_params[$prefix_special.'_id'].'/';
+ }
+
+ if($processed_params[$prefix_special.'_Page'] > 1)
+ {
+ if ($processed_params[$prefix_special.'_Page']) $ret = rtrim($ret, '/');
+ $ret .= '_'.$processed_params[$prefix_special.'_Page'].'/';
+ }
+
+ // post
+ if($processed_params[$prefix_special.'_post_id'])
+ {
+ $ret .= $processed_params[$prefix_special.'_post_id'].'/';
+ }
+
+ if($processed_params[$prefix_special.'_Post_Page'] > 1)
+ {
+ if ($processed_params[$prefix_special.'_post_id']) $ret = rtrim($ret, '/');
+ $ret .= '_'.$processed_params[$prefix_special.'_Post_Page'].'/';
+ }
+
+ // private message
+ if($processed_params[$prefix_special.'_pm_id'])
+ {
+ $ret .= 'pm_'.$processed_params[$prefix_special.'_pm_id'].'/';
+ }
+
+ if($processed_params[$prefix_special.'_pm_Page'] > 1)
+ {
+ if ($processed_params[$prefix_special.'_pm_id']) $ret = rtrim($ret, '/');
+ $ret .= '_'.$processed_params[$prefix_special.'_pm_Page'].'/';
+ }
+
+ if ($ret) {
+ $ret = 'bb_'.$ret;
+ }
+
+ $event->setEventParam('url_params', $url_params);
+ $event->setEventParam('env_string', strtolower($ret) );
+ }
+
+ /**
+ * Process mod_rewrite url part left after previous parser
+ *
+ * @param kEvent $event
+ */
+ function ParseEnv(&$event)
+ {
+ // _/_/_
+
+ $url_parts = $event->getEventParam('url_parts');
+ $url_parts[0] = substr($url_parts[0], 3);
+
+
+ $vars = $event->getEventParam('vars');
+
+ $defaults = Array('id' => 0, 'Page' => 1, 'Reviews_Page' => 1, 'post_id' => 0, 'Post_Page' => 1, 'pm_id' => 0, 'pm_Page' => 1);
+ foreach ($defaults as $var_name => $var_value)
+ {
+ $this->Application->SetVar($event->getPrefixSpecial().'_'.$var_name, $var_value);
+ $vars[$event->getPrefixSpecial().'_'.$var_name] = $var_value;
+ }
+ if (!$url_parts) {
+ return false;
+ }
+
+ $ret = '';
+ $url_part = array_shift($url_parts);
+
+ if($url_part && substr($url_part,0,3) != 'pm_')
+ {
+ // match topic page
+ if( preg_match('/(.*)_([\d]+)$/', $url_part, $rets) )
+ {
+ $url_part = $rets[1];
+ $this->Application->SetVar( $event->getPrefixSpecial().'_Page', $rets[2]);
+ $vars[$event->getPrefixSpecial().'_Page'] = $rets[2];
+ }
+
+ if (is_numeric($url_part)) {
+ // match topic id (we don't use names here)
+ $this->Application->SetVar($event->getPrefixSpecial().'_id', $url_part);
+ $vars[$event->getPrefixSpecial().'_id'] = $url_part;
+ $url_part = $url_parts ? array_shift($url_parts) : '';
+ }
+ }
+
+ if($url_part && substr($url_part,0,3) != 'pm_')
+ {
+ // match post page
+ if( preg_match('/(.*)_([\d]+)$/', $url_part, $rets) )
+ {
+ $url_part = $rets[1];
+ $this->Application->SetVar( $event->getPrefixSpecial().'_Post_Page', $rets[2]);
+ $vars[$event->getPrefixSpecial().'_Post_Page'] = $rets[2];
+ }
+
+ if (is_numeric($url_part)) {
+ // match post id
+ $this->Application->SetVar($event->getPrefixSpecial().'_post_id', $url_part);
+ $vars[$event->getPrefixSpecial().'_post_id'] = $url_part;
+ $url_part = $url_parts ? array_shift($url_parts) : '';
+ }
+ }
+
+ if($url_part && substr($url_part,0,3) == 'pm_')
+ {
+ $url_part = substr($url_part, 3, strlen($url_part) );
+ // match private message page
+ if( preg_match('/(.*)_([\d]+)$/', $url_part, $rets) )
+ {
+ $url_part = $rets[1];
+ $this->Application->SetVar( $event->getPrefixSpecial().'_pm_Page', $rets[2]);
+ $vars[$event->getPrefixSpecial().'_pm_Page'] = $rets[2];
+ }
+
+ if (is_numeric($url_part)) {
+ // match private message id
+ $this->Application->SetVar($event->getPrefixSpecial().'_pm_id', $url_part);
+ $vars[$event->getPrefixSpecial().'_pm_id'] = $url_part;
+ $url_part = $url_parts ? array_shift($url_parts) : '';
+ }
+ }
+
+ if ($url_part) {
+ array_unshift($url_parts, $url_part);
+ }
+
+ $event->setEventParam('url_parts', $url_parts);
+ $event->setEventParam('vars', $vars);
+ }
+
+ /**
+ * Lock or unlock topic
+ *
+ * @param kEvent $event
+ */
+ function OnToggleLock(&$event)
+ {
+ $object =& $event->getObject();
+
+ $new_type = $object->GetDBField('TopicType') ? 0 : 1;
+ $object->SetDBField('TopicType', $new_type);
+ $object->Update();
+ }
+
+ /**
+ * Cache topic owner
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemUpdate(&$event)
+ {
+ $this->cacheItemOwner($event, 'OwnerId', 'PostedBy');
+ }
+
+ /**
+ * Cache topic owner
+ *
+ * @param kEvent $event
+ */
+ function OnBeforeItemCreate(&$event)
+ {
+ $this->cacheItemOwner($event, 'OwnerId', 'PostedBy');
+ }
+ }
+
+?>
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.50.2/in-bulletin/admin/install/inportal_data.sql
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.50.2/in-bulletin/admin/install/inportal_data.sql (revision 0)
+++ branches/unlabeled/unlabeled-1.50.2/in-bulletin/admin/install/inportal_data.sql (revision 12744)
@@ -0,0 +1,254 @@
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.01, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField', 'la_Text_Topics', 'la_topic_sortfield_prompt', 'select', '', 'TopicText=la_Topic_Text,Posts=la_Number_of_Posts,CreatedOn=la_CreatedOn,LastPostDate=la_LastUpdate,Views=la_Topic_Views,CachedRating=la_Rating,LastPoser=la_Poster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) ', 10.01, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortField2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '', 'TopicText=la_Topic_Text,Posts=la_Number_of_Posts,CreatedOn=la_CreatedOn,LastPostDate=la_LastUpdate,Views=la_Topic_Views,CachedRating=la_Rating,LastPoser=la_Poster,SELECT Prompt AS OptionName, CONCAT("cust_", FieldName) AS OptionValue FROM CustomField WHERE (Type = 3) AND (IsSystem = 0) ', 10.02, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_NewDays', 'la_Text_Topics', 'la_topic_newdays_prompt', 'text', '', 'asc=la_common_ascending,desc=la_common_descending', 10.05, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_SortOrder2', 'la_Text_Topics', 'la_topic_sortfield2_prompt', 'select', '', 'asc=la_common_ascending,desc=la_common_descending', 10.02, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics', 'la_Text_Topics', 'la_topic_perpage_prompt', 'text', '', '', 10.03, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MinPopRating', 'la_Text_Topics', 'la_fld_Topic_MinPopRating', 'text', '', '', 10.06, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MaxHotNumber', 'la_Text_Topics', 'la_fld_Topic_MaxHotNumber', 'text', '', '', 10.08, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_EditorPicksAbove', 'la_Text_Topics', 'la_topic_editorpicksabove_prompt', 'checkbox', '', '', 10.09, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Postings', 'la_posts_subheading', 'la_posts_perpage_prompt', 'text', '', '', 20.01, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Posts_NewDays', 'la_posts_subheading', 'la_posts_newdays_prompt', 'text', '', '', 20.02, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Topic_MinPopVotes', 'la_Text_Topics', 'la_fld_Topic_MinPopVotes', 'text', '', '', 10.07, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_Topics_Short', 'la_Text_Topics', 'la_topic_perpage_short_prompt', 'text', '', '', 10.04, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Value', 'la_Text_Topics', 'la_prompt_DupReviews', 'text', '', '', 10.1, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_ReviewDelay_Interval', 'la_Text_Topics', 'la_prompt_DupReviews', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.1, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Value', 'la_Text_Topics', 'la_prompt_DupRating', 'text', '', '', 10.11, 1, 1);
+INSERT INTO ConfigurationAdmin VALUES ('topic_RatingDelay_Interval', 'la_Text_Topics', 'la_prompt_DupRating', 'select', '', '1=la_Text_Second,60=la_Text_Minute,3600=la_Text_Hour,86400=la_Text_Day,604800=la_Text_Week,2419200=la_Text_Month,29030400=la_text_Year', 10.11, 2, 1);
+INSERT INTO ConfigurationAdmin VALUES ('AutoTopicLockPosts', 'la_Text_Topics', 'la_prompt_PostsToLock', 'text', NULL, NULL, 10.12, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_TopicReviews', 'la_Text_Reviews', 'la_review_perpage_prompt', 'text', NULL, NULL, 30.01, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('bb_CategoryTemplate', 'la_section_Templates', 'la_fld_CategoryTemplate', 'text', '', '', 40.01, 0, 0);
+INSERT INTO ConfigurationAdmin VALUES ('bb_ItemTemplate', 'la_section_Templates', 'la_fld_ItemTemplate', 'text', '', '', 40.02, 0, 0);
+
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Keyword_topics', 'la_config_SearchRel_DefaultKeyword', 'la_text_keyword', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Pop_topics', 'la_config_DefaultPop', 'la_text_popularity', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Rating_topics', 'la_config_DefaultRating', 'la_prompt_Rating', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('SearchRel_Increase_topics', 'la_config_DefaultIncreaseImportance', 'la_text_increase_importance', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Search_ShowMultiple_topics', 'la_config_ShowMultiple', 'la_Text_MultipleShow', 'text', NULL, NULL, 0, 0, 1);
+INSERT INTO ConfigurationAdmin VALUES ('Perpage_PrivateMessages', 'la_text_PrivateMessages', 'la_text_PrivateMessages_PerPage', 'text', NULL, NULL, 0, 0, 1);
+
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Postings', '25', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Topics', '5', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Posting_SortOrder', 'CreatedOn asc, PostingText', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Posts_NewDays', '5', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Bulletin_TopCount', '2', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Bulletin_CatNewDays', '10', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Bulletin_Pick_First', '1', 'inportal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortOrder', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortField', 'LastPostDate', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortOrder2', 'desc', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_SortField2', 'Posts', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_NewDays', '6', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_MinPopRating', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_MaxHotNumber', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_EditorPicksAbove', '1', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_MinPopVotes', '8', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Root', '{TopicCatId}', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_Sortfield', NULL, 'In-Bulletin', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_SortOrder', NULL, 'In-Bulletin', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'BBTags', 'b:;i:;u:;ul:type|align;font:color|face|size;url:href;img:src|border', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_Background1', '#cccccc', 'In-Portal', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Post_Background2', '#bbbbbb', 'In-Portal', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Background1', '#FAEBD7', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Background2', '#F5F5DC', 'In-Portal', '')
+INSERT INTO ConfigurationValues VALUES (NULL, 'AutoTopicLockPosts', '0', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'bb_CategoryTemplate', 'inbulletin/index', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'bb_ItemTemplate', 'inbulletin/post_list', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Highlight_OpenTag', '', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Topic_Highlight_CloseTag', ' ', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_Topics_Short', '3', 'In-Bulletin', 'in-bulletin:configuration_output')
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_RatingDelay_Interval', '3600', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_RatingDelay_Value', '1', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_ReviewDelay_Interval', '60', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'topic_ReviewDelay_Value', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Increase_topics', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Keyword_topics', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Pop_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Rating_topics', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Increase_posts', '30', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Keyword_posts', '90', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Pop_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'SearchRel_Rating_posts', '5', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'Search_ShowMultiple_topics', '0', 'In-Bulletin', 'in-bulletin:configuration_search');
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_PrivateMessages', '20', 'In-Bulletin', '');
+INSERT INTO ConfigurationValues VALUES (NULL, 'Perpage_TopicReviews', '10', 'In-Bulletin', 'in-bulletin:configuration_output');
+
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (1, 'Happy Smile', 0, ':)', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (2, 'Big Grin', 0, ':grin:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (3, 'Wink', 0, ';)', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (4, 'Scared', 0, ':scared:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (5, 'Teasing', 0, ':eek:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (6, 'Cool', 0, ':cool:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (7, 'Angry', 0, ':@', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (8, 'Squint', 0, ':squint:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (9, 'Oops', 0, ':o', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (10, 'Sad', 0, ':(', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (11, 'Cry', 0, ':cry:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (12, 'Smirk', 0, ';]', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (13, 'Happy sleep', 0, ':sleep:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (14, 'Very angry', 0, ':x', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (15, 'Geek', 0, ':geek:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (16, 'Upset', 0, ';(', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (17, 'LOL', 0, ':lol:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (18, 'Yawn', 0, ':O', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (19, 'Thinking', 0, ':hm:', 1);
+INSERT INTO Emoticon (EmoticonId, Name, ImageId, KeyStroke, Enabled) VALUES (20, 'Secret', 0, ':|', 1);
+
+INSERT INTO Events VALUES (1, 'TOPIC.ADD', 2, 0, 'In-Bulletin', 'la_event_topic.add', 1)
+INSERT INTO Events VALUES (2, 'POST.ADD', 2, 0, 'In-Bulletin', 'la_event_post.add', 1)
+INSERT INTO Events VALUES (3, 'POST.MODIFY', 2, 0, 'In-Bulletin', 'la_event_post.modify', 1)
+INSERT INTO Events VALUES (4, 'POST.ADD', 1, 0, 'In-Bulletin', 'la_event_post.add', 0)
+INSERT INTO Events VALUES (66, 'PM.ADD', 1, 0, 'In-Bulletin', 'la_event_pm.add', 0);
+
+INSERT INTO ItemTypes VALUES (3, 'In-Bulletin', 'bb', 'Topic', 'TopicText', 'OwnerId', 'Views', 'CachedRating', 'la_ItemTab_Topics', 1, '', 'clsTopic', 'Topic');
+INSERT INTO ItemTypes VALUES (30, 'In-Bulletin', 'posting', 'Posting', 'Subject', 'CreatedById', NULL, NULL, 'la_ItemTab_Posts', 0, '', '', 'Post');
+
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.VIEW', 'lu_PermName_Topic.View_desc', 'lu_PermName_Topic.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.ADD', 'lu_PermName_Topic.Add_desc', 'lu_PermName_Topic.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.ADD.PENDING', 'lu_PermName_Topic.Add.Pending_desc', 'lu_PermName_Topic.Add.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.DELETE', 'lu_PermName_Topic.Delete_desc', 'lu_PermName_Topic.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.MODIFY', 'lu_PermName_Topic.Modify_desc', 'lu_PermName_Topic.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.DELETE', 'lu_PermName_Topic.Reply.Delete_desc', 'lu_PermName_Topic.Reply.Delete_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.VIEW', 'lu_PermName_Topic.Reply.View_desc', 'lu_PermName_Topic.Reply.View_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.ADD', 'lu_PermName_Topic.Reply.Add_desc', 'lu_PermName_Topic.Reply.Add_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.MODIFY', 'lu_PermName_Topic.Reply.Modify_desc', 'lu_PermName_Topic.Reply.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.RATE', 'lu_PermName_Topic.Rate_desc', 'lu_PermName_Topic.Rate_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REVIEW', 'lu_PermName_Topic.Review_desc', 'lu_PermName_Topic.Review_desc', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 'lu_PermName_Topic.Reply.Owner.Modify_desc', 'lu_PermName_Topic.Reply.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 'lu_PermName_Topic.Reply.Owner.Delete_desc', 'lu_PermName_Topic.Reply.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.OWNER.DELETE', 'lu_PermName_Topic.Owner.Delete_desc', 'lu_PermName_Topic.Owner.Delete_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.MODIFY.PENDING', 'lu_PermName_Topic.Modify.Pending_desc', 'lu_PermName_Topic.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.OWNER.MODIFY.PENDING', 'lu_PermName_Topic.Owner.Modify.Pending_desc', 'lu_PermName_Topic.Owner.Modify.Pending_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.OWNER.MODIFY', 'lu_PermName_Topic.Owner.Modify_desc', 'lu_PermName_Topic.Owner.Modify_error', 'In-Bulletin');
+INSERT INTO PermissionConfig (PermissionName, Description, ErrorMessage, ModuleId) VALUES ('TOPIC.LOCK', 'lu_PermName_Topic.Lock_desc', 'lu_PermName_Topic.Lock_error', 'In-Bulletin');
+
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT count(*) FROM <%prefix%>Topic WHERE Status=1', NULL, 'la_prompt_ActiveTopics', 0, 1);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS TotalTopics FROM <%prefix%>Topic', NULL, 'la_prompt_TopicsTotal', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS ActiveTopics FROM <%prefix%>Topic WHERE Status = 1', NULL, 'la_prompt_TopicsActive', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS PendingTopics FROM <%prefix%>Topic WHERE Status = 2', NULL, 'la_prompt_TopicsPending', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS DisabledTopics FROM <%prefix%>Topic WHERE Status = 0', NULL, 'la_prompt_TopicsDisabled', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS NewTopics FROM <%prefix%>Topic WHERE (NewItem = 1) OR ( (UNIX_TIMESTAMP() - CreatedOn) <= <%m:config name="Topic_NewDays"%>*86400 AND (NewItem = 2) )', NULL, 'la_prompt_NewTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>Topic WHERE EditorsPick = 1', NULL, 'la_prompt_EditorsPickTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS HotTopics FROM <%prefix%>Topic WHERE (HotItem = 1) OR (Posts >= <%m:config name="Topic_MaxHotNumber"%> AND (HotItem = 2) )', NULL, 'la_prompt_HotTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS PopularTopics FROM <%prefix%>Topic WHERE (PopItem = 1) OR ( (CachedRating >= <%topic:hit_count type="top"%>) AND <%topic:hit_count type="top"%> AND (PopItem = 2) )', NULL, '(*) la_prompt_PopularTopics', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="AVG(CachedRating)" type="currency" precision="2"%> FROM <%prefix%>Topic WHERE CachedRating > 0', NULL, 'la_prompt_TopicAverageRating', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT MAX(Views) AS MaxTopicHits FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicHits', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT MAX(CachedVotesQty) AS MaxTopicVotes FROM <%prefix%>Topic', NULL, 'la_prompt_MaxTopicVotes', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_NewestTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Topic', NULL, 'la_prompt_LastUpdatedTopicTime', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) FROM <%prefix%>ItemReview WHERE Module = \'<%modules:get_current%>\'', NULL, 'la_prompt_TopicReviews', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT COUNT(*) AS TotalPosts FROM <%prefix%>Posting', NULL, 'la_prompt_PostsTotal', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(CreatedOn)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_NewestPostTime', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="date"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostDate', 0, 2);
+INSERT INTO StatItem VALUES (0, 'In-Bulletin', 'SELECT <%m:post_format field="MAX(Modified)" type="time"%> FROM <%prefix%>Posting', NULL, 'la_prompt_LastUpdatedPostTime', 0, 2);
+
+INSERT INTO SearchConfig VALUES ('Topic', 'NotifyOwnerOnChanges', 0, 1, 'lu_fielddesc_topic_notifyowneronchanges', 'lu_field_notifyowneronchanges', 'In-Bulletin', 'la_text_topic', 1, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicId', 0, 1, 'lu_fielddesc_topic_topicid', 'lu_field_topicid', 'In-Bulletin', 'la_text_topic', 0, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Priority', 0, 1, 'lu_fielddesc_topic_priority', 'lu_field_priority', 'In-Bulletin', 'la_text_topic', 8, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OwnerId', 0, 1, 'lu_fielddesc_topic_ownerid', 'lu_field_ownerid', 'In-Bulletin', 'la_text_topic', 9, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Modified', 0, 1, 'lu_fielddesc_topic_modified', 'lu_field_modified', 'In-Bulletin', 'la_text_topic', 2, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicText', 1, 1, 'lu_fielddesc_topic_topictext', 'lu_field_topictext', 'In-Bulletin', 'la_text_topic', 3, 0, 1, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Posts', 0, 1, 'lu_fielddesc_topic_posts', 'lu_field_posts', 'In-Bulletin', 'la_text_topic', 4, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Views', 0, 1, 'lu_fielddesc_topic_views', 'lu_field_views', 'In-Bulletin', 'la_text_topic', 5, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'EditorsPick', 0, 1, 'lu_fielddesc_topic_editorspick', 'lu_field_editorspick', 'In-Bulletin', 'la_text_topic', 6, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'Status', 0, 1, 'lu_fielddesc_topic_status', 'lu_field_status', 'In-Bulletin', 'la_text_topic', 7, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ModifiedById', 0, 1, 'lu_fielddesc_topic_modifiedbyid', 'lu_field_modifiedbyid', 'In-Bulletin', 'la_text_topic', 10, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'ResourceId', 0, 1, 'lu_fielddesc_topic_resourceid', 'lu_field_resourceid', 'In-Bulletin', 'la_text_topic', 11, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'TopicType', 0, 1, 'lu_fielddesc_topic_topictype', 'lu_field_topictype', 'In-Bulletin', 'la_text_topic', 12, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CreatedOn', 0, 1, 'lu_fielddesc_topic_createdon', 'lu_field_createdon', 'In-Bulletin', 'la_text_topic', 13, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedReviewsQty', 0, 1, 'lu_fielddesc_topic_cachedreviewsqty', 'lu_field_cachedreviewsqty', 'In-Bulletin', 'la_text_topic', 14, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedRating', 0, 1, 'lu_fielddesc_topic_cachedrating', 'lu_field_cachedrating', 'In-Bulletin', 'la_text_topic', 15, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'CachedVotesQty', 0, 1, 'lu_fielddesc_topic_cachedvotesqty', 'lu_field_cachedvotesqty', 'In-Bulletin', 'la_text_topic', 16, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'NewItem', 0, 1, 'lu_fielddesc_topic_newitem', 'lu_field_newitem', 'In-Bulletin', 'la_text_topic', 17, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PopItem', 0, 1, 'lu_fielddesc_topic_popitem', 'lu_field_popitem', 'In-Bulletin', 'la_text_topic', 18, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'HotItem', 0, 1, 'lu_fielddesc_topic_hotitem', 'lu_field_hotitem', 'In-Bulletin', 'la_text_topic', 19, 0, 0, 'boolean', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'PostedBy', 0, 1, 'lu_fielddesc_topic_postedby', 'lu_field_postedby', 'In-Bulletin', 'la_text_topic', 20, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'OrgId', 0, 1, 'lu_fielddesc_topic_orgid', 'lu_field_orgid', 'In-Bulletin', 'la_text_topic', 21, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO SearchConfig VALUES ('Topic', 'LastPostId', 0, 1, 'lu_fielddesc_topic_lastpostid', 'lu_field_lastpostid', 'In-Bulletin', 'la_text_topic', 22, 0, 0, 'text', NULL, NULL, NULL, NULL, NULL, NULL, NULL);
+
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 14, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.DELETE', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY.PENDING', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY', 12, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD.PENDING', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.RATE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REVIEW', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY', 13, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('CATEGORY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('FAVORITES', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.DELETE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.MODIFY', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.RATE', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REVIEW', 11, 1, 0, {TopicCatId});
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.ADD.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.VIEW', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.ADD', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.RATE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REVIEW', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.REPLY.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.DELETE', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY.PENDING', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.OWNER.MODIFY', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('TOPIC.LOCK', 15, 0, 0, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:inbulletin_general.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:inbulletin_general.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_output.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_output.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_search.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_search.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_censorship.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_emoticon.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_email.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_email.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-bulletin:configuration_custom.delete', 11, 1, 1, 0);
+
+INSERT INTO ImportScripts(is_string_id,is_Module,is_script,is_label,is_field_prefix,is_requred_fields,is_enabled,is_type) VALUES ('phpbb', 'In-Bulletin', 'phpbb_import', 'phpBB 2.x', 'phpBB', 'user_regular,init_cat', 1, 'db');
+
+INSERT INTO CustomField (Type, FieldName, FieldLabel, Heading, Prompt, ElementType, ValueList, DisplayOrder, OnGeneralTab, IsSystem) VALUES (1, 'bb_ItemTemplate', 'bb_ItemTemplate', 'la_title_SystemCF', 'bb_ItemTemplate', 'text', NULL, 0, 0, 1);
+
+INSERT INTO Modules (Name, Path, Var, Version, Loaded, LoadOrder, TemplatePath, RootCat, BuildDate) VALUES ('In-Bulletin', 'in-bulletin/', 'bb', '1.3.0', 1, 3, 'inbulletin/', {TopicCatId}, '1054738405');
\ No newline at end of file
Index: branches/unlabeled/unlabeled-1.37.2/in-bulletin/units/topics/topics_config.php
===================================================================
diff -u
--- branches/unlabeled/unlabeled-1.37.2/in-bulletin/units/topics/topics_config.php (revision 0)
+++ branches/unlabeled/unlabeled-1.37.2/in-bulletin/units/topics/topics_config.php (revision 12744)
@@ -0,0 +1,322 @@
+ 'bb',
+ 'ItemClass' => Array('class' => 'kCatDBItem', 'file' => '', 'build_event' => 'OnItemBuild'),
+ 'ListClass' => Array('class' => 'kCatDBList', 'file' => '', 'build_event' => 'OnListBuild'),
+ 'EventHandlerClass' => Array('class' => 'TopicsEventHandler', 'file' => 'topics_event_handler.php', 'require_classes' => Array('kCatDBEventHandler'), 'build_event' => 'OnBuild'),
+ 'TagProcessorClass' => Array('class' => 'TopicsTagProcessor', 'file' => 'topics_tag_processor.php', 'require_classes' => Array('kCatDBTagProcessor'), 'build_event' => 'OnBuild'),
+ 'AutoLoad' => true,
+ 'QueryString' => Array(
+ 1 => 'id', // topic id
+ 2 => 'post_id', // post id
+ 3 => 'Page', // topic page
+ 4 => 'Post_Page', // posts page
+ 5 => 'pm_Page', // private message page
+ 6 => 'pm_id', // private message id
+ 7 => 'Reviews_Page',
+ 8 => 'event',
+ 9 => 'mode',
+ ),
+
+ 'ConfigPriority' => 0,
+ 'Hooks' => Array (
+ Array (
+ 'Mode' => hBEFORE,
+ 'Conditional' => false,
+ 'HookToPrefix' => '',
+ 'HookToSpecial' => '*',
+ 'HookToEvent' => Array('OnAfterConfigRead'),
+ 'DoPrefix' => 'cdata',
+ 'DoSpecial' => '*',
+ 'DoEvent' => 'OnDefineCustomFields',
+ ),
+ ),
+
+ 'CatalogItem' => true,
+ 'AdminTemplatePath' => 'topics',
+ 'AdminTemplatePrefix' => 'topics_',
+ 'IDField' => 'TopicId',
+ 'StatusField' => Array('Status'), // field, that is affected by Approve/Decline events
+
+ 'TitleField' => 'TopicText', // field, used in bluebar when editing existing item
+ 'TitlePhrase' => 'la_Text_Topic', // phrase used to specify item type in relationship list
+
+ 'TitlePresets' => Array(
+ 'default' => Array( 'new_status_labels' => Array('bb' => '!la_title_AddingTopic!'),
+ 'edit_status_labels' => Array('bb' => '!la_title_EditingTopic!'),
+ 'new_titlefield' => Array('bb' => '!la_title_NewTopic!'),
+ ),
+
+ 'topics_edit' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_General!"),
+ 'topics_categories' => Array('prefixes' => Array('bb','bb-ci_List'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Categories!"),
+ 'topics_relations' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Relations!"),
+ 'topics_images' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Images!"),
+ 'topics_reviews' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Reviews!"),
+ 'topics_custom' => Array('prefixes' => Array('bb'), 'format' => "#bb_status# '#bb_titlefield#' - !la_title_Custom!"),
+
+ 'images_edit' => Array( 'prefixes' => Array('bb', 'bb-img'),
+ 'new_status_labels' => Array('bb-img'=>'!la_title_Adding_Image!'),
+ 'edit_status_labels' => Array('bb-img'=>'!la_title_Editing_Image!'),
+ 'new_titlefield' => Array('bb-img'=>'!la_title_New_Image!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-img_status# '#bb-img_titlefield#'",
+ ),
+
+ 'reviews_edit' => Array( 'prefixes' => Array('bb', 'bb-rev'),
+ 'new_status_labels' => Array('bb-rev'=>"!la_title_Adding_Review! '!la_title_New_Review!'"),
+ 'edit_status_labels' => Array('bb-rev'=>'!la_title_Editing_Review!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-rev_status#",
+ ),
+
+ 'relations_edit' => Array( 'prefixes' => Array('bb', 'bb-rel'),
+ 'new_status_labels' => Array('bb-rel'=>"!la_title_Adding_Relationship! '!la_title_New_Relationship!'"),
+ 'edit_status_labels' => Array('bb-rel'=>'!la_title_Editing_Relationship!'),
+ 'format' => "#bb_status# '#bb_titlefield#' - #bb-rel_status#",
+ ),
+
+ 'tree_in-bulletin' => Array('format' => '!la_Text_Version! '.$this->Application->findModule('Name', 'In-Bulletin', 'Version')),
+ ),
+
+ 'PermItemPrefix' => 'TOPIC',
+
+ 'PermTabText' => 'In-Bulletin',
+ 'PermSection' => Array('main' => 'CATEGORY:in-bulletin:topics_list', 'search' => 'in-bulletin:configuration_search', 'email' => 'in-bulletin:configuration_email', 'custom' => 'in-bulletin:configuration_custom'),
+
+ 'Sections' => Array(
+ 'in-bulletin' => Array(
+ 'parent' => 'in-portal:root',
+ 'icon' => 'settings_in-bulletin',
+ 'label' => 'la_title_In-Bulletin',
+ 'url' => Array('t' => 'sections_list', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view'),
+ 'priority' => 3.3,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:inbulletin_general' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_general',
+ 'label' => 'la_tab_GeneralSettings',
+ 'url' => Array('t' => 'config/config_general', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 1,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_output' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_output',
+ 'label' => 'la_tab_ConfigOutput',
+ 'url' => Array('t' => 'config/config_universal', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 2,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_search' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_search',
+ 'label' => 'la_tab_ConfigSearch',
+ 'url' => Array('t' => 'config/config_search', 'module_key' => 'topics', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 3,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_censorship' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_censor',
+ 'label' => 'la_tab_ConfigCensorship',
+ 'url' => Array('index_file' => '../in-bulletin/admin/censor_config.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit'),
+ 'priority' => 4,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_emoticon' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_smiley',
+ 'label' => 'la_tab_ConfigSmileys',
+ 'url' => Array('index_file' => '../in-bulletin/admin/emoticon_config.php', 'pass' => 'm'),
+ 'permissions' => Array('view', 'add', 'edit'),
+ 'priority' => 5,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_email' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_email',
+ 'label' => 'la_tab_ConfigE-mail',
+ 'url' => Array('t' => 'config/config_email', 'pass_section' => true, 'pass' => 'm'),
+ 'permissions' => Array('view', 'edit'),
+ 'priority' => 6,
+ 'type' => stTREE,
+ ),
+
+ 'in-bulletin:configuration_custom' => Array(
+ 'parent' => 'in-bulletin',
+ 'icon' => 'settings_custom',
+ 'label' => 'la_tab_ConfigCustom',
+ 'url' => Array('t' => 'custom_fields/custom_fields_list', 'cf_type' => 3, 'pass_section' => true, 'pass' => 'm,cf'),
+ 'permissions' => Array('view', 'add', 'edit', 'delete'),
+ 'priority' => 7,
+ 'type' => stTREE,
+ ),
+
+ ),
+
+ 'FilterMenu' => Array(
+ 'Groups' => Array(
+ Array('mode' => 'AND', 'filters' => Array('show_active','show_pending','show_disabled'), 'type' => WHERE_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_new'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_hot'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_pop'), 'type' => HAVING_FILTER),
+ Array('mode' => 'AND', 'filters' => Array('show_pick'), 'type' => WHERE_FILTER),
+ ),
+ 'Filters' => Array(
+ 'show_active' => Array('label' =>'la_Active', 'on_sql' => '', 'off_sql' => '%1$s.Status != 1' ),
+ 'show_pending' => Array('label' => 'la_Pending', 'on_sql' => '', 'off_sql' => '%1$s.Status != 2' ),
+ 'show_disabled' => Array('label' => 'la_Disabled', 'on_sql' => '', 'off_sql' => '%1$s.Status != 0' ),
+ 's1' => Array(),
+ 'show_new' => Array('label' => 'la_Text_New', 'on_sql' => '', 'off_sql' => '`IsNew` != 1' ),
+ 'show_hot' => Array('label' => 'la_Text_Hot', 'on_sql' => '', 'off_sql' => '`IsHot` != 1' ),
+ 'show_pop' => Array('label' => 'la_Text_Pop', 'on_sql' => '', 'off_sql' => '`IsPop` != 1' ),
+ 'show_pick' => Array('label' => 'la_prompt_EditorsPick', 'on_sql' => '', 'off_sql' => '%1$s.`EditorsPick` != 1' ),
+ )
+ ),
+
+ 'CatalogSelectorName' => 'topiclist',
+
+ 'ItemPropertyMappings' => Array(
+ 'NewDays' => 'Topic_NewDays', // number of days item to be NEW
+ 'MinPopVotes' => 'Topic_MinPopVotes', // minimum number of votes for an item to be POP
+ 'MinPopRating' => 'Topic_MinPopRating', // minimum rating for an item to be POP
+ 'MaxHotNumber' => 'Topic_MaxHotNumber', // maximum number of HOT items
+
+ 'HotLimit' => 'Topic_HotLimit', // variable name in inp_Cache table
+ 'ClickField' => 'Views', // item click count is stored here (in item table)
+ ),
+
+ 'ItemType' => 3, // this is used when relation to product is added from in-portal and via-versa
+
+ 'ViewMenuPhrase' => 'la_title_Topics',
+
+ 'StatisticsInfo' => Array(
+ 'pending' => Array(
+ 'icon' => 'icon16_topic_pending.gif',
+ 'label' => 'la_Text_Topics',
+ 'js_url' => '#url#',
+ 'url' => Array('t' => 'in-portal/advanced_view', 'SetTab' => 'bb', 'pass' => 'm,bb.showall', 'bb.showall_event' => 'OnSetFilterPattern', 'bb.showall_filters' => 'show_active=0,show_pending=1,show_disabled=0,show_new=1,show_hot=1,show_pop=1,show_pick=1'),
+ 'status' => STATUS_PENDING,
+ ),
+ ),
+
+ 'TableName' => TABLE_PREFIX.'Topic',
+
+ 'CalculatedFields' => Array(
+ '' => Array (
+ 'UserName' => 'IF (ISNULL(u.Login), IF (%1$s.OwnerId = -1, "root", IF (%1$s.OwnerId = -2, "Guest", "n/a")), u.Login)',
+ 'CategoryId' => TABLE_PREFIX.'%3$sCategoryItems.CategoryId',
+ 'Filename' => TABLE_PREFIX.'%3$sCategoryItems.Filename',
+ ),
+ ),
+
+ 'ListSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId
+ LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'PermCache perm ON perm.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.OwnerId = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'%3$sTopicCustomData cust ON %1$s.ResourceId = cust.ResourceId',
+ ), // key - special, value - list select sql
+
+ 'ListSortings' => Array(
+ '' => Array(
+ 'ForcedSorting' => Array('EditorsPick' => 'desc', 'Priority' => 'desc'),
+ 'Sorting' => Array('TopicText' => 'asc'),
+ )
+ ),
+ 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'%3$sCategoryItems ON '.TABLE_PREFIX.'%3$sCategoryItems.ItemResourceId = %1$s.ResourceId
+ LEFT JOIN '.TABLE_PREFIX.'Category ON '.TABLE_PREFIX.'Category.CategoryId = '.TABLE_PREFIX.'%3$sCategoryItems.CategoryId
+ LEFT JOIN '.TABLE_PREFIX.'PortalUser u ON %1$s.OwnerId = u.PortalUserId
+ LEFT JOIN '.TABLE_PREFIX.'%3$sTopicCustomData cust ON %1$s.ResourceId = cust.ResourceId'),
+
+ 'SubItems' => Array('bb-rev', 'bb-ci', 'bb-rel', 'bb-img', 'bb-cdata'),
+
+ 'Fields' => Array (
+ 'TopicId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0,),
+ 'NotifyOwnerOnChanges' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Modified' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'required' => 1, 'not_null' => 1, 'default' => '#NOW#'),
+ 'TopicText' => Array('type' => 'string', 'not_null' => 1, 'required' => 1, 'default' => ''),
+ 'AutomaticFilename' => Array('type' => 'int', 'not_null' => 1, 'default' => 1),
+ 'Posts' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'Views' => Array('type' => 'double', 'formatter' => 'kFormatter', 'format' => '%d', 'not_null' => 1, 'default' => 0),
+ 'EditorsPick' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(1 => 'la_Yes', 0 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 0),
+ 'Status' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (1 => 'la_Active', 2 => 'la_Pending', 0 => 'la_Disabled'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 2),
+ 'Priority' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'OwnerId' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'required' => 1, 'default' => -1),
+ 'ModifiedById' => Array('type' => 'int', 'formatter' => 'kLEFTFormatter', 'options' => Array(-1 => 'root', -2 => 'Guest'),'left_sql'=>'SELECT %s FROM '.TABLE_PREFIX.'PortalUser WHERE `%s` = \'%s\'', 'left_key_field' => 'PortalUserId', 'left_title_field' => 'Login', 'not_null' => 1, 'default' => 0),
+ 'ResourceId' => Array('type' => 'int', 'default' => null),
+ 'TopicType' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array(0 => 'la_Yes', 1 => 'la_No'), 'use_phrases' => 1, 'not_null' => 1, 'default' => 1),
+ 'CreatedOn' => Array('type' => 'double', 'formatter' => 'kDateFormatter', 'required' => 1, 'default' => '#NOW#', 'not_null' => 1),
+ 'CachedReviewsQty' => Array('type' => 'int' ,'not_null' => 1, 'default' => 0),
+ 'CachedRating' => Array('type' => 'string', 'not_null' => 1, 'default' => 0),
+ 'CachedVotesQty' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'NewItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'PopItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'HotItem' => Array('type' => 'int', 'formatter' => 'kOptionsFormatter', 'options' => Array (2 => 'la_Auto', 1 => 'la_Always', 0 => 'la_Never'), 'use_phrases' => 1, 'not_null' => 1,'default' => 2),
+ 'PostedBy' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'OrgId' => Array('type' => 'int', 'default' => null),
+ 'LastPostId' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ 'LastPostDate' => Array('type' => 'int', 'formatter' => 'kDateFormatter', 'default' => null),
+ 'TodayDate' => Array('type' => 'string', 'default' => null),
+ 'TodayPosts' => Array('type' => 'int', 'not_null' => 1, 'default' => 0),
+ ),
+
+ 'VirtualFields' => Array(
+ 'UserName' => Array('type'=>'string', 'default' => ''),
+ 'CategoryId' => Array('type' => 'int', 'default' => 0),
+ 'Filename' => Array('type' => 'string', 'not_null' => 1, 'default' => ''),
+ 'CachedNavbar' => Array('type' => 'string', 'default' => ''),
+ ),
+
+ 'Grids' => Array(
+ 'Default' => Array(
+ 'Icons' => Array(1 => 'icon16_topic.gif', 2 => 'icon16_topic_pending.gif', 0 => 'icon16_topic_disabled.gif', 'HOT' => 'icon16_topic_hot.gif', 'POP' => 'icon16_topic_pop.gif', 'NEW' => 'icon16_topic_new.gif', 'PICK' => 'icon16_topic_pick.gif'),
+ 'Fields' => Array(
+ 'TopicId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_checkbox_td'),
+ 'TopicText' => Array('title' => 'la_col_TopicText', 'data_block' => 'grid_catitem_td'),
+ 'UserName' => Array('title' => 'la_col_PostedBy'),
+ 'Modified_formatted' => Array('title' => 'la_col_ModifiedDate', 'sort_field' => 'Modified'),
+ 'Posts' => Array('title' => 'la_col_Posts'),
+ 'Views' => Array('title' => 'la_col_Views'),
+ ),
+ ),
+
+ 'Radio' => Array(
+ 'Icons' => Array(1 => 'icon16_topic.gif', 2 => 'icon16_topic_pending.gif', 0 => 'icon16_topic_disabled.gif', 'HOT' => 'icon16_topic_hot.gif', 'POP' => 'icon16_topic_pop.gif', 'NEW' => 'icon16_topic_new.gif', 'PICK' => 'icon16_topic_pick.gif'),
+ 'Fields' => Array(
+ 'TopicId' => Array('title' => 'la_col_Id', 'data_block' => 'grid_radio_td'),
+ 'TopicText' => Array('title' => 'la_col_TopicText', 'data_block' => 'grid_catitem_td'),
+ 'UserName' => Array('title' => 'la_col_PostedBy'),
+ 'Modified_formatted' => Array('title' => 'la_col_ModifiedDate', 'sort_field' => 'Modified'),
+ 'Posts' => Array('title' => 'la_col_Posts'),
+ 'Views' => Array('title' => 'la_col_Views'),
+ ),
+ ),
+ ),
+
+ 'ConfigMapping' => Array(
+ 'PerPage' => 'Perpage_Topics',
+ 'ShortListPerPage' => 'Perpage_Topics_Short',
+ 'DefaultSorting1Field' => 'Topic_SortField',
+ 'DefaultSorting2Field' => 'Topic_SortField2',
+ 'DefaultSorting1Dir' => 'Topic_SortOrder',
+ 'DefaultSorting2Dir' => 'Topic_SortOrder2',
+ ),
+ );
+
+
+?>
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/topics/modify_post.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/topics/modify_post.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/topics/modify_post.tpl (revision 12744)
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/topics/search_results.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/topics/search_results.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/topics/search_results.tpl (revision 12744)
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ : | : 0
+
+
+ : 05/17/2006
+
+
+
+ img/s.gif" width="1" height="4" alt="" />
+ img/grey_pix.gif" width="100%" height="1" alt="" />
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/topics/new_topic_reply.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/topics/new_topic_reply.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/topics/new_topic_reply.tpl (revision 12744)
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/topics/modify_topic.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/topics/modify_topic.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/topics/modify_topic.tpl (revision 12744)
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/topics/modify_pending_confirm.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/topics/modify_pending_confirm.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/topics/modify_pending_confirm.tpl (revision 12744)
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ">My Topics
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/topics/modify_confirm.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/topics/modify_confirm.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/topics/modify_confirm.tpl (revision 12744)
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ">My Topics
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/topics/new_topic.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/topics/new_topic.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/topics/new_topic.tpl (revision 12744)
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/topics/add_pending_confirm.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/topics/add_pending_confirm.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/topics/add_pending_confirm.tpl (revision 12744)
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ">My Topics
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/topics/add_confirm.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/topics/add_confirm.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/topics/add_confirm.tpl (revision 12744)
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ">My Topics
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/module_info.xml
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/module_info.xml (revision 0)
+++ trunk/themes/default2007/inbulletin/module_info.xml (revision 12744)
@@ -0,0 +1,5 @@
+
+
+ inbulletin/index
+ inbulletin/post_list
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/designs/private_messages.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/designs/private_messages.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/designs/private_messages.tpl (revision 12744)
@@ -0,0 +1,73 @@
+
+ active-tab inactive-tab">
+ ">
+
+
+
+
+
+
+
+ ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ " />
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+ ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/designs/categories.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/designs/categories.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/designs/categories.tpl (revision 12744)
@@ -0,0 +1,49 @@
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+ img/forums_dir.gif" width="20" height="24" alt="" />
+
+
+ ">
+
+
+
+
+
+
+
+ 123
+
+
+
+ 445
+
+
+
+
+
+
+
+
Index: trunk/themes/default2007/inbulletin/designs/topics.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/designs/topics.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/designs/topics.tpl (revision 12744)
@@ -0,0 +1,106 @@
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+ img/topics_icon.gif" width="14" height="12" alt="" />
+
+
+
+
+
+
+ ">
+
+ img/icon_hot.gif" alt=" "/>
+ img/icon_new.gif" alt=" "/>
+ img/icon_popular.gif" alt=" "/>
+ img/icon_pick.gif" alt=" "/>
+ img/icon_favorite.gif" alt=" "/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+ ">
+
+ img/icon_hot.gif" alt=" "/>
+ img/icon_new.gif" alt=" "/>
+ img/icon_popular.gif" alt=" "/>
+ img/icon_pick.gif" alt=" "/>
+ img/icon_favorite.gif" alt=" "/>
+
+
+
+ ( : )
+
+
+
+ :
+
+
+
+
+
+ img/ic_details.gif" width="14" height="13" alt="" /> ">
+
+
+
+
+ | img/ic_edit.gif" width="11" height="10" alt="" /> ">
+
+
+
+
+
+ | img/ic_delete.gif" width="11" height="10" alt="" /> " onclick="return confirm(' ');">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/designs/posts.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/designs/posts.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/designs/posts.tpl (revision 12744)
@@ -0,0 +1,143 @@
+
+ " />
+
+
+
+
+
+
+
+
+
+
+ img/btn_sm_corn1.gif" width="5" height="27" alt="" />
+
+
+ ">
+
+
+ "> img/ .gif">
+
+
+
+
+ img/btn_sm_corn2.gif" width="5" height="5" alt="" />
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+ img/btn_sm_corn2_.gif" width="5" height="5" alt="" />
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+ " valign="top">
+
+
+
+ img/icon_post_1.gif" width="21" height="24" alt="" />
+
+
+
+ ">
+
+
+
+
+
+
+ :
+ :
+ :
+
+
+
+
+
+
+
+
+ " valign="top">
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1111111111111
+
+
+
+
+
+
+
+ ------------------------------------------------------------------------------
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/post_list.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/post_list.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/post_list.tpl (revision 12744)
@@ -0,0 +1,189 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [ ]
+
+ - ( )
+
+
+
+
+
+ img/s.gif" width="1" height="10" alt="" />
+
+
+
+
+
+
+ img/btn_corn1.gif" width="11" height="16" alt="" />
+
+
+ ">
+
+
+ "> img/ .gif" alt="">
+
+
+
+
+ img/btn_corn2.gif" width="11" height="10" alt="" />
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+ img/btn_corn2_.gif" width="11" height="10" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/my_account/private_messages/view_message.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/my_account/private_messages/view_message.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/my_account/private_messages/view_message.tpl (revision 12744)
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ :
+
+
+
+ [ "> ]
+
+
+ [ " onclick="return confirm(' ');"> ]
+
+
+
+
+
+ :
+ :
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/my_account/private_messages/private_messages.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/my_account/private_messages/private_messages.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/my_account/private_messages/private_messages.tpl (revision 12744)
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/my_account/private_messages/new_message.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/my_account/private_messages/new_message.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/my_account/private_messages/new_message.tpl (revision 12744)
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ *
+
+
+
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/my_account/private_messages/add_confirm.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/my_account/private_messages/add_confirm.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/my_account/private_messages/add_confirm.tpl (revision 12744)
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ">
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/my_account/my_preferences.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/my_account/my_preferences.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/my_account/my_preferences.tpl (revision 12744)
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Forums
+
+
+ img/grey_pix.gif" width="100%" height="1" align="absmiddle" alt="" />
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/my_account/preferences_tab.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/my_account/preferences_tab.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/my_account/preferences_tab.tpl (revision 12744)
@@ -0,0 +1 @@
+
Index: trunk/themes/default2007/inbulletin/my_account/my_topics.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/my_account/my_topics.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/my_account/my_topics.tpl (revision 12744)
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/my_account/my_items.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/my_account/my_items.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/my_account/my_items.tpl (revision 12744)
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/img/bgr_btn_top.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/btn_modify.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/bgr_btn_l_side.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/icon_post_1.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/btn_sm_corn2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/bgr_btn_sm_top.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/btn_sm_modify.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/btn_rate.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/btn_sm_delete.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/bgr_btn_sm_r_side.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/btn_sm_corn1.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/btn_corn1.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/bgr_btn_sm_top_alt.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/bgr_btn_sm_l_side.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/btn_corn2_.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/btn_add_favorites.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/btn_reply.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/btn_noicon.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/btn_corn2.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/bgr_btn_bot.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/btn_threaded.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/bgr_btn_r_side.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/btn_favorites.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/btn_sm_quoted.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/bgr_btn_sm_bot.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/menu_topics.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/img/btn_sm_corn2_.gif
===================================================================
diff -u
Binary files differ
Index: trunk/themes/default2007/inbulletin/inc/styles.css
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/inc/styles.css (revision 0)
+++ trunk/themes/default2007/inbulletin/inc/styles.css (revision 12744)
@@ -0,0 +1,188 @@
+.bbcode {
+ border: 1px solid #888888;
+ background-color: #EEEEEE;
+ padding: 10px;
+}
+
+.forums-header TD
+ {
+ padding:6px;
+ color:#21619e;
+ }
+
+.forums-icon-cell
+ {
+ width:20px;
+ padding-right:10px;
+ vertical-align:top;
+ }
+
+.forums-subheaders
+ {
+ background:#f4f4f4;
+ font-weight:bold;
+ padding:5px 15px;
+ font-size:12px;
+ }
+
+.table-gradient-grey
+ {
+ background:url(../../platform/img/background_table_grey.gif) top repeat-x;
+ }
+
+.table-gradient-blue
+ {
+ background:url(../../platform/img/background_table_blue.gif) top repeat-x;
+ }
+
+
+.forums-subheaders A
+ {
+ color:#000000;
+ text-decoration: underline;
+ }
+
+.forums-subheaders A:hover
+ {
+ color: #666666;
+ text-decoration: underline;
+ }
+
+.forums-cells
+ {
+ vertical-align: middle;
+ padding:10px;
+ }
+
+.post-background-1
+ {
+ background:#f4f4f4;
+ padding:8px;
+ }
+
+.post-background-2
+ {
+ background:#FFFFFF;
+ padding:8px;
+ }
+
+.post-icon-padding-right
+ {
+ padding-right:10px;
+ }
+
+.topic-prewiew-padding-cell TD
+ {
+ padding: 13px;
+ }
+
+.post-control {
+ padding: 0px !important;
+ vertical-align: top;
+}
+
+
+.no-padding TD
+ {
+ padding:0px;
+ }
+
+
+.forums-icon-description TD
+ {
+ padding:10px;
+ vertical-align:middle;
+ }
+
+.topics-icon-padding
+ {
+ width:14px;
+ padding-right:10px;
+ }
+
+.new-private-message {
+ font-weight: bold;
+}
+
+
+
+
+
+
+/*--- FORUM GRAPHIC BUTTON //---*/
+.btn-l-side {
+ background: #efefef url(../img/bgr_btn_l_side.gif) repeat-y top left
+ }
+
+.btn-r-side {
+ background: #efefef url(../img/bgr_btn_r_side.gif) repeat-y top right
+ }
+
+.btn-bot {
+ background: #efefef url(../img/bgr_btn_bot.gif) repeat-x top left
+ }
+
+.btn-text, .btn-text-sm {
+ background: #efefef url(../img/bgr_btn_top.gif) repeat-x top left;
+ font: bold 14px arial, sans-serif;
+ letter-spacing: -1px;
+ color: #1F569A;
+ padding-top: 13px
+ }
+.btn-text-sm {
+ font: bold 11px arial, sans-serif;
+ letter-spacing: 0px;
+ padding-top: 14px
+ }
+.btn-text-sm a, .btn-text-sm a:hover {
+ text-decoration: none
+ }
+.btn-text a, .btn-text a:hover {
+ text-decoration: none
+ }
+/*--- FORUM GRAPHIC BUTTON \\---*/
+
+/*--- POST TEXT SMALL GRAPHIC BUTTON //---*/
+.btn-sm-l-side {
+ background: #efefef url(../img/bgr_btn_sm_l_side.gif) repeat-y top left
+ }
+
+.btn-sm-r-side {
+ background: #efefef url(../img/bgr_btn_sm_r_side.gif) repeat-y top right
+ }
+
+.btn-sm-bot {
+ background: #efefef url(../img/bgr_btn_sm_bot.gif) repeat-x top left
+ }
+
+.btn-sm-text {
+ background: url(../img/bgr_btn_sm_top.gif) repeat-x top left;
+ font: 10px arial, sans-serif;
+ color: #153C6A;
+ padding-top: 15px
+ }
+.btn-sm-text a {
+ color: #153C6A;
+ text-decoration: none
+ }
+.btn-sm-text a:hover {
+ text-decoration: none
+ }
+/*--- POST TEXT SMALL GRAPHIC BUTTON \\---*/
+
+/*--- POST TEXT SMALL GRAPHIC BUTTON ALTERNATIVE ROW //---*/
+.btn-sm-text-alt {
+ background: #efefef url(../img/bgr_btn_sm_top_alt.gif) repeat-x top left;
+ font: 10px arial, sans-serif;
+ color: #153C6A;
+ padding-top: 15px
+ }
+.btn-sm-text-alt a {
+ color: #153C6A;
+ text-decoration: none
+ }
+.btn-sm-text-alt a:hover {
+ text-decoration: none
+ }
+/*--- POST TEXT SMALL GRAPHIC BUTTON \\---*/
+
Index: trunk/themes/default2007/inbulletin/inc/script.js
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/inc/script.js (revision 0)
+++ trunk/themes/default2007/inbulletin/inc/script.js (revision 12744)
@@ -0,0 +1 @@
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/elements/content_boxes/my_favorites.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/elements/content_boxes/my_favorites.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/elements/content_boxes/my_favorites.tpl (revision 12744)
@@ -0,0 +1,33 @@
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/elements/content_boxes/search_results.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/elements/content_boxes/search_results.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/elements/content_boxes/search_results.tpl (revision 12744)
@@ -0,0 +1,53 @@
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+
+ : | : 0
+
+
+ : 05/17/2006
+
+
+
+ img/s.gif" width="1" height="4" alt="" />
+ img/grey_pix.gif" width="100%" height="1" alt="" />
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+ img/s.gif" width="1" height="5" alt="" />
+ "> ...
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/elements/content_boxes/category_topics.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/elements/content_boxes/category_topics.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/elements/content_boxes/category_topics.tpl (revision 12744)
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+
+
+ 0 posts in 0 Topics | Added Today:0
+
+
+ Links Updated: 05/17/2006
+
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/elements/menu.xml.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/elements/menu.xml.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/elements/menu.xml.tpl (revision 12744)
@@ -0,0 +1 @@
+
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/elements/html_head.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/elements/html_head.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/elements/html_head.tpl (revision 12744)
@@ -0,0 +1,2 @@
+ inc/styles.css" type="text/css" />
+inc/script.js">
\ No newline at end of file
Index: trunk/themes/default2007/inbulletin/elements/side_boxes/action_box.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/elements/side_boxes/action_box.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/elements/side_boxes/action_box.tpl (revision 12744)
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+ ">
+
+
+
+
+
+
+
+ -
+
+ " class="static">
+
+
+
+
Index: trunk/themes/default2007/inbulletin/index.tpl
===================================================================
diff -u
--- trunk/themes/default2007/inbulletin/index.tpl (revision 0)
+++ trunk/themes/default2007/inbulletin/index.tpl (revision 12744)
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+ 0 posts in 0 Topics | Added Today: 0 Topics, 0 posts
+
+
+
+ img/s.gif" width="1" height="4" alt="" />
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+ img/forums_new_post.gif" width="20" height="23" alt="" />
+
+
+ Forum has new posts
+
+
+ img/forums_no_new_post.gif" width="21" height="24" alt="" />
+
+
+ Forum has no new posts
+
+
+ img/forums_locked.gif" width="25" height="23" alt="" />
+
+
+ Forum is locked for posting
+
+
+
+
+
+
+
+ img/s.gif" width="1" height="1" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default/inbulletin/menubar_element.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/menubar_element.tpl (revision 0)
+++ trunk/themes/default/inbulletin/menubar_element.tpl (revision 12744)
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default/inbulletin/pick/right.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/pick/right.tpl (revision 0)
+++ trunk/themes/default/inbulletin/pick/right.tpl (revision 12744)
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default/inbulletin/pick/topic_element.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/pick/topic_element.tpl (revision 0)
+++ trunk/themes/default/inbulletin/pick/topic_element.tpl (revision 12744)
@@ -0,0 +1,18 @@
+
+
+ " class="posts">
+ " />
+ " />
+ " />
+ " />
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default/inbulletin/pick/topics.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/pick/topics.tpl (revision 0)
+++ trunk/themes/default/inbulletin/pick/topics.tpl (revision 12744)
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+ :
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ">
+ " width="11" height="11" alt="" border="0" />
+
+
+
+
+ ">
+ " width="11" height="11" alt="" border="0" />
+
+
+
+
+ ">
+ " width="11" height="11" alt="" border="0" />
+
+
+
+
+ ">
+ " width="11" height="11" alt="" border="0" />
+
+
+
+
+ ">
+ " width="11" height="11" alt="" border="0" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/themes/default/inbulletin/catindex/catindex.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/catindex/catindex.tpl (revision 0)
+++ trunk/themes/default/inbulletin/catindex/catindex.tpl (revision 12744)
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ">
+ " width="11" height="11" alt="" border="0" />
+
+
+ ">
+ " width="11" height="11" alt="" border="0" />
+
+
+ ">
+ " width="11" height="11" alt="" border="0" />
+
+
+ ">
+ " width="11" height="11" alt="" border="0" /> ">
+
+ ">
+ " width="11" height="11" alt="" border="0" />
+
+ ">
+ " width="11" height="11" alt="" border="0" />
+
+ ">
+ " width="11" height="11" alt="" border="0" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/themes/default/inbulletin/post_list.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/post_list.tpl (revision 0)
+++ trunk/themes/default/inbulletin/post_list.tpl (revision 12744)
@@ -0,0 +1,266 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ " width="18" height="12" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ">
+ ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/themes/default/inbulletin/quicklinks/new.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/quicklinks/new.tpl (revision 0)
+++ trunk/themes/default/inbulletin/quicklinks/new.tpl (revision 12744)
@@ -0,0 +1,8 @@
+
+
+
Index: trunk/themes/default/inbulletin/quicklinks/edpick/topic_element.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/quicklinks/edpick/topic_element.tpl (revision 0)
+++ trunk/themes/default/inbulletin/quicklinks/edpick/topic_element.tpl (revision 12744)
@@ -0,0 +1,4 @@
+
+
+ " class="posts">
+
Index: trunk/themes/default/inbulletin/quicklinks/edpick/topics.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/quicklinks/edpick/topics.tpl (revision 0)
+++ trunk/themes/default/inbulletin/quicklinks/edpick/topics.tpl (revision 12744)
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/themes/default/inbulletin/quicklinks/new/links_element.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/quicklinks/new/links_element.tpl (revision 0)
+++ trunk/themes/default/inbulletin/quicklinks/new/links_element.tpl (revision 12744)
@@ -0,0 +1,5 @@
+
+
+ ">
+
+
Index: trunk/themes/default/inbulletin/quicklinks/new/links.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/quicklinks/new/links.tpl (revision 0)
+++ trunk/themes/default/inbulletin/quicklinks/new/links.tpl (revision 12744)
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default/inbulletin/quicklinks/edpick.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/quicklinks/edpick.tpl (revision 0)
+++ trunk/themes/default/inbulletin/quicklinks/edpick.tpl (revision 12744)
@@ -0,0 +1,7 @@
+
+
Index: trunk/themes/default/inbulletin/advsearch/adv_searchtype_options.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/advsearch/adv_searchtype_options.tpl (revision 0)
+++ trunk/themes/default/inbulletin/advsearch/adv_searchtype_options.tpl (revision 12744)
@@ -0,0 +1 @@
+
\ No newline at end of file
Index: trunk/themes/default/inbulletin/my_preferences/preferences.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/my_preferences/preferences.tpl (revision 0)
+++ trunk/themes/default/inbulletin/my_preferences/preferences.tpl (revision 12744)
@@ -0,0 +1,134 @@
+
+">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "> >
+ "> >
+
+
+
+
+
+ " width="18" height="12" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/themes/default/inbulletin/my_preferences/pref_menubar_element1.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/my_preferences/pref_menubar_element1.tpl (revision 0)
+++ trunk/themes/default/inbulletin/my_preferences/pref_menubar_element1.tpl (revision 12744)
@@ -0,0 +1,10 @@
+
+
+
+
+ ">
+ ">
+
+
+
+
Index: trunk/themes/default/inbulletin/my_preferences/preferences_form.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/my_preferences/preferences_form.tpl (revision 0)
+++ trunk/themes/default/inbulletin/my_preferences/preferences_form.tpl (revision 12744)
@@ -0,0 +1,76 @@
+ ">
+
+
\ No newline at end of file
Index: trunk/themes/default/inbulletin/my_preferences/pref_menubar_element.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/my_preferences/pref_menubar_element.tpl (revision 0)
+++ trunk/themes/default/inbulletin/my_preferences/pref_menubar_element.tpl (revision 12744)
@@ -0,0 +1,11 @@
+
+
+
+
+ ">
+ ">
+
+
+
+
+
Index: trunk/themes/default/inbulletin/post_edit/post_edit_form.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/post_edit/post_edit_form.tpl (revision 0)
+++ trunk/themes/default/inbulletin/post_edit/post_edit_form.tpl (revision 12744)
@@ -0,0 +1,70 @@
+ " METHOD="POST">
+
+
Index: trunk/themes/default/inbulletin/my_account/new_topics.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/my_account/new_topics.tpl (revision 0)
+++ trunk/themes/default/inbulletin/my_account/new_topics.tpl (revision 12744)
@@ -0,0 +1,158 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ " width="18" height="12" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+ :
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ">
+ " width="11" height="11" alt="" border="0" />
+
+
+
+
+ ">
+ " width="11" height="11" alt="" border="0" />
+
+
+
+
+ ">
+ " width="11" height="11" alt="" border="0" />
+
+
+
+
+ ">
+ " width="11" height="11" alt="" border="0" />
+
+
+
+
+ ">
+ " width="11" height="11" alt="" border="0" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default/inbulletin/my_account/new_items.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/my_account/new_items.tpl (revision 0)
+++ trunk/themes/default/inbulletin/my_account/new_items.tpl (revision 12744)
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ">
+ " width="11" height="11" alt="" border="0" />
+
+
+
+
+ ">
+ " width="11" height="11" alt="" border="0" /> ">
+
+ ">
+ " width="11" height="11" alt="" border="0" />
+
+ ">
+ " width="11" height="11" alt="" border="0" />
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default/inbulletin/my_account/topics.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/my_account/topics.tpl (revision 0)
+++ trunk/themes/default/inbulletin/my_account/topics.tpl (revision 12744)
@@ -0,0 +1,10 @@
+
+
+ ">
+
+
+ ">
+
+
+
+
Index: trunk/themes/default/inbulletin/pick.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/pick.tpl (revision 0)
+++ trunk/themes/default/inbulletin/pick.tpl (revision 12744)
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ " width="18" height="12" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default/inbulletin/get_rated.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/get_rated.tpl (revision 0)
+++ trunk/themes/default/inbulletin/get_rated.tpl (revision 12744)
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/themes/default/inbulletin/topic_reply.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/topic_reply.tpl (revision 0)
+++ trunk/themes/default/inbulletin/topic_reply.tpl (revision 12744)
@@ -0,0 +1,88 @@
+
+">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/themes/default/inbulletin/search_results/search_count.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/search_results/search_count.tpl (revision 0)
+++ trunk/themes/default/inbulletin/search_results/search_count.tpl (revision 12744)
@@ -0,0 +1,3 @@
+
+
+ - ">
Index: trunk/themes/default/inbulletin/search_results/short_results.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/search_results/short_results.tpl (revision 0)
+++ trunk/themes/default/inbulletin/search_results/short_results.tpl (revision 12744)
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+
+
+
+
+
+ "> " width="11" height="11" alt="" border="0" />
+
+
+ "> " width="11" height="11" alt="" border="0" />
+
+
+ "> " width="11" height="11" alt="" border="0" />
+
+ "> " width="11" height="11" alt="" border="0" />
+
+ "> " width="11" height="11" alt="" border="0" />
+
+ "> " width="11" height="11" alt="" border="0" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: trunk/themes/default/inbulletin/search_results/search_results_element.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/search_results/search_results_element.tpl (revision 0)
+++ trunk/themes/default/inbulletin/search_results/search_results_element.tpl (revision 12744)
@@ -0,0 +1,41 @@
+
+
+
+
+ " class="posts">
+ " />
+ " />
+ " />
+ " />
+
+
+
+ ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/themes/default/inbulletin/search_results/item_results.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/search_results/item_results.tpl (revision 0)
+++ trunk/themes/default/inbulletin/search_results/item_results.tpl (revision 12744)
@@ -0,0 +1,180 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "> >
+ "> >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ( )
+
+
+
+
+
+
+
+
+
+
+
+ "> " width="11" height="11" alt="" border="0" />
+
+
+ "> " width="11" height="11" alt="" border="0" />
+
+
+ "> " width="11" height="11" alt="" border="0" />
+
+ "> " width="11" height="11" alt="" border="0" />
+
+ "> " width="11" height="11" alt="" border="0" />
+
+ "> " width="11" height="11" alt="" border="0" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/themes/default/inbulletin/post_edit.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/post_edit.tpl (revision 0)
+++ trunk/themes/default/inbulletin/post_edit.tpl (revision 12744)
@@ -0,0 +1,89 @@
+
+">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/themes/default/inbulletin/topic_list.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/topic_list.tpl (revision 0)
+++ trunk/themes/default/inbulletin/topic_list.tpl (revision 12744)
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ " width="18" height="12" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/themes/default/inbulletin/favorites_element.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/favorites_element.tpl (revision 0)
+++ trunk/themes/default/inbulletin/favorites_element.tpl (revision 12744)
@@ -0,0 +1,45 @@
+
+
+ " class="posts">
+ " />
+ " />
+ " />
+ " />
+
+
+
+ ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/themes/default/inbulletin/topic_reply/topic_reply_form.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/topic_reply/topic_reply_form.tpl (revision 0)
+++ trunk/themes/default/inbulletin/topic_reply/topic_reply_form.tpl (revision 12744)
@@ -0,0 +1,70 @@
+ " METHOD="POST">
+
+
Index: trunk/themes/default/inbulletin/edit_topic.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/edit_topic.tpl (revision 0)
+++ trunk/themes/default/inbulletin/edit_topic.tpl (revision 12744)
@@ -0,0 +1,93 @@
+
+">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/themes/default/inbulletin/post_list_threaded.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/post_list_threaded.tpl (revision 0)
+++ trunk/themes/default/inbulletin/post_list_threaded.tpl (revision 12744)
@@ -0,0 +1,246 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ " width="18" height="12" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ :
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ">
+ ">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: trunk/themes/default/inbulletin/pm_list.tpl
===================================================================
diff -u
--- trunk/themes/default/inbulletin/pm_list.tpl (revision 0)
+++ trunk/themes/default/inbulletin/pm_list.tpl (revision 12744)
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "> >
+ "> >
+
+
+
+
+ " width="18" height="12" alt="" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+