Not logged in. · Lost password · Register
Forum: Support Ideas and suggestions RSS
Moving miscellaneous MarkUp #3
jense #1
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
Subject: Moving miscellaneous MarkUp #3
This time in forumlist.html:
@@ -248,16 +248,16 @@
        {endif}
 
        {-- if or $forumlistCount (not $forumlistTopForum)}
-       {if and (or $forumlistActionAddForum $forumlistActionAdvanced) (not $threadlistActionAdvanced)}{-- advanced options}
-               {if or or $forumlistActionAdvanced $forumlistActionMarkRead $forumlistActionAddForum}
+       {if and (or $forumlistActionAddForumLink $forumlistActionAdvanced) (not $threadlistActionAdvanced)}{-- advanced options}
+               {if or or $forumlistActionAdvanced $forumlistActionMarkReadLink $forumlistActionAddForumLink}
                <div class="all_forum_actions_bottom">
                        {set $div ""}
                        {if and $forumlistActionAdvanced (not $threadlistActionAdvanced)}
                                {$div}<a href="javascript:nothing()" onclick="setImageId('advanced_link_img_forums', toggleVisIdScroll('advanced_options_forums') == 1, '{
imgurl}arrow_down.png', '{imgurl}arrow_right.png')"><img {$UNBImage.arrow_down} id="advanced_link_img_forums" />  {tr "advanced options"}</a>
                                {set $div " &middot; "}
                        {endif}
-                       {if $forumlistActionMarkRead}{$div}{$forumlistActionMarkRead}{set $div " &middot; "}{endif}
-                       {if $forumlistActionAddForum}{$div}{$forumlistActionAddForum}{set $div " &middot; "}{endif}
+                       {if $forumlistActionMarkReadLink}{$div}<a href="{$forumlistActionMarkReadLink}"><img {$UNBImage.unread} /> {tr "mark all forums read"}</a>{set $di
v " &middot; "}{endif}
+                       {if $forumlistActionAddForumLink}{$div}<a href="{$forumlistActionAddForumLink}"><img {$UNBImage.add} /> {tr "forum.new"}</a>{set $div " &middot; "
}{endif}
                </div>
                {endif}
        {endif}
@@ -275,9 +275,8 @@
                <h1>{tr "forum.advanced options"}</h1>
                <div class="advanced_options_container">
                <div class="advanced_options_content">
-               {$forumlistAdvIgnoreForum}
-               {$forumlistAdvHideForum}
-               {$forumlistAdvShowHiddenForums}
+{foreach $action in $forumlistActionAdvanced}
+               <div class="advanced_option"><a href="{$action.link}">{$action.option}</a><div class="advanced_subtitle">{$action.subtitle}</div></div>{endforeach}
                </div><!-- advanced_options_content -->
                </div><!-- advanced_options_container -->
                {set $ShadowBottomOffset 0}
