Go Back   vb.org Archive > vBulletin Modifications > vBulletin 5.x Modifications > vBulletin 5.x Products & Extensions
Mid Post Advertisements (middle of the post) Details »»
Mid Post Advertisements (middle of the post)
Version: 1.1, by YankForum YankForum is offline
Developer Last Online: Sep 2014 Show Printable Version Email this Page

Category: Add-On Releases - Version: 5.1.1 Rating:
Released: 08-13-2014 Last Update: 08-14-2014 Installs: 9
Template Edits
Code Changes Additional Files  
No support by the author.

Hello
although vbulletin 5 has no good options for developers and make the life hard for us , but I decided to go through it and adopt my previouse mods to vbulletin 5 hope you guys like em.

[hr]1[/hr]What does this hack do ?

This mod simply lets you put your desired ads or any other codes just in the middle of first post , in each page of a thread .
This mod is updated in such a way that it recognized end of the sentences by ".!?" so it wont break the post content on the wrong place instead it only inserts ads after the sentence , near to the middle of the post.






[hr]1[/hr]Known Issues :
  • [s]you shouldn't edit your first post , that causes real problems , and you lose all the contents of first post.[/s] (this is solved in version 1.1)
  • Vbulletin 5 AJAX and Post caching sucks! and this might have a little bit conflicts with that system since vbulletin 5 is not written professionally and has many and many bugs and downsides.
  • sometimes it's not exactly in the middle of posts , that's because in logic sometimes there is no real half point , while some posts have even number of lines and some posts have odd number of lines . but it tries to put it to the nearest location to the mid point!
[hr]1[/hr]Try not to mention following things :
if you think it's against google TOS then don't install it but keep in mind you can also use it with other network ads , and keep in mind at no point google directly mentioned it's against their TOS to put adsense in between content , so do not insist
[hr]1[/hr]Installation Guide:

1- upload the MidPostAds folder to its equivalent folder on your FTP site.
there is only 1 folder: yourwebsite/core/packages/MidPostads

2- goto: Admincp=>Products & Hooks=>Manage Products=>[Add/Import Product]
choose the xml file we provided : MidPostAds.xml , set overwrite to YES (if it's upgrade) and hit "Import"

3- File edit (only 3 lines) : open this file : yourwebsite/includes/vb5/template/nodetext.php
search for this line:
$found = $cache->read(array_keys($this->placeHolders));

and after it add this:
if (class_exists('MidPostAds_Api_node')) {$found = MidPostAds_Api_node::MidPostAdsInsertion($found); }$i=1;

--------------------

now search for this line:
$parsed = $parser->doParse(

and just BEFORE it add this:
if (class_exists('MidPostAds_Api_node')) {$textData['rawtext'] = MidPostAds_Api_node::MidPostAdsInsertionRaw($textD ata['rawtext'],$i);}$i=$i+1;

--------------------

find this line:
$cache->write($cacheKey, $parsed, 10080, $events);

and remove it or comment it

DONE

you can now go to admincp => Settings => MidpostAds
and change the settings or import your Ads code to be shown.

please keep in mind vbulletin 5 has lots if issues with posts Caching and sometimes needs to refresh the page or wait for changes to take effect
[hr]1[/hr]Updates
version 1.0 : Initial release FIXED
version 1.1 : Now it works with vBulletin5 Caching system and without FIXED

[hr]1[/hr]Enjoy and please please try not to forget to click as Installed if you liked it you can also Nominate it for MOTM , that's optional but clicking as installed is a must

Edit by Staff: This modification adds a copyright to the bottom of your site which includes more than one link. If you do not wish for the copyright to be included at the bottom of your site do not use this modification OR ask for permission to remove them from the developer directly via private message.

Download Now

File Type: zip MidPost.zip (5.0 KB, 153 views)

Screenshots

File Type: jpg 1.jpg (89.2 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
markoroots

Comments
  #2  
Old 08-14-2014, 05:30 PM
YankForum's Avatar
YankForum YankForum is offline
 
Join Date: Mar 2010
Location: MY
Posts: 304
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

first post is reserved
by the way , vBulletin 5 needs serious updates!

Good to know: This mod doesn't break post content , first it searched for the middle of the post then it looks for end of sentence there based on symbols (.?!) and inserts ADS after that sentence.
Reply With Quote
  #3  
Old 10-07-2016, 12:04 PM
shneler2010 shneler2010 is offline
 
Join Date: Apr 2013
Location: Philippines
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

not working ?! in VB5.2.4
please update
Reply With Quote
  #4  
Old 11-29-2017, 05:49 PM
Qsrr.Net Qsrr.Net is offline
 
Join Date: May 2008
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Doesn't work for my vB 5.3.3. All pages became blank with this error in error_log:

Code:
PHP Fatal error:  Broken Extension Class: MidPostAds_node in /home/xx/public_html/core/vb/api/extensions.php on line 310
Reply With Quote
  #5  
Old 08-21-2019, 09:00 PM
ringnews24's Avatar
ringnews24 ringnews24 is offline
 
Join Date: Aug 2012
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work in 5.5.3?
Reply With Quote
  #6  
Old 09-15-2019, 10:42 PM
lordicon2019 lordicon2019 is offline
 
Join Date: Aug 2019
Location: Green Spring, WV
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Or does it work in 5.5.4??
Reply With Quote
Reply

Thread Tools

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 11:34 AM.


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.03982 seconds
  • Memory Usage 2,276KB
  • Queries Executed 22 (?)
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)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (1)post_thanks_box_bit
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (2)postbit_attachment
  • (6)postbit_onlinestatus
  • (6)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete