vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   I hope someone help me!! (https://vborg.vbsupport.ru/showthread.php?t=260363)

v123shine 03-14-2011 04:03 PM

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:

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

Quote:

$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

Quote:

Originally Posted by Lynne (Post 2173282)
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

Quote:

Originally Posted by BirdOPrey5 (Post 2173322)
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.)


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
  • Page Generation 0.01003 seconds
  • Memory Usage 1,730KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete