Advertisement:

Author Topic: [Solved] if the limit characters is more of than XX  (Read 1073 times)

fog

  • Hero Member
  • *****
  • Posts: 1062
[Solved] if the limit characters is more of than XX
« on: April 20, 2016, 08:28:06 pm »
Hi, how I can use a condition, if the limit characters  is more of than XX value?

Somebody know?  :-\

Code: [Select]
<?php echo mb_substrosc_highlight(strip_tagsosc_item_title())), 048 'utf-8' ) ; ?>
Thank you
« Last Edit: April 21, 2016, 04:03:38 am by fog »

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: [Help] if the limit characters is more of than XX
« Reply #1 on: April 20, 2016, 08:55:36 pm »
Hi,

I don't understand, here you are hardcoding the limit (48 multibyte characters in this case)... ???

Regards

fog

  • Hero Member
  • *****
  • Posts: 1062
Re: [Help] if the limit characters is more of than XX
« Reply #2 on: April 20, 2016, 09:22:08 pm »
Hi teseo, I need the condition on all listings.

I need show something like this:
Code: [Select]
title with limit [+]
title complete [-]
link to swap.
I have all ready on code and working well, but I just need show the button (+ -) if the character limit is more than to xx. Otherwise, no make sense existing a button for short titles (limit inferior of than xx).

Thank you for your precious help.

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: [Help] if the limit characters is more of than XX
« Reply #3 on: April 20, 2016, 09:41:18 pm »
title with limit:

Code: [Select]
<?php echo mb_substrosc_highlight(strip_tagsosc_item_title())), 048 'utf-8' ) ; ?>
title complete:

Code: [Select]
<?php echo mb_substrosc_highlight(strip_tagsosc_item_title())), 0null 'utf-8' ) ; ?>
Regards

fog

  • Hero Member
  • *****
  • Posts: 1062
Re: [Help] if the limit characters is more of than XX
« Reply #4 on: April 20, 2016, 09:54:59 pm »
Hi teseo, I think you not understood.  :D  sorry, I do not explain you well.

Is more simple like that, of course: <?php echo osc_item_title(); ?> and <?php echo osc_premium_title(); ?> but is not the point.

The problem is: I need to know how much characters have that title on database. That's my problem, to find a condition for showing the title complete.

Imagine if one of the titles on listings have a short title, so that condition will avoid showing the link to swap [+ -].

I only need showing that link on long titles (more of than XX, characters).

Can be possible some code to know this, with a condition? I think it need be a conexion on database, but not sure.

Thanks for all help you can, man.

Regards

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: [Help] if the limit characters is more of than XX
« Reply #5 on: April 20, 2016, 10:07:33 pm »
Oh

Code: [Select]
mb_strlen(strip_tags(osc_item_title()), 'utf-8')
That will give you the real number of characters of the title, regardless of the language.

Regards
« Last Edit: April 20, 2016, 10:09:48 pm by teseo »

fog

  • Hero Member
  • *****
  • Posts: 1062
Re: [Solved] if the limit characters is more of than XX
« Reply #6 on: April 20, 2016, 10:11:16 pm »
That's it!!
Thank you very much  :D

Regards
« Last Edit: April 21, 2016, 04:03:55 am by fog »