Missing comma here:


'pageview_config' => array(
    // Change to `false` if you want to remove the leading zero in counter
    'leading_zero' => '000000'
) ← // here!
'tags_config'

2

(6 replies, posted in Questions)

You answered your own question:

<?php echo date('d/m/Y', strtotime($page['date'])); ?>

http://php.net/manual/en/function.date.php

I think it is better to stop touching the config.php file. Switch back to the previous state. Just focus on your template content.

<?php include 'header.html' ?>
<?php include 'navbar.html' ?>
<div class="container">
    <?php Morfy::factory()->runAction('theme_content_before'); ?>
    <?php

    // Configuration data
    $config = array( // <= Configuration
        'param' => 'page', // <= Page parameter name in URL
        'limit' => 5, // <= Number of posts to display per page
        ...
    );

    ...
    ...

    ?>
    <?php Morfy::factory()->runAction('theme_content_after'); ?>
</div>
<?php include 'footer.html' ?>

Replace this line:

// Configuration data
$config = Morfy::$config['nextprev_config'];

with the configuration data:

// Configuration data
$config = array( // <= Configuration
    'param' => 'page', // <= Page parameter name in URL
    'limit' => 5, // <= Number of posts to display per page
    ...
);

5

(29 replies, posted in Projects)

dylan wrote:

I actually had this question.  What are the project goals of morphy vs. monstra?  I looked at github and saw that there haven't been updates in a while, so I assume this was maybe an experiment.

Sometimes there are some people who make something for the following reasons:

  • Because I also use it.

  • This might be good if it could be used by others.

  • I made this as soon as possible so that I can be the FIRST.

  • I had plenty of time to make it.

  • Why not?

This is my reasons, I do not know about the owner’s reasons of this project. Who knows?

6

(22 replies, posted in Questions)

MTE plugin updated. Added custom drop, draggable modal, typography characters etc.

+ Heading button now has better output for H1 and H2:

https://cloud.githubusercontent.com/assets/1669261/6375994/73c9978a-bd4d-11e4-9d57-2c54310ac41c.gif

I don’t get it.

Just advice: http://forum.monstra.org/topic/550/prop … t-for-post

9

(22 replies, posted in Questions)

Thanks a lot.

Really? It should be faded to a gray button on the last/first page.

11

(22 replies, posted in Questions)

Enter key bug fixed smile

12

(22 replies, posted in Questions)

Fixed now. But there’s a little problem when you press the enter key, it won’t scroll until you press another key.

Currently, I feel that it was not too distracting.

Something like this:

<?php include 'header.html' ?>
<?php include 'navbar.html' ?>
<div class="container">
    <?php Morfy::factory()->runAction('theme_content_before'); ?>
    <?php

    // Configuration data
    $config = Morfy::$config['nextprev_config'];
    // Get current URI segments
    $path = Morfy::factory()->getUriSegments();
    $path = implode('/', $path);
    // Number of posts to display per page request
    $per_page = isset($config['limit']) ? $config['limit'] : 5;
    // Get all posts
    $all_posts = Morfy::factory()->getPages(CONTENT_PATH . '/' . $path . '/', 'date', 'DESC', array('404', 'index'));
    // Calculate total pages
    $total_pages = ceil(count($all_posts) / $per_page);
    // Get current page offset
    $current_page = isset($_GET[$config['param']]) ? $_GET[$config['param']] : 1;
    // Split all posts into chunks
    $posts = is_array($all_posts) ? array_chunk($all_posts, $per_page) : array();

    // Posts loop
    if(isset($posts[$current_page - 1]) && ! empty($posts[$current_page - 1])) {
        foreach($posts[$current_page - 1] as $post) {
            echo '<div class="' . $config['classes']['page_item'] . '">';
            echo $post['title'] ? '<h3><a href="' . $post['url'] . '">' . $post['title'] . '</a></h3>' : "";
            echo $post['date'] ? '<p><em><strong>Published on:</strong> ' . $post['date'] . '</em></p>' : "";
            if(strlen($post['description']) > 0) {
                echo '<p>' . $post['description'] . '</p>';
            } elseif(strlen($post['content_short']) > 0) {
                echo '<p>' . $post['content_short'] . '</p>';
            }
            echo '</div>';
        }
    } else {
        echo '<div class="' . $config['classes']['page_item'] . '">' . $config['labels']['not_found'] . '</div>';
    }

    // Build the pagination
    $html  = '<ul class="' . $config['classes']['nav'] . '">';
    $html .= $current_page > 1 ? '<li class="' . $config['classes']['nav_prev'] . '"><a href="?' . $config['param'] . '=' . ($current_page - 1) . '">' . $config['labels']['nav_prev'] . '</a></li>' : '<li class="' . $config['classes']['nav_prev'] . ' ' . $config['classes']['nav_disabled'] . '"><span>' . $config['labels']['nav_prev'] . '</span></li>';
    $html .= $current_page < $total_pages ? ' <li class="' . $config['classes']['nav_next'] . '"><a href="?' . $config['param'] . '=' . ($current_page + 1) . '">' . $config['labels']['nav_next'] . '</a></li>' : ' <li class="' . $config['classes']['nav_next'] . ' ' . $config['classes']['nav_disabled'] . '"><span>' . $config['labels']['nav_next'] . '</span></li>';
    $html .= '</ul>';

    echo $html;

    ?>
    <?php Morfy::factory()->runAction('theme_content_after'); ?>
