The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
I hope someone help me!!
Hello,
I want show/insert ads automatic every 3 line in first post or every 200 word in first post. this is the example: Uploaded with ImageShack.us I add new plugin Product: vbulletin Hook Location: postbit_display_complete Title: Ads every 200 word Execution Order: 5 Plugin PHP code: $post['text_length'] = strlen($post['message']); I go to edit Postbit_Legacy template I find this code in Postbit_Legacy: $post[message] I put this code below: Quote:
Quote:
plugin dont want automatic show ads every 200 word or every 3 line in first post. I'm using vb.3.8.x Please help me....!! |
#2
|
||||
|
||||
Your code only puts that ad code in if the message is less than 200 characters, not after the first 200 characters.
|
#3
|
|||
|
|||
Dear Lynne can you tell to me, how to show ads in first 200 characters?
I beg your help |
#4
|
||||
|
||||
I dont' have the code for that, sorry.
|
#5
|
||||
|
||||
If you are trying to insert an ad every 3 lines or 200 characters you need to modify $post['message'] in a plugin. There would be nothing to change or add to the templates.
There is a mod that will put an ad in the middle of the first post, I've seen it, it can be searched for. |
#6
|
|||
|
|||
Quote:
Yes i know the mod that will put an ad in the middle of the first post, but I dont want show ad in midle, i want show ad automatic in first 3 line or first 200 characters. Can you give to me tutorial how to modify $post['message'], please!! Thank you. |
#7
|
||||
|
||||
You will want to look through the string functions for php to see which will do what you want with your message string.
http://php.net/manual/en/ref.strings.php Perhaps first count 200 characters and then look for the first "<br />" after that. That is where you would want to insert the ad and then put the string back together. It's not going to be an easy one-line piece of code. |
#8
|
||||
|
||||
What Lynne said... It's possible but not going to be easy. You'll need to be familiar with php's string functions. Remember that $post['message'] is already HTML so like Lynne said look for <br /> to end lines, not /r/n. (If you don't know what /r/n is you have a lot of brushing up to do before you can get this working.)
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|