Bug #3212 ยป 3212.patch
modules/mod_cbpblatest/mod_cbpblatest.php | ||
---|---|---|
/**
|
||
* Parses posts content with substitution parser replaceUserVars
|
||
*/
|
||
class cbpblatest_replacer {
|
||
/**
|
||
* Poster should be used to store posters
|
||
* @var cbUser
|
||
*/
|
||
var $poster = null;
|
||
/**
|
||
* User should be used to store recipients
|
||
* @var cbUser
|
||
*/
|
||
var $user = null;
|
||
/**
|
||
* Entry should be used to store entries substitution array
|
||
* @var array
|
||
*/
|
||
var $entry = null;
|
||
if ( ! class_exists( 'cbpblatest_replacer' ) ) {
|
||
class cbpblatest_replacer {
|
||
/**
|
||
* Poster should be used to store posters
|
||
* @var cbUser
|
||
*/
|
||
var $poster = null;
|
||
/**
|
||
* User should be used to store recipients
|
||
* @var cbUser
|
||
*/
|
||
var $user = null;
|
||
/**
|
||
* Entry should be used to store entries substitution array
|
||
* @var array
|
||
*/
|
||
var $entry = null;
|
||
|
||
/**
|
||
* Replace posts content with posters substitution data
|
||
*
|
||
* @param string $matches
|
||
* @return string
|
||
*/
|
||
function replace_poster( $matches ) {
|
||
return $this->poster->replaceUserVars( $matches[1] );
|
||
}
|
||
/**
|
||
* Replace posts content with posters substitution data
|
||
*
|
||
* @param string $matches
|
||
* @return string
|
||
*/
|
||
function replace_poster( $matches ) {
|
||
return $this->poster->replaceUserVars( $matches[1] );
|
||
}
|
||
|
||
/**
|
||
* Replace posts content with recipient substitution data
|
||
*
|
||
* @param string $matches
|
||
* @return string
|
||
*/
|
||
function replace_user( $matches ) {
|
||
return $this->user->replaceUserVars( $matches[1] );
|
||
}
|
||
/**
|
||
* Replace posts content with recipient substitution data
|
||
*
|
||
* @param string $matches
|
||
* @return string
|
||
*/
|
||
function replace_user( $matches ) {
|
||
return $this->user->replaceUserVars( $matches[1] );
|
||
}
|
||
|
||
/**
|
||
* Replace posts content with posts substitution data
|
||
*
|
||
* @param string $matches
|
||
* @return string
|
||
*/
|
||
function replace_entry( $matches ) {
|
||
$entry = $matches[1];
|
||
/**
|
||
* Replace posts content with posts substitution data
|
||
*
|
||
* @param string $matches
|
||
* @return string
|
||
*/
|
||
function replace_entry( $matches ) {
|
||
$entry = $matches[1];
|
||
|
||
foreach ( $this->entry as $k => $v ) {
|
||
$entry = str_replace( $k, $v, $entry );
|
||
}
|
||
foreach ( $this->entry as $k => $v ) {
|
||
$entry = str_replace( $k, $v, $entry );
|
||
}
|
||
|
||
return $entry;
|
||
return $entry;
|
||
}
|
||
}
|
||
}
|
||
?>
|