FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Suggestions » Code Features
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Code Features [message #16306] Sun, 25 January 2004 18:08 Go to next message
Anonymous   United States
I know this has been discussed in some form before but I would like to see the use of fudcode in the code feature

For example, I would like to do the following and point out the menudd01 and menudd02:

Code:
<php>print ShowDropDown("[COLOR=red]menudd01[/COLOR]","High Grade,Master Grade,Perfect Grade","1,2,3",2);</php>
<php>print ShowDropDown("[COLOR=red]menudd02[/COLOR]","High Grade,Master Grade,Perfect Grade","1,2,3",2);</php>


But that obviously does not work

Instead, I have to use the QUOTE feature
Quote:

<php>print ShowDropDown("menudd01","High Grade,Master Grade,Perfect Grade","1,2,3",2);</php>
<php>print ShowDropDown("menudd02","High Grade,Master Grade,Perfect Grade","1,2,3",2);</php>



And while not a biggie, there is no "title=" in the Code feature like there is in the Quote feature.

[CODE title=CODE]If I put "title=CODE" it does not work[/CODE]


just some minor suggestions.
Re: Code Features [message #16311 is a reply to message #16306] Sun, 25 January 2004 19:08 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Using FUDcode inside [code] tag will never be allowed since parsing of FUDcode could potentially corrupt the data you are trying to display. The idea of [code] tag is to show the data you place it exactly as it is, so you can easily paste into the program and have it work.

FUDforum Core Developer
Re: Code Features [message #16574 is a reply to message #16311] Sun, 08 February 2004 14:36 Go to previous messageGo to next message
Anonymous   United States
If you don't allow the use of fudcode inside the CODE tag, it certainly reduces the effective use of the tag. There are times when you just want to show the code but there are other times when you want to show what changes have occurred in the code to highlight those changes to the viewer.

I find that we do the latter more than we do the former. Usually, members are just making small changes to a section of code in their posts. We sometimes start out with a section of code and evolve that code over a series of posts. We can use the CODE tag in the original post but not for subsequent posts. At least not if we want to highlight the changes for the viewer.

But most of the time we just post a section of code that we want to bring to the attention of the viewer. And we highlight just a part of that code to show what has changed from the previous post.

In either case, we cannot use the CODE tag and other fudcode tags inside the CODE tage to highlight any changes. Instead, we are forced to use the QUOTE tag. And since code looks better in the courier font, we have to wrap the whole thing in a FONT tag.

It would be nice to show what changes from one post to the next by somehow highlighting it. This would bring it to viewers attention so that they could see immediately what the poster has changed.

Allowing fudcode inside the CODE tag does make sense in that senario.
Re: Code Features [message #16575 is a reply to message #16311] Sun, 08 February 2004 14:41 Go to previous messageGo to next message
esm2002 is currently offline  esm2002   United States
Messages: 339
Registered: May 2002
Location: Atlanta Georgia
Karma: 0
Senior Member
sorry about the anonymous post.

Didn't know that it would allow you to that.

You can delete it

*********************************************

If you don't allow the use of fudcode inside the CODE tag, it certainly reduces the effective use of the tag. There are times when you just want to show the code but there are other times when you want to show what changes have occurred in the code to highlight those changes to the viewer.

I find that we do the latter more than we do the former. Usually, members are just making small changes to a section of code in their posts. We sometimes start out with a section of code and evolve that code over a series of posts. We can use the CODE tag in the original post but not for subsequent posts. At least not if we want to highlight the changes for the viewer.

But most of the time we just post a section of code that we want to bring to the attention of the viewer. And we highlight just a part of that code to show what has changed from the previous post.

In either case, we cannot use the CODE tag and other fudcode tags inside the CODE tage to highlight any changes. Instead, we are forced to use the QUOTE tag. And since code looks better in the courier font, we have to wrap the whole thing in a FONT tag.

It would be nice to show what changes from one post to the next by somehow highlighting it. This would bring it to viewers attention so that they could see immediately what the poster has changed.

Allowing fudcode inside the CODE tag does make sense in that senario.



Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."

[Updated on: Sun, 08 February 2004 14:43]

Report message to a moderator

Re: Code Features [message #16589 is a reply to message #16575] Mon, 09 February 2004 19:07 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The code tag is intended specifically for displaying source code in such a way that you could safely paste in to a file or editor and have it work. Using FUDcode inside it would work counter to this.

FUDforum Core Developer
Re: Code Features [message #16617 is a reply to message #16589] Tue, 10 February 2004 03:24 Go to previous messageGo to next message
esm2002 is currently offline  esm2002   United States
Messages: 339
Registered: May 2002
Location: Atlanta Georgia
Karma: 0
Senior Member
can you elaborate as to which fudcode would not allow what you suggest????

Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Re: Code Features [message #16618 is a reply to message #16617] Tue, 10 February 2004 04:21 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Simple certain browsers will copy underlying entities and various formatting bits when using syntax highlighted tags. I personally have seen this happen with color highlighted PHP code, where copy & paste would result in a broken code being pasted into the editor.

FUDforum Core Developer
Re: Code Features [message #16656 is a reply to message #16618] Tue, 10 February 2004 20:02 Go to previous messageGo to next message
Anonymous   United States
so if I wanted to modify the code, what would I have to do?
Re: Code Features [message #16658 is a reply to message #16656] Tue, 10 February 2004 20:03 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
You would need to edit post_proc.inc.t file, which is responsible for parsing FUDCODE.

FUDforum Core Developer
Re: Code Features [message #16680 is a reply to message #16589] Thu, 12 February 2004 10:23 Go to previous messageGo to next message
esm2002 is currently offline  esm2002   United States
Messages: 339
Registered: May 2002
Location: Atlanta Georgia
Karma: 0
Senior Member
wouldn't it be better from a program features standpoint to allow the user to make the decision as to whether or not to use fudcode inside CODE tag rather than you making that decision for them?

Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Re: Code Features [message #16684 is a reply to message #16680] Thu, 12 February 2004 15:39 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Some features are akin to giving a loaded gun a child and expecting them not to injure themeselves or those around them.

FUDforum Core Developer
Re: Code Features [message #16690 is a reply to message #16684] Fri, 13 February 2004 01:08 Go to previous messageGo to next message
Anonymous   United States
so we dumb down the features to the lowest common IQ?

Sorry, I just could not resist that. But there is an element of truth to it nonetheless.

It does seem a shame that those who know a little bit about what is going on to have to suffer because of those who don't know.

but it does beg the question that aren't the folks (both sender and receiver) who would use the CODE tag in a post reasonably savvy about about program code and could be expected to use fudcode wisely???

and the CODE tag is the ideal tag to show changes in the program code from one post to the next.
Re: Code Features [message #16691 is a reply to message #16684] Fri, 13 February 2004 01:09 Go to previous messageGo to next message
esm2002 is currently offline  esm2002   United States
Messages: 339
Registered: May 2002
Location: Atlanta Georgia
Karma: 0
Senior Member
so we dumb down the features to the lowest common IQ?

Sorry, I just could not resist that. But there is an element of truth to it nonetheless.

It does seem a shame that those who know a little bit about what is going on to have to suffer because of those who don't know.

but it does beg the question that aren't the folks (both sender and receiver) who would use the CODE tag in a post reasonably savvy about about program code and could be expected to use fudcode wisely???

and the CODE tag is the ideal tag to show changes in the program code from one post to the next.


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Re: Code Features [message #16693 is a reply to message #16691] Fri, 13 February 2004 01:29 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
It really comes down to a matter of preference and a situation.
For PHP code you have the [php] tag for syntax highlighting provided by PHP's own native highlight_string() function. However, in my experience this sometimes causes problem as the entered code when copied & pasted from the page does not always come out the same. Some browsers will paste the HTMLized code, which must be 'cleaned' before it can run to me this is a BIG annoyance.

So, then there is [code] tag which will output code without any alterations to make sure that you can safely copy & paste into your application and have it work with no additional effort.

More over, people may use [code] tag to show examples of how to use various forum tags etc... and making those tags valid inside [code] would leave them without means to do so.


FUDforum Core Developer
Re: Code Features [message #16696 is a reply to message #16693] Fri, 13 February 2004 04:30 Go to previous messageGo to next message
Anonymous   United States
Ilia wrote on Thu, 12 February 2004 20:29


For PHP code you have the [php] tag for syntax highlighting provided by PHP's own native highlight_string() function. However, in my experience this sometimes causes problem as the entered code when copied & pasted from the page does not always come out the same. Some browsers will paste the HTMLized code, which must be 'cleaned' before it can run to me this is a BIG annoyance.

So, then there is [code] tag which will output code without any alterations to make sure that you can safely copy & paste into your application and have it work with no additional effort.



Well, at least that is a better argument than "they are too stupid so we will protect them."

But I contend that most of the folks using the CODE tag are not posting sections of code into Word/Excel, etc but into to text editors - which strip away any HTML junk anyway.

The argument that you make applies much more to the QUOTE tag than the CODE tag. That is where all the underlying FUDCODE wreaks havoc when posting into Word/Excel etc.

Ilia wrote

More over, people may use [code] tag to show examples of how to use various forum tags etc... and making those tags valid inside [code] would leave them without means to do so.



Alas, that is what you so ably point out is what the NOTAG tag is for. Couldn't they just do the following with the NOTAG tag???

Code

Text Styling
There are a number of tags which you can use to style text, they are:

[b]bold [/b] produces bold text
[u]underline [/u] produces underlined text
[i]italic [/i] produces italicized text
[sub]subscript [/sub] produces subscript text
[sup]superscript [/sup] produces superscript text
It is also possible to control color/size and even font face.

[color=red]red text [/color] produces red text
[size=4]big text [/size] produces text in the specified size
[font=courier]text [/font] produces text using the named type face





So couldn't those who want to insure that there are no underlying HTML stuff use the NOTAG tag???

As it is those folks have the NOTAG and the CODE tags to do what they want and for those of us who want to highlight parts of code, we cannot use either - we have nothing.

They get two tags to do what they need. We get none to do what we need.



Re: Code Features [message #16697 is a reply to message #16696] Fri, 13 February 2004 04:35 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Quote:


But I contend that most of the folks using the CODE tag are not posting sections of code into Word/Excel, etc but into to text editors - which strip away any HTML junk anyway.



Standard HTML gunk may ruin formatting, but it also tends to convert & <> to their HTML entity equivalents. The result is that you need to spend a fair bit of time doing find & replace for &amp; &gt; &lt; etc... which becomes especially tedious if the source file has those entities in valid places.

[notag] was added for demonstrating FUDcode, however not many people are familiar with it and will often use the more universal [code] tag.

Why not use the quote tag if you want the pretty formatting?


FUDforum Core Developer
Re: Code Features [message #16698 is a reply to message #16693] Fri, 13 February 2004 04:37 Go to previous messageGo to next message
esm2002 is currently offline  esm2002   United States
Messages: 339
Registered: May 2002
Location: Atlanta Georgia
Karma: 0
Senior Member
Ilia wrote on Thu, 12 February 2004 20:29

For PHP code you have the [php] tag for syntax highlighting provided by PHP's own native highlight_string() function. However, in my experience this sometimes causes problem as the entered code when copied & pasted from the page does not always come out the same. Some browsers will paste the HTMLized code, which must be 'cleaned' before it can run to me this is a BIG annoyance.

So, then there is [code] tag which will output code without any alterations to make sure that you can safely copy & paste into your application and have it work with no additional effort.



Well, at least that is a better argument than "they are too stupid so we will protect them."

But I contend that most of the folks using the CODE tag are not posting sections of code into Word/Excel, etc but into to text editors - which strip away any HTML junk anyway.

The argument that you make applies much more to the QUOTE tag than the CODE tag. That is where all the underlying FUDCODE wreaks havoc when posting into Word/Excel etc.

Ilia wrote

More over, people may use [code] tag to show examples of how to use various forum tags etc... and making those tags valid inside [code] would leave them without means to do so.


Alas, that is what you so ably point out is what the NOTAG tag is for. Couldn't they just do the following with the NOTAG tag???

Code

Text Styling
There are a number of tags which you can use to style text, they are:

[b]bold [/b] produces bold text
[u]underline [/u] produces underlined text
[i]italic [/i] produces italicized text
[sub]subscript [/sub] produces subscript text
[sup]superscript [/sup] produces superscript text
It is also possible to control color/size and even font face.

[color=red]red text [/color] produces red text
[size=4]big text [/size] produces text in the specified size
[font=courier]text [/font] produces text using the named type face



So couldn't those who want to insure that there are no underlying HTML stuff use the NOTAG tag???

As it is those folks have the NOTAG and the CODE tags to do what they want and for those of us who want to highlight parts of code, we cannot use either - we have nothing.

They get two tags to do what they need. We get none to do what we need.


Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Re: Code Features [message #16699 is a reply to message #16697] Fri, 13 February 2004 04:55 Go to previous messageGo to next message
esm2002 is currently offline  esm2002   United States
Messages: 339
Registered: May 2002
Location: Atlanta Georgia
Karma: 0
Senior Member
Ilia wrote on Thu, 12 February 2004 23:35

[notag] was added for demonstrating FUDcode, however not many people are familiar with it and will often use the more universal [code] tag.

Why not use the quote tag if you want the pretty formatting?


It is not a question of pretty. It is an issue of presentation. It is a way to distinuish the important from the less important.

as for the quote vs code issue, we have been down that road before. it was like pulling eye teeth to even get you to consider highlighting the code section within a post. You adamantly refused to even consider it. we had some long, drawn-out discussions on it.

Using the CODE tag to highlight changes in the code from one msg to another is a similar case of highlighting. You either just don't see the need for it or you think that some other necessity trumps the need for highlighing. just like with highlighting of the CODE section itself.



Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."
Re: Code Features [message #16700 is a reply to message #16699] Fri, 13 February 2004 05:07 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Your last statement has described my position almost perfectly.

Quote:


you think that some other necessity trumps the need for highlighting



Yes, proper copy & paste.

Quote:


You either just don't see the need.



I don't see a essential need for it, although in some instances code highlighting is helpful. The biggest problem, which is why I do not want to compromise and just add [highligh_code] tag or similar is because there is no automated tools to highlight non-php code. As such, I do not want to add more code for a sake of a feature most people won't use simply because I doubt most people would spend the time to painstakingly insert FUDcode tags to highlight source code.
Every tag adds a slight slowdown in the message parsing code, so adding tags that won't be used is mostly bloat.


FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: First post as description in topics RSS feed
Next Topic: Security option: profiles invisible to anon users
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat May 25 13:49:48 GMT 2024

Total time taken to generate the page: 0.03221 seconds