Stoppt die Vorratsdatenspeicherung! Jetzt klicken &handeln! Willst du auch an der Aktion teilnehmen? Hier findest du alle relevanten Infos und Materialien:

Archived entries for

Drupal: Theming Views 2

Ein wie ich finde sehr gutes Tutorial zu Views 2 Theming gibt es bei Group 42.

Insbesondere den ” theme information link” habe ich erst kürzlich bemerkt, dabei ist er so hilfreich.

Basic steps for theming a Views 2 view:

  • Use the theme information link to determine your template file starting point and naming options
  • Copy the default template file from modules/views/theme to your theme directory
  • Rename the file with your selected name
  • Press rescan to reload the cache and confirm you’ve done the copy/rename correctly
  • Read the template file comments and use:
    <?php
     print print_r(array_keys(get_defined_vars()), 1);
     // Or if you have the developer module installed
     dsm(array_keys(get_defined_vars()));
     ?>

    to find variable names

  • Use a views subdirectory in your theme directory to keep your theme files organized

Silben trennen mit PHP

Der PHP Blogger hat sich mit Silbentrennung in PHP beschäftigt und stellt sein Zwischenergebnis in diesem Posting vor.

Easy px to em conversion

Die Webseite PXtoEM.com hilft px in em umzurechnen. Praktisch und schön gemacht.

Die Umrechungsformeln lauten wie folgt:

16px is used as the body text size in all conversions because that is the browser default on today’s browser. You will change 16px to your base text size.

  • PX to EM: text size in pixels / body text size in pixels = size in EMs
    o Example: 12px / 16px = .75em
  • PX to %: text size in pixels / body text size in pixels * 100 = size in %
    o Example: 12px / 16px * 100 = 75%
  • PX to PT: text size in pixels * points per inch / pixels per inch = size in pt
    o Example: 16px * 72 (72 points = 1 inch) / 96 (96 pixels per inch in Windows, 72 in Mac) = 12pt
  • EM to PX: text size in EMs * body text size in pixels = size in pixels
    o Example: .75em * 16px = 12px
  • EM to %: text size in EMs * 100 = size in %
    o Example: .75em * 100 = 75%
  • % to PX: text size in % * body text size in pixels / 100 = size in pixels
    o Example: 75 * 16px / 100 = 12px
  • % to EM: text size in % / 100 = size in EMs
    o Example: 75 / 100 = .75em
  • PT to PX: text size in pt * pixels per inch / points per inch = text size in pixels
    o Example: 12pt * 96ppi / 72ppi = 16px

WordPress: Google News füttern

WP Engineer erklärt wie man mit WordPress eine News Sitemap erstellt.

Once you have the above syntax as a file in the root installation and successfully tested, then you only have to ask for inclusion in Google News. There is a form available. Then just wait for an answer from Google.
To see if you are indexed, you can simple search in Google News: site:domain.com.

Use Is.Gd with PHP

David Walsh zeigt wie man den URL-Verkürzer is.gd mit PHP verwenden kann:

is.gd is a service that shortens URLs such as web addresses. This is useful in many circumstances e.g. in email clients that break long URLs. Our goal is to allow shortening URLs to the maximum extent technically possible.

Ach ja der Code:

//gets the data from a URL
function get_tiny_url($url)
{
	//get content
	$ch = curl_init();
	$timeout = 5;
	curl_setopt($ch,CURLOPT_URL,'http://is.gd/create.php?longurl='.$url);
	curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
	curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
	$content = curl_exec($ch);
	curl_close($ch);

	//grab the URL
	preg_match('/value="(.*)" onselect/isU',$content,$matches);
	$new_url = $matches[1];

	//return the data
	return $new_url;
}

//usage
$new_url = get_tiny_url('http://davidwalsh.name/php-imdb-information-grabber');


Copyright © 2004–2009. All rights reserved. – Impressum

RSS Feed. This blog is proudly powered by Wordpress and uses Modern Clix, a theme by Rodrigo Galindez.