Forum Announcements
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsForum InformationForum Announcements

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old December 1st, 2002, 01:23 AM
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 23 sec
Reputation Power: 6
Function Linking

PHP functions in messages will now be linked to their manual pages on php.net, thanks to zombie! This is something I started messing with, but found it just wasn't quick enough. Zombie took over and came up with some lightning fast routines to do the linking.

So, if things break - blame him :laugh:

Reply With Quote
  #2  
Old December 1st, 2002, 01:48 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: Function Linking

i already found some verry small errors, but i am not going to tell ;)

btw matt, while links are visible in the middle of text like mysql_connect() this, in a php code, they are also blue, and not so visible. can you change css class a bit, to make them more visible in php code (make them underlined or smth).

php Code:
Original - php Code
  1.  
  2. // example
  3.  
  4. $query="select 1+1 as sum";
  5.  
  6. $r=mysql_query($query);
  7.  
  8.  
  9. my_function($a);
  10.  


see that links are not much visible in [php] tags...

Reply With Quote
  #3  
Old December 1st, 2002, 02:42 AM
sliver's Avatar
sliver sliver is offline
Moderator
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: WI, USA
Posts: 881 sliver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 h 27 m 27 sec
Reputation Power: 2
Send a message via AIM to sliver Send a message via XFire to sliver
RE: Function Linking

thnx zombie

Reply With Quote
  #4  
Old December 1st, 2002, 03:11 AM
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 23 sec
Reputation Power: 6
RE: Function Linking

Better zombie?

Reply With Quote
  #5  
Old December 1st, 2002, 04:58 PM
sethadam1 sethadam1 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Orlando, FL
Posts: 223 sethadam1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Function Linking

Cool! If you don't mind me asking, which code did you go with? I know it was discussed for a while in the PHP coding forum...

Reply With Quote
  #6  
Old December 1st, 2002, 05:27 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 23 sec
Reputation Power: 6
RE: Function Linking

Zombie..want to post an explanation of your code?

Reply With Quote
  #7  
Old December 2nd, 2002, 12:09 AM
sliver's Avatar
sliver sliver is offline
Moderator
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: WI, USA
Posts: 881 sliver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 h 27 m 27 sec
Reputation Power: 2
Send a message via AIM to sliver Send a message via XFire to sliver
RE: Function Linking

there is a bug in it
i posted this in support & suggestions but here it is again foreach() has a link to each and not foreach

Reply With Quote
  #8  
Old December 2nd, 2002, 02:46 PM
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: Function Linking

i implemented str_replace() and strtr() solutions, but i don't know which one matt used.

yes, i know of some small bugs, but i am not going to solve them one by one. when there are around 5 of them, i will solve them all at once, so... post them here.

bugs found so far:

php Code:
Original - php Code
  1.  
  2.     foreach();
  3.  
  4. // will include foreach in function
  5. // list, and it will work...
  6.  
  7.     $mysql_query=1;
  8.  
  9. // or any other variable with a
  10. // name of some php function
  11.  
  12. // don't know how to fix this yet...
  13.  
  14.     print 1;
  15.     echo 2;
  16.  
  17. // not working because it misses (
  18. // after the function name.
  19.  
  20. // will do it with preg_replace()
  21.  


if you see any more bugs, post them here pls...

Reply With Quote
  #9  
Old December 2nd, 2002, 03:03 PM
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: Function Linking

are links red now just for me, or for everyone?

i like them blue better. underlined dark blue would be even better...


i forgot to explain the code itself. it is very simple.

it is only one line of code, and a zilion lines of data ;)

php Code:
Original - php Code
  1.  
  2.     $text=strtr($text, $phpfunctions['trans']);


and data array looks like:

php Code:
Original - php Code
  1.  
  2.   'acosh('=>'<a class="a1" href="http://php.net/acosh" target="_blank">acosh</a>(',
  3.   'addcslashes('=>'<a class="a1" href="http://php.net/addcslashes" target="_blank">addcslashes</a>(',
  4.   'addslashes('=>'<a class="a1" href="http://php.net/addslashes" target="_blank">addslashes</a>(',
  5.  
  6. // ... and
  7.  
  8.   'pdf_close</font>'=>'<a class="a1" href="http://php.net/pdf_close" target="_blank">pdf_close</a></font>',
  9.   'pi</font>'=>'<a class="a1" href="http://php.net/pi" target="_blank">pi</a></font>',
  10.   'print</font>'=>'<a class="a1" href="http://php.net/print" target="_blank">print</a></font>'


the second part is for php code that is run trough php color coding, and that function adds some html, so i can't use "function_name(" for search pattern, but have to use "function_name" instead.

and before all this, i did some rearanging in function list.

that solved sleep() before usleep() and similar functions...

basicly, every function that is a part of another function (max(), print(), time(), trim(), etc...) had to be moved to the end of a array...

again, post errors here...

Reply With Quote
  #10  
Old December 2nd, 2002, 10:27 PM
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: Function Linking

just remembered one more..

if you don't place opening bracket just after the function name, but add a space beetween, it will not link. like this print ()

php Code:
Original - php Code
  1.  
  2.   // and this
  3.   print ("blah");


i think that only second form should be linked, and function names in text should be only linked if there is a bracket imidietly after the function name.

but i might correct this in the [php] tags...

Reply With Quote
  #11  
Old December 10th, 2002, 07:52 PM
sethadam1 sethadam1 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Orlando, FL
Posts: 223 sethadam1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Function Linking

zombie,

Uou might consider also looking for a space before the function name. This will elminate the foreach() problem as well as a few others I've seen, like the word background followed by () changing into round().

Reply With Quote
  #12  
Old December 11th, 2002, 02:33 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: Function Linking

can't do that.

$a=unserialize(urldecode(gzip_decompress($str)))

not one space, but three functions...

foreach() will be solved in next version, but problem with background() remains...

Reply With Quote
Reply

Viewing: Codewalkers ForumsForum InformationForum Announcements > Function Linking


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 On
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump