FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » select all and deselect all in thread view [For 2.7.7]
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
select all and deselect all in thread view [For 2.7.7] [message #158151] Thu, 05 February 2009 10:00 Go to previous message
Marticus   United States
Messages: 272
Registered: June 2002
Karma:
Senior Member
Note: There is a much cleaner solution found in 2.8. Be looking forward to it.

This change will add two links next to the Delete All and Move All Selected boxes at the top and the bottom of thread display. I borrowed the js function from rkquest's post at digitalpoint
--- thread.tmpl.dist    2009-02-05 01:39:24.000000000 -0700
+++ thread.tmpl 2009-02-05 02:51:40.000000000 -0700
@@ -93,7 +93,7 @@
 {SECTION: END}

 {SECTION: thread_list}
-{IF: $MOD || $mo == 8224}<form method="post" action="{TEMPLATE: thread_mod_mass_lnk}">{ENDIF}
+{IF: $MOD || $mo == 8224}<form method="post" action="{TEMPLATE: thread_mod_mass_lnk}" name="frmthreadsel">{ENDIF}
 <table border="0" cellspacing="1" cellpadding="2" class="pad">
 <tr>
    <th>&nbsp;</th>
@@ -106,14 +106,14 @@
 {TEMPLATE-DATA: announcements}
 {IF: $MOD || $mo == 8224}
 <tr>
-   <td colspan="3" class="RowStyleC ar"><input type="submit" class="button" name="del_sel_all" value="{MSG: thread_del_all}"> <input type="submit" class="button" name="mov_sel_all" value="{MSG: thread_mov_all}"></td>
+   <td colspan="3" class="RowStyleC ar"><input type="submit" class="button" name="del_sel_all" value="{MSG: thread_del_all}"> <input type="submit" class="button" name="mov_sel_all" value="{MSG: thread_mov_all}"> <a href="javascript:thread_select(1)">{MSG: select_all}</a> <a href="javascript:thread_select(0)">{MSG: deselect_all}</a></td>
    <td colspan="3" class="RowStyleC"> </td>
 </tr>
 {ENDIF}
 {TEMPLATE-DATA: thread_list_table_data}
 {IF: $MOD || $mo == 8224}
 <tr>
-   <td colspan="3" class="RowStyleC ar"><input type="submit" class="button" name="del_sel_all" value="{MSG: thread_del_all}"> <input type="submit" class="button" name="mov_sel_all" value="{MSG: thread_mov_all}"></td>
+   <td colspan="3" class="RowStyleC ar"><input type="submit" class="button" name="del_sel_all" value="{MSG: thread_del_all}"> <input type="submit" class="button" name="mov_sel_all" value="{MSG: thread_mov_all}"> <a href="javascript:thread_select(1)">{MSG: select_all}</a> <a href="javascript:thread_select(0)">{MSG: deselect_all}</a></td>
    <td colspan="3" class="RowStyleC"> </td>
 </tr>
 {ENDIF}
--- msg 2009-02-05 02:55:07.000000000 -0700
+++ msg.dist    2009-02-05 02:54:58.000000000 -0700
@@ -1004,6 +1004,8 @@
 search_results_hdr:            {VAR: total} Search Results Found
 thread_del_all:                        Delete All Selected
 thread_mov_all:                        Move All Selected
+select_all:                            Select All
+deselect_all:                  Deselect All
 dmsg_ip:                       IP:
 err_blockedaccnt_title:                ERROR: Your account has been filtered out.
 err_blockedaccnt_msg:          Your account has been blocked from accessing the forum due to one of the installed user filters.
--- lib.js.dist 2009-02-05 01:50:24.000000000 -0700
+++ lib.js  2009-02-05 02:58:27.000000000 -0700
@@ -16,6 +16,15 @@
 var OPERA = navigator.userAgent.indexOf("Opera") > -1 ? 1 : 0;
 var MAC = navigator.userAgent.indexOf("Mac") > -1 ? 1 : 0;

+/* select or deselect all, see thread.tmpl */
+function thread_select(a) {
+    var theForm = document.frmthreadsel;
+    for (i=0; i<theForm.elements.length; i++) {
+        if (theForm.elements[i].name=='_sel[]')
+            theForm.elements[i].checked = a;
+    }
+}
+
 /* edit box stuff */
 function insertTag(obj, stag, etag)
 {

[Updated on: Thu, 05 February 2009 11:08]

Report message to a moderator

[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: sync up group members with wow roster [Works with armory as of Feb 04, 2009]
Next Topic: Adding FUDcode tags for (WoW) ItemStats
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat May 11 21:31:44 GMT 2024

Total time taken to generate the page: 0.04176 seconds