Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 MINI-MOD: Using every HEX color in Forum Code
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

SiSL
Average Member

Turkey
671 Posts

Posted - 19 October 2005 :  16:24:55  Show Profile  Visit SiSL's Homepage  Reply with Quote
This mini-mod actually helps you use any HEX color on your forum code.

Example: [color="#FF00FF"]Text here[/color="#FF00FF"]

Add this function somewhere in your inc_func_common.asp

Function doColorCode(fstring)
	set re = new RegExp
	re.pattern = "\[color=("")(\#)([a-f0-9]{6})+("")\]"
	re.ignorecase = true
	re.global = true
	set matches = re.execute(fstring) ' find matches
	if matches.count <> 0 then
		for each match in matches
			changetext = Replace(Replace(match.value,"[color=" &chr(34),"<span style=""color: "),chr(34) & "]",chr(34) & ">")
			fstring = Replace(fstring, match.value, changetext)
		next
	end if
	re.pattern = "\[\/color=("")(\#)([a-f0-9]{6})+("")\]"
	re.ignorecase = true
	re.global = true
	set matches = re.execute(fstring) ' find matches
	if matches.count <> 0 then
		for each match in matches
			changetext = Replace(Replace(match.value,"[/color=" & chr(34) ,"</span style=""color: "),chr(34) & "]",chr(34) & ">")
			fstring = Replace(fstring, match.value, changetext)
		next
	end if
	doColorCode = fstring
	set re = nothing
	set matches = nothing
end function


Find following line in inc_func_common.asp

		fString = extratags(fString)


Add following right above it:

		fString = doColorCode(fstring)



And that's it :)

I would love someone can actually write a "Prompt" mode addition to it, but I guess best way is to make an iframe visible on an icon and let users pick colors :)

You can see a working demo at with using [renk="#FF0000"]test[/renk] (because renk = color in my language :P)

http://www.amedia.org/forum/
User: demo Password: test

EDIT: Updated Font Tags with SPAN<

CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod

Edited by - SiSL on 20 October 2005 05:15:51

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 20 October 2005 :  04:29:22  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Nifty mod you've got there SiSL!!!!! Impressive!
Quick question though about using the font tag ; I've been told by many people already that the <font> tag is 'deprecated'. In other words ; we shoulnd't use it anymore...
So, you might want to use <SPAN style="text-color: #EAEAAE">

With that in mind you could also whipp up a nice 'magic marker' mod from this mod.
For instance : [marker="#123456"]blabla[/marker] which then is transformed into something like this: <SPAN style="background-color: #123456">blabla</span>.

(I see you know how to create a regular expression, so I alsmost do not dare to ask, but do you think you could remodel this mod to a regular expression ánd so that it uses the [tip=""][/tip] instead of [tip=**][/tip] syntax ? It would be very much appreciated if you could have a look at that mod, to see if it's possible! However, it's not easy to define a recurring pattern between the ""'s, as it's free format text....of any length...)<

portfolio - linkshrinker - oxle - twitter

Edited by - MarcelG on 20 October 2005 04:31:32
Go to Top of Page

SiSL
Average Member

Turkey
671 Posts

Posted - 20 October 2005 :  04:33:53  Show Profile  Visit SiSL's Homepage  Reply with Quote
I will take a look quickly :)

PS: Same can be applied to [quote="nick"]message[/quote] I guess too :) Hmm I may go further with [quote nick="post" time="this" replyid="this"] stuff :P (btw I added stuff for people picking colors on my website)

But point there in your mod, there is no limiter like (6) characters top will be only A-F and 0-9 characters, there for need a task still removing unwanted stuff such as < > however, I guess it may work out well :)
<

CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod

Edited by - SiSL on 20 October 2005 04:48:49
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 20 October 2005 :  05:00:10  Show Profile  Visit MarcelG's Homepage  Reply with Quote
ooooooh....this opens up so many hot possibilities!!!! <

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

