Hi,cmb.Thanks for the reply.
I was able to understand the contents of the $c , $pd_s , $c [$pd_s]. Thanks for the tip.
It seems to work in the following code.
Code: Select all
###################
## This code for development version(https://github.com/cmb69/realblog_xh), Not 3.0beta5.
###################
Read Syntaxhighlighter's JS and CSS
And
When Save entry : \t --> chr(26) , \n -->chr(27)
When View entry : \t <-- chr(26) , \n <--chr(27)
##
########## classes/Article.php
##
public function asRecord()
{
// Add
$new_body = str_replace("\t", chr(26), str_replace("\n", chr(27), $this->body));
return array(
$this->id, $this->date, $this->publishingDate, $this->archivingDate,
// $this->status, false, $this->title, $this->teaser, $this->body,
$this->status, false, $this->title, $this->teaser, $new_body,
$this->feedable, $this->commentable
);
}
}
##
#######classes/ArticleView.php
##
protected function renderStory()
{
global $c,$pd_s;
$story = $this->article->getBody() != ''
? $this->article->getBody()
: $this->article->getTeaser();
// Add
$show_story = evaluate_scripting($story);
if(function_exists('Syntaxhighlighter')){
Syntaxhighlighter($show_story); // load Syntaxhighlighter's JS and CSS
}
return '<div class="realblog_show_story_entry">'
// . evaluate_scripting($story)
. str_replace(chr(26), "\t", str_replace(chr(27), "\n",$show_story))
. '</div>';
}
#
######classes/ArticleAdminView.php
#
protected function renderStory()
{
global $plugin_tx;
//Add
$show_body = str_replace(chr(26), "\t", str_replace(chr(27), "\n",$this->article->getBody()));
return '<h4>' . $plugin_tx['realblog']['story_label'] . '</h4>'
. '<textarea class="realblog_story_field"'
. ' name="realblog_story" id="realblog_story" rows="30" cols="80">'
// . XH_hsc($this->article->getBody()) . '</textarea>';
. XH_hsc($show_body) . '</textarea>';
}
sample
http://cmsimple-jp.org/xh/?test/PluginT ... alblogID=7
Code: Select all
###################
For 3.0beta5
###################
Read Syntaxhighlighter's JS and CSS
And
When Save entry : \t --> chr(26) , \n -->chr(27)
When View entry : \t <-- chr(26) , \n <--chr(27)
##
#######classes/Presentation.php
## About Line 1495
private function _getArticleFromParameters()
{
$article = array();
...................
$article[REALBLOG_STORY] = stsl(
// Realblog_getPgParameter('realblog_story')
str_replace("\t", chr(26), str_replace("\n", chr(27), Realblog_getPgParameter('realblog_story')))
);
##
#######classes/Presentation.php
## About Line 866
private function _renderStory()
{
$story = $this->_article[REALBLOG_STORY] != ''
? $this->_article[REALBLOG_STORY]
: $this->_article[REALBLOG_HEADLINE];
// Add
$show_story = evaluate_scripting($story);
if(function_exists('Syntaxhighlighter')){
Syntaxhighlighter($show_story); // load Syntaxhighlighter's JS and CSS
}
return '<div class="realblog_show_story_entry">'
// . evaluate_scripting($story)
. str_replace(chr(26), "\t", str_replace(chr(27), "\n",$show_story))
. '</div>';
}
#
## About Line 2322
#
private function _renderStory()
{
global $plugin_tx;
//Add
$show_body = str_replace(chr(26), "\t", str_replace(chr(27), "\n",$this->_record[REALBLOG_STORY]));
return '<h4>' . $plugin_tx['realblog']['story_label'] . '</h4>'
. '<textarea class="realblog_story_field"'
. ' name="realblog_story" id="realblog_story" rows="30" cols="80">'
// . XH_hsc($this->_record[REALBLOG_STORY]) . '</textarea>';
. XH_hsc($show_body) . '</textarea>';
}
* \n, might towards PHP_EOL better