DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • September 20, 2017, 09:24:31 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: 1 2 3 [4]   Go Down
  Print  
Author Topic: Custom Colors : File Submission/Discussion  (Read 7649 times)
0 Members and 1 Guest are viewing this topic.
TGTarheel
Captain of the Guard
***
Offline Offline

Posts: 121


View Profile
« Reply #45 on: July 04, 2017, 07:55:02 PM »

Ok, so I am still not clear.

Do I have to change this in EVERY MODULE that called for sanitize?

Do I have to require modules/custom-colors.php in EVERY INSTALLED MODULE??

This is what I am failing to understand.

Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1740


View Profile
« Reply #46 on: July 05, 2017, 07:50:42 AM »

Either or. You can either add in the new sanitize function and then edit every file to use it, or simple replace the original sanitize function with the new one.
Logged

TGTarheel
Captain of the Guard
***
Offline Offline

Posts: 121


View Profile
« Reply #47 on: July 05, 2017, 12:28:21 PM »

So, LET ME SEE...if I thoroughly understand this now...

in lib/sanitize.php

Code:
function sanitize($in){
$out = preg_replace("/[`][01234567890!@#\$%^&)~QqRrVvGgTtjJeElL?*AabicnHw]/", "", $in);
return $out;
}

is replaced by
Code:
function sanitize($in){
$out = preg_replace("/[`][1234567890!@#\$%^&)~QqRVvGgTtjJeElLxXyYkKpPmM?*AabicnHw".getcustomchars()."]/", "", $in);
return $out;
}

AND

Code:
function color_sanitize($in){
$out = preg_replace("/[`][01234567890!@#\$%^&)~QqRrVvGgTtjJeElL?*Aabi]/", "", $in);
return $out;
}

is replaced by

Code:
function color_sanitize($in){
$out = preg_replace("/[`][1234567890!@#\$%^&)~QqRVvGgTtjJeElLxXyYkKpPmM?*Aabi".getcustomchars()."]/", "", $in);
return $out;
}

AND

Code:
function comment_sanitize($in) {
// to keep the regexp from boinging this, we need to make sure
// that we're not replacing in with the ` mark.
$out=preg_replace("/[`](?=[^1234567890!@#\$%^&)~QqRrVvGgTteEjJlL?*Aa])/", chr(1).chr(1), $in);
$out = str_replace(chr(1),"`",$out);
return $out;
}

is replaced by

Code:
function comment_sanitize($in) {
// to keep the regexp from boinging this, we need to make sure
// that we're not replacing in with the ` mark.
$out = preg_replace("/[`](?=[^1234567890!@#\$%^&)~QqRVvGgTteEjJlLxXyYkKpPmM?*Aa".getcustomchars()."])/", chr(1).chr(1), $in);
$out = str_replace(chr(1),"`",$out);
return $out;
}

THEN...I do not have to replace anything in any modules anywhere....it all should work.  RIGHT??

Seriously, I need to know before I do this.  And sorry, but the instructions might be clear for ADVANCED CODERS...I am not one.  I am intermediate level at best.  Just know enough to be thoroughly dangerous.

You oughta get a look at the most-recent module I coded for myself from scratch, for example.

I use over 4000 lines of code.  An experienced coder would probably look at it, laugh, and do the same thing in half the lines.  But I am not that slick with coding...just am not.  But I can get it done.  This is advanced stuff, though...so I need to be sure I am doing it right.

How else does one learn if they do not ask questions?

I thank you for bearing with me and being patient with me on this.
« Last Edit: July 05, 2017, 12:31:17 PM by TGTarheel » Logged
Aeolus
Mod God
*****
Offline Offline

Posts: 1773


You're welcome.


View Profile WWW
« Reply #48 on: July 05, 2017, 04:57:33 PM »

Yep, exactly that. After you've done that, the module should work. No guarantees, as I didn't code it for a deprecated core system.

You'll learn as you go along, it'll become second nature the more you do it. Good luck.
Logged

TGTarheel
Captain of the Guard
***
Offline Offline

Posts: 121


View Profile
« Reply #49 on: July 05, 2017, 06:10:56 PM »

