Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Question about custom blog

Featured Replies

Yea i have a custom blog i've been building which is here http://www.submitbannerusa.com/4Coding, the prob is i made where it will add a read More link incase each post go over 2500 characters, but sometimes it will cut off the closing tag of some of my BBcode which as u may guess makes everything below that broken tag bold or whatever, how would u fix this? the code im using for the readmore link is

 

if(strlen($content) > 2500 && !$pid){
   /**
   *If the content is greater then 2500 chars add the read-more link,
   * and cut the content down to 2500 chars
   * this cuts down on loading times for the main page
   * due to long post displaying
   **/
 $content = substr($content,0,2500)."[...] <span class='readmore'><a href='./index.php?post=".$post['id']."'>Read More</a></span>"; 
 }

Edited by webdesigner93

After you substr the string, make a function that will look for the last BBCODE appearence. If it 's an opening BBCODE, add the equivalent closing one to the end. Since BBCODEs are not that many, it 's easily doable, maybe a bit boring but... :)

 

Or you could get fancy, write a full fledged BBCODE parser, tokenize everything and manage it like that. But that would be like building a tank to go to the grocery store for shopping, so I 'd stick with the first solution. :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.