This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Assumes date field is $variables['field_event_date'] | |
$dateObj = new DateObject($variables['field_event_date'][0]['value'], new DateTimeZone($variables['field_event_date'][0]['timezone_db'])); | |
$dateObj->setTimezone(new DateTimeZone($variables['field_event_date'][0]['timezone'])); | |
$date = $dateObj->getTimestamp(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
brew update | |
brew install rbenv | |
brew install ruby-build | |
brew install openssl | |
RUBY_CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl` | |
rbenv install 2.0.0-preview1 |
To give anonymous users media permissions, know that Media module's permissions don't work as you might expect:
- Import media files from the local filesystem: this is not for the media widget. You don't need to turn this on.
- Edit media: You need this to upload files via the media widget.
- Add media from remote services: straightforward.
The Library tab is not protected by any permissions. It's always included with the media browser plugin (aka the media widget).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="col col-1">DC Office: National Coalition for Asian Pacific American Community Development<br />1628 16th Street, NW - 4th Floor, Washington DC 20009<br />t 202-223-2442 | f 202-223-4144</div><div class="col col-2">CA Office: National Coalition for Asian Pacific American Community Development<br />310 8th Street, Suite 303, Oakland, CA 94607<br />t 510-452-4800 | f 510-981-3840</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul class="social-media-buttons"><li><a href="http://facebook.com/capacd"><img alt="Like NationalCAPACD on Facebook" src="http://www.searac.org/sites/all/themes/searac/images/facebook.png" /></a></li><li><a href="http://twitter.com/#!/CAPACD"><img alt="Follow CAPACD on Twitter" src="http://www.searac.org/sites/all/themes/searac/images/twitter.png" /></a></li><li><a href="http://vimeo.com/user6427743"><img alt="Follow NationalCAPACD on Vimeo" src="http://esenkay.com/socialmedia/vimeo-32x32.png" /></a></li></ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Making a patch | |
// When patching core, cd to www. When patching a module, cd to the module directory. | |
$ git diff --relative > file.patch | |
// Applying a patch | |
// From the git root directory | |
$ git apply -v --directory www/sites path/to/file.patch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$result = db_query("SELECT uid FROM {users}"); | |
while ($row = db_fetch_object($result)) { | |
$user = user_load($row->uid); | |
$new_state_profile = preg_replace('/^(\S){2}\s/', '', $user->profile_state); | |
update_sql("UPDATE {profile_values} SET value = '$new_state_profile' WHERE uid = $user->uid AND fid = 6"); | |
} | |
// Clear caches |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* "No context" sample content type. It operates with no context at all. It would | |
* be basically the same as a 'custom content' block, but it's not even that | |
* sophisticated. | |
* | |
*/ |