</div>
<?php include 'footer.html' ?>

14

(22 replies, posted in Questions)

Sigh! Yea, I think that’s a bug. I will try to fix that.

Update:

Oh, so you want to make the blog pagination separated from the posts list. Hm, you will need to modify the source code yourself.

Put the content of the plugin definition from here to here to replace the <?php Morfy::factory()->runAction('index_nextprev'); ?> line in your template.

Yes, the plugin will automatically detect the current folder via URL path.

Example:

  • hxxp://latitudu.com/notes/morfy-cms (blog page)

  • hxxp://latitudu.com/notes/morfy-cms/plugins (plugins page)

  • hxxp://latitudu.com/notes/nursing (another blog page)

Note: Here I put the blog pagination in blog.html, so all of the page above only use blog.html template. But again, It works only by detecting folder names from URL, so it will work if you put them in news.html template for example as an alternative for blog.html or has the same behavior with the blog.html template.

17

(22 replies, posted in Questions)

Good. What fix? If you want to make a code block, just select in-multiple then press the code button (?)

18

(22 replies, posted in Questions)

Btw, Nakome. Have you tried my Markdown Text Editor plugin? It is supports a lot of features like toggling, automatic list increment, auto-close bracket, auto-indent. You can even make custom buttons and modals.

https://github.com/tovic/markdown-text- … ar-Buttons

19

(22 replies, posted in Questions)

@dextra Yes smile

@nakome Take a look. Here I was replaced the blog path to notes:

http://s25.postimg.org/uj573vee3/2015_02_12_152936.jpg

The solution is basically simple. Use the built-in method called getUriSegments to extract the URL path as array.

My breadcrumb plugin works recursively with that way → https://github.com/tovic/breadcrumb-plu … mb.php#L25

20

(22 replies, posted in Questions)

My first thought was the page editor is only valid for the blog path. Certainly, it would be great if this could be applied recursively, perhaps by specifying the folder path in URL?

21

(5 replies, posted in Plugins)

nakome wrote:

Welcome back bro

Thanks. Lately I’m getting a lot of new activity in campus.

22

(5 replies, posted in Plugins)

I’ve added pagination feature on this plugin, just re-download and re-install the plugin. Demo URL is here → hxxp://latitudu.com/notes/morfy-cms?tagged=Plugins

Better alternative to in_array() is strpos() smile

foreach($all_posts as $post) {
    // Remove all spaces between commas, then wrap them with `<` and `>`
    $tags = '<' . preg_replace('/\s*,\s*/', ',', $post['tags']) . '>';
    if(
        strpos($tags, '<' . $filter . ',') !== false ||
        strpos($tags, ',' . $filter . ',') !== false ||
        strpos($tags, ',' . $filter . '>') !== false ||
        '<' . $filter . '>' === $tags
    ) {
        $filtered_posts[] = $post;
    }
}

23

(2 replies, posted in Questions)

Use {cut}

24

(5 replies, posted in Plugins)

I’ve thinking about that, it’s just that I’m still looking for a better alternative to in_array() to filter the tags.

25

(3 replies, posted in Plugins)

Please read: https://github.com/Awilum/morfy-cms/issues/9