Skip to content

Commit

Permalink
Color the topic title in preview
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidIQ committed Mar 30, 2018
1 parent 7865b17 commit 58956d7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
7 changes: 6 additions & 1 deletion event/main_listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,12 @@ public function modify_posting_auth($event)
if ($mode == 'post' || ($post_id == $topic_first_post_id))
{
$this->user->add_lang_ext('davidiq/topictitlecolor', 'topictitlecolor');
$this->template->assign_var('S_TOPIC_TITLE_COLOR', true);
$title_color = strtoupper($this->request->variable('title_color', ''));
$this->template->assign_vars(array(
'S_TOPIC_TITLE_COLOR' => true,
'TITLE_COLOR' => $title_color,
'S_TOPIC_PREVIEW' => true,
));
}

$this->get_topic_color($topic_id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@
</dd>
<dd id="topic_title_color_palette_placeholder" class="color_palette_placeholder" data-orientation="h" data-height="10" data-width="13" data-target="#title_color">
<!-- ENDIF -->
<!-- INCLUDE @davidiq_topictitlecolor/topic_title_color_style.html -->
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- INCLUDE @davidiq_topictitlecolor/topic_title_color_style.html -->
3 changes: 2 additions & 1 deletion styles/all/template/topic_title_color_style.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!-- IF TITLE_COLOR -->
<style>
.posting-title a,
<!-- IF S_TOPIC_PREVIEW -->div.postbody h3,<!-- ENDIF -->
<!-- IF not S_TOPIC_PREVIEW -->.posting-title a,<!-- ENDIF -->
.topic-title a {
color: #{TITLE_COLOR} !important;
}
Expand Down

0 comments on commit 58956d7

Please sign in to comment.