Add ability to crosspost new thread (max 3 groups).
This commit is contained in:
parent
ff689009ed
commit
932d9a14ad
|
@ -67,6 +67,15 @@ if ($OVERRIDES['enable_post_log'] > 0) {
|
||||||
@$abspeichern = $_REQUEST["abspeichern"];
|
@$abspeichern = $_REQUEST["abspeichern"];
|
||||||
@$references = $_REQUEST["references"];
|
@$references = $_REQUEST["references"];
|
||||||
@$id = $_REQUEST["id"];
|
@$id = $_REQUEST["id"];
|
||||||
|
|
||||||
|
if($type == 'reply') {
|
||||||
|
$max_crosspost = 12;
|
||||||
|
$allow_ngs_edit = false;
|
||||||
|
} else {
|
||||||
|
$max_crosspost = 3;
|
||||||
|
$allow_ngs_edit = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (! isset($group) && isset($newsgroups)) {
|
if (! isset($group) && isset($newsgroups)) {
|
||||||
$group = $newsgroups;
|
$group = $newsgroups;
|
||||||
}
|
}
|
||||||
|
@ -106,6 +115,15 @@ if ($_REQUEST['returngroup']) {
|
||||||
$returngroup = $thisgroup;
|
$returngroup = $thisgroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$linkgroups = preg_split("/[\s,]+/", $returngroup);
|
||||||
|
foreach($linkgroups as $linkgroup) {
|
||||||
|
$linkgroup = trim($linkgroup);
|
||||||
|
if (get_section_by_group($linkgroup)) {
|
||||||
|
$returngroup = $linkgroup;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
echo '<h1 class="np_thread_headline">';
|
echo '<h1 class="np_thread_headline">';
|
||||||
echo '<a href="' . $file_index . '" target=' . $frame['menu'] . '>' . basename(getcwd()) . '</a> / ';
|
echo '<a href="' . $file_index . '" target=' . $frame['menu'] . '>' . basename(getcwd()) . '</a> / ';
|
||||||
echo '<a href="' . $file_thread . '?group=' . rawurlencode($returngroup) . '" target=' . $frame["content"] . '>' . htmlspecialchars(group_display_name($returngroup)) . '</a>';
|
echo '<a href="' . $file_thread . '?group=' . rawurlencode($returngroup) . '" target=' . $frame["content"] . '>' . htmlspecialchars(group_display_name($returngroup)) . '</a>';
|
||||||
|
@ -219,7 +237,13 @@ if ($type == "post") {
|
||||||
$type = "retry";
|
$type = "retry";
|
||||||
$error = $text_post["missing_subject"];
|
$error = $text_post["missing_subject"];
|
||||||
}
|
}
|
||||||
|
if($allow_ngs_edit) {
|
||||||
|
$grouptotal = preg_split("/\,/", $newsgroups);
|
||||||
|
if(count($grouptotal) > $max_crosspost) {
|
||||||
|
$type = "retry";
|
||||||
|
$error = "Too many newsgroups";
|
||||||
|
}
|
||||||
|
}
|
||||||
// captcha-check
|
// captcha-check
|
||||||
if (($post_captcha) && (captcha::check() == false)) {
|
if (($post_captcha) && (captcha::check() == false)) {
|
||||||
$type = "retry";
|
$type = "retry";
|
||||||
|
@ -398,6 +422,7 @@ if ($show == 1) {
|
||||||
$ngroups = preg_split("/[\s,]+/", $newsgroups);
|
$ngroups = preg_split("/[\s,]+/", $newsgroups);
|
||||||
$found = false;
|
$found = false;
|
||||||
foreach ($ngroups as $group) {
|
foreach ($ngroups as $group) {
|
||||||
|
$group = trim($group);
|
||||||
if (get_section_by_group($group)) {
|
if (get_section_by_group($group)) {
|
||||||
$found = true;
|
$found = true;
|
||||||
break;
|
break;
|
||||||
|
@ -441,6 +466,17 @@ if ($show == 1) {
|
||||||
echo '</td><td>';
|
echo '</td><td>';
|
||||||
echo '<label for="newsgroups">' . $head->newsgroups . '</label>';
|
echo '<label for="newsgroups">' . $head->newsgroups . '</label>';
|
||||||
echo '</tr><tr>';
|
echo '</tr><tr>';
|
||||||
|
} else {
|
||||||
|
echo '<td align="right"><b>Newsgroups:</b></td>';
|
||||||
|
echo '<td>';
|
||||||
|
if($allow_ngs_edit) {
|
||||||
|
echo '<input tclass="post" type="text" name="fgroups" size="40" value="' . $newsgroups . '">';
|
||||||
|
echo " comma separated, max $max_crosspost groups";
|
||||||
|
} else {
|
||||||
|
echo '<input tclass="post" type="text" name="fgroups" size="40" value="' . $newsgroups . '" readonly>';
|
||||||
|
}
|
||||||
|
echo '</td><td>';
|
||||||
|
echo '</tr><tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<td align="right"><b>' . $text_post["name"] . '</b></td>';
|
echo '<td align="right"><b>' . $text_post["name"] . '</b></td>';
|
||||||
|
|
Loading…
Reference in New Issue