Thank you for clearing it up.  I will give it a try, first backing up my original sanitize.php file so that I can get back if I need to.

Will report back if this works on 1.1.0
Logged
TGTarheel
Captain of the Guard
***
Offline Offline

Posts: 121


View Profile
« Reply #50 on: July 05, 2017, 06:34:22 PM »

OK.  It does not work on 1.1.0 - it caused no commentary to be able to be posted.

I tested it with adding a code for the character A and did a HTML color code I looked up.  Six hexadecimal characters.

It saved, but then...not only did the color code not work, no other commentary did either.

SO...seeing as it does not work for 1.1.0 - does anyone know how I could add a few colors into 1.1.0?

(BY THE WAY....an upgrade to 1.1.1 is OUT OF THE QUESTION...I learned the the Alternate Currencies do not work on 1.1.1 and many of my modules depend on an alternate currency.  Not happening, 1.1.1 would break way too much of my site.)
« Last Edit: July 06, 2017, 03:01:33 PM by TGTarheel » Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1740


View Profile
« Reply #51 on: July 06, 2017, 04:50:29 PM »

Thing is, there really shouldn't be any major difference between 1.1.0 and 1.1.1 and 1.1.2 Changing the last digit should only mean bug fixes and possibly code changes due to mysql/php function changes.

There are detailed change logs somewhere that show exactly what's changed between versions. Can't seem to find them though.

What versions of php/mysql is your server running TGTarheel?
Logged

TGTarheel
Captain of the Guard
***
Offline Offline

Posts: 121


View Profile
« Reply #52 on: July 06, 2017, 05:06:54 PM »

Thing is, there really shouldn't be any major difference between 1.1.0 and 1.1.1 and 1.1.2 Changing the last digit should only mean bug fixes and possibly code changes due to mysql/php function changes.

There are detailed change logs somewhere that show exactly what's changed between versions. Can't seem to find them though.

What versions of php/mysql is your server running TGTarheel?

TBH, I do not know, it has been a while since I checked.  My site has been dormant for a while, I am revamping and revising things.

I kinda had personal issues that caused me to drop out of the LOTGD world for a while...and then I got back into it and decided to write a new module, based on an unrleased moduke I saw on someone else's site that I liked and they would not give me.  So - knowing how things worked, I was able to figure out how that module was done, and then code my own...and I improved and expanded on it, so sorta glad they didn't just give me the module I had wanted.  I did credit the idea from the unreleased module in my own module, and I also am mot releasing it here...primarily becaue mine relies heavily on the Item System, my particular alternate currency, and a couple of other unreleased modukes on my site that it interacts with...so it would not be useful on anyone else's site.

SO...that got me kinda really back into things and revamping and revising my site...that is how all this query about color codes came up.  So...the short answer is...I have to check.

I have a cheap server from HostGator, so I suspect I am not running the latest greatest of anything.

Seeing as I am running 1.1.0 I would say I was at least using PHP 5 - but beyond that, no real idea.  I would have to check on that.  As to MySQL...my Control Panel calls it PHPMyAdmin, if that tells you anything.

To be perfectly honest...I am a pretty poor intermediate level coder, most of you all would probably laugh at the stuff I do.  You're probably all way better than I am.
« Last Edit: July 06, 2017, 05:10:36 PM by TGTarheel » Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1740


View Profile
« Reply #53 on: July 06, 2017, 05:58:47 PM »

I'm actually surprised that v1.1.0 runs, there have been so many depreciated php functions that if you tried to install the unmodded v1.1.2, it just gives errors. Smiley

In the grotto, if you have the raw sql/php options, go to the php box and enter,

Code:
<?php
phpinfo
();

PHPMyadmin is just a free web based interface to allow for easy access to the sql database.

Quote
I am a pretty poor intermediate level coder

We all started somewhere, and the more you look through the LotGD files/modules, the more you'll see the struction and common function calls and understand them. All the modules basically follow the same layout.

I haven't coded in years and even when I did I'd only class myself as acceptable. I've no idea how classes work. Cheesy
Logged

TGTarheel
Captain of the Guard
***
Offline Offline

Posts: 121


View Profile
« Reply #54 on: July 06, 2017, 06:30:31 PM »

