Advertisement:

Author Topic: Moderation Form instead of images in Topic Display  (Read 36607 times)

Offline Kirby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,040
  • Gender: Male
Moderation Form instead of images in Topic Display
« on: November 14, 2004, 12:22:21 AM »
I know there are a few people who don't like the moderation images (ex. Sticky/Lock buttons) in the topic display. I looked at MessageIndex's quick mod form and found a better way to represent those (similar to Invision's mod form). Add this somewhere in your Display.template.php, preferrably in the mod options function.
Code: [Select]
<form action="', $scripturl, '?action=quickmod;board=', $context['current_board'], '.', $context['start'], '" method="post" name="topicForm" style="margin: 0;">
<input type="hidden" name="topics[]" value="', $context['current_topic'] ,'">
<select name="qaction"', $context['can_move'] ? ' onchange="document.topicForm.moveItTo.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
<option value="" style="font-weight: bold;">Moderation Options</option>
', $context['can_remove'] ? '<option value="remove">Delete Topic</option>' : '', '
', $context['can_lock'] ? '<option value="lock">Lock Topic</option>' : '', '
', $context['can_sticky'] ? '<option value="sticky">Pin Topic</option>' : '', '
', $context['can_move'] ? '<option value="move">Move Topic to: </option>' : '', '
', $context['can_merge'] ? '<option value="merge">Merge Topic</option>' : '', '
  </select>';
  if ($context['can_move'])
{
echo '
<select id="moveItTo" name="move_to" disabled="disabled">';
foreach ($context['jump_to'] as $category)
foreach ($category['boards'] as $board)
{
if (!$board['is_current'])
echo '
<option value="', $board['id'], '"', !empty($board['selected']) ? ' selected="selected"' : '', '>', str_repeat('-', $board['child_level'] + 1), ' ', $board['name'], '</option>';
}
echo '
</select>';
}
echo '
        <input type="submit" class="forminput" value="', $txt['quick_mod_go'], '">
  <input type="hidden" name="sc" value="' . $context['session_id'] . '" />
 </form>';

Example:


(No that is not Invision, it is SMF... I just made an Invision skin for a forum that requested it)
« Last Edit: November 14, 2004, 02:46:22 PM by Kirby »

Offline A.M.A

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,133
  • Gender: Male
  • ..
Re: Moderation Form instead of images in Topic Display
« Reply #1 on: November 14, 2004, 06:18:11 AM »
Nice tip .. here how I did it, add the code above in Display.template.php after
Code: [Select]
function theme_show_mod_buttons()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;
put ( echo ' ) as the first line to the code above .. and finally delete it this:
Code: [Select]
$moderationButtons = array();

if ($context['can_move'])
$moderationButtons[] = '<a href="' . $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_move.gif" alt="' . $txt[132] . '" border="0" />' : $txt[132]) . '</a>';
if ($context['can_delete'])
$moderationButtons[] = '<a href="' . $scripturl . '?action=removetopic2;topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt[162] . '\');">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_rem.gif" alt="' . $txt[63] . '" border="0" />' : $txt[63]) . '</a>';
if ($context['can_lock'])
$moderationButtons[] = '<a href="' . $scripturl . '?action=lock;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_lock.gif" alt="' . (empty($context['is_locked']) ? $txt['smf279'] : $txt['smf280']) . '" border="0" />' : (empty($context['is_locked']) ? $txt['smf279'] : $txt['smf280'])) . '</a>';
if ($context['can_sticky'])
$moderationButtons[] = '<a href="' . $scripturl . '?action=sticky;topic=' . $context['current_topic'] . '.' . $context['start'] . ';sesc=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_sticky.gif" alt="' . (empty($context['is_sticky']) ? $txt['smf277'] : $txt['smf278']) . '" border="0" />' : (empty($context['is_sticky']) ? $txt['smf277'] : $txt['smf278'])) . '</a>';
if ($context['can_merge'])
$moderationButtons[] = '<a href="' . $scripturl . '?action=mergetopics;board=' . $context['current_board'] . '.0;from=' . $context['current_topic'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/merge.gif" alt="' . $txt['smf252'] . '" border="0" />' : $txt['smf252']) . '</a>';
if ($context['can_remove_poll'])
$moderationButtons[] = '<a href="' . $scripturl . '?action=removepoll;topic=' . $context['current_topic'] . '.' . $context['start'] . '" onclick="return confirm(\'' . $txt['poll_remove_warn'] . '\');">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/admin_remove_poll.gif" alt="' . $txt['poll_remove'] . '" border="0" />' : $txt['poll_remove']) . '</a>';

