Testing 1 2 3
3 posts by 2 authors in: Forums > CMS Builder
Last Post: December 21, 2012 (RSS)
By Dave - December 10, 2012 - edited: December 21, 2012
Testing
1
2
3
interactivetools.com
By gregThomas - December 21, 2012 - edited: December 21, 2012
Testing, testing 123.
In adipisci antiopam constituto vel. Mei eu mentitum gloriatur, vix ea illum tacimates mediocrem. Id nec everti similique, feugait praesent consequuntur ex sea, an sit evertitur referrentur vituperatoribus. Vel et semper tibique constituto, porro verear id nam, eos copiosae nominati ei. Nemore nominavi adipiscing et pri.
Ius modo eius vocibus in, nibh denique ut ius. Esse molestie nec ea, qui placerat disputando te. Mei cu vero legere iracundia. Ne augue phaedrum vix, ut mei solum instructior consectetuer. Sale magna oblique cu eos, nonumy populo vituperata vis no.
Ex sit dicunt oblique. Eu nec cibo invenire. Eos maluisset democritum ut, pro ex modus noster antiopam. Has enim nobis epicurei ei. Est facete meliore molestiae ut.
function test(){
echo "Test"!";
}
test();
PHP Programmer - interactivetools.com
By Dave - December 21, 2012
Replying back with a test code block:
// usage: echo sforum_getPostSnippet($message));
function sforum_getPostSnippet($html) {
$snippet = $html;
$snippet = preg_replace("/<br\s*\/?>\n?/", "\n", $snippet); // replace breaks with nexlines
$snippet = strip_tags($snippet); // strip tags
$maxLength = 255;
$currentLength = strlen($snippet);
if (preg_match("/^(.{0,$maxLength})(\s|$)/s", $snippet, $matches)) { $snippet = $matches[1]; } // chop at first whitespace break before 140 chars
else { $snippet = mb_substr($snippet, 0, $maxLength); } // otherwise force cut at maxlength (for content with no whitespace such as malicious or non-english)
$wasShortened = strlen($snippet) < $currentLength;
End of message
interactivetools.com