![]() |
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: http://img849.imageshack.us/img849/4600/adshow.gif 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....!! |
Your code only puts that ad code in if the message is less than 200 characters, not after the first 200 characters.
|
Dear Lynne can you tell to me, how to show ads in first 200 characters?
I beg your help https://vborg.vbsupport.ru/external/2011/12/7.gif Quote:
|
I dont' have the code for that, sorry.
|
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. |
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. |
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. |
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.)
|
All times are GMT. The time now is 12:33 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|