Welcome To Snipplr
Everyone's Recent Snippets Tagged c
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
PHP
Rewrite Drupal's File system paths to remove redundant sites/example.com (alternate settings.php method)
Alternate to <a href="http://snipplr.com/view/133530">this method</a>. Have not yet tested.
In settings.php, put this code:
0
1728
posted 17 years ago by zachharkey
My [original post](http://drupal.org/node/84895) languished for years before someone pointed out a possible solution [here](http://drupal.org/node/53705).
The following user-submitted code may be useful in redirecting URLs for the /files directory...
0
1888
posted 17 years ago by zachharkey
We wanted to change all /films/example style paths to /film/example (basically remove the 's').
Here was the query that worked:
1
1692
posted 17 years ago by zachharkey
Creating a object that doesn't have any methods in Ruby (regular objects inherit methods from Object class), useful for Proxies that use method missing (http://onestepback.org/index.cgi/Tech/Ruby/BlankSlate.rdoc).
1
2270
posted 17 years ago by narkisr
closes opened tags in text piece.
original code slightly modified to supress PHP warnings
NOTE: need to fix the order of closing tags to get standards compliance
0
1797
posted 17 years ago by kossmoss
Great little snippit to add a <tr> to the bottom of a table. Note the use of the context in the jQuery e.g var n = $('tr:last td', this).length; Will have to use this in the future, very good to know!
4
3478
posted 17 years ago by 1man
Returns last word of a string (words separated by blanks). if string does not have any blanks, it will return the whole string.
1
1892
posted 17 years ago by fischkopp
Will return a string that has any matched URLs wrapped in `<a>` tags.
Example: `"This is a link to http://foobar.com . Please visit !"`
Becomes: `"This is a link to <a href='http://foobar.com'>http://foobar.com</a> . Please visit!"`
Note: Op...
2
6771
posted 17 years ago by jasonseney
Lets you get YouTube video scene images by video id or youtube video url using only javascript OR jQuery.
5
3461
posted 17 years ago by Uzbekjon
include this snippet in your sites to force InternetExplorer 8 to display your site like InternetExplorer 7
In summary, IE7 compatibility support looks as follows:
IE=7
Display in IE7 Standards mode; Already supported in the IE8 Beta 1 relea...
3
3578
posted 17 years ago by tobaco
Here is a small function [[lobo235](http://www.netlobo.com/javascript_tooltips.html "Javascript Tool-tips")] wrote that will parse the window.location.href value and return the value for the parameter you specify. It does this using javascript's buil...
1
4003
posted 17 years ago by nelsnelson