if ($context['calendar_post'])
$moderationButtons[] = '<a href="' . $scripturl . '?action=post;calendar;msg=' . $context['topic_first_message'] . ';topic=' . $context['current_topic'] . '.0;sesc=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/linktocal.gif" alt="' . $txt['calendar37'] . '" border="0" />' : $txt['calendar37']) . '</a>';

if ($context['can_remove_post'] && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
$moderationButtons[] = $settings['use_image_buttons'] ? '<input type="image" name="submit" src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/delete_selected.gif" alt="' . $txt['quickmod_delete_selected'] . '" onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" />' : '<a href="javascript:document.quickModForm.submit();" onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');">' . $txt['quickmod_delete_selected'] . '</a>';

return implode($context['menu_separator'], $moderationButtons);
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

Offline Kirby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,040
  • Gender: Male
Re: Moderation Form instead of images in Topic Display
« Reply #2 on: November 14, 2004, 01:55:24 PM »
Thats actually how I did it too :P
Quote
Add this somewhere in your Display.template.php, preferrably in the mod options function.
Thanks ^_^

Offline codenaught

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 14,653
  • Gender: Male
  • Formerly Known As akabugeyes
Re: Moderation Form instead of images in Topic Display
« Reply #3 on: November 14, 2004, 02:16:00 PM »
Nice change! I just am having problems with the move topic to: box. When I select that the box is not enabled, thus not letting me to click on it. Are you sure there is nothing wrong with that part of it?
Dev Consultant
Former SMF Doc Coordinator

Offline Kirby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,040
  • Gender: Male
Re: Moderation Form instead of images in Topic Display
« Reply #4 on: November 14, 2004, 02:47:07 PM »
Thats odd... be sure to copy every bit of the code. I'm pretty sure the JavaScript is in there...

Offline suren

  • Semi-Newbie
  • *
  • Posts: 45
  • Gender: Male
Re: Moderation Form instead of images in Topic Display
« Reply #5 on: January 17, 2005, 08:40:31 AM »
Nice change! I just am having problems with the move topic to: box. When I select that the box is not enabled, thus not letting me to click on it. Are you sure there is nothing wrong with that part of it?

i'm getting the same error & also javascript error

Offline Kirby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,040
  • Gender: Male
Re: Moderation Form instead of images in Topic Display
« Reply #6 on: January 17, 2005, 01:38:12 PM »
Oops... replace
Code: [Select]
document.topicForm.moveItTo with
Code: [Select]
document.getElementById("moveItTo")
« Last Edit: January 17, 2005, 02:11:39 PM by Kirby »

Offline mytreo

  • Jr. Member
  • **
  • Posts: 284
    • treo
Re: Moderation Form instead of images in Topic Display
« Reply #7 on: January 17, 2005, 05:30:32 PM »
How does one remove a poll or post the topic to calendar with this mod?

Thanks

Chris
Treo forum - Powered by SMF, of course
Treo news - powered by MovableType and integrated with SMF
Treo downloads - hacked from phpNuke and integrated with SMF
Treo knowledge base - powered by Wikka and integrated with SMF
Treo 650 | Treo 700w | Treo 700p

Offline Kirby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,040
  • Gender: Male
Re: Moderation Form instead of images in Topic Display
« Reply #8 on: January 17, 2005, 05:35:08 PM »
It isn't in there yet, but my enhanced default theme has it (its a complete redo of what I posted).

Offline mytreo

  • Jr. Member
  • **
  • Posts: 284
    • treo
