[2.0.19] Hex BBCode v1.1.0

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
1
100%
Very Good
0
No votes
Good
0
No votes
Fair
0
No votes
Poor
0
No votes
 
Total votes: 1

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 27920
Joined: Sat Aug 16, 2003 7:36 am

[2.0.19] Hex BBCode v1.1.0

Post by Extensions Robot » Mon Jan 16, 2006 7:53 pm

MOD Name: Hex BBCode v1.1.0
Author: marcus.smith
MOD Description: Allows members to indicate colours by entering the HEX value as a BBCode. Useful for Photoshop tutorial type forums.


MOD Version: 1.1.0

Download File: hex_bbcode_v1.1.0.zip
mods overview page: View
File Size: 12938 Bytes

Security Score: 0

Support for this MOD needs to be asked within this topic. The phpBB Teams are not responsible or required to give anyone support for this MOD. By installing this MOD, the phpBB Support Team or phpBB MODifications Team may not be able to provide support.

This MOD has only been tested by the phpBB MOD Team with the phpBB version in the topic title. It may not work in any other versions of phpBB.
Last edited by Extensions Robot on Mon Apr 30, 2007 12:27 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)

User avatar
webmacster87
Former Team Member
Posts: 3758
Joined: Fri Jun 11, 2004 2:30 am
Location: San Mateo, CA
Name: Douglas Bell
Contact:

Post by webmacster87 » Sat Feb 04, 2006 12:05 am

MOD Validated/Released

Notes:
Adds a [hex][/hex] BBCode which will display a sample of whatever hex color is specified.

User avatar
3Di
Former Team Member
Posts: 13782
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Post by 3Di » Sat Feb 04, 2006 2:25 am

That's cool, thank you marcus.smith. :)
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

HiImGlen
Registered User
Posts: 18
Joined: Sat Apr 15, 2006 7:52 am
Location: Sydney - Australia.
Contact:

Post by HiImGlen » Fri Apr 21, 2006 12:58 am

Hey could someone explain how this could be made to work inside code tags?

I have the mod that enables color tags in code tags but couldn't figure out how to adapt it for this hex mod.

Any help is appreciated.
My Site - HERE!
My Forum - HERE!

marcus.smith
Registered User
Posts: 916
Joined: Sun Oct 10, 2004 9:58 pm

Post by marcus.smith » Fri Apr 21, 2006 5:26 am

HiImGlen wrote: ...I have the mod that enables color tags in code tags...


Hi there!

Can you link me to the mod detailed here so I can figure how it works, please?

Thanks,
Ma®©uS
..: Ma®©uS™ :..
Image Mods: Contact Form | Hex BBCode | Login Name

marcus.smith
Registered User
Posts: 916
Joined: Sun Oct 10, 2004 9:58 pm

Post by marcus.smith » Fri Apr 21, 2006 5:28 am

On second thoughts, no need - I found it.

Will get back to you ASAP. :)
..: Ma®©uS™ :..
Image Mods: Contact Form | Hex BBCode | Login Name

marcus.smith
Registered User
Posts: 916
Joined: Sun Oct 10, 2004 9:58 pm

Post by marcus.smith » Fri Apr 21, 2006 5:36 am

Okay, I don't have a phpBB setup at the moment - so this is untested - but may work. There's not much to alter, so if anything goes wrong at least you need only replace the bbcode.php with a back-up. :wink:

Please tell me if it worked, as I should like to know.

##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php

