This file contains hidden or 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
| /** | |
| * Implements hook_file_insert(). | |
| */ | |
| function MYMODULE_file_insert($file) { | |
| $hash = 'public://' . md5($file->filename) . '.' . pathinfo($file->filename, PATHINFO_EXTENSION); | |
| file_move($file, $hash, 'FILE_EXIST_REPLACE'); | |
| } |
This file contains hidden or 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 Pathname and Add background image of path for dynamic backgrounds. | |
| var loc = window.location.pathname.substring(1); | |
| if (loc === '') { | |
| $( "#marketing-header" ).css('background-image', 'url(/img/default-bg.jpg)'); | |
| } else { | |
| $( "#marketing-header" ).css('background-image', 'url(/img/'+loc+'.jpg)'); | |
| }; |
This file contains hidden or 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
| /* Author Note: | |
| * Uses a Json object to populate Drupal 7's webform select options. You have to modify webform to accept external select options to be posted. | |
| * On remote Json failure, A local Json object is loaded. I have a cron script that updates the Local Json object daily from remote server. | |
| */ | |
| //Remove required webform select option | |
| $("#edit-submitted-programs-list option[value='NA']").each(function() { | |
| $(this).remove(); | |
| }); | |
| //Get list of programs from Server |
This file contains hidden or 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
| /* Author Note: | |
| * Captures URL parameters and inputs into Drupal webform | |
| * Used for PPC Landing Page marketing. Passing SourceId, Adid, KwId to converted leads and submiting to database with lead. | |
| * URL Ussage http://www.domain.com/?sid=Adwords&cmid=CampainID&adgid=AdGroupID&adid=AdID&kwid=KeyworkID | |
| */ | |
| //Split apart URL and extract Parameters | |
| var parseQueryString = function() { | |
| var str = window.location.search; | |
| var objURL = {}; |
This file contains hidden or 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() | |
| * Call a custom form as menu callback | |
| * @return | |
| * $items array of menu items created programmatically | |
| */ | |
| function test_menu() { |
This file contains hidden or 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
| console.log( "window=" + $(document).width() + "x" + $(document).height() ); |
This file contains hidden or 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
| $(‘.div').css('min-height', $(‘.main-div').height()); |
This file contains hidden or 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
| // Back To Top | |
| $('a.top').click(function(){ | |
| $(document.body).animate({scrollTop : 0},800); | |
| return false; | |
| }); | |
| //Create an anchor tag | |
| <a class=”top” href=”#”>Back to top</a> |
This file contains hidden or 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
| // Hide the image on error | |
| $("img").error(function(){ | |
| $(this).hide(); | |
| }); | |
| // Change the image to a missing image | |
| $('img').error(function(){ | |
| $(this).attr('src', 'no-image.jpg'); | |
| }); |
This file contains hidden or 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
| <script type="text/javascript"> | |
| $(document).ready(function() { | |
| var url = window.location.href; | |
| if (url.search("checkout.html") >= 0) { | |
| $('td:contains("A portion of Brown Paper Tickets profits"):last').hide(); | |
| $('td:contains("This sale should benefit "):last').parent().hide(); | |
| } | |
| }); | |
| </script> |