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 | |
function hosting_default_layouts() { | |
return 'W3sia2V5IjoiZGVmYXVsdCIsInRpdGxlIjoiRGVmYXVsdCIsInNlY3Rpb25zIjpbeyJrZXkiOiJoZWFkZXIiLCJ0aXRsZSI6IkhlYWRlciIsIndlaWdodCI6MCwiZnVsbHdpZHRoIjoibm8iLCJiYWNrZ3JvdW5kY29sb3IiOiIiLCJzdGlja3kiOmZhbHNlLCJ2cGhvbmUiOmZhbHNlLCJ2dGFibGV0IjpmYWxzZSwidmRlc2t0b3AiOmZhbHNlLCJocGhvbmUiOmZhbHNlLCJodGFibGV0IjpmYWxzZSwiaGRlc2t0b3AiOmZhbHNlLCJjb2xwYWRkaW5nIjoiIiwiY3VzdG9tX2NsYXNzIjoiaGVhZGVyX3dyYXBwZXIiLCJyZWdpb25zIjpbeyJrZXkiOiJsb2dvIiwidGl0bGUiOiJMb2dvIiwid2VpZ2h0IjowLCJjb2x4cyI6IjQiLCJjb2xzbSI6IjQiLCJjb2xtZCI6IjMiLCJjb2xsZyI6IjMifSx7ImtleSI6ImNhbGxfdXMiLCJ0aXRsZSI6IkNhbGwgVXMiLCJ3ZWlnaHQiOjEsImNvbHhzIjoiNiIsImNvbHNtIjoiNiIsImNvbG1kIjoiNiIsImNvbGxnIjoiNiJ9LHsia2V5Ijoic2VhcmNoIiwidGl0bGUiOiJTZWFyY2giLCJ3ZWlnaHQiOjIsImNvbHhzIjoiNCIsImNvbHNtIjoiNCIsImNvbG1kIjoiMSIsImNvbGxnIjoiMSJ9LHsia2V5IjoibG9naW4iLCJ0aXRsZSI6IkxvZ2luIiwid2VpZ2h0IjozLCJjb2x4cyI6IjQiLCJjb2xzbSI6IjQiLCJjb2xtZCI6IjIiLCJjb2xsZyI6IjIifV19LHsia2V5IjoibmF2aWdhdGlvbiIsInRpdGxlIjoiTmF2aWdhdGlvbiIsIndlaWdodCI6MSwiZnVsb |
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
.text-xs-left { text-align: left; } | |
.text-xs-right { text-align: right; } | |
.text-xs-center { text-align: center; } | |
.text-xs-justify { text-align: justify; } | |
@media (min-width: @screen-sm-min) { | |
.text-sm-left { text-align: left; } | |
.text-sm-right { text-align: right; } | |
.text-sm-center { text-align: center; } | |
.text-sm-justify { text-align: justify; } |
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 | |
// http://kahthong.com/2012/08/programmatically-show-number-items-drupal-commerce-shopping-cart | |
global $user; | |
$quantity = 0; | |
$order = commerce_cart_order_load($user->uid); | |
if ($order) { | |
$wrapper = entity_metadata_wrapper('commerce_order', $order); | |
$line_items = $wrapper->commerce_line_items; | |
$quantity = commerce_line_items_quantity($line_items, commerce_product_line_item_types()); | |
$total = commerce_line_items_total($line_items); |
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
/** | |
* Global Reset of all HTML Elements | |
* | |
* Resetting all of our HTML Elements ensures a smoother | |
* visual transition between browsers. If you don't believe me, | |
* try temporarily commenting out this block of code, then go | |
* and look at Mozilla versus Safari, both good browsers with | |
* a good implementation of CSS. The thing is, all browser CSS | |
* defaults are different and at the end of the day if visual | |
* consistency is what we're shooting for, then we need to |
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 | |
public static function get_the_fb_like( $url = '' ){ | |
$pageURL = 'http://nextopics.com'; | |
$url = ($url == '' ) ? $pageURL : $url; // setting a value in $url variable | |
$params = 'SELECT comment_count, share_count, like_count FROM link_stat WHERE url = "'.$url.'"'; | |
$component = urlencode($params); | |
$url = 'http://graph.facebook.com/fql?q='.$component; | |
$fbLIkeAndSahre = json_decode(file_get_contents($url)); | |
$getFbStatus = $fbLIkeAndSahre->data['0']; | |
return $getFbStatus; |
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 | |
/** | |
* @file | |
* Default theme implementation to display a single Drupal page. | |
* | |
* Available variables: | |
* | |
* General utility variables: | |
* - $base_path: The base URL path of the Drupal installation. At the very | |
* least, this will always default to /. |
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
(function($){ | |
$(document).ready(function(){ | |
var relativeDir = Drupal.settings.paththeme+'/css/'; | |
/* *************************************** | |
* Reading Cookies for stored values | |
*******************************************/ | |
(function(){ | |
if(readCookie("ssTruckingStyle") !== null){ | |
var styleVal = readCookie("ssTruckingStyle"); |
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
// Note: this example makes use of jquery.cookie Plugin by Klaus Hartl, so make sure you include it, too. | |
(function ($) { | |
$( document ).ready(function() { | |
var cookieName = 'firstPageLoad'; | |
var cookieValue = 1; | |
// if the cookie doesn't exist we're on the first page load... | |
if (!$.cookie(cookieName)) { | |
// and set a cookie that is valid for the entire domain | |
$.cookie(cookieName, cookieValue, { path: '/'}); |
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
The extensions that are specific for Drupal, or that have a specific meaning in Drupal, are the following ones: | |
The .api.php extension is used for the file describing the hooks used by a module, such as system.api.php. | |
The .install extension is used for the file that is used when a module is installed, such as system.install. It is also loaded when Drupal is verifying the requirements needed from a module. | |
The .inc extension is used for any secondary file that contains code that is loaded only when necessary. If the code is used in specific cases, such as when a specific menu callback is being invoked, then the code is moved in a separated .inc file. Often, you will find modules using a file with the .admin.inc extension (e.g. node.admin.inc) that includes all the code necessary to run the administrative interface, and a file with .pages.inc extension (e.g. node.pages.inc) that contains the code executed for other menu callbacks. If a module implements tokens, in Drupal 7 you will find files us |
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 | |
public function load_fields($entity_type, $bundle_name) { | |
$instances = field_info_instances($entity_type, $bundle_name); // Load entity tye and bundle_name | |
$fields = array(); | |
foreach($instances as $key => $instance) { | |
foreach($instance as $field_name => $instance_field) | |
{ | |
$field_info = field_info_field($field_name); | |
if($field_info['type'] === 'text') { // Get Type Fields 'text' , You can conndition type other |