Bell Boy

Read More

JQuery Code Snippet For Select Lists

This code will help display a special note when a specific value from a select list is chosen. In this example, some note text is added to the page, near the form save button.

This script can then be set in a Drupal "code" block, with conditions for only displaying on our node add/edit form page.

<script>
(function ($) {
$(document).ready(function(){
$('#select_list_div_id').change(function()
{
if (this.value == 'some_value_from_select_list')
{
$('<div id="special_note"><H1>Special Note:</H1> Note text here. </div>').insertBefore('#existing_div_id_of_where_to_place_on_page');
} else if ($('#special_note').length){
// Check for length (existence) of our note div.
// This removes our note if the value is selected and then changed to another value.
$("div").remove( "#special_note" );
}
});
});
}(jQuery))
</script>

Kt, Tag, Morse Code, The Shack, Glue Box Telephone

Read More

Philadelphia Frequencies & Repeaters

This post contains a bunch of frequency notes from our radio channel memory. It won't mean much for most.
 

Read More

PHP Snippet print drupal custom search block

This code can be used to print Custom Search blocks any where you can stick PHP. Tested in Drupal 7.

#open php code

$block = block_load('custom_search_blocks','1');
$content = _block_get_renderable_array(_block_render_blocks(array($block)));      
$output = drupal_render($content);        
print $output;

#close php code

Apache Note

Read More

Apache Notes - preventing external hot links

/**
.htaccess code to prevent external sites from directly linking to to files in an Apache directory. This prevent external sites from "hot-linking"
**/

SetEnvIf Referer "^http://subdomain\.domain\.edu" local_referral
SetEnvIf Referer "^https://subdomain\.domain\.edu" local_referral

# Apache 2.2
Order Deny,Allow
Deny from all
Allow from env=local_referral
Allow from env=auth_referral

# Apache 2.4 Syntax
local_referral
SetEnvIf Referer "server_23\.gluebox\.com" localreferer
Require env localreferer

#######################
// Double check for all .htaccess files in a directory
find . -name ".htaccess" -type f

// Now delete theme
find . -name ".htaccess" -type f -delete

########################
#  Enable a list of Drupal modules from a text file,
#  helpful for moving sites around
#  Make a list of all non-core modules.

sudo drush pml --no-core --type=module --status=enabled --pipe | cat > modlist.txt

# Now enable the list

sudo drush en -y $(cat modlist.txt)

 

Pages

Subscribe to Front page feed