Items
Nodes Posts Things
Blocks
items_blocks.tpl.php
- Wordpress <?php // Adds custom post type for Projects and Services function create_post_type(){ register_post_type('project', array( 'labels' => array( 'name' => __('Projects'), 'sing... Frameworks Topics Frameworks 2014 10
- Rename stuck field names <?php $fields = array( 'field_inspirational_imagery' => 'field_images', ); // Loop through each of the fields/tables with the old name and change them foreach($fields as $field_name => $new_field_name) { // First check that field_name exists if(!db_table_exists('field_data_' . $field_name... Code Drupal PHP 2014
- OSX Virtual Web Host Config add line to /etc/hosts 127.0.0.1 amniot.localhost add lines to /etc/apache2/httpd.conf NameVirtualHost 127.0.0.1:80 <VirtualHost amniot.localhost:80> <Directory "/Library/Webserver/Documents_AMNIOT"> Options FollowSymLinks Indexes AllowOverride All Order deny,allow allow from All ... Code Macintosh 2014
- MySQL Basics add export PATH=$PATH:/usr/local/mysql/bin to ~/.bash_profile or /etc/profile Backup database to text file mysqldump database_name > database_name.sql Remove database mysql> drop database database_name; Create database mysql> CREATE DATABASE database_name;... Code 2014
- Manually reset Drupal admin password <?php define('DRUPAL_ROOT', getcwd()); require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); require_once DRUPAL_ROOT . '/includes/password.inc'; if (isset($_GET['pass']) && !empty($_GET['pass'])) { $newhash = user_hash_password($_GET['pass']); } else { die('... Code Drupal PHP 2014
- PHP <?php function loadchildrens($context){ $sql_children = "SELECT node.nid AS nid, node.vid AS node_vid, node.title AS node_title FROM node node LEFT JOIN content_field_connection node_data_field_connection O... Frameworks Topics Template Coding 2014 12
- JQuery jQuery(window).load(function(){ jQuery('.flexslider').flexslider( { pauseOnHover: true, controlsContainer: ".flex-container", slideshowSpeed: 8000, before: function(slider){ ... The JavaScript jQuery(function($){ $("#contact").submit(function(){ //grab form values before blowing it out of the DOM in the next line values=$(this).serialize(); $("#contact").html( "<... w/JavaScript window.onload = function(){ //create new button var btn = document.createElement("a"); btn.setAttribute("id", "addedbutton"); var btntxt = document.createTextNode("Run Me"); btn.appendChild(btntxt)... Frameworks Topics JavaScript 2014 6
- Nested-query approach to mining field_collection data and relationship <?php function get_species_country($id_country) { $inner = new EntityFieldQuery(); $inner_r = $inner->entityCondition('entity_type', 'field_collection_item') ->fieldCondition('field_species_country', 'target_id', $id_country, '=') ->execute(); if(!emp... Code Template Coding Drupal 2014
- Create symlinks <?php symlink('/homepages/21/d93015512/htdocs/library/organic_connectivity', '/homepages/21/d93015512/htdocs/drupal/sites/all/modules/organic_connectivity/lib'); ?>... Code Information Structuring PHP 2014
- Trauma Informed Care Information & Blog Stylesheet Coding Template Coding Work Wordpress 2013
Nodes
items_nodes.tpl.php
-
Wordpress
Submitted by orgnsm on Mon, 04/28/2014 - 19:08Context:Connection:Attribute Type:TypesConnection:Attribute Type:TypesImages: -
Rename stuck field names
Submitted by orgnsm on Fri, 02/21/2014 - 15:11<?php $fields = array( 'field_inspirational_imagery' => 'field_images', ); // Loop through each of the fields/tables with the old name and change them foreach($fields as $field_name => $new_field_name) { // First check that field_name exists if(!db_table_exists('field_data_' . $field_name)) { // If we cannot find a data table then just continue. continue; } // Define some things... $data_table_name = 'field_data_' . $field_name; $revision_table_name = 'field_revision_' . $field_name; $field_info = field_info_field($field_name); $storage_details = $field_info['storage']['details']; // The storage for each field has unique configuration. Must follow. foreach($storage_details['sql']['FIELD_LOAD_CURRENT'] as $field) { // Change the field names. foreach($field as $key => $value) { // Rename the field table columns and preserve existing spec. Let // features take care of any configuration changes. $spec = $field_info['columns'][$key]; db_change_field($data_table_name, $value, $new_field_name . "_" . $key, $spec); db_change_field($revision_table_name, $value, $new_field_name . "_" . $key, $spec); } } // Change the field storage table names. db_rename_table($data_table_name, 'field_data_' . $new_field_name); db_rename_table($revision_table_name, 'field_revision_' . $new_field_name); // Change the field names int he field_config and // field_instance_config tables db_update('field_config') ->fields( array( 'field_name' => $new_field_name, ) ) ->condition('field_name', $field_name, '=') ->execute(); db_update('field_config_instance') ->fields( array( 'field_name' => $new_field_name, ) ) ->condition('field_name', $field_name, '=') ->execute(); } /// end foreach loop on fields... whew. ?>
-
OSX Virtual Web Host Config
Submitted by orgnsm on Thu, 02/20/2014 - 15:47add line to /etc/hosts
127.0.0.1 amniot.localhost
add lines to /etc/apache2/httpd.conf
NameVirtualHost 127.0.0.1:80 <VirtualHost amniot.localhost:80> <Directory "/Library/Webserver/Documents_AMNIOT"> Options FollowSymLinks Indexes AllowOverride All Order deny,allow allow from All </Directory> ServerName amniot.localhost DocumentRoot "/Library/Webserver/Documents_AMNIOT" </VirtualHost>
-
MySQL Basics
Submitted by orgnsm on Wed, 02/12/2014 - 15:56Context:Connection:Attribute Type:Typesadd
export PATH=$PATH:/usr/local/mysql/bin
to ~/.bash_profile or /etc/profileBackup database to text file
mysqldump database_name > database_name.sql
Remove database
mysql> drop database database_name;
Create database
mysql> CREATE DATABASE database_name;
-
Manually reset Drupal admin password
Submitted by orgnsm on Wed, 02/12/2014 - 13:22<?php define('DRUPAL_ROOT', getcwd()); require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); require_once DRUPAL_ROOT . '/includes/password.inc'; if (isset($_GET['pass']) && !empty($_GET['pass'])) { $newhash = user_hash_password($_GET['pass']); } else { die('Retry with ?pass=PASSWORD set in the URL'); } $updatepass = db_update('users') ->fields(array( 'pass' => $newhash, // Uncomment the following lines to reset the administrative username and/or email address, if necessary. // 'name' => 'admin', // 'mail' => 'yourmail@example.com' )) ->condition('uid', '1', '=') ->execute(); print "Done. Please delete this file immediately!"; drupal_exit(); ?>
-
PHP
Submitted by orgnsm on Wed, 02/05/2014 - 16:09Context:Connection:Attribute Type:TypesImages: -
JQuery
Submitted by orgnsm on Wed, 02/05/2014 - 15:20Context:Connection:Attribute Type:TypesImages: -
Nested-query approach to mining field_collection data and relationship
Submitted by orgnsm on Wed, 02/05/2014 - 15:15Context:Connection:Attribute Type:Types<?php function get_species_country($id_country) { $inner = new EntityFieldQuery(); $inner_r = $inner->entityCondition('entity_type', 'field_collection_item') ->fieldCondition('field_species_country', 'target_id', $id_country, '=') ->execute(); if(!empty($inner_r['field_collection_item'])) { $keys = array_keys($inner_r['field_collection_item']); $query = new EntityFieldQuery(); $species_r = $query->entityCondition('entity_type', 'node') ->entityCondition('bundle', self::$bundle) ->fieldCondition('field_species_countries', 'value', $keys) ->execute(); if(!empty($species_r['node'])) { $ret = node_load_multiple(array_keys($species_r['node'])); } } return $ret; } ?>
-
Create symlinks
Submitted by orgnsm on Mon, 01/20/2014 - 14:39Context:Connection:Attribute Type:Types<?php symlink('/homepages/21/d93015512/htdocs/library/organic_connectivity', '/homepages/21/d93015512/htdocs/drupal/sites/all/modules/organic_connectivity/lib'); ?>
-
Trauma Informed Care
Submitted by orgnsm on Wed, 12/18/2013 - 17:48Subtitle:Information & BlogContext:Connection:Attribute Type:TypesInstallation URL:http://www.traumainformedhawaii.netImages:
Table
items_table.tpl.php
ID | Images/Body | Types | Title | Subjects | Attributes | Edit |
---|---|---|---|---|---|---|
112 | WordpressInformation & Blog |
|
EDIT | |||
111 | <?php $fields = array( 'field_inspirational_imagery' => 'field_images', ); // Loop through each of the fields/tables with the old name and change them foreach($fields as $field_name => $new_field_name) { // First check that field_name exists if(!db_table_exists('field_data_' . $field_name)) { // If we cannot find a data table then just continue. continue; } // Define some things... $data_table_name = 'field_data_' . $field_name; $revision_table_name = 'field_revision_' . $f | Rename stuck field namesInformation & Blog |
|
EDIT | ||
110 | add line to /etc/hosts 127.0.0.1 amniot.localhost add lines to /etc/apache2/httpd.conf NameVirtualHost 127.0.0.1:80 <VirtualHost amniot.localhost:80> <Directory "/Library/Webserver/Documents_AMNIOT"> Options FollowSymLinks Indexes AllowOverride All Order deny,allow allow from All </Directory> ServerName amniot.localhost DocumentRoot "/Library/Webserver/Documents_AMNIOT" </VirtualHost> | OSX Virtual Web Host ConfigInformation & Blog |
|
EDIT | ||
109 | add export PATH=$PATH:/usr/local/mysql/bin to ~/.bash_profile or /etc/profile Backup database to text file mysqldump database_name > database_name.sql Remove database mysql> drop database database_name; Create database mysql> CREATE DATABASE database_name; | MySQL BasicsInformation & Blog |
|
|
EDIT | |
108 | <?php define('DRUPAL_ROOT', getcwd()); require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); require_once DRUPAL_ROOT . '/includes/password.inc'; if (isset($_GET['pass']) && !empty($_GET['pass'])) { $newhash = user_hash_password($_GET['pass']); } else { die('Retry with ?pass=PASSWORD set in the URL'); } $updatepass = db_update('users') ->fields(array( 'pass' => $newhash, // Uncomment the following lines to reset the administrative username and/or email address, if nec | Manually reset Drupal admin passwordInformation & Blog |
|
EDIT | ||
106 | PHPInformation & Blog |
|
EDIT | |||
105 | JQueryInformation & Blog |
|
EDIT | |||
104 | <?php function get_species_country($id_country) { $inner = new EntityFieldQuery(); $inner_r = $inner->entityCondition('entity_type', 'field_collection_item') ->fieldCondition('field_species_country', 'target_id', $id_country, '=') ->execute(); if(!empty($inner_r['field_collection_item'])) { $keys = array_keys($inner_r['field_collection_item']); $query = new EntityFieldQuery(); $species_r = $query->entityCondition('entity_type', 'node') | Nested-query approach to mining field_collection data and relationshipInformation & Blog |
|
EDIT | ||
103 | <?php symlink('/homepages/21/d93015512/htdocs/library/organic_connectivity', '/homepages/21/d93015512/htdocs/drupal/sites/all/modules/organic_connectivity/lib'); ?> | Create symlinksInformation & Blog |
|
EDIT | ||
102 | Trauma Informed CareInformation & Blog |
|
EDIT |
Rotator
items_cinema.tpl.php
-
<?php $fields = array( 'field_inspirational_imagery' => 'field_images', ); // Loop through each of the fields/tables with the old name and change them foreach($fields as $field_name => $new_field_name) { // First check that field_name exists if(!db_table_exists('field_data_' . $field_name)) { // If we cannot find a data table then just continue. continue; } // Define some things... $data_table_name = 'field_data_' . $field_name; $revision_table_name = 'field_revision_' . $field_name; $field_info = field_info_field($field_name); $storage_details = $field_info['storage']['details']; // The storage for each field has unique configuration. Must follow. foreach($storage_details['sql']['FIELD_LOAD_CURRENT'] as $field) { // Change the field names. foreach($field as $key => $value) { // Rename the field table columns and preserve existing spec. Let // features take care of any configuration changes. $spec = $field_info['columns'][$key]; db_change... Code Rename stuck field names Drupal PHP
-
add line to /etc/hosts 127.0.0.1 amniot.localhost add lines to /etc/apache2/httpd.conf NameVirtualHost 127.0.0.1:80 <VirtualHost amniot.localhost:80> <Directory "/Library/Webserver/Documents_AMNIOT"> Options FollowSymLinks Indexes AllowOverride All Order deny,allow allow from All </Directory> ServerName amniot.localhost DocumentRoot "/Library/Webserver/Documents_AMNIOT" </VirtualHost>... Code OSX Virtual Web Host Config Macintosh
-
<?php define('DRUPAL_ROOT', getcwd()); require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); require_once DRUPAL_ROOT . '/includes/password.inc'; if (isset($_GET['pass']) && !empty($_GET['pass'])) { $newhash = user_hash_password($_GET['pass']); } else { die('Retry with ?pass=PASSWORD set in the URL'); } $updatepass = db_update('users') ->fields(array( 'pass' => $newhash, // Uncomment the following lines to reset the administrative username and/or email address, if necessary. // 'name' => 'admin', // 'mail' => 'yourmail@example.com' )) ->condition('uid', '1', '=') ->execute(); print "Done. Please delete this file immediately!"; drupal_exit(); ?>... Code Manually reset Drupal admin password Drupal
-
<?php function get_species_country($id_country) { $inner = new EntityFieldQuery(); $inner_r = $inner->entityCondition('entity_type', 'field_collection_item') ->fieldCondition('field_species_country', 'target_id', $id_country, '=') ->execute(); if(!empty($inner_r['field_collection_item'])) { $keys = array_keys($inner_r['field_collection_item']); $query = new EntityFieldQuery(); $species_r = $query->entityCondition('entity_type', 'node') ->entityCondition('bundle', self::$bundle) ->fieldCondition('field_species_countries', 'value', $keys) ->execute(); if(!empty($species_r['node'])) { $ret = node_load_multiple(array_keys($species_r['node'])); } } return $ret; } ?>... Code Nested-query approach to mining field_collection data and relationship Template Coding Drupal
RSS
items_syndicate.tpl.php
]]>Organic Interfaces http://interfaces.orgnsm.org/syndicateRecent Web Design & Info Code en Mon, 28 Apr 2014 19:08:21 -1000 Wordpress http://interfaces.orgnsm.org/node/112]]> 112 Mon, 28 Apr 2014 19:08:21 -1000 http://interfaces.orgnsm.org/sites/interfaces.orgnsm.org/files/styles/large-landscape-or-portrait/public/wordpress-logo-notext-rgb.png?itok=kbCsVk7S Rename stuck field names http://interfaces.orgnsm.org/node/111<?php $fields = array( 'field_inspirational_imagery' => 'field_images', ); // Loop through each of the fields/tables with the old name and change them foreach($fields as $field_name => $new_field_name) { // First check that field_name exists if(!db_table_exists('field_data_' . $field_name)) { // If we cannot find a data table then just continue. continue; } // Define some things... $data_table_name = 'field_data_' . $field_name; $revision_table_name = 'field_revision_' . $field_name; $field_info = field_info_field($field_name); $storage_details = $field_info['storage']['details']; // The storage for each field has unique configuration. Must follow. foreach($storage_details['sql']['FIELD_LOAD_CURRENT'] as $field) { // Change the field names. foreach($field as $key => $value) { // Rename the field table columns and preserve existing spec. Let // features take care of any configuration changes. $spec = $field_info['columns'][$key]; db_change_field($data_table_name, $value, $new_field_name . "_" . $key, $spec); db_change_field($revision_table_name, $value, $new_field_name . "_" . $key, $spec); } } // Change the field storage table names. db_rename_table($data_table_name, 'field_data_' . $new_field_name); db_rename_table($revision_table_name, 'field_revision_' . $new_field_name); // Change the field names int he field_config and // field_instance_config tables db_update('field_config') ->fields( array( 'field_name' => $new_field_name, ) ) ->condition('field_name', $field_name, '=') ->execute(); db_update('field_config_instance') ->fields( array( 'field_name' => $new_field_name, ) ) ->condition('field_name', $field_name, '=') ->execute(); } /// end foreach loop on fields... whew. ?>
127.0.0.1 amniot.localhost
add lines to /etc/apache2/httpd.conf
NameVirtualHost 127.0.0.1:80
<VirtualHost amniot.localhost:80>
<Directory "/Library/Webserver/Documents_AMNIOT">
Options FollowSymLinks Indexes
AllowOverride All
Order deny,allow
allow from All
</Directory>
ServerName amniot.localhost
DocumentRoot "/Library/Webserver/Documents_AMNIOT"
</VirtualHost>
]]>export PATH=$PATH:/usr/local/mysql/bin
to ~/.bash_profile or /etc/profile
Backup database to text file
mysqldump database_name > database_name.sql
Remove database
mysql> drop database database_name;
Create database
mysql> CREATE DATABASE database_name;
]]><?php
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
require_once DRUPAL_ROOT . '/includes/password.inc';
if (isset($_GET['pass']) && !empty($_GET['pass'])) {
$newhash = user_hash_password($_GET['pass']);
}
else {
die('Retry with ?pass=PASSWORD set in the URL');
}
$updatepass = db_update('users')
->fields(array(
'pass' => $newhash,
// Uncomment the following lines to reset the administrative username and/or email address, if necessary.
// 'name' => 'admin',
// 'mail' => 'yourmail@example.com'
))
->condition('uid', '1', '=')
->execute();
print "Done. Please delete this file immediately!";
drupal_exit();
?>
]]><?php
function get_species_country($id_country) {
$inner = new EntityFieldQuery();
$inner_r = $inner->entityCondition('entity_type', 'field_collection_item')
->fieldCondition('field_species_country', 'target_id', $id_country, '=')
->execute();
if(!empty($inner_r['field_collection_item'])) {
$keys = array_keys($inner_r['field_collection_item']);
$query = new EntityFieldQuery();
$species_r = $query->entityCondition('entity_type', 'node')
->entityCondition('bundle', self::$bundle)
->fieldCondition('field_species_countries', 'value', $keys)
->execute();
if(!empty($species_r['node'])) {
$ret = node_load_multiple(array_keys($species_r['node']));
}
}
return $ret;
}
?>
]]><?php
symlink('/homepages/21/d93015512/htdocs/library/organic_connectivity',
'/homepages/21/d93015512/htdocs/drupal/sites/all/modules/organic_connectivity/lib');
?>
]]>