Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 16 May 2013, 13:35
GoyoH GoyoH is offline
 
Join Date: Aug 2011
How to count the number of characters of a post?

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.
Reply With Quote
  #2  
Old 16 May 2013, 14:29
ForceHSS's Avatar
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Why, for what reason
Reply With Quote
  #3  
Old 17 May 2013, 12:01
GoyoH GoyoH is offline
 
Join Date: Aug 2011
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.
Reply With Quote
  #4  
Old 17 May 2013, 17:20
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Real name: Lynne
Use the strlen function on the $message in a plugin - http://php.net/manual/en/function.strlen.php
__________________
Former vBulletin.org Staff Member

Try a search before posting for help. Many users won't, and don't, help if the question has been answered several times before.
W3Schools -
Online vBulletin Manual
If I post some CSS and don't say where it goes, put it in the additional.css template.
I will NOT help via PM (you will be directed to post in the forums for help.)
Reply With Quote
  #5  
Old 20 May 2013, 17:22
GoyoH GoyoH is offline
 
Join Date: Aug 2011
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.
Reply With Quote
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Post Count Modifier - Minimum Post Characters to Count towards Post Count Chris M vBulletin 2.x Full Releases 35 13 Oct 2003 19:29



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 12:53.

Layout Options | Width: Wide Color: