This file contains 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 | |
$items = field_get_items('node', $node, 'field_yourfield', $node->language); |
This file contains 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 | |
$display_id = "departement"; | |
$args = array("view argument"); | |
$view = views_get_view('view machine name'); | |
$view->items_per_page = 0; // set number of items per page. 0 is all. | |
$content = $view->execute_display($display_id, $args); | |
print($content['content']); |
This file contains 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 | |
if(user_access('administer')) { | |
drupal_set_message("hello Admin!"); | |
} |
This file contains 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 | |
// from: http://stackoverflow.com/questions/7372780/creating-a-ping-uptime-service-with-php | |
// TODO: add string recognition to check specific pages | |
//Config information | |
$email = "[email protected]"; | |
$server = "google.com"; //the address to test, without the "http://" |
This file contains 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
export PHP_OPTIONS="-dxdebug.remote_autostart=On -didekey=PHPSTORM -dremote_host=localhost -dprofiler_enable=1" |
This file contains 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
# set the correct php.ini for drush! | |
export PHPRC='/Library/Application Support/appsolute/MAMP PRO/conf/' | |
export PHP_OPTIONS="-dxdebug.remote_autostart=On -didekey=PHPSTORM -dremote_host=localhost -dprofiler_enable=1" | |
# FROM https://www.deeson.co.uk/labs/debugging-drupal-drush-real-time-phpstorm-and-xdebug |
This file contains 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
# get information over the php version (php_info) | |
drush php-eval "phpinfo();" | less |
This file contains 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
# ----------------------------------------------------------------- | |
# .gitignore for WordPress | |
# Bare Minimum Git | |
# http://ironco.de/bare-minimum-git/ | |
# ver 20150227 | |
# | |
# This file is tailored for a WordPress project | |
# using the default directory structure | |
# | |
# This file specifies intentionally untracked files to ignore |
This file contains 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 | |
/** | |
* You need to have module imageapi_optimize enabled | |
*/ | |
function HOOK_file_presave($file) { | |
// only temporary files from IMCE | |
if ($file->source === 'imce' && $file->status == 0) { | |
if ($wrapper = file_stream_wrapper_get_instance_by_uri($file->uri)) { |
OlderNewer