Welcome Guest, Not a member yet? Register   Sign In
Paginate only 1 DB field
#11

[eluser]Twisted1919[/eluser]
You may want to try a more elegant yet easier solution .
Define a separator for your content , for example wordpress uses <!--more-->
You can do it like that, then add a button to your editor that would insert this separator into the text at the portion you want to cut from .
Then you can do it like :
Code:
if( strpos($content,$separator) !== FALSE )
   {
   explode($separator);
   return $separator[0];
   }
Or you can come up with better code, i don't really know how explode() compares to substr_replace or something similar , i guess is slower .

Not doing like so, and just counting the chars from your text on a fixed limit will get you plenty surprises if your content that needs to be cuted is html(and i am sure it is) .


Messages In This Thread
Paginate only 1 DB field - by El Forum - 02-28-2010, 03:17 PM
Paginate only 1 DB field - by El Forum - 02-28-2010, 06:05 PM
Paginate only 1 DB field - by El Forum - 03-01-2010, 02:58 AM
Paginate only 1 DB field - by El Forum - 03-01-2010, 04:05 AM
Paginate only 1 DB field - by El Forum - 03-01-2010, 04:52 AM
Paginate only 1 DB field - by El Forum - 03-01-2010, 05:22 AM
Paginate only 1 DB field - by El Forum - 03-01-2010, 02:17 PM
Paginate only 1 DB field - by El Forum - 03-01-2010, 02:21 PM
Paginate only 1 DB field - by El Forum - 03-01-2010, 02:27 PM
Paginate only 1 DB field - by El Forum - 03-01-2010, 02:29 PM
Paginate only 1 DB field - by El Forum - 03-01-2010, 06:28 PM



Theme © iAndrew 2016 - Forum software by © MyBB