PDA

View Full Version : I hope someone help me!!


v123shine
03-14-2011, 04:03 PM
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 (http://img849.imageshack.us/i/adshow.gif/)
Uploaded with ImageShack.us (http://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:


<if condition="THIS_SCRIPT == 'showthread'">
<if condition="$post['text_length'] < 200">
<br>
Ads code 468x60
</if>
</if>


Result code:


$post[message]
<if condition="THIS_SCRIPT == 'showthread'">
<if condition="$post['text_length'] < 200">
<br>
Ads code 468x60
</if>
</if>


But still not working :'(
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....!!

Lynne
03-14-2011, 04:15 PM
Your code only puts that ad code in if the message is less than 200 characters, not after the first 200 characters.

v123shine
03-14-2011, 04:21 PM
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

Your code only puts that ad code in if the message is less than 200 characters, not after the first 200 characters.

Lynne
03-14-2011, 04:55 PM
I dont' have the code for that, sorry.

BirdOPrey5
03-14-2011, 05:37 PM
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.

v123shine
03-14-2011, 10:14 PM
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.

Dear BirdOPrey, thank you so much for respone my post.

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.

Lynne
03-14-2011, 10:22 PM
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.

BirdOPrey5
03-15-2011, 12:07 AM
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.)