Created
August 24, 2010 01:03
-
-
Save dmuth/546688 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* This code is to load a chat created with Drupal's Chat Room module | |
* (http://drupal.org/project/chatroom) into a block. | |
* If implemented properly, users will be able to chat from any page | |
* on the site that displays this block. | |
* | |
* @author Douglas Muth <http://www.dmuth.org/> | |
*/ | |
// | |
// The node ID of the chat to load. | |
// | |
$nid = 1377; | |
$node = node_load($nid); | |
// | |
// Load the node. | |
// | |
$html = node_view($node, FALSE, TRUE, FALSE); | |
// | |
// Remove submitter info. | |
// | |
$regexp = "|<span class=\"submitted\">.*?</span>|"; | |
$html = preg_replace($regexp, "", $html); | |
// | |
// Remove tag list | |
// | |
$regexp = "|<span class=\"taxonomy\">.*?</span>|s"; | |
$html = preg_replace($regexp, "", $html); | |
// | |
// Remove the tagging form | |
// | |
$regexp = "|<form[^>]+id=\"community-tags-form(-1)?\">.*?</form>|s"; | |
$html = preg_replace($regexp, "", $html); | |
print $html; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment