diff --git a/wbce/modules/topics/add.php b/wbce/modules/topics/add.php
index 254ff98a7..09f8a124e 100644
--- a/wbce/modules/topics/add.php
+++ b/wbce/modules/topics/add.php
@@ -72,27 +72,13 @@
}
$theq = "INSERT INTO ".TABLE_PREFIX."mod_".$mod_dir."_settings SET ";
- $theq .= "section_id='".$section_id."', page_id='".$page_id."', section_title='".$section_title."' ". $addstring;
- //echo $theq;
- //die();
+ $theq .= "section_id='".$section_id."', page_id='".$page_id."', section_title='".$section_title."' ". $addstring;
+ $database->query($theq);
} else {
$theq = "INSERT INTO ".TABLE_PREFIX."mod_".$tablename."_settings (section_id,page_id,section_title,section_description,sort_topics,use_timebased_publishing,picture_dir,header,topics_loop,footer,topics_per_page,topic_header,topic_footer,topic_block2,pnsa_string,pnsa_max,comments_header,comments_loop,comments_footer,commenting,default_link,use_captcha,sort_comments) VALUES ('$section_id','$page_id','$section_title','','$sort_topics','$use_timebased_publishing','$picture_dir','$header','$topics_loop','$footer','$topics_per_page','$topic_header','$topic_footer','$topic_block2','$pnsa_string','$pnsa_max','$comments_header','$comments_loop','$comments_footer','$commenting','$default_link','$use_captcha','$sort_comments')";
+ $database->query($theq);
include('defaults/first-topics.php');
}
-$database->query($theq);
-
-$test = WB_PATH.substr($topics_directory, 0, -1);
-//Add a frirst topic
-if (isset($firsttopic) AND is_dir($test) ) {
- $database->query($firsttopic);
- // Get the id
- $topic_id = $database->get_one("SELECT LAST_INSERT_ID()");
-
- $filename = WB_PATH.$topics_directory.'welcome'.PAGE_EXTENSION;
- define('TOPICS_DIRECTORY_DEPTH', $topics_directory_depth);
- topics_archive_file ($filename, $topic_id, $section_id, $page_id, $create_topics_accessfiles);
-
-}
?>
diff --git a/wbce/modules/topics/add_topic.php b/wbce/modules/topics/add_topic.php
index d83b5e8d9..51827d22c 100644
--- a/wbce/modules/topics/add_topic.php
+++ b/wbce/modules/topics/add_topic.php
@@ -4,11 +4,11 @@
require('permissioncheck.php');
$mpath = WB_PATH.'/modules/'.$mod_dir.'/';
-require_once($mpath.'defaults/module_settings.default.php');
-require_once($mpath.'module_settings.php');
+//require_once($mpath.'defaults/module_settings.default.php');
+//require_once($mpath.'module_settings.php');
// Include the ordering class
-require_once(WB_PATH.'/framework/class.order.php');
+require(WB_PATH.'/framework/class.order.php');
// Get new order
$order = new order(TABLE_PREFIX.'mod_'.$tablename, 'position', 'topic_id', 'section_id');
$position = $order->get_new($section_id);
@@ -41,4 +41,4 @@
$admin->print_footer();
}
-?>
+?>
\ No newline at end of file
diff --git a/wbce/modules/topics/assistant/assistant.inc.php b/wbce/modules/topics/assistant/assistant.inc.php
new file mode 100644
index 000000000..25fb200f0
--- /dev/null
+++ b/wbce/modules/topics/assistant/assistant.inc.php
@@ -0,0 +1,23 @@
+
Overview Presets: ';
+$Arr = array('ov_standard','ov_grid2_thumb','ov_grid3_thumb','ov_grid2_pic','ov_grid3_pic','ov_grid4_pic','ov_collector_sidebar');
+foreach($Arr as $pr) {
+ echo ' ';
+}
+
+echo ' | Topic Presets: ';
+$Arr = array('tp_standard','tp_simple','tp_simple_wide');
+foreach($Arr as $pr) {
+ echo ' ';
+}
+
+echo ' | Prev/Next: ';
+$Arr = array('pnsa_standard', 'pnsa_standard-en');
+foreach($Arr as $pr) {
+ echo ' ';
+}
+
+echo ' |
';
+?>
\ No newline at end of file
diff --git a/wbce/modules/topics/assistant/ov_collector_sidebar.js b/wbce/modules/topics/assistant/ov_collector_sidebar.js
new file mode 100644
index 000000000..a5ad702ff
--- /dev/null
+++ b/wbce/modules/topics/assistant/ov_collector_sidebar.js
@@ -0,0 +1,17 @@
+//Starting Javascript
+
+document.modify.header.value = '\nLatest Topics
\n';
+document.modify.topics_loop.value = '[THUMB]\n[TITLE]
\n[SHORT_DESCRIPTION]\n\n';
+document.modify.footer.value = '';
+
+// To save as a preset, change this line with your description:
+document.getElementById('presetsdescription').innerHTML = 'Check changed fields';
+
+document.modify.header.style.backgroundColor = '#e8ff98';
+document.modify.topics_loop.style.backgroundColor = '#e8ff98';
+document.modify.footer.style.backgroundColor = '#e8ff98';
+
+document.getElementById('linktabarea3').style.backgroundColor = '#e8ff98';
+showtabarea(3);
+
+alert("Done");
\ No newline at end of file
diff --git a/wbce/modules/topics/assistant/ov_collector_sidebar.png b/wbce/modules/topics/assistant/ov_collector_sidebar.png
new file mode 100644
index 000000000..43bc336f2
Binary files /dev/null and b/wbce/modules/topics/assistant/ov_collector_sidebar.png differ
diff --git a/wbce/modules/topics/assistant/ov_grid2_pic.js b/wbce/modules/topics/assistant/ov_grid2_pic.js
new file mode 100644
index 000000000..86ae9841c
--- /dev/null
+++ b/wbce/modules/topics/assistant/ov_grid2_pic.js
@@ -0,0 +1,20 @@
+//Starting Javascript
+
+document.modify.header.value = '\n[SECTION_TITLE]
\n\n
\n';
+document.modify.topics_loop.value = '
\n
\n\n
\n[TOPIC_SHORT]\n
\n[EDITLINK]
\n';
+document.modify.footer.value = '
\n{PREV_NEXT_PAGES}\n
\n
\n';
+
+
+
+// To save as a preset, change this line with your description:
+document.getElementById('presetsdescription').innerHTML = 'Check changed fields';
+
+document.modify.header.style.backgroundColor = '#e8ff98';
+document.modify.topics_loop.style.backgroundColor = '#e8ff98';
+document.modify.footer.style.backgroundColor = '#e8ff98';
+
+document.getElementById('linktabarea3').style.backgroundColor = '#e8ff98';
+showtabarea(3);
+
+
+alert("Done");
\ No newline at end of file
diff --git a/wbce/modules/topics/assistant/ov_grid2_pic.png b/wbce/modules/topics/assistant/ov_grid2_pic.png
new file mode 100644
index 000000000..e40eb1f90
Binary files /dev/null and b/wbce/modules/topics/assistant/ov_grid2_pic.png differ
diff --git a/wbce/modules/topics/assistant/ov_grid2_thumb.js b/wbce/modules/topics/assistant/ov_grid2_thumb.js
new file mode 100644
index 000000000..291c58f0a
--- /dev/null
+++ b/wbce/modules/topics/assistant/ov_grid2_thumb.js
@@ -0,0 +1,20 @@
+//Starting Javascript
+
+document.modify.header.value = '\n[SECTION_TITLE]
\n\n
\n';
+document.modify.topics_loop.value = '
\n{THUMB}\n
\n[TOPIC_SHORT]\n[READ_MORE]\n
\n[EDITLINK]
\n';
+document.modify.footer.value = '
\n{PREV_NEXT_PAGES}\n
\n
\n';
+
+
+
+// To save as a preset, change this line with your description:
+document.getElementById('presetsdescription').innerHTML = 'Check changed fields';
+
+document.modify.header.style.backgroundColor = '#e8ff98';
+document.modify.topics_loop.style.backgroundColor = '#e8ff98';
+document.modify.footer.style.backgroundColor = '#e8ff98';
+
+document.getElementById('linktabarea3').style.backgroundColor = '#e8ff98';
+showtabarea(3);
+
+
+alert("Done");
\ No newline at end of file
diff --git a/wbce/modules/topics/assistant/ov_grid2_thumb.png b/wbce/modules/topics/assistant/ov_grid2_thumb.png
new file mode 100644
index 000000000..9d9fa8abe
Binary files /dev/null and b/wbce/modules/topics/assistant/ov_grid2_thumb.png differ
diff --git a/wbce/modules/topics/assistant/ov_grid3_pic.js b/wbce/modules/topics/assistant/ov_grid3_pic.js
new file mode 100644
index 000000000..a0b2a3e85
--- /dev/null
+++ b/wbce/modules/topics/assistant/ov_grid3_pic.js
@@ -0,0 +1,19 @@
+//Starting Javascript
+
+document.modify.header.value = '\n\n\n\n[SECTION_TITLE]
\n\n
\n';
+document.modify.topics_loop.value = '\n
\n
\n\n
\n[TOPIC_SHORT]\n
\n[EDITLINK]
\n';
+document.modify.footer.value = '
\n{PREV_NEXT_PAGES}\n
\n
\n';
+
+
+
+// To save as a preset, change this line with your description:
+document.getElementById('presetsdescription').innerHTML = 'Check changed fields';
+
+document.modify.header.style.backgroundColor = '#e8ff98';
+document.modify.topics_loop.style.backgroundColor = '#e8ff98';
+document.modify.footer.style.backgroundColor = '#e8ff98';
+
+document.getElementById('linktabarea3').style.backgroundColor = '#e8ff98';
+showtabarea(3);
+
+alert("Done");
\ No newline at end of file
diff --git a/wbce/modules/topics/assistant/ov_grid3_pic.png b/wbce/modules/topics/assistant/ov_grid3_pic.png
new file mode 100644
index 000000000..25033e720
Binary files /dev/null and b/wbce/modules/topics/assistant/ov_grid3_pic.png differ
diff --git a/wbce/modules/topics/assistant/ov_grid3_thumb.js b/wbce/modules/topics/assistant/ov_grid3_thumb.js
new file mode 100644
index 000000000..b234197c3
--- /dev/null
+++ b/wbce/modules/topics/assistant/ov_grid3_thumb.js
@@ -0,0 +1,20 @@
+//Starting Javascript
+
+document.modify.header.value = '\n[SECTION_TITLE]
\n\n
\n';
+document.modify.topics_loop.value = '
\n{THUMB}\n
\n[TOPIC_SHORT]\n[READ_MORE]\n
\n[EDITLINK]
\n';
+document.modify.footer.value = '
\n{PREV_NEXT_PAGES}\n
\n
\n';
+
+
+
+// To save as a preset, change this line with your description:
+document.getElementById('presetsdescription').innerHTML = 'Check changed fields';
+
+document.modify.header.style.backgroundColor = '#e8ff98';
+document.modify.topics_loop.style.backgroundColor = '#e8ff98';
+document.modify.footer.style.backgroundColor = '#e8ff98';
+
+document.getElementById('linktabarea3').style.backgroundColor = '#e8ff98';
+showtabarea(3);
+
+
+alert("Done");
\ No newline at end of file
diff --git a/wbce/modules/topics/assistant/ov_grid3_thumb.png b/wbce/modules/topics/assistant/ov_grid3_thumb.png
new file mode 100644
index 000000000..b625d279b
Binary files /dev/null and b/wbce/modules/topics/assistant/ov_grid3_thumb.png differ
diff --git a/wbce/modules/topics/assistant/ov_grid4_pic.js b/wbce/modules/topics/assistant/ov_grid4_pic.js
new file mode 100644
index 000000000..7a7bf4f83
--- /dev/null
+++ b/wbce/modules/topics/assistant/ov_grid4_pic.js
@@ -0,0 +1,19 @@
+//Starting Javascript
+
+document.modify.header.value = '\n\n\n\n[SECTION_TITLE]
\n\n
\n';
+document.modify.topics_loop.value = '\n
\n
\n\n
\n[TOPIC_SHORT]\n
\n[EDITLINK]
\n';
+document.modify.footer.value = '
\n{PREV_NEXT_PAGES}\n
\n
\n';
+
+
+
+// To save as a preset, change this line with your description:
+document.getElementById('presetsdescription').innerHTML = 'Check changed fields';
+
+document.modify.header.style.backgroundColor = '#e8ff98';
+document.modify.topics_loop.style.backgroundColor = '#e8ff98';
+document.modify.footer.style.backgroundColor = '#e8ff98';
+
+document.getElementById('linktabarea3').style.backgroundColor = '#e8ff98';
+showtabarea(3);
+
+alert("Done");
\ No newline at end of file
diff --git a/wbce/modules/topics/assistant/ov_grid4_pic.png b/wbce/modules/topics/assistant/ov_grid4_pic.png
new file mode 100644
index 000000000..52793b761
Binary files /dev/null and b/wbce/modules/topics/assistant/ov_grid4_pic.png differ
diff --git a/wbce/modules/topics/assistant/ov_grid4_thumb.png b/wbce/modules/topics/assistant/ov_grid4_thumb.png
new file mode 100644
index 000000000..54de33c14
Binary files /dev/null and b/wbce/modules/topics/assistant/ov_grid4_thumb.png differ
diff --git a/wbce/modules/topics/assistant/ov_standard.js b/wbce/modules/topics/assistant/ov_standard.js
new file mode 100644
index 000000000..15f9c78b3
--- /dev/null
+++ b/wbce/modules/topics/assistant/ov_standard.js
@@ -0,0 +1,17 @@
+//Starting Javascript
+
+document.modify.header.value = '\n[SECTION_TITLE]
\n';
+document.modify.topics_loop.value = '\n{THUMB}\n
{TITLE}
\n[TOPIC_SHORT]\n[READ_MORE][EDITLINK]
\n
\n';
+document.modify.footer.value = '{PREV_NEXT_PAGES}\n';
+
+// To save as a preset, change this line with your description:
+document.getElementById('presetsdescription').innerHTML = 'Check changed fields';
+
+document.modify.header.style.backgroundColor = '#e8ff98';
+document.modify.topics_loop.style.backgroundColor = '#e8ff98';
+document.modify.footer.style.backgroundColor = '#e8ff98';
+
+document.getElementById('linktabarea3').style.backgroundColor = '#e8ff98';
+showtabarea(3);
+
+alert("Done");
\ No newline at end of file
diff --git a/wbce/modules/topics/assistant/ov_standard.png b/wbce/modules/topics/assistant/ov_standard.png
new file mode 100644
index 000000000..abda4f916
Binary files /dev/null and b/wbce/modules/topics/assistant/ov_standard.png differ
diff --git a/wbce/modules/topics/assistant/pnsa_standard-en.js b/wbce/modules/topics/assistant/pnsa_standard-en.js
new file mode 100644
index 000000000..4a0494d1c
--- /dev/null
+++ b/wbce/modules/topics/assistant/pnsa_standard-en.js
@@ -0,0 +1,24 @@
+//Starting Javascript
+selectDropdownOption (document.modify.pnsa_max, 4);
+document.modify.see_also_link_title.value = 'See also:
';
+document.modify.next_link_title.value = 'Newer Topics:
';
+document.modify.previous_link_title.value = 'Older Topics:
';
+document.modify.pnsa_string.value = '[THUMB]\n[TITLE]
\n[SHORT_DESCRIPTION]\n\n\n';
+document.modify.sa_string.value = '[THUMB]\n[TITLE]
\n[SHORT_DESCRIPTION]\n\n\n';
+
+
+// To save as a preset, change this line with your description:
+document.getElementById('presetsdescription').innerHTML = 'Check changed fields';
+
+document.modify.pnsa_max.style.backgroundColor = '#e8ff98';
+document.modify.see_also_link_title.style.backgroundColor = '#e8ff98';
+document.modify.next_link_title.style.backgroundColor = '#e8ff98';
+document.modify.previous_link_title.style.backgroundColor = '#e8ff98';
+document.modify.pnsa_string.style.backgroundColor = '#e8ff98';
+document.modify.sa_string.style.backgroundColor = '#e8ff98';
+
+document.getElementById('linktabarea5').style.backgroundColor = '#e8ff98';
+
+showtabarea(5);
+
+alert("Done");
\ No newline at end of file
diff --git a/wbce/modules/topics/assistant/pnsa_standard-en.png b/wbce/modules/topics/assistant/pnsa_standard-en.png
new file mode 100644
index 000000000..1c9673142
Binary files /dev/null and b/wbce/modules/topics/assistant/pnsa_standard-en.png differ
diff --git a/wbce/modules/topics/assistant/pnsa_standard.js b/wbce/modules/topics/assistant/pnsa_standard.js
new file mode 100644
index 000000000..ddf647792
--- /dev/null
+++ b/wbce/modules/topics/assistant/pnsa_standard.js
@@ -0,0 +1,24 @@
+//Starting Javascript
+selectDropdownOption (document.modify.pnsa_max, 4);
+document.modify.see_also_link_title.value = 'Siehe auch:
';
+document.modify.next_link_title.value = 'Neuere Themen:
';
+document.modify.previous_link_title.value = 'Ältere Themen:
';
+document.modify.pnsa_string.value = '[THUMB]\n[TITLE]
\n[SHORT_DESCRIPTION]\n\n\n';
+document.modify.sa_string.value = '[THUMB]\n[TITLE]
\n[SHORT_DESCRIPTION]\n\n\n';
+
+
+// To save as a preset, change this line with your description:
+document.getElementById('presetsdescription').innerHTML = 'Check changed fields';
+
+document.modify.pnsa_max.style.backgroundColor = '#e8ff98';
+document.modify.see_also_link_title.style.backgroundColor = '#e8ff98';
+document.modify.next_link_title.style.backgroundColor = '#e8ff98';
+document.modify.previous_link_title.style.backgroundColor = '#e8ff98';
+document.modify.pnsa_string.style.backgroundColor = '#e8ff98';
+document.modify.sa_string.style.backgroundColor = '#e8ff98';
+
+document.getElementById('linktabarea5').style.backgroundColor = '#e8ff98';
+
+showtabarea(5);
+
+alert("Done");
\ No newline at end of file
diff --git a/wbce/modules/topics/assistant/pnsa_standard.png b/wbce/modules/topics/assistant/pnsa_standard.png
new file mode 100644
index 000000000..31d9de2e1
Binary files /dev/null and b/wbce/modules/topics/assistant/pnsa_standard.png differ
diff --git a/wbce/modules/topics/assistant/presets.psd b/wbce/modules/topics/assistant/presets.psd
new file mode 100644
index 000000000..48dcb60b6
Binary files /dev/null and b/wbce/modules/topics/assistant/presets.psd differ
diff --git a/wbce/modules/topics/assistant/tp_simple.js b/wbce/modules/topics/assistant/tp_simple.js
new file mode 100644
index 000000000..69d114137
--- /dev/null
+++ b/wbce/modules/topics/assistant/tp_simple.js
@@ -0,0 +1,17 @@
+//Starting Javascript
+document.modify.topic_header.value = '\n\n
[TITLE]
\n
{PICTURE}[TOPIC_SHORT]
\n';
+document.modify.topic_footer.value = '\n
Back
\n[EDITLINK]\n
\n';
+document.modify.topic_block2.value = '';
+
+// To save as a preset, change this line with your description:
+document.getElementById('presetsdescription').innerHTML = 'Check changed fields';
+
+document.modify.topic_header.style.backgroundColor = '#e8ff98';
+document.modify.topic_footer.style.backgroundColor = '#e8ff98';
+document.modify.topic_block2.style.backgroundColor = '#e8ff98';
+
+document.getElementById('linktabarea4').style.backgroundColor = '#e8ff98';
+showtabarea(4);
+
+
+alert("Done");
\ No newline at end of file
diff --git a/wbce/modules/topics/assistant/tp_simple.png b/wbce/modules/topics/assistant/tp_simple.png
new file mode 100644
index 000000000..e017a17d3
Binary files /dev/null and b/wbce/modules/topics/assistant/tp_simple.png differ
diff --git a/wbce/modules/topics/assistant/tp_simple_wide.js b/wbce/modules/topics/assistant/tp_simple_wide.js
new file mode 100644
index 000000000..bb222a233
--- /dev/null
+++ b/wbce/modules/topics/assistant/tp_simple_wide.js
@@ -0,0 +1,17 @@
+//Starting Javascript
+document.modify.topic_header.value = '\n\n
[TITLE]
\n
{THUMB}[TOPIC_SHORT]
\n
';
+document.modify.topic_footer.value = '[ADDITIONAL_PICTURES]\n\n
Back
\n[EDITLINK]\n
\n';
+document.modify.topic_block2.value = '';
+
+// To save as a preset, change this line with your description:
+document.getElementById('presetsdescription').innerHTML = 'Check changed fields';
+
+document.modify.topic_header.style.backgroundColor = '#e8ff98';
+document.modify.topic_footer.style.backgroundColor = '#e8ff98';
+document.modify.topic_block2.style.backgroundColor = '#e8ff98';
+
+document.getElementById('linktabarea4').style.backgroundColor = '#e8ff98';
+showtabarea(4);
+
+
+alert("Done");
\ No newline at end of file
diff --git a/wbce/modules/topics/assistant/tp_simple_wide.png b/wbce/modules/topics/assistant/tp_simple_wide.png
new file mode 100644
index 000000000..58cf84715
Binary files /dev/null and b/wbce/modules/topics/assistant/tp_simple_wide.png differ
diff --git a/wbce/modules/topics/assistant/tp_standard.js b/wbce/modules/topics/assistant/tp_standard.js
new file mode 100644
index 000000000..c6f679efa
--- /dev/null
+++ b/wbce/modules/topics/assistant/tp_standard.js
@@ -0,0 +1,19 @@
+//Starting Javascript
+document.modify.topic_header.value = '\n\n
[TITLE]
\n
[USER_DISPLAY_NAME] ([USER_NAME]) on [PUBL_DATE]
\n[USER_MODIFIEDINFO]\n
{PICTURE}[TOPIC_SHORT]
\n
\n[ADDITIONAL_PICTURES]\n';
+document.modify.topic_footer.value = '
\n{SEE_ALSO}{SEE_PREVNEXT}\n
\n
Back
\n[EDITLINK]\n
\n';
+document.modify.topic_block2.value = '\n\n{PICTURE}\n[TOPIC_SHORT]\n{SEE_ALSO}{SEE_PREVNEXT}\n
\n';
+
+
+
+// To save as a preset, change this line with your description:
+document.getElementById('presetsdescription').innerHTML = 'Check changed fields';
+
+document.modify.topic_header.style.backgroundColor = '#e8ff98';
+document.modify.topic_footer.style.backgroundColor = '#e8ff98';
+document.modify.topic_block2.style.backgroundColor = '#e8ff98';
+
+document.getElementById('linktabarea4').style.backgroundColor = '#e8ff98';
+showtabarea(4);
+
+
+alert("Done");
\ No newline at end of file
diff --git a/wbce/modules/topics/assistant/tp_standard.png b/wbce/modules/topics/assistant/tp_standard.png
new file mode 100644
index 000000000..2c9ab7dfc
Binary files /dev/null and b/wbce/modules/topics/assistant/tp_standard.png differ
diff --git a/wbce/modules/topics/backend.css b/wbce/modules/topics/backend.css
index d182908c0..e59d5f6d4 100644
--- a/wbce/modules/topics/backend.css
+++ b/wbce/modules/topics/backend.css
@@ -23,6 +23,7 @@ td {
.tpfw30 {width:30%;}
.tpfh30 {height:30px;}
.tpfh60 {height:60px;}
+.inputf.tpf-small {width:40px; margin-right:20px;}
.mod_moduledirectory_edit_css {float:right;}
@@ -86,6 +87,10 @@ a img {border:0;}
.mod_topics_edit_css {display:inline; }
+.assistantpresets td {padding: 0 0 0 5px; border-left: 1px solid #999; line-height:140%;}
+.assistantpresets a {padding: 5px 5px 0 0; opacity:0.5; transition: 1s opacity;}
+.assistantpresets a:hover {opacity:0.9; }
+
/*list Page*/
.topiclist-toptable {width:100%;}
@@ -123,7 +128,7 @@ td .topicprops {width:150px;}
.pnsa_links {width:100%;}
.pnsa_links td.pn_links a {font-size:11px; font-weight:normal;}
-/*Bei sehr großen Thumbs: Verkleinerung erzwingen*/
+/*Bei sehr groszen Thumbs: Verkleinerung erzwingen*/
.pnsa_links td.pn_links a img, .pnsa_links td.sa_links a img {max-width:50px; max-height:50px; clear:left; float:left; margin:0 5px 20px 0;}
@@ -181,6 +186,8 @@ input.mod_topics_edit_css {
#topics_picturechooser iframe {height:100%; width:100%; margin:0; padding:0; border:0;}
.topicpic_preview_close {width:100%; height:20px; text-align:right; background-color:#ddd;}
+.topicpic_preview_closebox {display:block; float:right; width:20px; height:20px; background: url(img/closebox.png) no-repeat;}
+
.topicpic_preview {float:left; margin:10px; width:140px; height:100px; overflow:hidden;}
.topicpic_preview img {max-width:140px; border:0; text-align:center}
diff --git a/wbce/modules/topics/backend.js b/wbce/modules/topics/backend.js
index 0e07e3927..8eb18c8d4 100644
--- a/wbce/modules/topics/backend.js
+++ b/wbce/modules/topics/backend.js
@@ -3,10 +3,10 @@ innerw = 0.8*window.innerWidth;
//if (innerh < 500) innerh = 500;
//if (innerw < 768) innerw = 768;
-var lastopentab = 0;
+var lastopentab = 1;
$( document ).ready(function() {
- $( "body" ).append( '');
+ $( "body" ).append( '');
document.getElementById('topics_picturechooser').style.height = innerh+"px";
document.getElementById('topics_chooser_overlay').style.width = innerw+"px";
@@ -74,9 +74,10 @@ function closeadditionalpictures () {
/*--------- END NewUploader ---------------*/
function makevisible(what) {
- document.getElementById(what).style.display="block";
- if (what != 'getfromtable' && document.getElementById("getfromtable")) document.getElementById("getfromtable").style.display="none";
- if (what != 'presetstable' && document.getElementById("presetstable")) document.getElementById("presetstable").style.display="none";
+ document.getElementById("getfromtable").style.display="none";
+ document.getElementById("presetstable").style.display="none";
+ document.getElementById("assistant").style.display="none";
+ document.getElementById(what).style.display="block";
}
@@ -126,15 +127,20 @@ function changesettings(sid) {
}
-function changepresets(thefile) {
+function changepresets(thefile, what) {
- if (!thelanguage) {thelanguage = "en";}
+ var thelanguage = "en";
if( !document.createElement ) {
alert('No createElement, sorry');
return;
}
- fn = 'presets-'+thelanguage+'/'+thefile+'.js';
+ var d = new Date();
+ var n = d.getMilliseconds();
+
+ fn = 'presets-'+thelanguage+'/'+thefile+'.js?t='+n;
+ if (what == 'as') {fn = 'assistant/'+thefile+'.js?t='+n;}
+
if (thefile.substr(0,3) == '../') {fn = thefile; }
if (script) {
@@ -264,20 +270,32 @@ function openpicturemodify(picfile) {
//----------------------------------------------------------------
+function tp_changedmetafield(ths) {
+ var v = ths.value;
+ v = v.trim();
+ v = v.replace(/(\r\n|\n|\r)/gm," ");
+ v = v.replace(/\s+/g," ");
+ if (ths.type = 'input') {
+ ths.value = v;
+ } else {
+ ths.text = v;
+ }
+ //alert(v);
+}
+
function copythistopic() {
document.getElementById('copytopic').value = 1;
document.modify.submit();
}
function showtabarea(nr) {
-
if (nr==0) {
if (localStorage['topics_lastopentab'+section_id]) {
lastopentab = parseInt( localStorage['topics_lastopentab'+section_id]);
if (lastopentab > 0) {nr = lastopentab;}
}
}
- if (nr==0) nr=1;
+ if (nr==0) {nr=1;}
i=0;
while (i < 7) {
@@ -285,17 +303,10 @@ function showtabarea(nr) {
nar = '#linktabarea'+i;
if (i == nr) {
- document.getElementById('tabarea'+i).style.display = "block";
- //document.getElementById('linktabarea'+i).style.borderBottom = "0";
- //document.getElementById('linktabarea'+i).style.backgroundColor = "#fff";
- $(nar).addClass( "activeTab" );
-
- } else {
-
- document.getElementById('tabarea'+i).style.display = "none";
- if (document.getElementById('linktabarea'+i)) {
-
- }
+ document.getElementById('tabarea'+i).style.display = "block";
+ $(nar).addClass( "activeTab" );
+ } else {
+ document.getElementById('tabarea'+i).style.display = "none";
$(nar).removeClass( "activeTab" );
}
}
@@ -303,9 +314,10 @@ function showtabarea(nr) {
localStorage.setItem('topics_lastopentab'+section_id, nr);
$('.settingsform input, .settingsform textarea').css({"background-color": "none"});
- //window.localStorage.clear(); //try that
+ //window.localStorage.clear(); //testing
}
+/*
function showtabareajQuery(nr) {
//Funktioniert leider nicht
n = '#tabarea'+lastopentab;
@@ -321,5 +333,5 @@ function showtabareajQuery(nr) {
lastopentab = nr;
}
-
+*/
diff --git a/wbce/modules/topics/comments_ajax/comments.js b/wbce/modules/topics/comments_ajax/comments.js
index 358d77d6e..0c380ba20 100644
--- a/wbce/modules/topics/comments_ajax/comments.js
+++ b/wbce/modules/topics/comments_ajax/comments.js
@@ -77,7 +77,7 @@ function validateForm() {
}
m = document.c_mment_form.themoil.value;
- //if (m != '') { //Wenn vorhanden, dann muss gültig sein
+ //if (m != '') { //Wenn vorhanden, dann muss gueltig sein
p1=m.indexOf('@');
p2=m.indexOf('.');
if (emailsettings > 1) {
diff --git a/wbce/modules/topics/comments_iframe/comment.php b/wbce/modules/topics/comments_iframe/comment.php
index be49aa533..0563ce8df 100644
--- a/wbce/modules/topics/comments_iframe/comment.php
+++ b/wbce/modules/topics/comments_iframe/comment.php
@@ -123,7 +123,7 @@
// Include index (wrapper) file
//require(WB_PATH.'/index.php');
- //von Chio eingefügt
+ //von Chio eingefuegt
require(WB_PATH.'/modules/'.$mod_dir.'/comments_iframe/commentframe.php');
diff --git a/wbce/modules/topics/comments_iframe/commentdone.php b/wbce/modules/topics/comments_iframe/commentdone.php
index d9b0c8878..7ec1eefcf 100644
--- a/wbce/modules/topics/comments_iframe/commentdone.php
+++ b/wbce/modules/topics/comments_iframe/commentdone.php
@@ -122,7 +122,7 @@ function doresize() {
$values = array($name, $comment['email'], $comment['website'], $thecomment, '', '', '0', '', '', $nameLink);
$outputjs = str_replace($vars, $values, $setting_comments_loop);
- $outputjs = preg_replace('/\s+/', ' ', $outputjs); //einzeilig für Javascript
+ $outputjs = preg_replace('/\s+/', ' ', $outputjs); //einzeilig fuer Javascript
$outputjs = addslashes($outputjs);
echo '
\ No newline at end of file
diff --git a/wbce/modules/topics/extras/copy_news.inc.php b/wbce/modules/topics/extras/copy_news.inc.php
index 8683772d1..f7b5275be 100644
--- a/wbce/modules/topics/extras/copy_news.inc.php
+++ b/wbce/modules/topics/extras/copy_news.inc.php
@@ -107,7 +107,7 @@
$position = $post['position'];
$content_short = ''.$post['content_short'];
$content_long = $post['content_long'];
- //$short_description = $post['content_short']; //Wird nicht übertragen
+ //$short_description = $post['content_short']; //Wird nicht uebertragen
$description = makemetadescription ( strip_tags($content_short . ' ' . $title) );
$keywords = makemetakeywords ( strtolower(strip_tags($title .' '.$content_short)));
diff --git a/wbce/modules/topics/frontend.css b/wbce/modules/topics/frontend.css
index e5403ae71..08f2af1f0 100644
--- a/wbce/modules/topics/frontend.css
+++ b/wbce/modules/topics/frontend.css
@@ -1,3 +1,7 @@
+/*simple basics*/
+.tp_pic {max-width:100%;}
+
+
/* List Page */
.mod_topic_loop {
margin-bottom:30px;
@@ -40,10 +44,14 @@ Topic Page*/
.mod_topic_page .tp_date {float:right; color:#aaaaaa; font-size: 11px;}
.mod_topic_page .tp_teaser {} /*[Short]*/
.mod_topic_page .tp_teaser img.tp_pic {max-width: 48%; float:left; margin:4px 4% 2px 0;}
+.mod_topic_page .tp_teaser_right img.tp_pic {float:right; margin:4px 0 2px 4%;}
.mod_topic_back {font-size: 14px; margin: 20px 0 0 0; font-weight: bold;}
.mod_topic_edit {font-size: 14px; margin: 20px 0 0 0; font-weight: bold;}
+.mod_topic_page .tp_teaser-mobile {display:none;}
+.mod_topic_page .tp_teaser-mobile img {}
+
/*Previous, Next, Also see */
/*topic_block2*/
@@ -63,49 +71,30 @@ a.pnsa_block:hover {background: rgba(200, 200, 200, 0.2); padding: 5px 0 10px 0;
.topic_block2 .tp_pic {max-width:100%;}
-/*Responsive*/
-@media (max-width: 480px) {
- .mod_topic_page .tp_teaser {margin-bottom:20px; padding-bottom:5px; border-bottom:1px #999 solid;}
- .mod_topic_page .tp_teaser img.tp_pic {max-width: 100%; float:none; margin:0 0 2px 0;}
-}
/*topic_footer*/
.topic_footer {width:102%;}
.topic_footer a.pnsa_block {float: left; width: 48%; min-width:220px; margin: 0 2% 10px 0; }
.topic_footer a.pnsa_block:hover { padding: 0 0;}
+/*footerpnsa*/
+.tp_footerpnsa {width:102%; clear:both; margin-top:30px;}
+.tp_footerpnsa a.pnsa_block {width:48%; float:left; padding: 0 0; margin:0 2% 20px 0;}
+.tp_footerpnsa.tp-blocks-3 {width:103%; }
+.tp_footerpnsa.tp-blocks-3 a.pnsa_block {width:31%;margin:0 2% 20px 0;}
-.additional_pictures {}
+
+
+.additional_pictures {margin-top:10px;}
.additional_pictures a {float:left; margin: 0 5px 5px 0;}
/* .additional_pictures a img {height:100px;} */
/*Topic Comments*/
-.mod_topic_nocomments {
- font-size: 11px;
- color: #666666;
-}
-.mod_topic_commentbox {
- XXborder: 0;
- XXborder-bottom: 1px solid #666666;
- XXwidth:100%;
- XXmax-width: 400px;
- XXmargin: 10px 0 10px 0;
- XXpadding:10px;
- XXbackground-color: #ffffff;
-}
-
-.mod_topic_commentbox .comment_name {
- margin:0;
- font-weight: bold;
-}
-
-.mod_topic_commentbox .comment_date {float:right; width:100px; text-align:right;
- font-size: 10px;
- color: #666666;
- margin:0;
-}
-
+.mod_topic_nocomments { font-size: 12px; color: #666666;}
+.mod_topic_commentbox {}
+.mod_topic_commentbox .comment_name {margin:0; font-weight: bold;}
+.mod_topic_commentbox .comment_date {float:right; width:100px; text-align:right; font-size: 10px; color: #666666; margin:0;}
.mod_topic_commentbox .comment_text {margin:3px 0; padding-top:5px; border-top: 1px dotted #666;}
@@ -119,42 +108,17 @@ a.pnsa_block:hover {background: rgba(200, 200, 200, 0.2); padding: 5px 0 10px 0;
/*Add Comments iFrame*/
.mod_topic_comment_iframe {width:90%; max-width: 400px; height: 450px;}
-.mod_topic_add_comment {
- /*font-family:"Century Gothic", "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
- color: #2872A6;*/
- font-size: 16px;
- margin: 20px 0 0 5px;
- font-weight: bold;
-}
+.mod_topic_add_comment {font-size: 16px; margin: 20px 0 0 5px; font-weight: bold;}
/*Add Comment Frame*/
/*** Don't remove the class nixhier, this is required for ASP ***/
-.nixhier {
- display:none;
-}
-
-.topicsc_the_f {
- font-size: 12px;
- font-family: Arial, Helvetica, sans-serif;
-}
-
-.topicsc_the_f p {
- margin:4px 0;
-}
+.nixhier { display:none;}
+.topicsc_the_f { font-size: 12px; font-family: Arial, Helvetica, sans-serif; }
-.topicsc_the_f input , .topicsc_the_f textarea {
- border: 1px solid #222222; width:90%;}
+.topicsc_the_f p { margin:4px 0;}
+.topicsc_the_f input , .topicsc_the_f textarea { border: 1px solid #222222; width:90%;}
.topicsc_the_f textarea { height: 120px; font-size: 11px;}
-
-
-
-
-
-.topicsc_the_f td {
- font-size: 12px;
- font-weight: bold;
- color: #000066;
-}
+.topicsc_the_f td { font-size: 12px; font-weight: bold; color: #000066;}
/*--------------LastComments------------------*/
@@ -174,22 +138,34 @@ ul.topic_menu .tp_listactive {font-weight: bold; color:#000000;}
/*Extras:
-3 or 4 Blocks Overview
+2, 3 or 4 Blocks Overview
*/
-.tp-blocks-3 {width:100%; overflow:hidden;}
-.tp-blocks-3 .tp-blocks-inner {width:103%;}
-.tp-blocks-3 .mod_topic_loop {float:left; width:30%; height: 340px; margin: 10px 3% 20px 0; }
+.tp-blocks {width:100%; overflow:hidden;}
+.tp-blocks h3, .tp-blocks p {margin:0;}
+
+.tp-blocks-3 .tp-blocks-inner {width:104.2%;}
+.tp-blocks-3 .mod_topic_loop {float:left; width:30%; margin: 20px 3% 20px 0; }
-.tp-blocks-4 {width:100%; overflow:hidden;}
-.tp-blocks-4 .tp-blocks-inner {width:102%;}
-.tp-blocks-4 .mod_topic_loop {float:left; width:23%; height: 340px; margin: 10px 2% 20px 0; }
+.tp-blocks-2 .tp-blocks-inner, .tp-blocks-4 .tp-blocks-inner {width:102.1%;}
+.tp-blocks-2 .mod_topic_loop {float:left; width:48%; margin: 10px 2% 20px 0; }
+.tp-blocks-4 .mod_topic_loop {float:left; width:23%; margin: 10px 2% 20px 0; }
-.tp-blocks-inner .mod_topic_loop .short_description {display:block; padding:5px 0; }
-.tp-blocks-inner .mod_topic_loop a.loop-pic {display:block; width:100%; XXpadding-bottom:60%; background-size: 101% auto, auto; background-position: center, center; transition:0.5s all;}
+.tp-blocks-inner .mod_topic_loop {border-bottom:0;}
+.tp-blocks-inner .mod_topic_loop a.loop-pic {display:block; width:100%; margin-bottom:6px; background-size: 101% auto, auto; background-position: center, center; transition:0.5s all;}
.tp-blocks-inner .mod_topic_loop a.loop-pic img {width:100%; float:left; opacity:1; transition:0.5s all;}
.tp-blocks-inner .mod_topic_loop a.loop-pic span.miniclear {display:block; height:0; clear:both; }
-.tp-blocks-inner .mod_topic_loop .textblock {height:120px; overflow:hidden; }
+.tp-blocks-3 .mod_topic_loop .textblock {line-height:130%; padding-right:1%;}
+.tp-blocks-3.tp_thumbsblock .mod_topic_loop .textblock_thumb {line-height:130%; padding-right:1%;}
+.tp-blocks-3.tp_thumbsblock .mod_topic_loop .tp_thumb { margin-bottom: 5px; }
+
+
+.tp-blocks-2 .tpcount2-1 {clear:left;}
+.tp-blocks-3 .tpcount12-4, .tp-blocks-3 .tpcount12-7, .tp-blocks-3 .tpcount12-10, .tp-blocks-3 .tpcount12-1 {clear:left;}
+.tp-blocks-4 .tpcount12-5, .tp-blocks-4 .tpcount12-9, .tp-blocks-4 .tpcount12-1 {clear:left;}
+
+/*ausnahmen*/
+.tp_content_wide .tp_thumb {float:left; max-width: 24%; margin:3px 2% 2px 0; }
/*some effects:*/
@@ -197,18 +173,45 @@ ul.topic_menu .tp_listactive {font-weight: bold; color:#000000;}
.tp-blocks-inner .mod_topic_loop a.loop-pic:hover {background-size: 140% auto, auto; }
/*--------------Responsive------------------*/
-@media screen and (max-width: 800px) {
-
+@media screen and (max-width: 768px) {
+
+ .tp-blocks-3 .tp-blocks-inner, .tp-blocks-4 .tp-blocks-inner {width:102%;}
+ .tp-blocks-4 .mod_topic_loop, .tp-blocks-3 .mod_topic_loop { width:47.8%; margin: 10px 2% 20px 0; }
+
+ .tp-blocks-3 .tpcount12-4, .tp-blocks-3 .tpcount12-7, .tp-blocks-3 .tpcount12-10 {clear:none;}
+ .tp-blocks-3 .tpcount12-3, .tp-blocks-3 .tpcount12-5, .tp-blocks-3 .tpcount12-7, .tp-blocks-3 .tpcount12-9, .tp-blocks-3 .tpcount12-11 {clear:left;}
+ .tp-blocks-4 .tpcount12-3, .tp-blocks-4 .tpcount12-7, .tp-blocks-4 .tpcount12-9, .tp-blocks-4 .tpcount12-11 {clear:left;}
- .tp-blocks-4 .mod_topic_loop { width:47.8%; }
+ .tp-blocks.tp_thumbsblock .tp-blocks-inner, .tp-blocks.tp_thumbsblock .mod_topic_loop {float:none; clear:both; width:100%; min-height: 20px; height: auto ! important; margin: 10px 0 10px 0; padding-bottom:10px;}
+
+ .mod_topic_page .tp_teaser-mobile {display:block;}
+ .mod_topic_page .tp_teaser-mobile img {max-width:48%; float:left; margin:0 4% 0 0;}
+
+
+ /*footer*/
+ .tp_footerpnsa.tp-blocks-3 {width:102%; }
+ .tp_footerpnsa.tp-blocks-3 a.pnsa_block {width:48%;}
}
@media screen and (max-width: 480px) {
+ .mod_topic_page .tp_teaser {margin-bottom:20px; padding-bottom:5px; border-bottom:1px #999 solid;}
+ .mod_topic_page .tp_teaser img.tp_pic {max-width: 100%; float:none; margin:0 0 2px 0;}
- .tp-blocks-3 .tp-blocks-inner, .tp-blocks-4 .tp-blocks-inner {width:100%;}
- .tp-blocks-3 .mod_topic_loop, .tp-blocks-4 .mod_topic_loop {float:none; width:100%; height: auto; margin: 10px 0 20px 0; }
- .tp-blocks-inner .mod_topic_loop .textblock {height:auto; overflow:show; }
+ .tp-blocks-2 .tp-blocks-inner, .tp-blocks-3 .tp-blocks-inner, .tp-blocks-4 .tp-blocks-inner {width:100%;}
+ .tp-blocks-2 .mod_topic_loop, .tp-blocks-3 .mod_topic_loop, .tp-blocks-4 .mod_topic_loop {float:none; width:100%; min-height: 20px; height: auto ! important; margin: 10px 0 20px 0; padding-bottom:20px;}
+ .tp-blocks-inner .mod_topic_loop .textblock {height:auto ! important; }
+
+ .mod_topic_page .tp_teaser-mobile img {max-width:100%;}
+
+ .tp_content_wide .tp_pic {clear: both; float:none; width:100%; margin: 10px 0 10px 0 ! important; }
+
+ /*footer*/
+ .tp_footerpnsa, .tp_footerpnsa a.pnsa_block, .tp_footerpnsa.tp-blocks-3, .tp_footerpnsa.tp-blocks-3 a.pnsa_block {width:100%; float:none; margin-left:0;}
+
+ .additional_pictures a {max-width:45%;}
+ .additional_pictures a img {max-width:100%;}
+
}
diff --git a/wbce/modules/topics/functions.php b/wbce/modules/topics/functions.php
index 8297f32ba..037aa8386 100644
--- a/wbce/modules/topics/functions.php
+++ b/wbce/modules/topics/functions.php
@@ -10,13 +10,12 @@
function makemetadescription ($thestring) {
- $the_description = stripslashes($thestring);
+ $the_description = html_entity_decode(stripslashes($thestring));
$wsp = "\\x00-\\x20"; //all white-spaces and control chars
$the_description = preg_replace( "/[".$wsp."]+/" , ' ', $the_description );
- $the_description = str_replace('"', ' ', $the_description);
- $the_description = str_replace("'", ' ', $the_description);
- $the_description = str_replace('\'', ' ', $the_description);
+ $bad = array('"', "'", '\'',' ',' ',' ');
+ $the_description = str_replace($bad, ' ', $the_description);
if (strlen($the_description) > 160) {
if(preg_match('/.{0,160}(?:[.!?:,])/su', $the_description, $match)) { $the_description = $match[0]; } //thanks to thorn
@@ -25,23 +24,15 @@ function makemetadescription ($thestring) {
if ($pos > 0) {$the_description = substr($the_description, 0, $pos); }
}
}
- //$the_description = ' '.$the_description;
- $the_description = trim(str_replace(' ',' ',$the_description));
- $the_description = trim(str_replace(' ',' ',$the_description));
-
return (' '.$the_description);
}
function makemetakeywords ($thestring ) {
- $the_keywords = $thestring;
- if (strlen($the_keywords) > 100) {
- if(preg_match('/.{0,100}(?:[.!?:,])/su', $the_keywords, $match)) { $the_keywords = $match[0]; } //thanks to thorn
- if (strlen($the_keywords) > 100) {
- $pos = strpos($the_keywords, " ", 100);
- if ($pos > 0) {$the_keywords = substr($the_keywords, 0, $pos); }
- }
- }
+ $the_keywords = html_entity_decode(stripslashes($thestring));
+ $wsp = "\\x00-\\x20"; //all white-spaces and control chars
+ $the_keywords = preg_replace( "/[".$wsp."]+/" , ' ', $the_keywords );
+
$bad = array(
'\'', /* / */ '"', /* " */ '<', /* < */ '>', /* > */
'{', /* { */ '}', /* } */ '[', /* [ */ ']', /* ] */ '`', /* ` */
@@ -51,9 +42,16 @@ function makemetakeywords ($thestring ) {
';', /* ; */ ':', /* : */ ' ', /* */ '.', /* . */ '?' /* ? */
);
$the_keywords = str_replace($bad, ',', $the_keywords);
- $the_keywords = str_replace(',,,',',',$the_keywords);
- $the_keywords = str_replace(',,',',',$the_keywords);
-
+ $the_keywordsArr = explode(',',$the_keywords);
+ $the_keywordsArr2 = array(); $ksum = 0;
+ foreach ($the_keywordsArr as $k) {
+ if (strlen($k) < 4) {continue;}
+ if (in_array($k, $the_keywordsArr2)) {continue;}
+ $the_keywordsArr2[] = $k;
+ $ksum += strlen($k);
+ if ($ksum > 60) {break;}
+ }
+ $the_keywords = implode(', ',$the_keywordsArr2);
return (' '.$the_keywords);
}
@@ -83,7 +81,7 @@ function topics_move_topic($movetopic) {
$newpicture_dir = $sections_fetch['picture_dir'];
if ($restrict2picdir > 0 AND $newpicture_dir != $picture_dir) { die('No Permission'); }
- //Hier muss überprüft werden, ob der User überhaupt in die andere Section speichern darf.
+ //Hier muss ueberprueft werden, ob der User ueberhaupt in die andere Section speichern darf.
if (!$admin->get_page_permission($sections_fetch['page_id'])) { die('No Permission'); }
//------------------------------------------------------------
diff --git a/wbce/modules/topics/functions_small.php b/wbce/modules/topics/functions_small.php
index 043eff3b4..cbd45bfa7 100644
--- a/wbce/modules/topics/functions_small.php
+++ b/wbce/modules/topics/functions_small.php
@@ -6,140 +6,139 @@
exit(0);
}
-function topics_localtime() {
- //return time();
- return gmmktime ( (int) gmdate("H"), (int) gmdate("i"), (int) gmdate("s"), (int) gmdate("n"), (int) gmdate("j"), (int) gmdate("Y")) + DEFAULT_TIMEZONE;
-}
-
-function topics_update_comments_count ($topic_id) {
- global $database;
- $mod_dir = basename(dirname(__FILE__));
- $tablename = $mod_dir;
-
- $theq = "SELECT * FROM ".TABLE_PREFIX."mod_".$tablename."_comments WHERE topic_id = '".$topic_id."' AND active>'0'";
- $query_comments = $database->query($theq);
- $comments_count = $query_comments->numRows();
-
- $theq = "UPDATE ".TABLE_PREFIX."mod_".$tablename." SET comments_count = '".$comments_count."' WHERE topic_id = '".$topic_id."'";
- $database->query($theq);
-
-}
-
-
-
-function topics_commentsclass ($comments_count) {
- $commentsclass = 0;
- if ($comments_count > 0) {$commentsclass = 1;
- if ($comments_count > 2) {$commentsclass = 2;
- if ($comments_count > 5) {$commentsclass = 3;
- if ($comments_count > 8) {$commentsclass = 4;}
+if (!function_exists('topics_localtime')) {
+ function topics_localtime() {
+ //return time();
+ return gmmktime ( (int) gmdate("H"), (int) gmdate("i"), (int) gmdate("s"), (int) gmdate("n"), (int) gmdate("j"), (int) gmdate("Y")); // + DEFAULT_TIMEZONE;
+ }
+
+ function topics_update_comments_count ($topic_id) {
+ global $database;
+ $mod_dir = basename(dirname(__FILE__));
+ $tablename = $mod_dir;
+
+ $theq = "SELECT * FROM ".TABLE_PREFIX."mod_".$tablename."_comments WHERE topic_id = '".$topic_id."' AND active>'0'";
+ $query_comments = $database->query($theq);
+ $comments_count = $query_comments->numRows();
+
+ $theq = "UPDATE ".TABLE_PREFIX."mod_".$tablename." SET comments_count = '".$comments_count."' WHERE topic_id = '".$topic_id."'";
+ $database->query($theq);
+
+ }
+
+
+
+ function topics_commentsclass ($comments_count) {
+ $commentsclass = 0;
+ if ($comments_count > 0) {$commentsclass = 1;
+ if ($comments_count > 2) {$commentsclass = 2;
+ if ($comments_count > 5) {$commentsclass = 3;
+ if ($comments_count > 8) {$commentsclass = 4;}
+ }
}
}
+ return $commentsclass;
}
- return $commentsclass;
-}
-
-function get_sort_topics_by($sort_topics) {
-
- switch ($sort_topics) {
- case 0: return(' position DESC');
- case 1: return(' published_when DESC, posted_first DESC');
- case 2: return(' topic_score DESC');
- case 3: return(' published_when ASC');
- case 4: return(' title ASC');
-
- case -1: return(' position ASC');
- case -2: return(' published_when ASC, posted_first ASC');
- case -3: return(' topic_score ASC');
- case -4: return(' published_when DESC');
- case -5: return(' title DESC');
+
+ function get_sort_topics_by($sort_topics) {
+
+ switch ($sort_topics) {
+ case 0: return(' position DESC');
+ case 1: return(' published_when DESC, posted_first DESC');
+ case 2: return(' topic_score DESC');
+ case 3: return(' published_when ASC');
+ case 4: return(' title ASC');
+
+ case -1: return(' position ASC');
+ case -2: return(' published_when ASC, posted_first ASC');
+ case -3: return(' topic_score ASC');
+ case -4: return(' published_when DESC');
+ case -5: return(' title DESC');
+ }
}
-}
-
-
-
-function users_lowest_groupid() {
- //obsolete?
- global $database;
- global $authorsgroup;
-
- if (!isset($_SESSION["GROUPS_ID"])) {return 0;};
-
- //Das wird wohl einfacher gehen:
- //In welcher (niedrigsten) Gruppe ist der aktuelle User?
- //M�glicher Bug: Wie werden Groups > 9 sortiert?
-
- $checkstring = ','.$_SESSION ["GROUPS_ID"].',';
- if (strpos($checkstring, ',1,') !== false) {return 1;}
-
- if ($authorsgroup > 0) {
- if (strpos($checkstring, ','.$authorsgroup.',') !== false) {return $authorsgroup ;}
- //Fallstrick:
- //Ist autorgruppe=3 und und der aktuelle User in Gruppe 2 und 3, dann wird er trotzdem NUR als Autor gef�hrt.
-
+
+
+
+ function users_lowest_groupid() {
+ //obsolete?
+ global $database;
+ global $authorsgroup;
+
+ if (!isset($_SESSION["GROUPS_ID"])) {return 0;};
+
+ //Das wird wohl einfacher gehen:
+ //In welcher (niedrigsten) Gruppe ist der aktuelle User?
+ //M�glicher Bug: Wie werden Groups > 9 sortiert?
+
+ $checkstring = ','.$_SESSION ["GROUPS_ID"].',';
+ if (strpos($checkstring, ',1,') !== false) {return 1;}
+
+ if ($authorsgroup > 0) {
+ if (strpos($checkstring, ','.$authorsgroup.',') !== false) {return $authorsgroup ;}
+ //Fallstrick:
+ //Ist autorgruppe=3 und und der aktuelle User in Gruppe 2 und 3, dann wird er trotzdem NUR als Autor gef�hrt.
+
+ }
+
+ return 0;
}
-
- return 0;
-}
-
-function topics_archive_file ($filename, $t_id, $s_id, $p_id, $create_topics_accessfiles = 0) {
- if ($create_topics_accessfiles != 1) {return 0;}
+ function topics_archive_file ($filename, $t_id, $s_id, $p_id, $create_topics_accessfiles = 0)
+ {
+ if ($create_topics_accessfiles != 1) {return 0;}
+
+ //global $topics_directory;
+ //global $topics_directory_depth;
+ //Asume, everything is alright if we came so far
+ //$filename = WB_PATH.$topics_directory.$link.PAGE_EXTENSION;
+ //echo $filename;
+ if (file_exists($filename)) { unlink($filename);}
- //global $topics_directory;
- //global $topics_directory_depth;
-
- //Asume, everything is alright if we came so far
- //$filename = WB_PATH.$topics_directory.$link.PAGE_EXTENSION;
- //echo $filename;
- if (file_exists($filename)) { unlink($filename);}
-
- // Write to the filename
- $content = '';
- $handle = fopen($filename, 'w');
- fwrite($handle, $content);
- fclose($handle);
+ // Write to the filename
+ $content = 'Auto-archived: '.$link.'';
+ ?>';
+ $handle = fopen($filename, 'w');
+ fwrite($handle, $content);
+ fclose($handle);
+ //echo 'Auto-archived: '.$link.'
';
+ }
+
+ function topics_frontendfooter () {
+ echo '