if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin'))) { 
      // Only admin 
     Chunk::get('first-level');
     //  Custom admin
    if(Session::get('user_login') == 'michael'){
        Chunk::get('admin');
    }
}else if  (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin','editor')))  {
      // Only admin and editors
     Chunk::get('second-level');
     //  Custom editor
    if(Session::get('user_login') == 'michael'){
       Chunk::get('editor');
    }
}else if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin','user'))) { 
      // Only admin and users
     Chunk::get('third-level');
     //  Custom user
    if(Session::get('user_login') == 'michael'){
       Chunk::get('user');
    }
}else{
      // all Unregistered users 
       Chunk::get('normal'); 
}

27

(27 replies, posted in Plugins)

Nice smile when finish my work ( I work for in plugin for client with multiple Json storage  like firebase ) I create a new portfolio plugin 2 versions Free and Premium 5€ Only.

28

(27 replies, posted in Plugins)

Yes like me but people who are starting need free hosting for learning.
for everything else mastercard smile

29

(8 replies, posted in Plugins)

Php ismobile function is for include or o require_once files in same template or load other scripts without redirecting page.

30

(22 replies, posted in Questions)

I'm Sorry, not understand your question ?

The admin panel it's not a plugin is independent of Morfy you can remove admin folder and no problem Morfy is ok.


Note: Only need configure admin/database/configuration.json with your settings
Admin Cms

31 2015-02-11 14:49:57

(8 replies, posted in Plugins)

Monstra have this method

if (Agent::isMobile()) {
    // Do something...
}

32 2015-02-11 12:41:53

(22 replies, posted in Questions)

Only rest language to share beta.

Web Demo

[video]

Go to forum: Questions Go to post 32

33

(27 replies, posted in Plugins)

Almost all free hosting have this method but you can using forwarding if is not premium feature.

I'm glad to have helped.

34

(1 replies, posted in Questions)

Demo

<?php include 'header.html' ?>
<?php include 'navbar.html' ?>
<div class="container">
    <?php Morfy::factory()->runAction('theme_content_before'); ?>
      <?php
            $posts = Morfy::factory()->getPages(CONTENT_PATH . '/blog/', 'date', 'DESC', array('404','index'));
      $c = 0;
      foreach( $posts as $post ){
        $b = (( ++$c % 3 == 0 ) ? true : false );
        if ( $b ) { echo '<div class="row">'; };
    ?>
              <div class="col-sm-6 col-md-4">
                  <div class="thumbnail">
                    <img data-src="holder.js/100%x200" alt="100%x200" src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjQyIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDI0MiAyMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiPjxkZWZzLz48cmVjdCB3aWR0aD0iMjQyIiBoZWlnaHQ9IjIwMCIgZmlsbD0iI0VFRUVFRSIvPjxnPjx0ZXh0IHg9IjkzIiB5PSIxMDAiIHN0eWxlPSJmaWxsOiNBQUFBQUE7Zm9udC13ZWlnaHQ6Ym9sZDtmb250LWZhbWlseTpBcmlhbCwgSGVsdmV0aWNhLCBPcGVuIFNhbnMsIHNhbnMtc2VyaWYsIG1vbm9zcGFjZTtmb250LXNpemU6MTFwdDtkb21pbmFudC1iYXNlbGluZTpjZW50cmFsIj4yNDJ4MjAwPC90ZXh0PjwvZz48L3N2Zz4=" data-holder-rendered="true" style="height: 200px; width: 100%; display: block;">
                    <div class="caption">
                      <h3><?php echo $post['title'];?></h3>
                      <p><?php echo $post['content_short'];?></p>
                      <p><a href="<?php echo $config['site_url'].'/blog/'.$post['slug'];?>" class="btn btn-primary">more..</a></p>
                    </div>
                  </div>
              </div>
    <?php if ( $b ) { echo '</div>';} }; ?>
    <?php Morfy::factory()->runAction('theme_content_after'); ?>
</div>
<?php include 'footer.html' ?>

35

(27 replies, posted in Plugins)

The plugin use php mailer  and  bootstrap,

If you don't use bootstrap in your theme this not looks good.
if you use free hosting  be sure you configure the mail of hosting first.

I make  a free acount in byehost ( lazzy hosting = yes )  here and test the plugin  with shortcode and with php code and work's fine  but in this case i use the mail of hosting because the hosting block mails.


This is the output:

Received: from sendmail.free.byetcluster.com (2813427185.ifastnet.org [185.27.134.28])
    by freemail.byetcluster.com (Postfix) with ESMTP id 517176E0772
    for <demo@demosmonstra.byethost7.com>;
    Tue, 10 Feb 2015 20:01:54 -0500 (EST)
