How to change nickname link color in comments? How to change nickname link color in comments?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

How to change nickname link color in comments?

Started by kpgmza, August 11, 2023, 01:07:57 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

kpgmza

Hi... I hope you can help me with this modification.

I try to change the color of the user's nickname link that appears in the comments, but I see that it also affects the color of the link that appears on the homepage.
The problem is that the homepage has a light background and the comment title bar has a dark background, that is, there is no link color that goes well with both!

I modify the color of the links (active, visited, etc) from the CSS file.

Is there any way to make the user's nickname link behave differently on the homepage and on the comments page so I can assign it different colors without one affecting the other?

I hope I was clear in my question and that you can help me. thank you so much.

ron4mac

At the top of the theme.php file in your theme, add this define with other defines that may be there:
define('THEME_WANTS_BODY_CLASS', 1);
And in the template.html file in your theme, change the <body> tag to:
<body class="{BODY_CLASS}">

Then in your css, you can use the class name of the page being displayed. Class names are in the form: BC-<page>
Example:
.BC-index .thumb_title_owner {color: red}

kpgmza

Hi ron4mac:

Thank you, but not working for me.

My files were like this:

theme.php
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2009 Coppermine Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License version 3
  as published by the Free Software Foundation.

  ********************************************
  Coppermine version: 1.4.25
  $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.4.x/themes/water_drop/theme.php $
  $Revision: 5997 $
  $Author: gaugau $
  $Date: 2009-05-26 08:43:24 +0200 (Di, 26 Mai 2009) $
**********************************************/

define('THEME_IS_XHTML10_TRANSITIONAL',1); // Remove this if you edit this template until // you have validated it. See docs/theme.htm.
define('THEME_WANTS_BODY_CLASS'1);                                          

// HTML template for template sys_menu spacer
$template_sys_menu_spacer ='&#38;#8226';

?>




template.html
</script>

</head>
<body class="{BODY_CLASS}">
<div id="rap">
<div id="container">
<div class="content">


style.css

.BC-index .thumb_title_owner {color: red}


The change of the color of the name of the users under the thumbnails was not made  :(

ron4mac

Oh ... sorry, I was assuming that you are using a recent version of CPG (1.6.10 or newer). Are you?

kpgmza


ron4mac

Please provide a link to your site. You can PM me with it, if you prefer.

ron4mac

For what you are trying to do, use this CSS:
.BC-displayimage #comments a { color: #f9e0b2; }

kpgmza

Thank you very much!!! :) :) :).... That's work for me!!! . You are a genius! :)