Topic: Add readmore automatically withour {cut}

This code is well done to show only 400 characters?

<?php  if(strlen($post['content']) > 400){
    echo substr($post['content'], 0, 400); 
?>
<br>
<a  class="btn btn-danger" href="<?php echo Option::get('siteurl'); ?><?php echo Blog::$parent_page_name; ?>/<?php echo $post['slug'] ?>">Read more</a>
<?php }else { 
  echo $post['content']; 
}?>
..::: Moncho Varela ::::..   ..::: @Nakome ::::..   ..::: Github ::::..

nakome's Website

2 2013-04-24 10:15:20

Re: Add readmore automatically withour {cut}

Use this method https://github.com/MonstraLab/monstra-c … #L240-L260

Monstra Loves You! Give some love back!

3 2013-04-24 10:59:37

Re: Add readmore automatically withour {cut}

Nice wink ,thanks master

..::: Moncho Varela ::::..   ..::: @Nakome ::::..   ..::: Github ::::..

nakome's Website

4 2013-10-13 12:57:38 (edited by tovic 2013-10-14 15:31:27)

Re: Add readmore automatically withour {cut}

<!-- plugins/blog/views/frontend/index.view.php -->
<p><?php echo Text::cut(strip_tags($post['content']), 400); ?></p>
<p><a class="btn btn-danger" href="<?php echo Option::get('siteurl'); ?><?php echo Blog::$parent_page_name; ?>/<?php echo $post['slug'] ?>">Read More »</a></p>
XSS Testing <script>alert('HIYAA!!!');</script>

tovic's Website

Re: Add readmore automatically withour {cut}

ohh wow, mas taufik here too. good big_smile

I'm not like them but I can pretend.

Re: Add readmore automatically withour {cut}

Aryandhani wrote:

ohh wow, mas taufik here too. good big_smile

Starting stuck with blogspot that still doesn't have static file directory to save CSS and JS sad

XSS Testing <script>alert('HIYAA!!!');</script>

tovic's Website

Re: Add readmore automatically withour {cut}

jeje.. have fun with monstra big_smile

I'm not like them but I can pretend.