vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Mini Mods - The second post is advertising (https://vborg.vbsupport.ru/showthread.php?t=239981)

Asterix_ita 03-28-2011 06:30 PM

Quote:

Originally Posted by BadgerDog (Post 2178472)
Can I assume the Forum Exclude can be reversed in a similar way?

Yes, it is similar.

Asterix_ita 03-28-2011 07:06 PM

@Digital

sorry my mistake, try this

admincp ->Plugins & Products ->Plugin Manager search Second Post ADS (press edit)

seach this code

Code:

if ($ctads['ok'] && $ctads['template'] == 0)
                {
                    $templater = vB_Template::create('postbit_ads_ct_2th');
                    $templater->register('post', $post);
                    $templater->register('ctads', $ctads);
                    $template_hook['postbit_end'] .= $templater->render(); 
                }
                if ($ctads['ok'] && $ctads['template'] == 1)
                {
                $templater = vB_Template::create('postbit_legacy_ads_ct_2th');
                    $templater->register('post', $post);
                    $templater->register('ctads', $ctads);
                    $template_hook['postbit_end'] .= $templater->render();
                }

replace with
Code:

if ($ctads['ok'] && $ctads['template'] == 0)
                {
                    $templater = vB_Template::create('postbit_ads_ct_2th');
                    $templater->register('post', $post);
                    $templater->register('ctads', $ctads);
                    $ctads['template1'] = $templater->render(); 
                }
                if ($ctads['ok'] && $ctads['template'] == 1)
                {
                $templater = vB_Template::create('postbit_legacy_ads_ct_2th');
                    $templater->register('post', $post);
                    $templater->register('ctads', $ctads);
                    $ctads['template1'] = $templater->render();
                }

vB_Template::preRegister('postbit',array('ctads' => $ctads));
vB_Template::preRegister('postbit_legacy',array('ctads' => $ctads));

Search postbit or postbit_legacy template and add on top this {vb:raw ctads.template1}

BadgerDog 03-29-2011 10:21 AM

Quote:

Originally Posted by Asterix_ita (Post 2178482)
Yes, it is similar.

Thanks .. :)

So, I changed this:

Code:

if (in_array($thread['forumid'],$ctads['forums']))
                                {
                                        $ctads['ok'] = false;
                                }

to this:

Code:

if (!in_array($thread['forumid'],$ctads['forums']))
                                {
                                        $ctads['ok'] = false;
                                }

... which should make the mod only INCLUDE any forums checked in either place?

Thanks ..

Regards,
Doug

Asterix_ita 03-29-2011 10:52 AM

the change applied says: in all forums that are not reported here denies viewing

I sincerely leave ads in all forums and select the excluded, that variable should act on the second ads.

Warning:

All the plugin code is linked and changing one part may create problems in other options

BadgerDog 04-17-2011 04:03 PM

Here's an odd request, but feedback with advice from anyone would be appreciated ... :up:

If I wanted to execute the following conditional so that this excellent mod ONLY displayed the ads on the second post under those conditions specified, where in the plugins would I put it? I've tried everywhere including the template and it always seems to still interact with the mod's own settings, or prevents elements of the postbit_legacy bottom bar from displaying properly.

Code:

<vb:if condition="is_member_of($bbuserinfo,1,2,3,4,13,17) || in_array($bbuserinfo['userid'],array(2,5539))">

Execute Ads in Second Post Mod

</vb:if>

Would appreciate any advice ... :)

Regards,
Doug

Asterix_ita 04-18-2011 04:47 AM

Hi

you could try changing the plugin "Second Post ADS, in it there are all conditions

or set no exclusion in the options plugin and act in templates postbit_legacy_ads_ct_2th or postbit_ads_ct_2th

Regards

Asterix

BadgerDog 04-18-2011 09:47 AM

Quote:

Originally Posted by Asterix_ita (Post 2185851)
Hi

you could try changing the plugin "Second Post ADS, in it there are all conditions

or set no exclusion in the options plugin and act in templates postbit_legacy_ads_ct_2th or postbit_ads_ct_2th

Regards

Asterix

Thank you Sir .. :)

I did try all those without any success.....

I have added a new usergroup which combined with the customization for "including" usergroups you kindly gave me earlier, I think will work. Still have to test it though.

Nice mod.... do you do paid customization work on this for a fee?

Regards,
Doug

Ricsca 04-23-2011 09:50 AM

How can you place the ad under the first post and sottol'ultimo post?

Asterix_ita 04-24-2011 05:41 AM

Hi Ricsca

should be sufficient to change the template or postbit_ads_ct_2th postbit_legacy_ads_ct_2th

find

Code:

                <vb:if condition="$post[postcount] % $vboptions[maxposts] == 1">
Replace with

Code:

                <vb:if condition="$post[postcount] % $vboptions[maxposts] == 1 || $post[islastshown]">
let me know

Regards

Asterix

sticky 07-10-2011 04:18 AM

Can I have different ads in different forums for the second post?

For example, forum A has ad X as second post and forum B has ad Y as second post?


All times are GMT. The time now is 03:08 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.01862 seconds
  • Memory Usage 1,750KB
  • 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
  • (7)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete