$can_del = $User && $User->hasRight('delete@forums'); // Not to use anymore (JeanYves) $can_edit_own = $User; // $can_edit_own = $User && $User->hasRight('edit_own@forums'); $can_edit_foreign = $User && $User->hasRight('edit_foreign@forums'); if (!isset($topic->topicinfo->IsClosed)) { $topic->topicinfo->IsClosed = false; } echo "<h2 class=\"forumstopic\">"; if ($topic->topicinfo->ThreadDeleted == 'Deleted') { echo "[Deleted]"; } if ($topic->topicinfo->ThreadVisibility == 'ModeratorOnly') { echo "[ModOnly]"; } echo $words->fTrad($topic->topicinfo->IdTitle); if ($User) { $url = $_SERVER['REQUEST_URI']; if (strpos($url, "/reverse") === false) { // THis in order to avoid to concatenate /reverse twice $url .= "/reverse"; } echo ' <a href="' . $url . '" title="' . $words->getSilent('ReverseOrder') . '" ><img src="images/icons/reverse_order.png" alt="' . $words->getSilent('ReverseOrder') . '" /></a> ' . $words->flushBuffer(); } echo "</h2>"; ?> <div class="forumthreadinfo"> <div class="float_left"> <?php if ($topic->topicinfo->IdGroup > 0) {
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // get current request $request = PRequest::get()->request; $words = new MOD_words(); if (!isset($vars['errors']) || !is_array($vars['errors'])) { $vars['errors'] = array(); } $Data = $this->_data; // Retrieve the data to display (set by the controller) $list = $Data->Choices; // Retrieve the possible choices ?> <h2><?php echo $words->fTrad($Data->rPoll->Title); ?> </h2> <p><?php echo $words->fTrad($Data->rPoll->Description); ?> </p> <p><?php echo $words->getFormatted("polls_peoplehavecontributed", $Data->rPoll->Started, $Data->rPoll->Ended, $Data->TotContrib); ?> </p> <?php $styles = array('highlight', 'blank'); // alternating background for table rows $iiMax = count($list); // This retrieve the number of polls
if (in_array('text', $vars['errors'])) { echo '<div class="row error">' . $words->getFormatted("forum_error_post") . '</div>'; } } if (isset($allow_title) && $allow_title) { ?> <div class="row"> <label for="topic_title"><?php echo $words->getFormatted("forum_label_topicTitle"); ?> </label><br/> <?php $topic_titletrad = ""; if (isset($vars['topic_title'])) { if (isset($vars['IdTitle'])) { $topic_titletrad = $words->fTrad($vars['IdTitle']); } else { $topic_titletrad = $vars['topic_title']; } } ?> <input type="text" style="width: 95%" name="topic_title" size="50" maxlength="200" id="topic_title" value="<?php echo $topic_titletrad; ?> "/> </div> <!-- row --> <?php } ?> <div class="row">
$last_url = $url . ($maxPage != 1 ? '/page' . $maxPage : '') . '/#post' . $thread->last_postid; ?> <tr class="<?php echo $styles[$cnt % 2]; ?> "> <td class="forumsboardthreadtitle"> <?php if ($thread->ThreadDeleted == "Deleted") { echo "[Deleted]"; } if ($thread->ThreadVisibility == "ModeratorOnly") { echo "[ModOnly]"; } echo "<a href=\"", $url, "\">"; echo $words->fTrad($thread->IdTitle); ?> </a> <br /> <span class="forumsboardthreadtags"><?php // show tags if post is part of a group if ($thread->IdGroup > 0) { echo "<a href=\"groups/" . $thread->IdGroup . "\"><strong>Group: </strong>", $this->_model->getGroupName($thread->GroupName), "</a><br >"; } $breadcrumb = ''; $ShowHelp = false; // todo process in a better way this hritage of travel book (create a type help for tags) for ($ii = 0; $ii < $thread->NbTags; $ii++) { if ($breadcrumb) { $breadcrumb .= '<span class="small"> | </span>'; }
echo '<img src="styles/css/minimal/images/iconsfam/comment_add.png" alt="' . $words->getBuffered('tags') . '" title="' . $words->getBuffered('tags') . '" />' . $words->flushBuffer(); ?> <?php if ($thread->ThreadDeleted == 'Deleted') { echo "[Deleted]"; } if ($thread->ThreadVisibility == "ModeratorOnly") { echo "[ModOnly]"; } ?> <a href="<?php echo $url; ?> " class="news"> <?php echo $words->fTrad($thread->IdTitle); ?> </a><br /> <span class="small grey"><?php echo $words->getSilent('by'); ?> <a href="members/<?php echo $thread->last_author; ?> "><?php echo $thread->last_author; ?> </a> <?php if ($thread->IdGroup > 0 && $showGroups) { echo $words->getFormatted('in') . ' <a href="groups/' . $thread->IdGroup . '/" title="' . $words->getSilent('Group') . ": " . $thread->GroupName . '">' . MOD_layoutbits::truncate($thread->GroupName, 13);
} echo "</select>\n"; echo "</td><td>new translation<br /><textarea name=\"NewTranslatedPost\" cols=\"60\" rows=\"5\"></textarea>\n</td><td><input type=\"submit\" value=\"add translated post\" name=\"submit\"></td>"; echo "</form>"; $max = count($DataPost->Tags); echo "<tr bgcolor=\"#ffcc99\"><th colspan=\"3\" align=left>Used tags (" . $max . ")</th></tr>"; echo "<form method=\"post\" action=\"forums/modeditpost/" . $DataPost->Post->id . "\" id=\"modpostforum\">"; echo "<input type=\"hidden\" name=\"", $callbackId, "\" value=\"1\"/>"; foreach ($DataPost->Tags as $Tag) { echo "<tr bgcolor=\"#ffcc99\">"; echo "<form method=\"post\" action=\"forums/modeditpost/" . $DataPost->Post->id . "\" id=\"modpostforum\">"; echo "<input type=\"hidden\" name=\"", $callbackId, "\" value=\"1\"/>"; echo "<input type=\"hidden\" name=\"IdThread\" value=\"" . $DataPost->Thread->id . "\"/>"; echo "<input type=\"hidden\" name=\"IdPost\" value=\"" . $DataPost->Post->id . "\"/>"; echo "<input type=\"hidden\" name=\"IdTag\" value=\"" . $Tag->IdTag . "\"/>"; echo "<td><a href=\"forums/t" . $Tag->IdTag . "-" . $words->fTrad($Tag->IdName) . "\">", $words->fTrad($Tag->IdName), "</a></td>"; echo "<td align=\"left\"><input type=\"submit\" Name=\"submit\" value=\"delete Tag\"></td>"; echo "<td><a href=\"forums/modedittag/" . $Tag->IdTag . "\">edit tag #t" . $Tag->IdTag . "</a></td>"; echo "</form>\n"; echo "</tr>\n"; } echo "<tr bgcolor=\"#ffcc99\"><td>Select a Tag</td>"; echo "<form method=\"post\" action=\"forums/modeditpost/" . $DataPost->Post->id . "\" id=\"modpostforum\">"; echo "<input type=\"hidden\" name=\"", $callbackId, "\" value=\"1\"/>"; echo "<input type=\"hidden\" name=\"IdThread\" value=\"" . $DataPost->Thread->id . "\"/><br />"; echo "<input type=\"hidden\" name=\"IdPost\" value=\"" . $DataPost->Post->id . "\"/>"; echo "<td>"; echo "<select Name=\"IdTag\" style='width:400px'>"; echo "<option value=\"0\">Choose a Tag to add</option>"; foreach ($DataPost->AllNoneTags as $Tag) { echo "<option value=\"" . $Tag->IdTag . "\">", $words->fTrad($Tag->IdName) . "(" . $Tag->cnt . ")", "</option>\n";
} if ($can_del) { if ($post->postid == $topic->topicinfo->first_postid) { $title = $words->getFormatted('del_topic_href'); $warning = $words->getFormatted('del_topic_warning'); } else { $title = $words->getFormatted('del_post_href'); $warning = $words->getFormatted('del_post_warning'); } echo ' [<a href="forums/delete/m' . $post->postid . '" mouseover="return confirm(\'' . $warning . '\');">' . $title . '</a>]'; } if (isset($post->title) && $post->title) { // This is set if it's a SEARCH echo $words->getFormatted('search_topic_text'); // echo ' <b>'.$post->title.'</b> — <a href="'.ForumsView::postURL($post).'">'.$words->getFormatted('search_topic_href').'</a>'; echo ' <strong><a href="' . ForumsView::postURL($post) . '">' . $words->fTrad($post->IdTitle) . '</a></strong>'; } ?> </p> </div> <?php // Todo : find a way to land here with a $topic variable well initialized if ($topic->WithDetail) { // If the details of trads are available, we will display them if ($post->PostDeleted == "Deleted") { echo "[Deleted]"; } // If current user has a moderator right, he can see the post if ($post->PostDeleted != "Deleted" or $this->BW_Right->HasRight("ForumModerator")) { $PostMaxTrad = 0;
echo "<input type=\"hidden\" name=\"IdDescription\" value=\"" . $DataTag->Tag->IdDescription . "\"/>"; if (!isset($Content->IdLanguage)) { die("Bug in modtagform.php \$Content->IdLanguage is not set !"); } $ArrayLanguage = $this->_model->LanguageChoices($Content->IdLanguage); echo "<tr><td>"; echo "<select Name=\"NewIdLanguage\">"; // echo "<option value=\"-1\">-</option>" ; foreach ($ArrayLanguage as $Choices) { echo "<option value=\"", $Choices->IdLanguage, "\""; if ($Choices->IdLanguage == $Content->IdLanguage) { echo " selected "; } echo "\">", $Choices->EnglishName, "</option>"; } echo "</select>\n"; echo "</td><td>Name <input type=\"text\" name=\"SentenceTag\"><br />Description<textarea name=\"SentenceDescription\" cols=\"80\" rows=\"5\"></textarea>\n</td><td><input type=\"submit\" name=\"submit\" value=\"add translation\"></td>"; echo "</form>\n"; // Now propose to replace another tag with this one echo "<tr bgcolor=#663300 ><td colspan=3></td></tr>"; echo "<form method=\"post\" action=\"forums/modedittag/" . $Content->id . "\" id=\"modtagforum\">"; echo "<input type=\"hidden\" name=\"", $callbackId, "\" value=\"1\"/>"; echo "<input type=\"hidden\" name=\"IdTag\" value=\"" . $DataTag->IdTag . "\"/>"; echo "<tr><td colspan=2>"; echo "USE CAREFULLY !<br />here you can enter the #id of a tag which will be deleted and will have all its entries in forum treads replaced by the current tag (<b>" . $words->fTrad($DataTag->Tag->IdName) . "</b>)"; echo "</td><td>numeric Id of the tag to delete and replace <input type=\"text\" name=\"IdTagToReplace\" size=3><br /><input type=\"submit\" name=\"submit\" value=\"replace tag\"></td>"; echo "</form>\n"; echo "</table>"; ?> </p>
} echo ' <a href="forums/subscriptions/unsubscribe/group/' . $group->IdGroup . '" class="button">' . $words->getSilent('ForumUnsubscribe') . '</a>' . $words->flushBuffer() . PHP_EOL; } else { echo ' <a href="forums/subscriptions/subscribe/group/' . $group->IdGroup . '" class="button">' . $words->getSilent('ForumSubscribe') . '</a>' . $words->flushBuffer() . PHP_EOL; } echo '</td></tr>'; } } else { echo '<tr><td colspan="2">' . $words->get('ForumNoGroups') . '</td>'; } echo '<tr><td colspan="2"><h3>' . $words->getFormatted("ForumThreadSubscriptions") . '</h3></td></tr>' . PHP_EOL; if (count($TResults->TData) > 0) { foreach ($TResults->TData as $data) { echo '<tr>' . PHP_EOL; echo '<td>'; echo '<a href="forums/s' . $data->IdThread . '">' . $words->fTrad($data->IdTitle) . '</a><br />'; echo $data->subscribedtime; echo '</td>' . PHP_EOL; echo '<td style="text-align: right; text-wrap: none; width: 40%">'; if ($data->notificationsEnabled > 0) { echo '<a href="forums/subscriptions/disable/thread/' . $data->IdThread . '/' . $data->UnSubscribeKey . '" class="button">' . $words->getSilent('ForumDisable') . '</a>' . $words->flushBuffer() . PHP_EOL; } else { echo '<a href="forums/subscriptions/enable/thread/' . $data->IdThread . '/' . $data->UnSubscribeKey . '" class="button">' . $words->getSilent('ForumEnable') . '</a>' . $words->flushBuffer() . PHP_EOL; } echo '<a href="forums/subscriptions/unsubscribe/thread/' . $data->IdSubscribe . '/' . $data->UnSubscribeKey . '" class="button">' . $words->getSilent('Unsubscribe') . '</a>' . $words->flushBuffer() . PHP_EOL; echo '</td>' . PHP_EOL; echo '</tr>' . PHP_EOL; } } else { echo '<tr><td colspan="2">' . $words->get('ForumNoThreadsSubscribed') . '</td>'; }
</tr> <?php } ?> <?php for ($ii = 0; $ii < $iiMax; $ii++) { $p = $list[$ii]; ?> <tr class="<?php echo $styles[$ii % 2]; ?> "> <td> <h4><?php echo $words->fTrad($p->Title); ?> </h4> <em><?php echo $words->fTrad($p->Description); ?> </em> </td> <td> <?php if (!empty($p->IdCreator)) { echo MOD_layoutbits::PIC_50_50($p->CreatorUsername); echo "<br />"; echo "<a class=\"username\" href=\"member/", $p->CreatorUsername, "\">", $p->CreatorUsername, "</a>"; } if (!empty($p->IdGroupCreator)) {