News Flash:
New Version of ShopClass theme 1.4.0 is Released on 13 JUNE 2018, Please upgrade your installation.

Description text format

If you are having general problems with Tuffclassified theme, post your questions here. This is not the place for customization or feature requests
Locked
steve
Senior
Posts: 222
Joined: Thu Oct 01, 2015 5:33 pm
Has thanked: 11 times
Been thanked: 4 times

Description text format

Post by steve » Sat Oct 08, 2016 5:58 pm

Hi,
This is for Tuffclassified theme, without using tiny_mce.
I see that when the description text is written, it does not display the format in which the text is inputted. For example, the next line, etc.
Everything is crammed together in a paragraph, and posted as the ad finally.

How can we correct this?
Thanks.

User avatar
tuffadmin
Site Admin
Posts: 1236
Joined: Tue Jan 29, 2013 7:31 pm
Has thanked: 33 times
Been thanked: 111 times

Re: Description text format

Post by tuffadmin » Fri Oct 14, 2016 5:36 pm

You need to edit function tfc_not_clean_items as 1058,
All you need to do is comment (//) these lines.
$description=preg_replace('/<a[^>]*>/i', ' ', $description);
$description=preg_replace('/<\/a>/i', ' ', $description);
$description=str_replace ('<p>&nbsp;</p>',' ',$description);
$description=preg_replace("{(<br[\\s]*(>|\/>)\s*){1,}}i", " ", $description);
No support for unnecessary PM, use forum for support queries.
Please give us good review if you bought our theme from Osclass Market

steve
Senior
Posts: 222
Joined: Thu Oct 01, 2015 5:33 pm
Has thanked: 11 times
Been thanked: 4 times

Re: Description text format

Post by steve » Sat Oct 15, 2016 4:07 pm

I'm afraid i dont have those lines in my includs > core-functions.php

Here is what my functions displays -

function tfc_not_clean_items($item) {
$catID = $item['fk_i_category_id'];
$itemID = $item['pk_i_id'];

$title = Params::getParam('title', false, false) ;
$description = Params::getParam('description', false, false) ;
$locale = osc_current_user_locale() ;

$mItems = Item::newInstance() ;
$mItems->updateLocaleForce($itemID, $locale, $title[$locale], $description[$locale]) ;
}

PS - This is not shopclass, this is the Tuffclassified theme

User avatar
tuffadmin
Site Admin
Posts: 1236
Joined: Tue Jan 29, 2013 7:31 pm
Has thanked: 33 times
Been thanked: 111 times

Re: Description text format

Post by tuffadmin » Sat Oct 15, 2016 5:33 pm

My fault I missed this forum section. Which version it is?
No support for unnecessary PM, use forum for support queries.
Please give us good review if you bought our theme from Osclass Market

steve
Senior
Posts: 222
Joined: Thu Oct 01, 2015 5:33 pm
Has thanked: 11 times
Been thanked: 4 times

Re: Description text format

Post by steve » Sun Oct 16, 2016 2:43 am

3.4 . I can't upgrade as of now, because there are a lot of customizations that i've done.

User avatar
tuffadmin
Site Admin
Posts: 1236
Joined: Tue Jan 29, 2013 7:31 pm
Has thanked: 33 times
Been thanked: 111 times

Re: Description text format

Post by tuffadmin » Sun Oct 16, 2016 7:51 pm

Remove this code at the end of item.php file.

Code: Select all

	var MORE = "... More...",
    LESS = " Less...";

$(function(){
    $("p.item_des_trunk").each(function(){
        var $ths = $(this),
            txt = $ths.text();

        //Clear the text
        $ths.text("");
<?php if (tfc_getpref('max_character_item')) { ?>
        //First 250 chars
        $ths.append($("<span>").text(txt.substr(0,<?php echo tfc_getpref('max_character_item'); ?>)));

        //The rest
        $ths.append($("<span>").text(txt.substr(<?php echo tfc_getpref('max_character_item'); ?>, txt.length)).hide());
<?php }
else {
?>
        //First 250 chars
        $ths.append($("<span>").text(txt.substr(0,250)));

        //The rest
        $ths.append($("<span>").text(txt.substr(250, txt.length)).hide());
<?php }?>        //More link
        if(txt.length > <?php if (tfc_getpref('max_character_item')){echo tfc_getpref('max_character_item');} else {echo '250';} ?>){
		$ths.append(
            $('<strong class="gap10 label label-success">').text(MORE).click(function(){
                var $ths = $(this);

                if($ths.text() == MORE){
                    $ths.prev().show();
                    $ths.text(LESS);
                }
                else{
                    $ths.prev().hide();
                    $ths.text(MORE);
                }
            })
        );
		};
    });
});
No support for unnecessary PM, use forum for support queries.
Please give us good review if you bought our theme from Osclass Market

steve
Senior
Posts: 222
Joined: Thu Oct 01, 2015 5:33 pm
Has thanked: 11 times
Been thanked: 4 times

Re: Description text format

Post by steve » Tue Oct 18, 2016 7:27 pm

Works perfect!

Locked