Suggestions & Feedback
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsForum InformationSuggestions & Feedback

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old June 6th, 2003, 07:00 AM
crisp crisp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Holland
Posts: 336 crisp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
[ php ] tags

Some character sequences in PHP code (e.g. : ( without the spaces) are being replaced by smilies.
Further I would like to see a tag for other languages besides PHP, eg a general [ code ] tag for fi javascript.
You don't need to highlight these code, but can simply put in in between <pre> tags.

Reply With Quote
  #2  
Old June 6th, 2003, 07:40 AM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: [ php ] tags

but we already have [code] tags. in fact, they where here before [php] tags.

(in fact, someone suggested coloring code inside [code] tags as if it was php, and i suggested a new set of tags, just for php code, since php is the main topic of this site, and there should be a general [code] tag.. so..)

Reply With Quote
  #3  
Old June 6th, 2003, 07:45 AM
crisp crisp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Holland
Posts: 336 crisp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: [ php ] tags

test:

Code:
var allowedTags;
function strip_tags(strString, allowed) {

  allowedTags = allowed.toLowerCase();

  strString = strString.replace(/</?([a-z]+)(>|.*?[w'" /]>)/gi, function($0, $1, allowedTags) { return check_allowed($0, $1); } );

  return strString;

}

function check_allowed(fullmatch, tag) {

  var reg = new RegExp('<'+tag.toLowerCase()+'>');
  if (allowedTags.match(reg)) return fullmatch;

  return '';

}


to be honest: I had no idea this tag existed, I think it is rarely used and I haven't found a faq with an overview of all available tags and such on this forum yet (but I might be looking with my nose).
anyway, this is still messing up my layout; I would prefer to have it between <pre>, and also between [ code ] smilies shouldn't be parsed:

Code:
document.write(':(');

Reply With Quote
  #4  
Old June 6th, 2003, 12:34 PM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
RE: [ php ] tags

When you go to post (or reply) a message, there is a link to the left of the message textarea entitled 'eF Code & Smilies Guide'. This will show you the tags.

As for smilies being parsed in code tags, I agree. I will look into it.

About the <pre> tags. I specifically don't use those. The reason being is that people tend to post code that has very long lines. This makes the layout of the entire site unusable for that thread. So, I allow the breaking of lines to make sure the layout stays intact....

Reply With Quote
  #5  
Old June 6th, 2003, 03:57 PM
crisp crisp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Holland
Posts: 336 crisp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: RE: [ php ] tags

Quote:
When you go to post (or reply) a message, there is a link to the left of the message textarea entitled 'eF Code & Smilies Guide'. This will show you the tags.

As for smilies being parsed in code tags, I agree. I will look into it.

About the <pre> tags. I specifically don't use those. The reason being is that people tend to post code that has very long lines. This makes the layout of the entire site unusable for that thread. So, I allow the breaking of lines to make sure the layout stays intact....

yes, but now my indenting is gone, which makes it a whole less readable.
An alternative would be to place a div with a fixed width and with the overflow property set to auto, which will generate a scrollbar in case of long code.
As a bonus you could also add linenumbers! ;)

Thanks for showing me where to find the codes, I've overlooked it more than 300 times

Reply With Quote
  #6  
Old June 6th, 2003, 04:07 PM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
RE: [ php ] tags

Testing indent....

php Code:
Original - php Code
  1.  
  2. var allowedTags;
  3. function strip_tags(strString, allowed) {
  4.  
  5.   allowedTags = allowed.toLowerCase();
  6.  
  7.   strString = strString.replace(/</?([a-z]+)(>|.*?[w'" /]>)/gi, function($0, $1, allowedTags) { return check_allowed($0, $1); } );
  8.   return strString;
  9. }
  10. function check_allowed(fullmatch, tag) {
  11.   var reg = new RegExp('<'+tag.toLowerCase()+'>');
  12.   if (allowedTags.match(reg)) return fullmatch;
  13.   return '';
  14. }

Reply With Quote
  #7  
Old June 6th, 2003, 04:09 PM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
RE: [ php ] tags

I agree with the ident...seems that my php tags do the indent...i believe they convery spaces to non-breaking spaces...i'll look into correcting the ident problem with the normal code tag...

As for a div and adding line numbers, etc...I know I shouldn't worry about netscape 4...but I still do...I can't help it ;)

Reply With Quote
  #8  
Old June 6th, 2003, 09:00 PM
crisp crisp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Holland
Posts: 336 crisp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: [ php ] tags

Netscape 4 should have been burried and forgotten a long time ago. What is it with those version 4 browsers having a lifespan so much longer than their ancestors?
Honestly, I gave up NS4 support already two years ago and it made my life so much easier ;)

I do hope you can fix the problem with the indenting, now I'm mostly misusing the [ php ] tag to get my code straight ;)

Reply With Quote
Reply

Viewing: Codewalkers ForumsForum InformationSuggestions & Feedback > [ php ] tags


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway