2023-06-15 12:38:40 +00:00
|
|
|
```php
|
2023-06-15 12:39:17 +00:00
|
|
|
/*PHP*/
|
2023-06-15 12:38:40 +00:00
|
|
|
static function ReduceStringForPreview($text,$size=100)
|
|
|
|
{
|
2023-06-15 12:40:28 +00:00
|
|
|
define($reduced,'');
|
|
|
|
if(strlen($text) > $size){
|
|
|
|
$reduced .= "
|
|
|
|
". substr($text, 0, $size);
|
|
|
|
$remaining = substr($text, $size);
|
|
|
|
$reduced .= "...
|
|
|
|
";
|
|
|
|
$text = $reduced;
|
|
|
|
}
|
|
|
|
return $text;
|
2023-06-15 12:38:40 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
```js
|
2023-06-15 12:39:17 +00:00
|
|
|
/*jQuery*/
|
2023-06-15 12:38:40 +00:00
|
|
|
$(".preview_releaser").click(function(){
|
2023-06-15 12:40:28 +00:00
|
|
|
$(this).children('span').toggle('fast',function(){
|
|
|
|
if($(this).css('display') == 'inline-block'){
|
|
|
|
$(this).css('display','inline');
|
|
|
|
}
|
2023-06-15 12:38:40 +00:00
|
|
|
});
|
|
|
|
```
|