PDA

View Full Version : How to count the number of characters of a post?


GoyoH
05-16-2013, 12:35 PM
I'd like to know the number of characters of the first post of each page. It's possible to do this?

For example:

If "number of characters" > 5000

"do option1!

else

"do option 2"

End if

Thanks.

ForceHSS
05-16-2013, 01:29 PM
Why, for what reason

GoyoH
05-17-2013, 11:01 AM
Hello Force,

It's for showing diferent ads. One larger ads if the text is larger than X characters, and one sorter ad if the text is shorter than X characters.

Do you know how to do this?

Thanks.

Lynne
05-17-2013, 04:20 PM
Use the strlen function on the $message in a plugin - http://php.net/manual/en/function.strlen.php

GoyoH
05-20-2013, 04:22 PM
Thanks very much, Lynne.

I can do some little things with PHP, but I don't know how to do a plugin.

It could function this?:

<vb:if condition="strlen ($message)"> 5000

"show ad 1"

</vb:if>

<vb:if condition="strlen ($message)"<= 5000

"show ad 2"

</vb:if>

Thanks.