The relevant changes in main.inc.php are
  1. @@ -1285,11 +1285,11 @@
  2.                     $new_forums &&
  3.                     $forums_count)
  4.                 {
  5. -                       $TP['forumlistActionMarkRead'] = '<a href="' . UnbLink('@this', 'id=' . $parent . '&allforumsread=1&timestamp=' . time() . '&key=' . UnbUrlGetKey(
  6. ), true) . '"><img ' . $UNB['Image']['unread'] . ' /> ' . $UNB_T['mark all forums read'] . '</a>';
  7. +                       $TP['forumlistActionMarkReadLink'] = UnbLink('@this', 'id=' . $parent . '&allforumsread=1&timestamp=' . time() . '&key=' . UnbUrlGetKey(), true);
  8.                 }
  9.                 if (UnbCheckRights('addforum', $toplevel))
  10.                 {
  11. -                       $TP['forumlistActionAddForum'] = '<a href="' . UnbLink('@this', 'id=' . $toplevel . '&addparent=' . $toplevel . '#here', true) . '"><img ' . $UNB[
  12. 'Image']['add'] . ' /> ' . $UNB_T['forum.new'] . '</a>';
  13. +                       $TP['forumlistActionAddForumLink'] = UnbLink('@this', 'id=' . $toplevel . '&addparent=' . $toplevel . '#here', true);
  14.                 }
  15.  
  16.                 if (!$forums_count && !$toplevel)
  17. @@ -1298,6 +1298,7 @@
  18.                 // advanced options area
  19.                 if ($TP['forumlistActionAdvanced'])
  20.                 {
  21. +                               $TP['forumlistActionAdvanced'] = array();
  22.                         if ($toplevel > 0)
  23.                         {
  24.                                 $forum = new IForum($toplevel);
  25. @@ -1305,24 +1306,24 @@
  26.                                 {
  27.                                         if ($UNB['LoginUser']->GetForumFlag($toplevel, UNB_UFF_IGNORE))
  28.                                         {
  29. -                                               $TP['forumlistAdvIgnoreForum'] = '<div class="advanced_option"><a href="' . UnbLink('@this', 'id=' . $toplevel . '&unignor
  30. eforum=' . $toplevel . '&key=' . UnbUrlGetKey(), true) . '">' . $UNB_T['forum.advanced.unignore'] . '</a><div class="advanced_subtitle">' . $UNB_T['forum.advanced.ignore~
  31. '] . ' ' . $UNB_T['forum.advanced.ignoring'] . '</div></div>';
  32. +                                               $TP['forumlistActionAdvanced'][] = array('link' => UnbLink('@this', 'id=' . $toplevel . '&unignoreforum=' . $toplevel . '&
  33. key=' . UnbUrlGetKey(), true), 'option' => $UNB_T['forum.advanced.unignore'], 'subtitle' => $UNB_T['forum.advanced.ignore~'] . ' ' . $UNB_T['forum.advanced.ignoring']);
  34.                                         }
  35.                                         else
  36.                                         {
  37. -                                               $TP['forumlistAdvIgnoreForum'] = '<div class="advanced_option"><a href="' . UnbLink('@this', 'id=' . $toplevel . '&ignoref
  38. orum=' . $toplevel . '&key=' . UnbUrlGetKey(), true) . '">' . $UNB_T['forum.advanced.ignore'] . '</a><div class="advanced_subtitle">' . $UNB_T['forum.advanced.ignore~'] .
  39.  ' ' . $UNB_T['forum.advanced.not ignoring'] . '</div></div>';
  40. +                                               $TP['forumlistActionAdvanced'][] = array('link' => UnbLink('@this', 'id=' . $toplevel . '&ignoreforum=' . $toplevel . '&ke
  41. y=' . UnbUrlGetKey(), true), 'option' => $UNB_T['forum.advanced.ignore'], 'subtitle' => $UNB_T['forum.advanced.ignore~'] . ' ' . $UNB_T['forum.advanced.not ignoring']);
  42.                                         }
  43.                                 }
  44.                                 if ($UNB['LoginUser']->GetForumFlag($toplevel, UNB_UFF_HIDE))
  45.                                 {
  46. -                                       $TP['forumlistAdvHideForum'] = '<div class="advanced_option"><a href="' . UnbLink('@this', 'id=' . $toplevel . '&unhideforum=' . $
  47. toplevel . '&key=' . UnbUrlGetKey(), true) . '">' . $UNB_T['forum.advanced.unhide'] . '</a><div class="advanced_subtitle">' . $UNB_T['forum.advanced.hide~'] . ' ' . $UNB_
  48. T['forum.advanced.hiding'] . '</div></div>';
  49. +                                       $TP['forumlistActionAdvanced'][] = array('link' => UnbLink('@this', 'id=' . $toplevel . '&unhideforum=' . $toplevel . '&key=' . Un
  50. bUrlGetKey(), true), 'option' => $UNB_T['forum.advanced.unhide'], 'subtitle' => $UNB_T['forum.advanced.hide~'] . ' ' . $UNB_T['forum.advanced.hiding']);
  51.                                 }
  52.                                 else
  53.                                 {
  54. -                                       $TP['forumlistAdvHideForum'] = '<div class="advanced_option"><a href="' . UnbLink('@this', 'id=' . $toplevel . '&hideforum=' . $to
  55. plevel . '&key=' . UnbUrlGetKey(), true) . '">' . $UNB_T['forum.advanced.hide'] . '</a><div class="advanced_subtitle">' . $UNB_T['forum.advanced.hide~'] . ' ' . $UNB_T['f
  56. orum.advanced.not hiding'] . '</div></div>';
  57. +                                       $TP['forumlistActionAdvanced'][] = array('link' => UnbLink('@this', 'id=' . $toplevel . '&hideforum=' . $toplevel . '&key=' . UnbU
  58. rlGetKey(), true), 'option' => $UNB_T['forum.advanced.hide'], 'subtitle' => $UNB_T['forum.advanced.hide~'] . ' ' . $UNB_T['forum.advanced.not hiding']);
  59.                                 }
  60.                         }
  61.  
  62. -                       $TP['forumlistAdvShowHiddenForums'] = '<div class="advanced_option"><a href="' . UnbLink('@this', array('id' => $toplevel, 'showhidden_f' => true)
  63. , true) . '">' . $UNB_T['show hidden forums'] . '</a><div class="advanced_subtitle">' . $UNB_T['show hidden forums~'] . '</div></div>';
  64. +                       $TP['forumlistActionAdvanced'][] = array('link' => UnbLink('@this', array('id' => $toplevel, 'showhidden_f' => true), true), 'option' => $UNB_T['s
  65. how hidden forums'], 'subtitle' => $UNB_T['show hidden forums~']);
  66.                 }
  67.         }
These changes are mark-up neutral in the web pages.
Alala, Alala, Gimme three wishes - CSS
Avatar
Yves (Administrator) #2
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Wow, that was a large one. ;) Done.

I have, however, renamed your $action.option to $action.title, as it fits better to the subtitle item below.
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
jense #3
Member since Nov 2006 · 327 posts · Location: Dortmund
Group memberships: Members
Show profile · Link to this post
Quote by Yves:
Wow, that was a large one. ;) Done.
Well, the net change was small, however, the lines were quite long... :)

I have, however, renamed your $action.option to $action.title, as it fits better to the subtitle item below.
Sounds reasonable.  I'd a reason, too, that I've forgotten... ;)

Thanks!
Alala, Alala, Gimme three wishes - CSS
Avatar
Yves (Administrator) #4
User title: UNB developer & webmaster
Member since Jan 2004 · 3855 posts · Location: Erlangen, Germany
Group memberships: Administrators, Members
Show profile · Link to this post
You were probably refering to the "advanced_option" CSS class names.
Option = the whole entry
Title = the name on it...
♪ ...nanananah, all in all we’re just brilliant thieves, nanananah... ♪♬
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
This board is powered by the Unclassified NewsBoard software, 20120620-dev, © 2003-2011 by Yves Goergen
Page created in 311.2 ms (256.1 ms) · 61 database queries in 124.8 ms
Current time: 2013-05-19, 00:26:40 (UTC +02:00)