DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • December 03, 2016, 07:53:33 PM
Home Forums News Links Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
IRC Channels
Search

Pages: [1] 2 3 4   Go Down
  Print  
Author Topic: Color question..  (Read 7704 times)
0 Members and 1 Guest are viewing this topic.
Dhampir
Guest
« on: March 25, 2005, 09:45:39 PM »

What do I need to go about doing, to re put Black, as a chat color code?

I heard it as takin' out because it was deemed too hard to see, but I wanted to add this. If anyone could help me with this, i'd greatly appreciate this.

Thanks,

Dhampir.
Logged
CortalUX
Dwellings Project
Mod God
*****
Offline Offline

Posts: 796


Wogga! Meep!


View Profile WWW
« Reply #1 on: March 27, 2005, 10:08:31 AM »

If you do a search through the forum, I think someone else wanted to add pink.. I'll just find the url.
Logged
CortalUX
Dwellings Project
Mod God
*****
Offline Offline

Posts: 796


Wogga! Meep!


View Profile WWW
« Reply #2 on: March 27, 2005, 10:14:47 AM »

0.9.7 http://dragonprime.net/index.php?board=8;action=display;threadid=479;start=msg3500#msg3500
0.9.8 http://dragonprime.net/index.php?board=5;action=display;threadid=94;start=msg2746#msg2746

For 0.9.7 (by MightyE)
Code:
Adding color is a 2 part process....the first part is to actually add the color to the style sheets....

I'm not sure all of the stylesheets which are being used anymore...so I'll just cover the basics....

Go into newstyle.css AND yarbrough.css...and add the following two lines to the bottom:

.colLtPink  { color: #FFCCFF; }
.colDkPink  { color: #FF80FF; }

After that, you must get the appoencode function to recognize the color....to do this, pick 2 symbols which you would like to use for light and dark pink...

For the purpose of this post I'll use '8' for dark pink and '*' for light pink.....Then go into common.php, line 351...notice the "switch" statement with all of the cases...add the following lines... between the case ')' and the case 'c' code....

case "8":
    if ($nestedtags[font]) $output.="</span>";
    else $nestedtags[font]=true;
    $output.="<span class='colDkPink'>";
    break;
case "*":
    if ($nestedtags[font]) $output.="</span>";
    else $nestedtags[font]=true;
    $output.="<span class='colLtPink'>";
    break;

Once you do that, you should be able to type `8 or `* in any formatted text and display the text in "pink"...

Hope that helps!!
One more thing you need to do is add the values to the filtering regexp in viewcommentary().  This is found shortly after the first for() loop in that function, and the line looks like this:
$row[comment]=preg_replace("'[`][^1234567!@#$%^&]'","",$row[comment]);
Change the [^1234567!@#$%^&] section to include the color codes you're adding.  So for example, you might do this:
[^12345678!@#$%^&*]
In 0.9.8, I introduced orange as a color and put it on Q and q.  I did this because I wanted people to have to search around a bit to find it =).

This regular expression is moving to the lib/sanitize.php script in 0.9.8, in a function called commentary_sanitize(), and the viewcommentary() function is moving to lib/commentary.php
Edit: By MightyE and Drenac

For 0.9.8:
Code:
look at lines 487-523 for the javascript lin 'lib/commentary.php', which should be self explanatory.
look at lines 113-269 for the php in 'lib/output.php', which, again, should be self explanatory.
Add the keycode for whatever you did to the following lines: 7, 17, 24, 105,  and 107. in 'lib/sanitize.php'.
Add the colours to your CSS files as so:
.col<NAME>  { color: #<CODE>; }
Another edit: That one was by me :P
« Last Edit: March 30, 2005, 12:41:54 PM by CortalUX » Logged
Dhampir
Guest
« Reply #3 on: March 29, 2005, 05:28:33 PM »

Thanks!

Alright I just found a problem, my common.php, only has 344 lines, so something is different, then when they posted that, any suggestions on what I should do?
« Last Edit: March 29, 2005, 05:45:05 PM by Dhampir » Logged
Nefarius
Guest
« Reply #4 on: March 29, 2005, 05:55:18 PM »

* Nefarius actually just aded black to his site today.

Well, not add it all together, ihave the same problem, not that many lines, and the 'lib/sanatize' has the codes, i believe. I changed 'light black to black [dark grey]

But i would like to add some colors, if i could ever work out how to do it.
Logged
CortalUX
Dwellings Project
Mod God
*****
Offline Offline

Posts: 796


Wogga! Meep!


View Profile WWW
« Reply #5 on: March 30, 2005, 04:02:36 AM »

* Nefarius actually just aded black to his site today.

Well, not add it all together, ihave the same problem, not that many lines, and the 'lib/sanatize' has the codes, i believe. I changed 'light black to black [dark grey]

But i would like to add some colors, if i could ever work out how to do it.
look at lines 487-523 for the javascript lin lib/commentary.php.
look at lines 113-269 for the php in lib/output.php.
Add the keycode for whatever you did to the following lines: 7, 17, 24, 105,  and 107. in lib/sanitize.php .
Add the colours to your CSS files.
Logged
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #6 on: March 30, 2005, 04:18:16 AM »

Don't forget to press CTRL+F5 to force your brwoser to reload  the CSS! Otherwise the new colour information will not be loaded...
Logged

Running for more than three years now:
Kendaer
Guest
« Reply #7 on: March 30, 2005, 11:41:02 AM »

Thanks!

Alright I just found a problem, my common.php, only has 344 lines, so something is different, then when they posted that, any suggestions on what I should do?

Dhampir, that information was posted relating to 0.9.7.. A lot of stuff lived in common.php at that point that didn't belong there.  It was moved out.

Look at the section which reads 'for 0.9.8' rather than the section which reads 'for 0.9.7' in the long post.

Logged
Dhampir
Guest
« Reply #8 on: March 31, 2005, 06:57:44 PM »

Thanks Kendaer, but the first time I saw it, it WAS labled 0.9.8.


Alright, I was abled to get the two pinks to work, and i've almost got the black working, but my problem is.

When I type "`-Test" where you type it and hit says, the preview under neath it shows it black, yet, when I hit Add, it doesn't turn the color, like its not a code. I've checked my work atleast 20x, to see if I skipped something, I did with the pinks.

Does anyone have an idea about what I'm doing wrong?
Logged
Dhampir
Guest
« Reply #9 on: April 08, 2005, 06:39:59 AM »

Well, now its all screwed up after the upgrade to .1.0.1

Did anything that would involve adding colors change?

One of the pink still works, after I readded it to all the skins. The other pink works in the preview you see under where ylou type it, just like my black, but once you hit enter, it acts like that code doesn't exist.

Thanks if anyone has any idea what my problem is.
Logged
Freeze
Guest
« Reply #10 on: April 10, 2005, 07:36:46 AM »

Has anything changed in v1?
Logged
CortalUX
Dwellings Project
Mod God
*****
Offline Offline

Posts: 796


Wogga! Meep!


View Profile WWW
« Reply #11 on: April 10, 2005, 08:04:06 AM »

I'm not sure... I don't think that much did.
Logged
MyLotGD
Captain of the Guard
***
Offline Offline

Posts: 136


View Profile WWW
« Reply #12 on: April 10, 2005, 08:31:23 AM »

Has anything changed in v1?

You could always take the time to have a look you know.

In general though if your looking for a way to explain all the problems you experienced with upgrading from pre-release.14 to 1.0.0 and or 1.0.1 within the core code. I doubt anything has changed as much as to obstruct the game play or altogether keep your users from accessing the game.

Nor have I heard of anyone having any similar troubles as you supposedly have had with the upgrade so I'm assuming the error is with you or something you have or are trying to do.

Whatever the case maybe good luck.
Logged

Dhampir
Guest
« Reply #13 on: April 10, 2005, 09:36:24 AM »

I never pointed a finger at the the upgrade, saying it was the one and only reason.

I merely ASKED, if anything was changed, that might affect them.
Logged
Freeze
Guest
« Reply #14 on: May 21, 2005, 09:19:50 PM »

* Lord NeXus has not 1 single idea what twisted is talking about
But for the record, it was the host, for some reason, and all works now.

And on topic, this color change thing doesnt work for me on .2. Has somthing changed in v1 that makes the color changing stuff diffrent?
Logged
Pages: [1] 2 3 4   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Welcome to DragonPrime - The LoGD Resource Community!

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Who's Online
48 Guests, 0 Users
DragonPrime LoGD
Recent Topics
Home Forums News Links Downloads Login Register Advanced Search