SiSL
Average Member

Turkey
671 Posts

Posted - 20 October 2005 :  05:11:40  Show Profile  Visit SiSL's Homepage  Reply with Quote
Btw <span style="color: #color"> rather than text-color, text-color do not work :)<

CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 20 October 2005 :  05:21:45  Show Profile  Visit HuwR's Homepage  Reply with Quote
I'm not sure I agree with the [quote = "nick"] approach as people could abuse it and start wrongly attributing comments to other users<
Go to Top of Page

SiSL
Average Member

Turkey
671 Posts

Posted - 20 October 2005 :  05:33:07  Show Profile  Visit SiSL's Homepage  Reply with Quote
quote:
Originally posted by HuwR

This can be already abused



Like that :) So I dont think it is much of thing that is "actually" would be believed by users without seeing original reply that is quoted.<

CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod

Edited by - SiSL on 20 October 2005 05:34:32
Go to Top of Page

SiSL
Average Member

Turkey
671 Posts

Posted - 20 October 2005 :  05:35:53  Show Profile  Visit SiSL's Homepage  Reply with Quote
quote:
Originally posted by MarcelG

(I see you know how to create a regular expression, so I alsmost do not dare to ask, but do you think you could remodel this mod to a regular expression ánd so that it uses the [tip=""][/tip] instead of [tip=**][/tip] syntax ? It would be very much appreciated if you could have a look at that mod, to see if it's possible! However, it's not easy to define a recurring pattern between the ""'s, as it's free format text....of any length...)



Here you go (with that, you cannot use " (quote) in tips tho..

EDIT: code makes it problem, here is link

I guess one of downsides of this, cursor don't really follow [tip][/tip] line. it changes front [tip] to yours and final tip to </span>

and oops, sorry, fixed the link<

CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod

Edited by - SiSL on 20 October 2005 05:43:55
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 20 October 2005 :  05:43:14  Show Profile  Visit MarcelG's Homepage  Reply with Quote
quote:
Originally posted by SiSL
Here you go (with that, you cannot use " (quote) in tips tho..
EDIT: code makes it problem, here is link
Thanks, but that link isn't working (it points to forum.snitz.com)<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

SiSL
Average Member

Turkey
671 Posts

Posted - 20 October 2005 :  05:47:00  Show Profile  Visit SiSL's Homepage  Reply with Quote
Changed link and you know you have to add
fString = doTips(fstring)


EDIT: I changed your function again Marcel (updated txt in link) now you can also use " (quote) too..

Such as:

[tip="This is "the mighty" MarcelG"]Tip here[/tip]<

CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod

Edited by - SiSL on 20 October 2005 06:02:05
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 20 October 2005 :  06:20:46  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Great!!! Thanks!
Now just finding a way to replace all instances of tip=** by tip=""

By the way, looking at the function, I see that it makes no difference for images being used inbetween the tip-tag.
Do you reckon you could update the function to leave out the span style in case the text between the tip-tags is an image (e.g. starts with [img] or [bimg=left] or [img=left] or [img=right] or [bimg=right], and ends with [/img], or [/img=left] or [/bimg=left] or [/bimg=right] or [/img=right] (upper/lowercase) ?)

Sorry to take this topic completely offtrack by the way....<

portfolio - linkshrinker - oxle - twitter

Edited by - MarcelG on 20 October 2005 06:21:26
Go to Top of Page

SiSL
Average Member

Turkey
671 Posts

Posted - 20 October 2005 :  08:27:36  Show Profile  Visit SiSL's Homepage  Reply with Quote
Not sure what you mean really? :(
<

CHIP Online Forum

My Mods
Select All Code | Fix a vulnerability for your private messages | Avatar Categories W/ Avatar Gallery Mod | Complaint Manager
Admin Level Revisited | Merge Forums | No More Nested Quotes Mod
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000 Version 3.4.07