I'm actually surprised that v1.1.0 runs, there have been so many depreciated php functions that if you tried to install the unmodded v1.1.2, it just gives errors. Smiley

In the grotto, if you have the raw sql/php options, go to the php box and enter,

Code:
<?php
phpinfo
();

PHPMyadmin is just a free web based interface to allow for easy access to the sql database.

Quote
I am a pretty poor intermediate level coder

We all started somewhere, and the more you look through the LotGD files/modules, the more you'll see the struction and common function calls and understand them. All the modules basically follow the same layout.

I haven't coded in years and even when I did I'd only class myself as acceptable. I've no idea how classes work. Cheesy

That is how I learned what coding I did.

I started off with the Valhalla Ten Pack...that one is mine...originally, I was Kalisiin here, but certain things have changed in my life hence the new handle.
Anyway, I started off reverse=engineering other people's stuff...which got me in trouble at first as I did not understand proper crediting, but that got fixed.

Anyway...I just started with a module that worked and then messed ariund with it till it did what I wanted it to.  I have a module on my site called The Tardis...which gives mew days...believe it or not that started as Crazy Audrey, LOL!!  Of course, the final looks and functions nothing like Crazy Audrey anymore.

Over time, I got a bit better at this.

Forest Guild...a unique module I recently coded, which I have made reference to before...is the very first module I ever coded from scratch...and with absolutely no help of any kind from anyone.  I had never before done that.

But it is still probabky twice as many lines as it needs to be, but I am just not all that confident with more advanced coding techniques.

There are sites still running 0.97 and 0.98 so why would you be surprised that 1.1.0 still works?  It may not be much supported by DP anymore but it does work.

I'll look for that thing you mentioned and see if I can find out what version of pho and so on I am using, I am probably running ancient stuff, though.  I'm just more comfortable coding in this because this is what I learned yaknow??
Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1740


View Profile
« Reply #55 on: July 06, 2017, 08:13:05 PM »

0.97/0.98 were very much hands on with no plug and play modules. You wanted nav links? You had to add them to the code to link to the other file. So people who run those versions will have made any changes to keep them running. Smiley
Logged

TGTarheel
Captain of the Guard
***
Offline Offline

Posts: 121


View Profile
« Reply #56 on: July 06, 2017, 08:50:31 PM »

0.97/0.98 were very much hands on with no plug and play modules. You wanted nav links? You had to add them to the code to link to the other file. So people who run those versions will have made any changes to keep them running. Smiley

OK.  But why would 1.1.0 ever quit working?  Seriously...it might not be supported by DP, but it still DOES WORK...
I ask to learn.  There is a site far more popular than mine that uses 1.1.0 - and there is also one about as popular as mine currently, thanks to my long absence...that uses 1.1.1 and bot howdy does he have things way screwed up....I like the guy, he's nice and everything, but he has some weird stuff going on that make no sense...text showing up in places where it makes no sense...etc.
Logged
Aeolus
Mod God
*****
Offline Offline

Posts: 1773


You're welcome.


View Profile WWW
« Reply #57 on: July 07, 2017, 04:05:51 AM »

OK.  But why would 1.1.0 ever quit working?  Seriously...it might not be supported by DP, but it still DOES WORK...
I ask to learn.

Answer:

I'm actually surprised that v1.1.0 runs, there have been so many depreciated php functions that if you tried to install the unmodded v1.1.2, it just gives errors. Smiley

Also see URGENT! PHP 5.4.0 causes Game problems and every other issue.

To people in the future going through this thread looking for errors or questions on my module, please be aware that none of this relates, and has digressed away from the primary topic.
Logged

MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1740


View Profile
« Reply #58 on: July 07, 2017, 07:27:16 AM »

Yeah sorry Aeolus. </offtopic>
Logged

TGTarheel
Captain of the Guard
***
Offline Offline

Posts: 121


View Profile
« Reply #59 on: July 07, 2017, 08:27:45 AM »

Yeah sorry Aeolus. </offtopic>

Don't be.  This was more my fault.
If Admins want to move these to another thread, it won't hurt my feelings any.
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!
Recent Topics
DragonPrime LoGD
Who's Online
22 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search