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)
 Add an Indent function with [t] and [/t]
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

cbsarge
Starting Member

USA
20 Posts

Posted - 13 February 2007 :  13:02:22  Show Profile  Visit cbsarge's Homepage  Reply with Quote
I'm trying to figure out how to enable an indent function. I'm willing to just have the key insert 4 blank spaces to have it look like it's indented. Maybe have [indent1, 2 or 3] each being more indented than the last. I got something like that to work by using the [code] tag as an example but, if I use it none of the other tags will work in that post.

Any help would be greatly appreciated!<

"if we don't measure it, we can't lie about it"

Edited by - cbsarge on 14 February 2007 10:14:59

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 13 February 2007 :  13:48:02  Show Profile  Visit MaD2ko0l's Homepage  Reply with Quote
to indent somthing cant u just use the <ul> and </ul>...that should make a block of text indented<

© 1999-2010 MaD2ko0l
Go to Top of Page

cbsarge
Starting Member

USA
20 Posts

Posted - 13 February 2007 :  14:31:13  Show Profile  Visit cbsarge's Homepage  Reply with Quote
We're using forum code.

I got it to work by adding this code to the inc_func_common.asp file at around line 634:
fString = doCode(fString, "[t]", "[/t]", "<dl><dt><dd>", "</dl></dt></dd>")


I put this in at after the following code:
fString = doCode(fString, "", "", "<i>", "</i>")


The nice thing about this is it carries to the next line so if you hit a carriage return while entering your message the next line stays indented the same as the line above until you use the closing tag [/t]

You can also nest this so that you can indent a line and then indent the next line down with another [t] even more.<

"if we don't measure it, we can't lie about it"

Edited by - cbsarge on 14 February 2007 10:13:37
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 14 February 2007 :  10:42:19  Show Profile  Visit MarcelG's Homepage  Reply with Quote
I'm not sure if this the way the definition tag was meant to be used. The fact that it shows correctly does not mean it's using the correct standard.
I think it would be better to use a div for that, and do something like this, with inline style definition:
fString = doCode(fString, "[t]", "[/t]", "<div style="padding-left:30px;width:100%;overflow:hidden>", "</div>")

By the way ; if I'm not mistaking, the place you put this code in, transforms the forumcode into HTML prior to the database insert.
If you edit an existing topic/reply which contains the [t][/t] tags, you'll see the HTML...unless you edit inc_func_posting.asp.

Therefore I advice you to put it in the extratags function instead.<

portfolio - linkshrinker - oxle - twitter

Edited by - MarcelG on 14 February 2007 10:44:28
Go to Top of Page

cbsarge
Starting Member

USA
20 Posts

Posted - 14 February 2007 :  15:03:10  Show Profile  Visit cbsarge's Homepage  Reply with Quote
As MarcelG said, the place I originally put the new code caused the html to be displayed (not converted back to forum code) when editing a previous post that had the new tag in it. I move the code to line number 393 in in_func_comon.asp in the extratags area and it now works correctly. When you go to edit a post that the new tag was used in, it correctly changes it back to forum code when retrieving it from the database.

So if you want to add this tag, go to around line 392 and below this:
fString = doCode(fString, "", "", "<font color=""" & CColor & """>", "</font id=""" & CColor & """>")


put this:
fString = doCode(fString, "[t]", "[/t]", "<dl><dt><dd>", "</dd></dt></dl>")
<

"if we don't measure it, we can't lie about it"

Edited by - cbsarge on 16 February 2007 09:30:31
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 14 February 2007 :  15:27:37  Show Profile  Visit AnonJr's Homepage  Reply with Quote
Glad you got the code in the right place. I'm going to have to second MarcelG's advice on using the proper tag for the proper purpose. The <dd> and related tags were not meant for the sole purpose of indentation. Because of this, screen readers, site validators, and other assistive technologies may have problems with your site. Also, different browsers treat that set of tags a little differently so you will most likely not get a consistent look.

You really ought to take Marcel's suggestion and use a <div> or a <span> and some CSS to get what you want as that is more semantically correct than your option.

If you're hell-bent on using those tags, you might want to at least nest them properly and close them in the reverse order they were opened in... <

Edited by - AnonJr on 14 February 2007 15:28:24
Go to Top of Page

cbsarge
Starting Member

USA
20 Posts

Posted - 16 February 2007 :  09:29:47  Show Profile  Visit cbsarge's Homepage  Reply with Quote
ROFL

Thanks AnonJr - plain old laziness on my part! "I'll just cut and paste this rather than having to type in 3 whole closing tags" - yikes.

I see your point on the right use of tags - I'm using a wrench to bang in some nails I guess. This is only going to be internal for our engineering group so it should be o.k. but, I'll mess around with some <div> tags to see about changing it to that method.

Is this worth posting when I get it to work? Do you think other users may be interested in having this function? Also, is there a more formal way of posting something like this or is this format o.k.?

Thanks for the input!<

"if we don't measure it, we can't lie about it"
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 19 February 2007 :  09:56:26  Show Profile  Visit AnonJr's Homepage  Reply with Quote
I'd go ahead and post it since you never know what somebody may be looking for.

Have fun, and watch that cut/past... <
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.19 seconds. Powered By: Snitz Forums 2000 Version 3.4.07