[Comoblog-commit] comoblog/modules/mod_markup/include mod_markup.inc.php,NONE,1.1
Status: Inactive
Brought to you by:
markwallis
|
From: Mark W. \(a. serialmonkey\) <mar...@us...> - 2005-10-09 01:37:46
|
Update of /cvsroot/comoblog/comoblog/modules/mod_markup/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11987/mod_markup/include Added Files: mod_markup.inc.php Log Message: RFE: 1280308 - Add mod_markup filter module to CVS. This is the prework for being able to support Image posts embedded in markup referencing remote URLs --- NEW FILE: mod_markup.inc.php --- <?php include_once (dirname(__FILE__).'/../../../include/config.inc.php'); function process_images_remote($post) { $pos = 0; $body = $post['post_mail_body']; $pos = strpos( $body, "[[Image:"); while ($pos != FALSE) { $start = $pos; $end = strpos( $body, "]]", $start + 1); $url = substr($body, $start+8, $end-$start-8); $html = "<img src='".$url."'>"; $body = substr($body, 0, $start).$html.substr($body, $end+2); $pos = strpos( $body, "[[Image:"); } $post['post_mail_body'] = $body; return $post; } function markup ($post) { if (CFG_MOD_MARKUP_DOWNLOAD_IMAGES == "N") $post = process_images_remote( $post ); if ($post['post_ctype'] == "text/plain") { $post['post_mail_body'] = nl2br($post['post_mail_body']); $post['post_ctype'] = "text/html"; } return $post; } ?> |