<?php

global $wpdb;
$site_id = 1109;

switch_to_blog( $site_id );

$template_ids = $wpdb->get_col( "SELECT id FROM wp_1109_wpmlthemes" );
foreach ( $template_ids as $tid ) {
	$template = $wpdb->get_row( $wpdb->prepare( "SELECT * from wp_1109_wpmlthemes WHERE id = %d", $tid ) );
	$img = '<img src="http://cpcp.commons.gc.cuny.edu/wp-content/plugins/wp-mailinglist/includes/themes/simplyelegant/images/hr-large.gif" width="560" height="27" alt="Hr">';

	if ( false === strpos( $template->content, $img ) ) {
		continue;
	}


	$content = $template->content;
	print_r( $template );
}

/*
$content = str_replace( '<img src="http://cpcp.commons.gc.cuny.edu/wp-content/plugins/wp-mailinglist/includes/themes/simplyelegant/images/hr-large.gif" width="560" height="27" alt="Hr">', '<hr />', $content );

$wpdb->query( $wpdb->prepare( "UPDATE wp_1109_wpmlthemes SET content = %s WHERE id = 6", $content ) );
*/

restore_current_blog();
