Author Topic: Texte color in PHP ?  (Read 180 times)

abo

  • Prime Member
  • ****
  • Posts: 150
  • Karma: +0/-0
Texte color in PHP ?
« on: September 17, 2020, 09:52:59 PM »
Hello

I would like to change the color of a text directly in the PHP code but all my attempts are wrong ...
The code :

Code: [Select]
$output['message_body']="\n\n\n  ---------------- Message ---------------- \n\n".$output['message_body']."\n";
I want to change "message" and make it orange (#ff9900) and bold...
Thank you for your answer

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3169
  • Karma: +212/-7
    • Maverick Webworks
Re: Texte color in PHP ?
« Reply #1 on: September 18, 2020, 03:18:28 AM »
It will difficult to style fonts directly in a php string unless it's using php echo.

You need to style it in the html page where the message is being outputted, so look in the relative html page for something that looks like this:

{output.message}

and style it like this ....

<p style="color:#ff9900; font-weight:bold;"> {output.message} </p>
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

abo

  • Prime Member
  • ****
  • Posts: 150
  • Karma: +0/-0
Re: Texte color in PHP ?
« Reply #2 on: September 18, 2020, 04:32:40 AM »
Thank you Maverick but I don't want to make all the text in orange only the part I mentionned...

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3169
  • Karma: +212/-7
    • Maverick Webworks
Re: Texte color in PHP ?
« Reply #3 on: September 18, 2020, 10:58:30 AM »
Well the output for the message could be {output.message_body}, you'll have to look in the html for the right code to use as I have no idea which page this if for, I'm just kind of blindly guessing.



DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

abo

  • Prime Member
  • ****
  • Posts: 150
  • Karma: +0/-0
Re: Texte color in PHP ?
« Reply #4 on: September 18, 2020, 12:53:06 PM »
the page is message_send.php and the code is around line 42

Code: [Select]
if (mysql_num_rows($res)) {
$output=array_merge($output,mysql_fetch_assoc($res));
$output['subject']=(substr($output['subject'],0,3)=='Re:') ? $output['subject'] : 'Re: '.$output['subject'];
if ($output['message_type']==MESS_MESS) {
$output['message_body']="\n\n\n  ---------------- the text here in red ---------------- \n\n".$output['message_body']."\n";

thank you my blind helpful master :)
I still try ...

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3169
  • Karma: +212/-7
    • Maverick Webworks
Re: Texte color in PHP ?
« Reply #5 on: September 18, 2020, 01:50:47 PM »
If what you're trying to do is style the text inside the textarea box where you type a message, you can't style a textarea. You can only style text that's read by the recipient that receives the message after it's been sent.
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3169
  • Karma: +212/-7
    • Maverick Webworks
Re: Texte color in PHP ?
« Reply #6 on: September 18, 2020, 02:06:03 PM »
If you want to change the message text for what the recipient sees.

Open the message_read.css file and edit the following ...


#message_body {
    clear: both;
    padding-bottom: 10px;
    font-size: 16px;
}

To this ....

#message_body {
    clear: both;
    padding-bottom: 10px;
    font-size: 16px;
    color: #FF0000;
    font-weight: bold;
}
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

abo

  • Prime Member
  • ****
  • Posts: 150
  • Karma: +0/-0
Re: Texte color in PHP ?
« Reply #7 on: September 18, 2020, 10:00:13 PM »
It doesn't work ! nothing change...

I just would like to separate with differents colors or as I did (---------------- Previous message ------------ ) the messages sent from message received in message_read.php ... to get a much better view for the members.
But the only css code would be with "message-text" ... and that's too bad no being able to modify the color of messages sent and messages received ...
Hope you'll understand my frenchy message ;)

Thank's

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3169
  • Karma: +212/-7
    • Maverick Webworks
Re: Texte color in PHP ?
« Reply #8 on: September 18, 2020, 11:02:11 PM »


Is this the text you're wanting to change??

If so then you edit the following in the message_read.css file ....

h5 {
border: 1px solid #ccc;
background: #f5f5f5;
margin: 25px 0px 5px 30px;
padding: 5px 10px 5px 10px;
font-size: 13px;
font-style: italic;
color:#A1A1A1;
}

If your read messages doesn't look like this, or you don't have this code in your css file, then you might not be running the latest version of Etano and you'll need to upgrade to version 2.60


Also keep in mind that you may need to do a hard refresh (Ctrl + F5) to see the changes.
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

abo

  • Prime Member
  • ****
  • Posts: 150
  • Karma: +0/-0
Re: Texte color in PHP ?
« Reply #9 on: September 20, 2020, 06:44:39 AM »
Thank you for your "always precious" help. I actually have an old version of datemill, and the piece of code you just gave isn't there. I was counting on the new version of Khdev to switch but ... apparently it does not go as planned ...
Thank you anyway ... I'll try to manage that as good as I can...