dptr1988 Posted April 28, 2008 Share Posted April 28, 2008 It would sure save a lot of typing if the forum could automatically recognize PHP function names in PHP code blocks replace them with links to http://php.net/function_name It wouldn't be that hard to detect PHP functions names 'get_defined_functions()'. http://us2.php.net/manual/en/function.get-defined-functions.php This feature would allow the people unfamiliar with PHP and the PHP manual to learn more about each function just by clicking on it. Quote Link to comment https://forums.phpfreaks.com/topic/103206-php-function-links/ Share on other sites More sharing options...
Coreye Posted April 28, 2008 Share Posted April 28, 2008 I'm pretty sure they will say: That would mean modifying the core SMF code. Sorry, but no. You could always suggest it to the SMF team. Perhaps they like the idea and will implement it in future releases. Talk to SMF if you want upgrades to it. But who knows, maybe they will implement it. Quote Link to comment https://forums.phpfreaks.com/topic/103206-php-function-links/#findComment-528662 Share on other sites More sharing options...
neylitalo Posted April 28, 2008 Share Posted April 28, 2008 Coreye, you're starting to get the hang of it. I think we had something like this, except it was far from automatic... SMF lets you define custom BBcode tags, and we had one something like [man][/man], that would link to the PHP manual page for the function inside the [man] tag. I can't seem to find it - admins, can you clarify A) if such a thing exists, and (if A) B) what the tag is? Quote Link to comment https://forums.phpfreaks.com/topic/103206-php-function-links/#findComment-528668 Share on other sites More sharing options...
dptr1988 Posted April 28, 2008 Author Share Posted April 28, 2008 Yeah, they probably will say that. But it really wouldn't be that hard. Sombody might even be able to do it with on line of code using regular expressions. Also the current SMF code already detects and specially processes PHP code so there would be no problem with that either. This would be complety automated, so nobody would have to bother typing ( or clicking for those that havn't learned how to use the keyboard yet. ) the [man] tag. Quote Link to comment https://forums.phpfreaks.com/topic/103206-php-function-links/#findComment-528669 Share on other sites More sharing options...
tomfmason Posted April 28, 2008 Share Posted April 28, 2008 I'm pretty sure they will say: That would mean modifying the core SMF code. Sorry, but no. You could always suggest it to the SMF team. Perhaps they like the idea and will implement it in future releases. Talk to SMF if you want upgrades to it. But who knows, maybe they will implement it. imho, it is a really bad practice to make edits to an application's core like that unless it is absolutely necessary for it to function properly. The main reason is that it will make future updates a real pita. We would have to keep a copy of the release that we are currently using and diff the production copy against the original. Then we would have to compare that with any new releases. So, we have opted to forgo this by keeping the edits limited as much as possible. I generally group features by Must Have, Should Have, Could Have and Wont Have. As far as the forums are concerned if it doesn't fit into the first group it is most likely not going to happen. It would be completely different if we were the developers behind smf. Quote Link to comment https://forums.phpfreaks.com/topic/103206-php-function-links/#findComment-528704 Share on other sites More sharing options...
Daniel0 Posted April 28, 2008 Share Posted April 28, 2008 I think we had something like this, except it was far from automatic... SMF lets you define custom BBcode tags, and we had one something like [man][/man], that would link to the PHP manual page for the function inside the [man] tag. I can't seem to find it - admins, can you clarify A) if such a thing exists, and (if A) B) what the tag is? You can select which of the built-in bbcodes that should be enabled here, but you cannot add additional codes. You don't seem to be able to do it in SMF 2 either, but if they implement it in the final release (unlikely), then I wouldn't mind adding a such code. It will in no way be automatic though as we risk regular text will trigger it and add totally irrelevant links. Quote Link to comment https://forums.phpfreaks.com/topic/103206-php-function-links/#findComment-528718 Share on other sites More sharing options...
dptr1988 Posted April 28, 2008 Author Share Posted April 28, 2008 It will in no way be automatic though as we risk regular text will trigger it and add totally irrelevant links. I was only reccomending this for PHP code blocks ( which are already detected becuase of the special syntax highlighting they get ). That would limit it to PHP code only. Would it really be that bad if somebody had a function name in there comments or strings and it got detected and linked? If it is, then it would not be very hard to detect comments and strings and skip them. That is very easy to do. Quote Link to comment https://forums.phpfreaks.com/topic/103206-php-function-links/#findComment-528852 Share on other sites More sharing options...
fenway Posted April 28, 2008 Share Posted April 28, 2008 If only code blocks would respect php highlighting too... or, equivalently, if php blocks were scrollable. Quote Link to comment https://forums.phpfreaks.com/topic/103206-php-function-links/#findComment-528876 Share on other sites More sharing options...
Daniel0 Posted April 28, 2008 Share Posted April 28, 2008 If only code blocks would respect php highlighting too... They do if the user uses lowercase <?php tags. or, equivalently, if php blocks were scrollable. Maybe it can be done using CSS. I'll try to see that. I don't mind doing changes to the stylesheet. echo "testing... just to have some html source code to look at..."; Edit: blocks now have the same CSS as [code] blocks have. It will in no way be automatic though as we risk regular text will trigger it and add totally irrelevant links. I was only reccomending this for PHP code blocks ( which are already detected becuase of the special syntax highlighting they get ). That would limit it to PHP code only. Would it really be that bad if somebody had a function name in there comments or strings and it got detected and linked? If it is, then it would not be very hard to detect comments and strings and skip them. That is very easy to do. Perhaps, but we are still not going to modify the SMF core files. See Tom's post for the reason. Quote Link to comment https://forums.phpfreaks.com/topic/103206-php-function-links/#findComment-529028 Share on other sites More sharing options...
trq Posted April 30, 2008 Share Posted April 30, 2008 Coreye, you're starting to get the hang of it. I think we had something like this, except it was far from automatic... SMF lets you define custom BBcode tags, and we had one something like [man][/man], that would link to the PHP manual page for the function inside the [man] tag. I can't seem to find it - admins, can you clarify A) if such a thing exists, and (if A) B) what the tag is? We've never had this feature on this board, I did suggest it a long while back but yeah... no go. I used it on another board I once frequented. Quote Link to comment https://forums.phpfreaks.com/topic/103206-php-function-links/#findComment-529993 Share on other sites More sharing options...
ober Posted April 30, 2008 Share Posted April 30, 2008 Actually, we did have that here at one point. It was very short-lived, however. Quote Link to comment https://forums.phpfreaks.com/topic/103206-php-function-links/#findComment-530431 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.