Truncate long text with PHP (excerpt function)

Truncate is a handy function which can truncate a long text into specific length string and adds elipsis (…) after it.

This is an example of how the function “truncate($text,47)” works :

function truncate ($str, $length=10, $trailing=’…’)
{
/*
** $str -String to truncate
** $length – length to truncate
** $trailing – the trailing character, default: “…”
*/
// take off chars for the trailing
$length-=mb_strlen($trailing);
if (mb_strlen($str)> $length)
{
// string exceeded length, truncate and add trailing dots
return mb_substr($str,0,$length).$trailing;
}
else
{
// string was already short enough, return the string
$res = $str;
}

return $res;

}

Ktinterakt view last import ID with PHP

How I know this function when I use insert Record transaction (advanced) and the redirect page has recordset that use $_POST[‘name for mysql_insert_id() ‘] for select record from db?

$ins_sivut->registerTrigger(“END”, “Trigger_Default_Redirect”, 99, “sisallot_edit.php?Id={the_field_from_the_transaction_selected_as_primary_key}”);

Tinymce Full Flash valid_elements

Full FlashMX 2004 rule set:
The following will validate that the page complies fully with the flashMX 2004 specification.
valid_elements : “”
+”a[href|target],”
+”b,”
+”br,”
+”font[color|face|size],”
+”img[src|id|width|height|align|hspace|vspace],”
+”i,”
+”li,”
+”p[align|class],”
+”h1,”
+”h2,”
+”h3,”
+”h4,”
+”h5,”
+”h6,”
+”span[class],”
+”textformat[blockindent|indent|leading|leftmargin|rightmargin|tabstops],”
+”u”

add custom buttons http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/theme_advanced_buttons_1_n

Flash var loop over php

onClipEvent (load)

{

//this.loadVariables(_global.VARGAL1+”tips.php”);

 

this.loadVariables(“all_pdf.php”);

}

onClipEvent (data)

{

    xcount = 0;

    yxount = 0;

trace(total);

 

    for (var i = 1; i <= total; i++)

    {

        media0.duplicateMovieClip(“media” + i, i);

        eval(“media” + i).pdfpath = eval(“pdfpath” + i);

eval(“media” + i).pdftitle = eval(“pdftitle” + i);

        eval(“media” + i)._x = media0._x + xcount * 22;

        eval(“media” + i)._y =  media0._y + yxount * 22;

 

  

  xcount++;

  

        if (xcount > 0)

        {

            xcount = 0;

            yxount++;

        }

    }break;

    _parent.media._visible = true;

}

Load Var to Level

dynsef._visible=false;

stop();

//_global.lang=”gr”;

_level2.done=undefined;

 

loadVariablesNum(“sef.php?lang=”+_global.lang, 2);

 

//_parent._parent.pop_prod.food_photo.url=_level2.photo1;

//_parent._parent.pop_prod.food_unbaked.url=_level2.unbaked1;

//trace(_level2.code1);

function checkParamsLoaded() {

 if (_level2.done == undefined) {

 //trace(“not yet.”);

 } else {

 trace(_level2.done);

  trace(_level2.pdfpath);

   trace(_level2.pdftitle);

 //trace(“finished loading. killing interval.”);

 clearInterval(param_interval);

 

if(_level2.pdftitle!= “”){

dynsef._visible=true; 

}

 }

}

var param_interval:Number = setInterval(checkParamsLoaded, 10);