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 | |
/** | |
* Implements hook_menu() | |
*/ | |
function hoverslider_menu(){ | |
$items = array(); | |
$items['admin/config/content/hoverslider'] = array( | |
'title' => 'Hover slider settings page', | |
'description' => 'This settings page is to set how many rows you want, images to each box etc...', |
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
SELECT * | |
FROM node node | |
LEFT JOIN users users_node | |
ON node.uid = users_node.uid | |
LEFT JOIN field_data_body field_data_body | |
ON node.nid = field_data_body.entity_id | |
AND (field_data_body.entity_type = 'node' | |
AND field_data_body.deleted = '0') | |
LEFT JOIN field_data_field_image field_data_field_image | |
ON node.nid = field_data_field_image.entity_id |
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
# | |
# Virtual Hosts | |
# | |
# If you want to maintain multiple domains/hostnames on your | |
# machine you can setup VirtualHost containers for them. Most configurations | |
# use only name-based virtual hosts so the server doesn't need to worry about | |
# IP addresses. This is indicated by the asterisks in the directives below. | |
# | |
# Please see the documentation at | |
# <URL:http://httpd.apache.org/docs/2.2/vhosts/> |
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 | |
function web2theme_preprocess_user_profile(&$variables) { | |
if( arg(2)==null ) { //im not editing | |
$qty_field=count($variables['user_profile']['field_telefone']['#items']); | |
for($i=0 ; $i<$qty_field; $i++) { | |
$field_collection_id = $variables['field_telefone'][$i]['value']; | |
//dsm($variables['user_profile']['field_telefone'][$i]['entity']['field_collection_item'][$field_collection_id]['field_telefone_showed']); | |
$toshow = $variables['user_profile']['field_telefone'][$i]['entity']['field_collection_item'][$field_collection_id]['field_telefone_showed']; | |
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
#!/bin/bash | |
# Script to install Drupal app | |
# Be careful using database credentials, this script is meant to be used on development server, to speed things up. | |
dbuser="root" | |
dbpass="root" | |
sites_path="~/Sites" | |
if [ $# -lt 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
<?php | |
function tng_form_alter(&$form, &$form_state, $form_id) { | |
if ($form_id == 'campaignmonitor-subscribe-form') { | |
honeypot_add_form_protection($form, $form_state, array('honeypot', 'time_restriction')); | |
} | |
} |
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
diff --git a/sites/default/settings.php b/sites/default/settings.php | |
index b2ce930..9d0514e 100644 | |
--- a/sites/default/settings.php | |
+++ b/sites/default/settings.php | |
@@ -611,7 +611,8 @@ | |
* The 'bootstrap_config_storage' setting needs to be a callable that returns | |
* core.services.yml. | |
*/ | |
- # $settings['bootstrap_config_storage'] = array('Drupal\Core\Config\BootstrapConfigStorageFactory', 'getFileStorage'); | |
+$settings['bootstrap_config_storage'] = 'Drupal\Core\Config\BootstrapConfigStorageFactory::getFileStorage'; |
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
diff --git a/sites/default/settings.php b/sites/default/settings.php | |
index b2ce930..9d0514e 100644 | |
--- a/sites/default/settings.php | |
+++ b/sites/default/settings.php | |
@@ -611,7 +611,8 @@ | |
* The 'bootstrap_config_storage' setting needs to be a callable that returns | |
* core.services.yml. | |
*/ | |
- # $settings['bootstrap_config_storage'] = array('Drupal\Core\Config\BootstrapConfigStorageFactory', 'getFileStorage'); | |
+$settings['bootstrap_config_storage'] = 'Drupal\Core\Config\BootstrapConfigStorageFactory::getFileStorage'; |
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
Steps to update local dev environment to PHP5.6 to be ready for Drupal 8. | |
In a terminal window: | |
brew update ( you may also may need brew doctor) | |
brew unlink php55 | |
brew install php56 --with-homebrew-apxs --with-apache | |
brew install php56-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
<?php | |
// Inside form alter function insert validation using buttons like commerce does. | |
// Insert the validation at the beginning of the array so the commerce module | |
// can access any of our errors and place them in the correct block instead of at top of page. | |
array_unshift($form['buttons']['continue']['#validate'], 'treepeople_commerce2_organization_validate'); | |
// Inside the validate function, set the errors using a special concatenated field name | |
// that include the panel the field is in. Notice there are no outer brackets. | |
form_set_error('customer_profile_billing][field_organization_name', t('Company/Organization Name field is required.')); |
OlderNewer