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
<?php | |
// Fatal error if the field doesn't exist on the content type | |
$wrapper = entity_metadata_wrapper('node', $node); | |
if ($wrapper->field_pathway->value()->name != $pathway) { | |
} | |
?> |
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 | |
// Check if the value of a field is equal to the $pathway variable. | |
$pathway = 'category 1'; | |
try { | |
if (arg(0) == 'node' && is_numeric(arg(1))) { | |
$wrapper = entity_metadata_wrapper('node', arg(1)); | |
if ($wrapper->field_FIELD_NAME->value()->name != $pathway) { | |
return TRUE; |
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 | |
$nid = 13; | |
// Grab entries written by the current $user that reference the given $nid. | |
$entries = $inner_query->entityCondition('entity_type', 'node') | |
->entityCondition('bundle', 'journal_entry') | |
->fieldCondition('field_course_reference', 'target_id', $nid, '=') | |
->propertyCondition('uid', $user->uid, '=') | |
->execute(); |
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 node.title AS node_title, node.nid AS nid, node.created AS node_created, 'node' AS field_data_body_node_entity_type, 'node' AS field_data_field_image_node_entity_type, 'node' AS field_data_field_course_reference_node_entity_type | |
FROM | |
{node} node | |
LEFT JOIN {users} users_node ON node.uid = users_node.uid | |
WHERE (( (node.type IN ('journal_entry')) AND( (users_node.uid = '1') ))) | |
ORDER BY node_created DESC | |
LIMIT 10 OFFSET 0 | |
SELECT node.title AS node_title, node.nid AS nid, node.created AS node_created, 'node' AS field_data_body_node_entity_type, 'node' AS field_data_field_image_node_entity_type, 'node' AS field_data_field_course_reference_node_entity_type |
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 node.title AS node_title, node.nid AS nid, node.created AS node_created, 'node' AS field_data_body_node_entity_type, 'node' AS field_data_field_image_node_entity_type, 'node' AS field_data_field_course_reference_node_entity_type | |
FROM node node | |
LEFT JOIN users users_node | |
ON node.uid = users_node.uid | |
WHERE (( (node.type | |
IN ('journal_entry')) | |
AND( (users_node.uid = 1) ))) | |
ORDER BY node_created DESC | |
LIMIT 10 OFFSET 0 |
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
nodes[1][type] = page | |
nodes[1][title] = Sample | |
nodes[1][uid] = 1 | |
nodes[1][body][und][0][value] = <p>Welcome.</p> | |
nodes[1][body][und][0][format] = full_html |
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_views_pre_view(). | |
*/ | |
function weekly_view_views_pre_view(&$view, &$display_id, &$args){ | |
if($view->name == 'training_overview' && $display_id ='weekly_view') { | |
global $user; | |
$wrapper = entity_metadata_wrapper('user', $user); |
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
[mysqld] | |
innodb_buffer_pool_size=1G | |
innodb_flush_method=O_DIRECT | |
innodb_additional_mem_pool_size=10M | |
max_allowed_packet= 16M |