Realblog_XH

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

utaka
Posts: 46
Joined: Fri Sep 18, 2015 6:00 am
Location: japanese
Contact:

Do not show filebrowser: tinyMCE4CMSimple_XH

Postby utaka » Mon Dec 07, 2015 9:23 am

Do not show filebrowser: tinyMCE4CMSimple_XH

Realblog_XH-3.0beta5
+ tinyMCE4CMSimple_XH version 1.2.5 - 2015-08-11
+CMSimple_XH 1.6.7

Fix.

Code: Select all

### OPEN realblog/classes/Presentation.php
# Find Bout Line1233

    private function _dispatchOnAction($action)
    {
        global $o;

        switch ($action) {
        case 'add_realblog':
        case 'modify_realblog':
        case 'delete_realblog':
            $o .= $this->_renderArticle();
            break;


## Cange / Replace With

    private function _dispatchOnAction($action)
    {
        global $o,$edit;//Add $edit

        switch ($action) {
        case 'add_realblog':
        case 'modify_realblog':
            $edit = true; //Add
        case 'delete_realblog':
            $o .= $this->_renderArticle();
            break;


#
### # OPEN : tinymce4/init.php
#
## Find

    $temp = str_replace(
        '"%FILEBROWSER_CALLBACK%"',
        $xh_editor ?
        $_SESSION['tinymce_fb_callback'] :
        '""',
        $temp
    );


## Cange / Replace With

    $temp = str_replace(
        '"%FILEBROWSER_CALLBACK%"',
//        $xh_editor ?
//        $_SESSION['tinymce_fb_callback'] :
//        '""',
        $_SESSION['tinymce_fb_callback'],
        $temp
    );
Last edited by utaka on Tue Dec 08, 2015 10:54 am, edited 3 times in total.
******************************************************
Japan Site http://cmsimple-jp.org
Twitter Googe+ github
*I English is not a good . I'm sorry...
*Ich habe nicht eine gut Deutsch. Es tut mir leid ...
*Jeg kender ikke dansk
--Powered by Google Translate-----

manu
Posts: 576
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Re: Do not show filebrowser: tinyMCE4CMSimple_XH

Postby manu » Mon Dec 07, 2015 5:04 pm

Code: Select all

## Cange / Replace With

    $temp = str_replace(
        '"%FILEBROWSER_CALLBACK%"',
//        $xh_editor ?
//        $_SESSION['tinymce_fb_callback'] :
//        '""',
        $_SESSION['tinymce_fb_callback'],
        $temp
    );
But then you have no filebrowser at all.
This happens when a previous admin session is still active.
To harden suppress of filebrowsercall in frontend edit better update init.php:

Code: Select all

//about line 32
if (!(XH_ADM && $edit)) {   // no filebrowser, if editor is called from front-end
        $_SESSION['tinymce_fb_callback'] = ''; // ADD THIS LINE - suppress filebrowsercall
        return '';
    }

The same issue in normal tinymce.

utaka
Posts: 46
Joined: Fri Sep 18, 2015 6:00 am
Location: japanese
Contact:

Re: Realblog_XH

Postby utaka » Tue Dec 08, 2015 6:22 am

thanks! maru.
******************************************************
Japan Site http://cmsimple-jp.org
Twitter Googe+ github
*I English is not a good . I'm sorry...
*Ich habe nicht eine gut Deutsch. Es tut mir leid ...
*Jeg kender ikke dansk
--Powered by Google Translate-----

utaka
Posts: 46
Joined: Fri Sep 18, 2015 6:00 am
Location: japanese
Contact:

Which one's the latest?

Postby utaka » Fri Dec 11, 2015 7:09 am

Which one's the latest?

I thought I'd propose fixes and improvements,Version 3.0beta5
Version 3.0beta5 -- released 2014-10-05
http://3-magi.net/?CMSimple_XH/Realblog_XH

Now. I found a different realblog_xh..

Copyright (c) 2014-2015
https://github.com/cmb69/realblog_xh

Which one's the latest / the development version ?

・More of Version 3.0beta5 has become better search function.
・realblog/classes/* It is different files of quantity
******************************************************
Japan Site http://cmsimple-jp.org
Twitter Googe+ github
*I English is not a good . I'm sorry...
*Ich habe nicht eine gut Deutsch. Es tut mir leid ...
*Jeg kender ikke dansk
--Powered by Google Translate-----

manu
Posts: 576
Joined: Wed Jun 04, 2008 12:05 pm
Location: St. Gallen - Schweiz
Contact:

Re: Realblog_XH

Postby manu » Fri Dec 11, 2015 11:37 am

I suppose Version 3.0beta5 is the latest stable.
The Git file version is development.

cmb
Posts: 10878
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Realblog_XH

Postby cmb » Sun Dec 13, 2015 12:07 pm

manu wrote:I suppose Version 3.0beta5 is the latest stable.
The Git file version is development.

Basically yes. To be more precise: the plugin downloads from http://3-magi.net are the latest published version only (they're not necessarily stable, such as Realblog_XH 3.0beta5, which is a beta version), and they don't contain some unneccessary files for production work (such as composer.json etc.) All development happens via Github, where the "master" contains the current development version, and all published releases are tagged.
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

utaka
Posts: 46
Joined: Fri Sep 18, 2015 6:00 am
Location: japanese
Contact:

Re: Realblog_XH

Postby utaka » Thu Dec 24, 2015 11:00 am

manu wrote:I suppose Version 3.0beta5 is the latest stable.
The Git file version is development.

cmb wrote:Basically yes. To be more precise: the plugin downloads from http://3-magi.net are the latest published version only (they're not necessarily stable, such as Realblog_XH 3.0beta5, which is a beta version), and they don't contain some unneccessary files for production work (such as composer.json etc.) All development happens via Github, where the "master" contains the current development version, and all published releases are tagged.


Thank you for your reply! manu,cmb.I understand.
I had to create a new plug-in that uses the data of Realblog in news style.
Adding functionality to Realblog
List only the title.{{{Realblog_NewsTitleWidget();}}}
- Including the latest blog only of display.{{{Realblog_NewsWidget();}}}
This is, I will publish soon as another plugin.

Another consultation.. :?:
Realblog_XH + Syntaxhighlighter work?
Syntaxhighlighter CSS and JavaScript is not loaded.
When, view the blog data, Is it possible to to have a $pd_s,by article?

Code: Select all

/*
 * Include the necessary JS and CSS.
 */
if (!$edit && $pd_s >= 0) {
    Syntaxhighlighter($c[$pd_s]);
}
******************************************************
Japan Site http://cmsimple-jp.org
Twitter Googe+ github
*I English is not a good . I'm sorry...
*Ich habe nicht eine gut Deutsch. Es tut mir leid ...
*Jeg kender ikke dansk
--Powered by Google Translate-----

cmb
Posts: 10878
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Realblog_XH

Postby cmb » Thu Dec 24, 2015 11:22 am

utaka wrote:This is, I will publish soon as another plugin.

Great! I'm looking forward to it. :)

utaka wrote:Realblog_XH + Syntaxhighlighter work?
Syntaxhighlighter CSS and JavaScript is not loaded.
When, view the blog data, Is it possible to to have a $pd_s,by article,?

I'll have to take a closer look at this issue. A quick workaround might be to always load the desired brushes:

Code: Select all

/*
 * Include the necessary JS and CSS.
 */
if (!$edit) {
    Syntaxhighlighter('<pre class="shBrushPhp"></pre>');
}
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

utaka
Posts: 46
Joined: Fri Sep 18, 2015 6:00 am
Location: japanese
Contact:

Re: Realblog_XH

Postby utaka » Fri Dec 25, 2015 2:34 am

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 :roll:
******************************************************
Japan Site http://cmsimple-jp.org
Twitter Googe+ github
*I English is not a good . I'm sorry...
*Ich habe nicht eine gut Deutsch. Es tut mir leid ...
*Jeg kender ikke dansk
--Powered by Google Translate-----

cmb
Posts: 10878
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Realblog_XH

Postby cmb » Mon Dec 28, 2015 12:25 am

utaka wrote:It seems to work in the following code.
[…]

Fine! :)

However, there still may be problems with code snippets in other plugins, newsboxes or the template. I've changed Syntaxhighlighter_XH to use the available autoloading of the desired brushes, which is supposed to solve all these issues. Please try the latest snapshot.
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+


Return to “Addons and Plugins”

Who is online

Users browsing this forum: No registered users and 1 guest