
seen from United States

seen from Singapore
seen from Russia
seen from Canada
seen from China
seen from Georgia

seen from Malaysia
seen from Germany

seen from Malaysia

seen from Germany
seen from China
seen from China

seen from Germany

seen from India
seen from China
seen from United States
seen from Germany
seen from United Kingdom
seen from United States

seen from Netherlands
SEO optimization in template.php
// SEO optimization, if the node has tags, use these as keywords for the page function phptemplate_preprocess_page(&$vars) { if (isset($vars['node']->taxonomy)) { $keywords = array(); foreach ($vars['node']->taxonomy as $term) { $keywords[] = $term->name; } $vars['head'] .= '<meta name="keywords" content="'. implode(',', $keywords) .'" />' ."\n"; } // SEO optimization, avoid duplicate titles in search indexes for pager pages if (isset($_GET['page']) || isset($_GET['sort'])) { $vars['head'] .= '<meta name="robots" content="noindex,follow" />' ."\n"; } }
Automatically flush the theme cache
/** * Uncomment the following line during development to automatically * flush the theme cache when you load the page. That way it will * always look for new tpl files. */ //drupal_flush_all_caches();
Return pieces of the current url
/** * Return pieces of the current url * * @param $path * What part of the path you want to return. Starts at 0. * @param $pieces * Return full path or just one part of it. Defaults to full path */ function MYTHEME_url_constructor($path = 0, $pieces = false) { $url = drupal_get_path_alias($_GET['q']); $url = explode('/', $url); if ($pieces == true) { $url = $url[$path]; } else { $url = array_slice($url, 0, $path + 1); $url = implode(',', $url); $url = str_replace(',', '/', $url); } return $url; }
URL based breadcrumbs in Drupal
function MYTHEME_url_breadcrumbs() { function get_crumb($lvl) { $uri_request_id = $_SERVER['REQUEST_URI']; $urlexplode = explode("?", $uri_request_id); $url = explode("/", $urlexplode[0]); if ($url[$lvl]) { if ($lvl > 1) { $var = array_keys($url); foreach ($var as $vars) { if ($vars == 1) { $urlpathpeice .= $url[$vars]; } if ($vars <= $lvl && $vars > 1) { $urlpathpeice .= '/'. $url[$vars]; } } $urlpathalias = $urlpathpeice; } elseif ($lvl == 1) { $urlpathalias = $url[$lvl]; } $urlsystem = drupal_lookup_path('source', $urlpathalias); $urlsystemexplode = explode("/", $urlsystem); $urltype = $urlsystemexplode[0]; if ($urltype == "taxonomy") { $term = taxonomy_get_term($urlsystemexplode[2]); if ($url[$lvl + 1]) { return ' <a href="/'. $urlpathalias .'" title="'. $term->name .'">'. $term->name .'</a>'; } else { return '<span>'. $term->name .'</span>'; } } elseif ($urltype == "node") { $node = node_load($urlsystemexplode[1]); if ($url[$lvl + 1]) { return ' <a href="/'. $urlpathalias .'" title="'. $nodename .'">'. $node->title .'</a>'; } else { return '<span>'. $node->title .'</span>'; } } else { $urltitleexplode = explode("-", $url[$lvl]); $words = array_keys($urltitleexplode); foreach ($words as $word) { $urltitle .= ''. ucwords($urltitleexplode[$word]) .' '; } if ($url[$lvl + 1]) { return ' <a href="/'. $urlpathalias .'" title="'. $urltitle .'">'. $urltitle .'</a>'; } else { return '<span>'. $urltitle .'</span>'; } } } } function get_crumb_all() { $uri_request_id = $_SERVER['REQUEST_URI']; $urlexplode = explode("?", $uri_request_id); $url = explode("/", $urlexplode[0]); $numbs = array_keys($url); foreach ($numbs as $numb) { $crumbs .= get_crumb($numb); } return $crumbs; } $output .= '<div id="breadcrumb">'; $output .= '<a href="/" title="Home">Home</a>'; $output .= get_crumb_all(); $output .= '</div>'; return $output; }
Alternate FileField Icon Sets
This just points to my images directory and uses the mimetype as the filename.
ie: application-pdf, application-msword
In your template.tpl.php
// implementation of theme_filefield_icon(), use our own icon set function fp_filefield_icon($file) { if (is_object($file)) { $file = (array)$file; } $mime = check_plain($file['filemime']); $dashed_mime = strtr($mime, array('/' => '-', '+' => '-')); if ($icon_url = filefield_icon_url($file)) { return '<img class="filefield-icon field-icon-' . $dashed_mime . '" alt="' . t('@mime icon', array('@mime' => $mime)) . '" src="' . base_path() . path_to_theme() . '/images/' . $dashed_mime . '.png" />'; } }