Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-14-2011, 04:03 PM
v123shine v123shine is offline
 
Join Date: Sep 2008
Posts: 242
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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:
<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....!!
Reply With Quote
  #2  
Old 03-14-2011, 04:15 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your code only puts that ad code in if the message is less than 200 characters, not after the first 200 characters.
Reply With Quote
  #3  
Old 03-14-2011, 04:21 PM
v123shine v123shine is offline
 
Join Date: Sep 2008
Posts: 242
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Dear Lynne can you tell to me, how to show ads in first 200 characters?
I beg your help

Quote:
Originally Posted by Lynne View Post
Your code only puts that ad code in if the message is less than 200 characters, not after the first 200 characters.
Reply With Quote
  #4  
Old 03-14-2011, 04:55 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I dont' have the code for that, sorry.
Reply With Quote
  #5  
Old 03-14-2011, 05:37 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 03-14-2011, 10:14 PM
v123shine v123shine is offline
 
Join Date: Sep 2008
Posts: 242
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BirdOPrey5 View Post
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.
Reply With Quote
  #7  
Old 03-14-2011, 10:22 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 03-15-2011, 12:07 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.)
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 01:16 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04631 seconds
  • Memory Usage 2,234KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete