User : davechild
|September 10, 2009|
|PHP SoftHyphens Function||DaveChild||PHP||typography||
This function will add soft hyphens after every 3rd character in words of over 10 characters. It will not leave fewer than three characters following a soft hyphen.
Known bugs: Adds soft hyphens to URLs and within HTML tags.
|September 9, 2009|
|MODx Snippet: Tweet This||DaveChild||PHP||modx||
This snippet returns a link to twitter for the user to tweet the current page. URL is TinyURLed automatically (and tinyurls are cached indefinitely in assets/cache/tweetthis.txt).
Simply paste code into a new snippet called "TweetThis". Call it like so:
[[TweetThis? &name=`@DaveChild` &text=`Tweet This!` &id=`7` ]]
All parameters are optional. ID defaults to current document.
|April 17, 2009|
|PHP Strip Signature from Email||DaveChild||PHP||php||
If reading email from a POP box with PHP, you can use this to strip out signatures (ones that are delimited with the proper '--' notation). It will only strip the last signature of an email, in case someone enters a '--' intentionally elsewhere.
|January 28, 2009|
|PHP Get First Characters of String in Complete Sentences||DaveChild||PHP||php||
Pass in text and the maximum allowable length and this snippet will return as many full sentences from the text as it can within that length. If no sentences, it will just trim to the maximum length allowed.
|December 12, 2008|
|PHP Generate URL From Text||DaveChild||PHP||rewrite||
Function replaces all non-alpha-numeric chars and cleans up a text string. Should output a usable URL for almost all text.
|October 15, 2008|
|PHP Singleton Class||DaveChild||PHP||Singleton||
Not extensively tested but should work just fine!
|September 17, 2008|
|HTML UK Counties Select Box||DaveChild||HTML||counties||September 11, 2008|
|HTML US States Select Box||DaveChild||HTML||html||September 11, 2008|
|HTML Countries Select Box (English)||DaveChild||HTML||countries||September 11, 2008|
|HTML Countries Select Box (French)||DaveChild||HTML||french||
Translated by David Hunter.
|September 11, 2008|
|VBScript Clickable URLs and Email Addresses||DaveChild||ASP||clickable||September 11, 2008|
|VBScript Pagination||DaveChild||ASP||pagination||September 11, 2008|