Received: from localhost.localdomain (5613427185.ifastnet.org [185.27.134.56])
    by sendmail.free.byetcluster.com (Postfix) with ESMTP id 38B7A312650E
    for <demo@demosmonstra.byethost7.com>;
    Wed, 11 Feb 2015 04:01:54 +0300 (MSK)
Date: Tue, 10 Feb 2015 20:01:54 -0500
To: demo@demosmonstra.byethost7.com
From: Moncho <nakome@demosonly.org>
Subject: Hola
Message-ID: <78a22e1089d6c7eb6fd7db037b39d156@localhost.localdomain>
X-Priority: 3
X-Mailer: PHPMailer 5.2.1
    (http://code.google.com/a/apache-extras.org/p/phpmailer/)
MIME-Version: 1.0
Return-Path: nakome@openmailbox.org
Content-Type: multipart/alternative
Content-Transfer-Encoding: 7bit
--b1_17b45bd6b43b64d08873f8fb6e5d9915
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
this is a demo
--b1_17b45bd6b43b64d08873f8fb6e5d9915
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit
this is a demo
--b1_17b45bd6b43b64d08873f8fb6e5d9915--
Spam Filtered (15864312)




Many people send me emails asking for help setting up hosting and sorry I don't have time for all,  It's very ease make plugins for Monstra ,
you can use my plugins for learning if you like ,and create your own plugins. Right now I'm focused in premium themes,Node Apps, and admin Cms for morfy,i don't update my old Monstra plugins because i have a lot of work.

36 2015-02-10 02:11:58

(27 replies, posted in Plugins)

I try the plugin and i't's works 

Functions like Wordpress it's possible, You can use Json for custom data, functions for contact files and more but i you need use  $vars  or functions  use include or require_once not chuck becaouse chunk is used by minify you probably get error.

With this code you write last access for admin in log.txt in root

    
    // redirect in users page 
    if (Uri::segment(0) == 'users' && Uri::segment(1) == 'login'){ 
     // custom code here
    }else if (Uri::segment(0) == 'users'){ 
        // if admin
        if (Session::exists('user_role') && in_array(Session::get('user_role'), array('admin'))) {
            // write last session in log.txt
            $session = Date('d-m-y').'  User  '.Session::get('user_role').' with Name '.Session::get('user_login').' has login ';
            File::setContent(ROOT.DS.'log.txt',$session); 
        }else{
            Request::redirect(Option::get('siteurl'));
        }
    }

38

(28 replies, posted in Plugins)

This is very ease contact form you only need edit mail in contactform.php and ad with

<iframe src="folder of contactform.php file"></iframe>

Try this:

Note: you  can use with

<?php Chunk::get('functions');?> 
<?php
        // file functions.chunk.php
       // Add this in index.template.php or in header.chunk.php
      // if go to users login show echo 
       if (Uri::segment(0) == 'users' && Uri::segment(1) == 'login'){ 
              echo 'This is login page'; 
      // if  go to users  redirect
       }else if (Uri::segment(0) == 'users'){ 
               Request::redirect(Option::get('siteurl'));
      }
?>

40

(28 replies, posted in Plugins)

like this html form guide is a good contact form example and you can use with iframe see the code to understand.

41 2015-01-05 17:30:05

(5 replies, posted in Plugins)

Welcome back bro

42

(0 replies, posted in Snippets)

<?php 
// send mail simple
  if (isset($_POST['sd'])){
    $to = 'example@gmail.com';
    $name = $_POST[ "name"];
    $message = $_POST["message"];
    $headers = 'From: '.$_POST[ "email" ].PHP_EOL;
    if(isset($_POST["robot"])){
      if(mail($to, name, $message, $headers)){
        echo('<span class="success">Your e-mail has been sent! You should receive a reply within 24 hours!</span>');            
      }else{
        echo('<span class="error" >Houston i have a problem</span>');
      }              
    }else{
      echo('<span class="error" >Are you a robot ?</span>');
    }
  }
?>
<style>
    form {
        width: 100%;
        margin: 1em auto;
        max-width: 30rem;
    }
    form p {
        display: block;
        margin: 1em auto;
    }
    form input[type="text"],
    form input[type="email"],
    form textarea {
        display: block;
        width: 100%;
        padding: 0.5em;
        border: 1px solid #DBDBDB;
        background: #EAEAEA;
    }
    form textarea {
        min-height: 8em;
        width: 100%;
    }
    form input[type="submit"] {
        display: block;
        padding: 1em 0.2em;
        background: #FFFFFF;
        border: 1px solid #000000;
        color: #000000;
        min-width: 6em;
        text-transform: uppercase;
        transition: border 0.5s ease, color 1s ease;
    }
    input[type="submit"] {}
    form input[type="submit"]:hover {
        border-color: #FC6B5D;
        color: #FC6B5D;
        transition: border 0.5s ease, color 1s ease;
    }
    .error{
        color: red;
        text-align: center;
        margin: 0 auto;
        width: 100%;
        display: block;
    }
    .success{
        color: blue;
        text-align: center;
        margin: 0 auto;
        width: 100%;
        display: block;
    }
</style>
<form method="post">
    <p>
     Name
     <input type="text" name="name" placeholder="Your subject"  required />
    </p>
    <p>
     Email
     <input type="email" name="email" placeholder="Your email" required />
    </p>
    <p>
     Menssage
     <textarea name="message" placeholder="Your message"  required ></textarea>
    </p>
    <p>
     <input type="checkbox" name="robot"> Are your a robot?
    </p>
    <p>
     <input type="submit" name="sd" value="Send" />
    </p>
</form>  

Try this:

Replace ../ to hosting url  like

http://example.com/fonts/glyphicons-halflings-regular.eot  
@font-face {
font-family: 'Glyphicons Halflings';
/* your url here like http://example.com/fonts/glyphicons-halflings-regular.eot  */
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../../../../../../../search/posts/user/161/fonts/forum_subdomain/glyphicons-halflings-regular.eot') format('embedded-opentype'), url('../../../../../../../search/posts/user/161/fonts/forum_subdomain/glyphicons-halflings-regular.woff') format('woff'), url('../../../../../../../search/posts/user/161/fonts/forum_subdomain/glyphicons-halflings-regular.ttf') format('truetype'), url('../../../../../../../search/posts/user/161/fonts/forum_subdomain/glyphicons-halflings-regular.svg') format('svg');
}

44

(3 replies, posted in Questions)

Try this:

Install in localhost and copy in hosting and go to storage/database/options.table.xml and change site_url with your hostin url

Note: Remember remove install.php

Try this:

<br><br>
<?php
    if (Request::get('tag')) $tag = '&tag='.Request::get('tag'); else $tag = '';
    // total posts to show
    $neighbours = 6;
    // left pages = page - total
    $left_neighbour = $page - $neighbours;
    if ($left_neighbour < 1) $left_neighbour = 1;
     // right pages = page + total
    $right_neighbour = $page + $neighbours;
    if ($right_neighbour > $pages) $right_neighbour = $pages;
    // Start pagination out of if condition
    $html = '<nav> <ul class="pagination"> ';
    // Start in page 1
    if ($page > 1) {
       $html .=' <li> <a href="?page=1'.$tag.'">'.__('begin', 'blog').'</a> </li> 
                <li><a href="?page=' . ($page-1) . $tag.'"> '.__('prev', 'blog').'</a></li> ';
    }
    // i = pages - total and  i < pages + total 
    for ($i=$left_neighbour; $i<=$right_neighbour; $i++) {
        if ($i != $page) {
             $html .=' <li><a href="?page=' . $i . $tag.'">' . $i . '</a></li>';
        } else {
             $html .=' <li><a href="#"><b>' . $i . '</b></a></li>';
        }
    }
    // if page less than pages
    if ($page < $pages) {
         $html .=
                 '<li><a href="?page=' . ($page+1) . $tag.'">'.__('next', 'blog').'</a></li>  
                  <li><a href="?page=' . $pages . $tag.'">'.__('end', 'blog').'</a> </li>';
    }
   // End pagination out of if condition
    $html .='</ul></nav>';
   // render html
   echo $html;
?>

46

(9 replies, posted in General discussion)

/*
*             ,
                   _/^\_
                  <     >
 *                 /.-.\         *
          *        `/&\`                   *
                  ,@.*;@,
                 /_o.I %_\    *
    *           (`'--:o(_@;
               /`;--.,__ `')             *
              ;@`o % O,*`'`&\ 
        *    (`'--)_@ ;o %'()\      *
             /`;--._`''--._O'@;
            /&*,()~o`;-.,_ `""`)
 *          /`,@ ;+& () o*`;-';\
           (`""--.,_0 +% @' &()\
           /-.,_    ``''--....-'`)  *
      *    /@%;o`:;'--,.__   __.'\
          ;*,&(); @ % &^;~`"`o;@();         *
          /(); o^~; & ().o@*&`;&%O\
    jgs   `"="==""==,,,.,="=="==="`
       __.----.(\-''#####---...___...-----._
     '`         \)_`"""""`
             .--' ')
           o(  )_-\
   */

::::::  Merry Christmas and Happy New Year ::::::

47

(9 replies, posted in General discussion)

Merry Christmas and Happy New Year big_smile

48

(28 replies, posted in Plugins)

First preview

[video]

The good idea is not use install.php or create in localhost first

50

(2 replies, posted in Questions)

Hello bro  I think you need clear temporary files or cache. And another idea is  Using snippets with <style>foo{font-family:loquesea !important}</style>