diff --git a/contrib/artists/theme.php b/contrib/artists/theme.php index 58e7842e..17fc9496 100644 --- a/contrib/artists/theme.php +++ b/contrib/artists/theme.php @@ -186,10 +186,7 @@ class ArtistsTheme extends Themelet { , 'member' => 'Member' ); - foreach ($artists as $artist) - { - $oe = ($n++ % 2 == 0) ? "even" : "odd"; - + foreach ($artists as $artist) { if ($artist['type'] != 'artist') $artist['name'] = str_replace("_", " ", $artist['name']); @@ -199,7 +196,7 @@ class ArtistsTheme extends Themelet { $edit_link = "Edit"; $del_link = "Delete"; - $html .= "". + $html .= "". "".$elementLink; //if ($artist['type'] == 'member') @@ -352,7 +349,7 @@ class ArtistsTheme extends Themelet { $html .= " - + Name: ".$artist_link.""; if ($userIsLogged) $html .= ""; @@ -365,7 +362,7 @@ class ArtistsTheme extends Themelet { $aliasEditLink = "Edit"; $aliasDeleteLink = "Delete"; - $html .= " + $html .= " Aliases: ".$aliasViewLink.""; @@ -385,7 +382,7 @@ class ArtistsTheme extends Themelet { $aliasEditLink = "Edit"; $aliasDeleteLink = "Delete"; - $html .= " + $html .= "   ".$aliasViewLink.""; if ($userIsLogged) @@ -404,7 +401,7 @@ class ArtistsTheme extends Themelet { $memberEditLink = "Edit"; $memberDeleteLink = "Delete"; - $html .= " + $html .= " Members: ".$memberViewLink.""; if ($userIsLogged) @@ -422,7 +419,7 @@ class ArtistsTheme extends Themelet { $memberEditLink = "Edit"; $memberDeleteLink = "Delete"; - $html .= " + $html .= "   ".$memberViewLink.""; if ($userIsLogged) @@ -441,7 +438,7 @@ class ArtistsTheme extends Themelet { $urlEditLink = "Edit"; $urlDeleteLink = "Delete"; - $html .= " + $html .= " URLs: ".$urlViewLink.""; @@ -461,7 +458,7 @@ class ArtistsTheme extends Themelet { $urlEditLink = "Edit"; $urlDeleteLink = "Delete"; - $html .= " + $html .= "   ".$urlViewLink.""; if ($userIsLogged) @@ -476,7 +473,7 @@ class ArtistsTheme extends Themelet { } $html .= - " + " Notes: ".$artist["notes"].""; if ($userIsLogged) $html .= ""; diff --git a/contrib/blotter/theme.php b/contrib/blotter/theme.php index fd78b467..9242c93a 100644 --- a/contrib/blotter/theme.php +++ b/contrib/blotter/theme.php @@ -23,10 +23,6 @@ class BlotterTheme extends Themelet { $page->add_block(new Block(null, $html, $position, 20)); } - private function is_odd($number) { - return $number & 1; // 0 = even, 1 = odd - } - private function get_html_for_blotter_editor($entries) { global $user; @@ -66,11 +62,9 @@ class BlotterTheme extends Themelet { $entry_text = $entries[$i]['entry_text']; if($entries[$i]['important'] == 'Y') { $important = 'Y'; } else { $important = 'N'; } - if(!$this->is_odd($i)) {$tr_class = "odd";} - if($this->is_odd($i)) {$tr_class = "even";} // Add the new table row(s) $table_rows .= - " + " $entry_date $entry_text $important diff --git a/contrib/forum/theme.php b/contrib/forum/theme.php index 40b015d9..6fe0ea4c 100644 --- a/contrib/forum/theme.php +++ b/contrib/forum/theme.php @@ -113,8 +113,6 @@ class ForumTheme extends Themelet { $poster = User::by_name($post["user_name"]); $gravatar = $poster->get_avatar_html(); - $oe = ($n++ % 2 == 0) ? "even" : "odd"; - if ($post["user_admin"] == "Y") { $rank = "admin"; } else { @@ -135,7 +133,7 @@ class ForumTheme extends Themelet { $delete_link = ""; } - $html .= "". + $html .= "". "".$user."
".$rank."
".$gravatar."". "".$message.""." diff --git a/contrib/image_hash_ban/theme.php b/contrib/image_hash_ban/theme.php index d4649921..d23721f7 100644 --- a/contrib/image_hash_ban/theme.php +++ b/contrib/image_hash_ban/theme.php @@ -24,9 +24,8 @@ class ImageBanTheme extends Themelet { $h_bans = ""; $n = 0; foreach($bans as $ban) { - $oe = ($n++ % 2 == 0) ? "even" : "odd"; $h_bans .= " - + {$ban['hash']} {$ban['reason']} diff --git a/contrib/ipban/theme.php b/contrib/ipban/theme.php index d5382f7c..388ef141 100644 --- a/contrib/ipban/theme.php +++ b/contrib/ipban/theme.php @@ -19,9 +19,8 @@ class IPBanTheme extends Themelet { $prefix2 = ($database->engine->name == "sqlite" ? "users." : ""); foreach($bans as $ban) { $end_human = date('Y-m-d', $ban[$prefix.'end_timestamp']); - $oe = ($n++ % 2 == 0) ? "even" : "odd"; $h_bans .= " - + {$ban[$prefix.'ip']} {$ban[$prefix.'reason']} {$ban['banner_name']} diff --git a/contrib/log_db/theme.php b/contrib/log_db/theme.php index 1d3d8ccf..5f387d39 100644 --- a/contrib/log_db/theme.php +++ b/contrib/log_db/theme.php @@ -44,9 +44,8 @@ class LogDatabaseTheme extends Themelet { reset($events); // rewind to first element in array. foreach($events as $event) { - $oe = ($n++ % 2 == 0) ? "even" : "odd"; $c = $this->pri_to_col($event['priority']); - $table .= ""; + $table .= ""; $table .= "".str_replace(" ", " ", $event['date_sent']).""; $table .= "".$event['section'].""; if($event['username'] == "Anonymous") { diff --git a/contrib/notes/theme.php b/contrib/notes/theme.php index bba37b28..02310d09 100644 --- a/contrib/notes/theme.php +++ b/contrib/notes/theme.php @@ -195,14 +195,12 @@ class NotesTheme extends Themelet { $n = 0; foreach($histories as $history) { - $oe = ($n++ % 2 == 0) ? "even" : "odd"; - $image_link = "".$history['image_id'].""; $history_link = "".$history['note_id'].".".$history['review_id'].""; $user_link = "".$history['user_name'].""; $revert_link = "Revert"; - $html .= "". + $html .= "". "".$image_link."". "".$history_link."". "".$history['note']."". @@ -245,14 +243,12 @@ class NotesTheme extends Themelet { $n = 0; foreach($histories as $history) { - $oe = ($n++ % 2 == 0) ? "even" : "odd"; - $image_link = "".$history['image_id'].""; $history_link = "".$history['note_id'].".".$history['review_id'].""; $user_link = "".$history['user_name'].""; $revert_link = "Revert"; - $html .= "". + $html .= "". "".$image_link."". "".$history_link."". "".$history['note']."". diff --git a/contrib/pm/theme.php b/contrib/pm/theme.php index 4689217f..ca7d205b 100644 --- a/contrib/pm/theme.php +++ b/contrib/pm/theme.php @@ -15,7 +15,6 @@ class PrivMsgTheme extends Themelet { "; $n = 0; foreach($pms as $pm) { - $oe = ($n++ % 2 == 0) ? "even" : "odd"; $h_subject = html_escape($pm->subject); if(strlen(trim($h_subject)) == 0) $h_subject = "(No subject)"; $from_name = User::by_id($pm->from_id)->name; @@ -25,7 +24,7 @@ class PrivMsgTheme extends Themelet { $del_url = make_link("pm/delete"); $h_date = html_escape($pm->sent_date); if($pm->is_read) $h_subject = "$h_subject"; - $html .= "$h_subject + $html .= "$h_subject $h_from$h_date
diff --git a/contrib/pools/theme.php b/contrib/pools/theme.php index 687fbba5..633cc8ad 100644 --- a/contrib/pools/theme.php +++ b/contrib/pools/theme.php @@ -47,13 +47,11 @@ class PoolsTheme extends Themelet { // Build up the list of pools. foreach($pools as $pool) { - $oe = ($n++ % 2 == 0) ? "even" : "odd"; - $pool_link = ''.html_escape($pool['title']).""; $user_link = ''.html_escape($pool['user_name']).""; $public = ($pool['public'] == "Y" ? "Yes" : "No"); - $html .= "". + $html .= "". "".$pool_link."". "".$user_link."". "".$pool['posts']."". @@ -125,9 +123,7 @@ class PoolsTheme extends Themelet { $n = 0; foreach($pools as $pool) { - $oe = ($n++ % 2 == 0) ? "even" : "odd"; - - $pool_info .= "". + $pool_info .= "". "".html_escape($pool['title'])."". "".html_escape($pool['description'])."". ""; @@ -357,8 +353,6 @@ class PoolsTheme extends Themelet { $n = 0; foreach($histories as $history) { - $oe = ($n++ % 2 == 0) ? "even" : "odd"; - $pool_link = "".html_escape($history['title']).""; $user_link = "".html_escape($history['user_name']).""; $revert_link = "Revert"; @@ -377,7 +371,7 @@ class PoolsTheme extends Themelet { $image_link .= "".$prefix.$image." "; } - $html .= "". + $html .= "". "".$pool_link."". "".$history['count']."". "".$image_link."". diff --git a/contrib/report_image/theme.php b/contrib/report_image/theme.php index a2d602b0..9200f6c9 100644 --- a/contrib/report_image/theme.php +++ b/contrib/report_image/theme.php @@ -36,9 +36,8 @@ class ReportImageTheme extends Themelet { ksort($iabbe->parts); $actions = join("
", $iabbe->parts); - $oe = ($n++ % 2 == 0) ? "even" : "odd"; $h_reportedimages .= " - + {$image_link} Report by $userlink: $h_reason diff --git a/contrib/tips/theme.php b/contrib/tips/theme.php index d06e0bd7..3c86b53e 100644 --- a/contrib/tips/theme.php +++ b/contrib/tips/theme.php @@ -66,14 +66,11 @@ class TipsTheme extends Themelet { $html .= ""; $n = 0; - foreach ($tips as $tip) - { - $oe = ($n++ % 2 == 0) ? "even" : "odd"; - + foreach ($tips as $tip) { $tip_enable = ($tip['enable'] == "Y") ? "Yes" : "No"; $set_link = "".$tip_enable.""; - $html .= "". + $html .= "". "".$tip['id']."". "".$set_link."". ( diff --git a/ext/alias_editor/theme.php b/ext/alias_editor/theme.php index dfb24f44..34e66d8d 100644 --- a/ext/alias_editor/theme.php +++ b/ext/alias_editor/theme.php @@ -33,9 +33,8 @@ class AliasEditorTheme extends Themelet { foreach($aliases as $old => $new) { $h_old = html_escape($old); $h_new = "".html_escape($new).""; - $oe = ($n++ % 2 == 0) ? "even" : "odd"; - $h_aliases .= "$h_old$h_new"; + $h_aliases .= "$h_old$h_new"; if($can_manage) { $h_aliases .= " diff --git a/ext/ext_manager/theme.php b/ext/ext_manager/theme.php index 879380cb..599acf85 100644 --- a/ext/ext_manager/theme.php +++ b/ext/ext_manager/theme.php @@ -27,11 +27,10 @@ class ExtManagerTheme extends Themelet { else if($extension->enabled === FALSE) $h_enabled = ""; else $h_enabled = " disabled checked='checked'"; $h_link = make_link("ext_doc/".url_escape($extension->ext_name)); - $oe = ($n++ % 2 == 0) ? "even" : "odd"; $h_en = $editable ? "" : ""; $html .= " - + $h_en $h_name $h_description diff --git a/ext/setup/theme.php b/ext/setup/theme.php index 609ed6b8..e8b304c8 100644 --- a/ext/setup/theme.php +++ b/ext/setup/theme.php @@ -50,7 +50,6 @@ class SetupTheme extends Themelet { $h_name = html_escape($name); $h_value = html_escape($value); $len = strlen($h_value); - $oe = ($n++ % 2 == 0) ? "even" : "odd"; $h_box = ""; if(strpos($value, "\n") > 0) { @@ -60,7 +59,7 @@ class SetupTheme extends Themelet { $h_box .= ""; } $h_box .= ""; - $h_rows .= "$h_name$h_box"; + $h_rows .= "$h_name$h_box"; } $table = " diff --git a/themes/default/style.css b/themes/default/style.css index 58e9de34..4a0bc0ce 100644 --- a/themes/default/style.css +++ b/themes/default/style.css @@ -60,8 +60,8 @@ TABLE.zebra TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;} TABLE.zebra THEAD TD, TABLE.zebra THEAD TH {border-bottom: 2px solid #CCC;} TABLE.zebra TFOOT TD, TABLE.zebra TFOOT TH {border-top: 2px solid #CCC;} TABLE.zebra TR TD {border-bottom: 1px solid #DDD;} -TABLE.zebra TR.odd {background: #EFEFEF;} -TABLE.zebra TR.even {background: #E0E0E0;} +TABLE.zebra TR:nth-child(odd) {background: #EFEFEF;} +TABLE.zebra TR:nth-child(even) {background: #E0E0E0;} #footer { clear: both; diff --git a/themes/flat/style.css b/themes/flat/style.css index 75e41b34..7c63161b 100644 --- a/themes/flat/style.css +++ b/themes/flat/style.css @@ -58,8 +58,8 @@ TABLE.zebra TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;} TABLE.zebra THEAD TD, TABLE.zebra THEAD TH {border-bottom: 2px solid #CCC;} TABLE.zebra TFOOT TD, TABLE.zebra TFOOT TH {border-top: 2px solid #CCC;} TABLE.zebra TR TD {border-bottom: 1px solid #DDD;} -TABLE.zebra TR.odd {background: #EFEFEF;} -TABLE.zebra TR.even {background: #E0E0E0;} +TABLE.zebra TR:nth-child(odd) {background: #EFEFEF;} +TABLE.zebra TR:nth-child(even) {background: #E0E0E0;} #footer { clear: both; diff --git a/themes/lite/style.css b/themes/lite/style.css index 11994ebb..50b7e18f 100644 --- a/themes/lite/style.css +++ b/themes/lite/style.css @@ -146,8 +146,8 @@ TABLE.zebra TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;} TABLE.zebra THEAD TD, TABLE.zebra THEAD TH {border-bottom: 2px solid #C3D2E0;} TABLE.zebra TFOOT TD, TABLE.zebra TFOOT TH {border-top: 2px solid #C3D2E0;} TABLE.zebra TR TD {border-bottom: 1px solid #C3D2E0;} -TABLE.zebra TR.odd {background: #CEDFF0;} -TABLE.zebra TR.even {background: #F0F7FF;} +TABLE.zebra TR:nth-child(odd) {background: #CEDFF0;} +TABLE.zebra TR:nth-child(even) {background: #F0F7FF;} INPUT, TEXTAREA { -moz-border-radius:4px; @@ -367,4 +367,4 @@ UL { left:0; z-index:3; display:none; -} \ No newline at end of file +} diff --git a/themes/old_default/style.css b/themes/old_default/style.css index 76bf02e9..90c99200 100644 --- a/themes/old_default/style.css +++ b/themes/old_default/style.css @@ -56,8 +56,8 @@ TABLE.zebra TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;} TABLE.zebra THEAD TD, TABLE.zebra THEAD TH {border-bottom: 2px solid #CCC;} TABLE.zebra TFOOT TD, TABLE.zebra TFOOT TH {border-top: 2px solid #CCC;} TABLE.zebra TR {border-bottom: 1px solid #DDD;} -TABLE.zebra TR.odd {background: #EFEFEF;} -TABLE.zebra TR.even {background: #E0E0E0;} +TABLE.zebra TR:nth-child(odd) {background: #EFEFEF;} +TABLE.zebra TR:nth-child(even) {background: #E0E0E0;} #footer { clear: both; diff --git a/themes/warm/style.css b/themes/warm/style.css index 236d8a49..3ee3e99a 100644 --- a/themes/warm/style.css +++ b/themes/warm/style.css @@ -61,8 +61,8 @@ TABLE.zebra TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;} TABLE.zebra THEAD TD, TABLE.zebra THEAD TH {border-bottom: 2px solid #B89F7C;} TABLE.zebra TFOOT TD, TABLE.zebra TFOOT TH {border-top: 2px solid #B89F7C;} TABLE.zebra TD {border-top: 1px solid #B89F7C;} -TABLE.zebra TR.odd {background: #FCD9A9;} -TABLE.zebra TR.even {background: #DABC92;} +TABLE.zebra TR:nth-child(odd) {background: #FCD9A9;} +TABLE.zebra TR:nth-child(even) {background: #DABC92;} #footer { clear: both;