Re: Moderation Form instead of images in Topic Display
« Reply #9 on: January 17, 2005, 05:50:47 PM »
Ooh sounds good, so where is your enhanced default theme? :)
Treo forum - Powered by SMF, of course
Treo news - powered by MovableType and integrated with SMF
Treo downloads - hacked from phpNuke and integrated with SMF
Treo knowledge base - powered by Wikka and integrated with SMF
Treo 650 | Treo 700w | Treo 700p

Offline Nidoking

  • Jr. Member
  • **
  • Posts: 141
  • Gender: Male
  • Enlightened
    • Forums
Re: Moderation Form instead of images in Topic Display
« Reply #10 on: January 18, 2005, 12:11:43 AM »
Ooh sounds good, so where is your enhanced default theme? :)
Probably under construction.

Offline Kirby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,040
  • Gender: Male
Re: Moderation Form instead of images in Topic Display
« Reply #11 on: January 18, 2005, 09:21:15 AM »
yeah, its under heavy construction and will have a whole bunch of old yabb se mods in it...

Offline helenbpd

  • Jr. Member
  • **
  • Posts: 181
    • The Nook at BPDCentral
Re: Moderation Form instead of images in Topic Display
« Reply #12 on: January 21, 2005, 07:16:22 AM »
Kirby,

This is a fabulous mod.  One question, though - is there a way to hide the menu from anyone who can't use it (i.e., members & guests)?  I installed it, and when I log out and read as a guest, the dropdown is still there, albeit just with the option "moderation options", but the go! button is still there and clickable.  (Selecting it simply takes you back to the index.)

How to hide it to spare confusion to guests & members?  (Or did I install it incorrectly somehow?)

Thanks!

Offline helenbpd

  • Jr. Member
  • **
  • Posts: 181
    • The Nook at BPDCentral
Re: Moderation Form instead of images in Topic Display
« Reply #13 on: January 21, 2005, 12:49:52 PM »
Fiddling with this a little more.

On my board (still RC2, based on default template), the

Code: [Select]
$context['can_remove'] had to be changed to
Code: [Select]
$context['can_delete']
Also, the Merge option doesn't work for me, either, & I'm not sure what to change.  It just returns me to the messages index with no intermediate page asking what to merge where.

Also, there doesn't seem to be a confirmation page built in, as there was with the buttons.  ("Do you really want to remove/sticky/etc this topic?") 

(I wish I knew PHP code or I'd just make these changes myself, sorry to bug you!  I don't want to totally mess things up by fiddling too much.)



Offline Kirby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,040
  • Gender: Male
Re: Moderation Form instead of images in Topic Display
« Reply #14 on: January 21, 2005, 01:55:49 PM »
I'll get back to you on this... I really have improved over this one in my IPB theme/default "enhanced" theme and I'll put up the code soon.

Offline helenbpd

  • Jr. Member
  • **
  • Posts: 181
    • The Nook at BPDCentral
Re: Moderation Form instead of images in Topic Display
« Reply #15 on: January 22, 2005, 10:06:26 AM »
Thanks Kirby!  I'll keep an eye out, it's a great mod idea.

Offline Midgard

  • Jr. Member
  • **
  • Posts: 271
  • Gender: Male
Re: Moderation Form instead of images in Topic Display
« Reply #16 on: February 13, 2005, 11:07:52 AM »
I need this script for ordering/sorting

-For memberslist
-For message index

Offline rojamaia

  • Semi-Newbie
  • *
  • Posts: 83
Re: Moderation Form instead of images in Topic Display
« Reply #17 on: August 27, 2005, 11:53:17 AM »


hi everyone!

is there an update on this?  this looks like a good mod

Offline Kirby

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 2,040
  • Gender: Male
Re: Moderation Form instead of images in Topic Display
« Reply #18 on: August 28, 2005, 12:19:27 AM »
This should still work.

Offline Eleglin

  • Sr. Member
  • ****
  • Posts: 754
  • Gender: Male
    • Les Archives de Gondor
Re: Moderation Form instead of images in Topic Display
« Reply #19 on: July 29, 2007, 08:49:06 AM »
Where are the options for calendar post or remove polls ?!
It's not compatible with SMF 1.1 (or it doesn't work with my theme : it appears, but the options don't work) ...
Can someone enhance it for SMF 1.1.x, please ? It should be fine.
No support by PM or Mail.