Archive for May, 2008

27MayAuto-Lightboxing

The following is an improvement on the existing krembo99_replace function that comes with Lightbox.
In addition to automatically adding the lightbox relation to links referring directly to image files, it also removes duplicates (in case you manually added the rel=”lightbox” at one point in previous posts) and supports links that include title attributes (title=”my pic”).

function autoexpand_rel_wlightbox ($content) {
	global $post;
	$pattern[0] = "/<a(.*?)href=('|\")([A-Za-z0-9\/_\.\~\:-]*?)(\.bmp|\.gif|\.jpg|\.jpeg|\.png)('|\")([^\>]*?)>/i";
	$pattern[1] = "/<a(.*?)href=('|\")([A-Za-z0-9\/_\.\~\:-]*?)(\.bmp|\.gif|\.jpg|\.jpeg|\.png)('|\")(.*?)(rel=('|\")lightbox(.*?)('|\"))([ \t\r\n\v\f]*?)((rel=('|\")lightbox(.*?)('|\"))?)([ \t\r\n\v\f]?)([^\>]*?)>/i";
	$replacement[0] = '<a$1href=$2$3$4$5$6 rel="lightbox['.$post->ID.']">';
	$replacement[1] = '<a$1href=$2$3$4$5$6$7>';
	$content = preg_replace($pattern, $replacement, $content);
	return $content;
}

// Usage

if (get_option('lightbox_2_automate') == 1){
	add_filter('the_content', 'autoexpand_rel_wlightbox');
	add_filter('the_excerpt', 'autoexpand_rel_wlightbox');
}

This function will ignore links where you have manually entered your own Lightbox reference.

Updated code to support NextGEN Gallery style single quote image posts.
Bush


20MayUgly people

no-country-mcain.jpgJohn McCain has been forced to cut ties with two campaign staffers recently because of their ties to the military junta in Burma. The first, Doug Goodyear, was the man McCain had selected to run the 2008 Republican convention. Goodyear is the chief executive of DCI Group, a lobbying firm that was paid $348,000 in 2002 to improve the junta’s image in America and to push the federal government to improve relations with the notorious human rights abusers. The second, Doug Davenport, was a regional campaign manager for McCain who helped found DCI Group and served as head of its lobbying practice, where he also worked for the junta.

Here are some people that still are (update:or until recently, were) on the McCain payroll:

  • Charlie Black, whose lobbying firm represented human rights abusers like Philipines President Ferdinand Marcos, Zaire dictator Mobuto Sese Seko, Somalia’s Mohamed Siad Barre and Nigeria’s Ibrahim Babangida, as well as foreign oil interests like the Chinese government’s CNOOC. Black currently serves McCain as a spokesman and senior counsel;
  • Tom Loeffler, whose firm has made more than $10 million since 2006 for lobbying for the Saudi Arabian monarchy and oil interests. Loeffler serves as McCain’s national finance chairman.
  • Peter Madigan, a lobbyist whose firm received $800,000 to represent the United Arab Emirates in a class action suit over allegations that boys are enslaved and forced to be camel jockeys. He is also is a former lobbyist for Shell Oil. Madigan serves as a top fundraiser for McCain.

Talk about ugly people….


19MayLightbox 2.6.0 WordPress Plugin

Unlike Lightbox 2.5.x, the 2.6.0 release includes a bit of code that automatically inserts the lightbox attribute to every link in your posts that directly refers to image files (.bmp, .gif, .jpg, .jpeg, .png). This means you no longer have to add the rel="lightbox[xxx]" attribute to your links manually; it is done for you. This also means that previous posts you made where you DID insert the code manually will include TWO rel=”lightbox[xxx]” attributes!…just so you know…




You are currently browsing the archives...