68 Classifieds Forums

68 Classifieds Forums (http://www.68classifieds.com/forums/index.php)
-   v3.1 Questions & Support (http://www.68classifieds.com/forums/forumdisplay.php?f=19)
-   -   Text too long (http://www.68classifieds.com/forums/showthread.php?t=2475)

fmuscia 02-20-2007 10:36 PM

Text too long
 
How do you control the feature title text length on the front page? By either making it wrap (I guess this would be controlled by the TD width) or by giving it a limit withe the ... at the end.

suzkaw 02-20-2007 10:47 PM

You could use the Smarty truncate function to accomplish this:
http://smarty.php.net/manual/en/lang...r.truncate.php

fmuscia 02-21-2007 06:45 PM

Where do I edit this? in the home.tpl.php

fmuscia 02-23-2007 09:54 PM

Humn, nobody knows this answer above?

PHP Code:

{feature_listings_horizontal number=8 cols=3 table_attr='width="100%" style="border: 1px solid #000;"' td_attr='valign="middle" align="center"'}


suzkaw 02-23-2007 11:02 PM

If that is the portion you are wanting to change you will have to truncate it through the Smarty plugin and will not be able to do it through the template file.

This file will not be encrypted however you will need to be familiar with php to alter it.

fmuscia 02-25-2007 05:15 PM

Quote:

Originally Posted by suzkaw (Post 12995)
If that is the portion you are wanting to change you will have to truncate it through the Smarty plugin and will not be able to do it through the template file.

This file will not be encrypted however you will need to be familiar with php to alter it.

I am familiar with PHP. Well since you did not tell me what and where to edit. After several days of tracking it down going through what code that is not encrypted, I finally found it. Now is it possible for you to tell me what to add to this line, to limit the text output?

Code:

$output.=$loop[$x][title] ."<br />";

fmuscia 02-28-2007 06:35 PM

I'm gonna keep asking until somebody answers me, sorry.

Where in the functions.feature_listings_horizontal.php is this done to make the title text limited?

suzkaw 02-28-2007 08:18 PM

I thought you found the answer?

You the code you posted is the title so you will need to use some type of php function to trim it to the amount of characters you want.

fmuscia 02-28-2007 08:53 PM

Quote:

Originally Posted by suzkaw (Post 13129)
I thought you found the answer?

You the code you posted is the title so you will need to use some type of php function to trim it to the amount of characters you want.

Looking at my above posts. I never said I found the answer. I said I found where the code should be MODDED and asked for help. Still no help...

gregbatch 02-28-2007 09:02 PM

Replace:

$output.=$loop[$x][title] ."<br />";

With:

$limit = '25'; // Set to your preference
$textin = $loop[$x][title];
if(strlen($textin)>$limit){
$textin = substr($textin,0,$limit);
$textout = substr($textin,0,-(strlen(strrchr($textin,' '))) )."…";}
else{$textout = $textin;}
$output.=$textout ."<br />";


This shortens the string to whatever you specify as the limit, drops any word fragment, and ads the ellipsis (…)


All times are GMT -4. The time now is 01:59 AM.

Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2007, Jelsoft Enterprises Ltd.