#
#-----[ FIND ]------------------------------------------
#
if ($mark_lowest_level && ($curr_nesting_depth == 1))
{
if ($open_tag[0] == '

Code: Select all

')
							{
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
								// HEX between [code] start
								$between_tags = preg_replace("#\[hex\](\#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/hex\]#si", "!hex=\\1~$uid!\\2!/hex~$uid!", $between_tags);
								// HEX between [code] end
# 
#-----[ FIND ]------------------------------------------ 
# 
						else
						{
							if ($open_tag[0] == '[code]')
							{
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
								// HEX between [code] start								
								$between_tags = preg_replace("#\[hex\](\#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/hex\]#si", "!hex=\\1~$uid!\\2!/hex~$uid!", $between_tags);
								// HEX between [code] end
# 
#-----[ FIND ]------------------------------------------ 
# 
	return $text;

} // bbencode_first_pass_pda()
# 
#-----[ BEFORE, ADD ]------------------------------------------ 
# 
	// HEX between [code] start								
	$text = preg_replace("/\!hex\](\#[0-9A-F]{6}|[a-z]+)~$uid\!/si","[hex=\\1:$uid]" , $text);
	$text = str_replace("!/hex~$uid!", "[/hex:$uid]", $text);
	// HEX between [code] end        
# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM

Regards,
Ma®©uS

PS: Soz, I can't wrap this in [code] tags because the mod itself contains [code] tags, as a result they don't work. :roll:
Last edited by marcus.smith on Fri Apr 21, 2006 5:59 am, edited 2 times in total.
..: Ma®©uS™ :..
Image Mods: Contact Form | Hex BBCode | Login Name

HiImGlen
Registered User
Posts: 18
Joined: Sat Apr 15, 2006 7:52 am
Location: Sydney - Australia.
Contact:

Post by HiImGlen » Fri Apr 21, 2006 5:43 am

It doesn't seem to have any effect. Although I just grabbed the header from another mod (that displays mod author info etc) and used EasyMod to install it.

It didn't complain about anything though...

EDIT: So basically it still comes up as [hex]#000000[/hex] within code tags.
My Site - HERE!
My Forum - HERE!

marcus.smith
Registered User
Posts: 916
Joined: Sun Oct 10, 2004 9:58 pm

Post by marcus.smith » Fri Apr 21, 2006 5:52 am

This might sound like a stupid question, but I need to check anyway...

Did you install the Hex Mod itself before these

Code: Select all

 edits?

And if so, does the [hex] tag work in normal posts outside of [code] tags?


Thanks,
Ma®©uS
..: Ma®©uS™ :..
Image Mods: Contact Form | Hex BBCode | Login Name

HiImGlen
Registered User
Posts: 18
Joined: Sat Apr 15, 2006 7:52 am
Location: Sydney - Australia.
Contact:

Post by HiImGlen » Fri Apr 21, 2006 5:57 am

The colour code inside code tag was installed before the hex bbcode mod (i checked in easymod history) and yes it does work outside of the code tags.

It's not vitally important but it would be nice :)
My Site - HERE!
My Forum - HERE!

marcus.smith
Registered User
Posts: 916
Joined: Sun Oct 10, 2004 9:58 pm

Post by marcus.smith » Fri Apr 21, 2006 6:01 am

That's okay, I figured there must have been something I overlooked - I editted the install code in the post above, please can you try it.

Thanks.
..: Ma®©uS™ :..
Image Mods: Contact Form | Hex BBCode | Login Name

HiImGlen
Registered User
Posts: 18
Joined: Sat Apr 15, 2006 7:52 am
Location: Sydney - Australia.
Contact:

Post by HiImGlen » Fri Apr 21, 2006 8:10 am

Afraid not, same result, no difference lol.
My Site - HERE!
My Forum - HERE!

marcus.smith
Registered User
Posts: 916
Joined: Sun Oct 10, 2004 9:58 pm

Post by marcus.smith » Fri Apr 21, 2006 11:10 pm

I can't figure this one out...

I thought it might be something to do with the '#' entity, and added code to have it replaced with ASCII ('#') - which did work, but still shows as:

Code: Select all

[hex]#FF0000[/hex]
So I'm a lil bit confused at the moment. :?

If I ever solve this, assuming its possible, I'll post again.

Cheers,
Ma®©uS
..: Ma®©uS™ :..
Image Mods: Contact Form | Hex BBCode | Login Name

HiImGlen
Registered User
Posts: 18
Joined: Sat Apr 15, 2006 7:52 am
Location: Sydney - Australia.
Contact:

Post by HiImGlen » Fri Apr 21, 2006 11:44 pm

Thanks, the help is much appreciated.

Remember though that i'm pretty sure the colour tag uses =somevalue where as your hex one doesn't, so that might make a difference.
My Site - HERE!
My Forum - HERE!

marcus.smith
Registered User
Posts: 916
Joined: Sun Oct 10, 2004 9:58 pm

Post by marcus.smith » Sat Apr 22, 2006 12:00 am

Yep, it uses [color=color]your text[/color]

But hex-bbcode can't do that, because it displays a coloured block, and there in nothing to go inbetween the tags, so I made the value go there instead.

Not sure in the [color] tag picks up the value like mine or if it uses an array. I see there's a limited drop-down selection, but am not sure what happens it a colour is entered as a hex value not in that list.

If it does use an array, I imagine hex-bbcode could be converted to use one also, but that then limits the selection and would not achieve what I hope for - a tool to use on Photoshop/art prog. type forums.

Also, arrays are a little out of my league, "php-wise", as I'm not that experienced with writing php from scratch yet.
..: Ma®©uS™ :..
Image Mods: Contact Form | Hex BBCode | Login Name

Post Reply

Return to “[2.0.x] MOD Database Releases”