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)

BadgerDog 03-28-2011 12:18 PM

Quote:

Originally Posted by Asterix_ita (Post 2178291)
from my point of view is correct to not distinguish between primary and secondary groups

If I decide that the components of the group “A” are excluded, they must be excluded independent primary or secondary group

Regards
Asterix

Could be, but in our opinion and the way most add-mods that we currently use treat UserGroup inclusion or exclusion, is when you select a group to exclude, it should not also require the us to select ALL other secondary groups that may be involved. The one selection should suffice.

For example, I want to exclude Admins, but with this mod, unless I also exclude other secondary UserGroups that Admins belong to, then the result of just excluding anyone belonging to the single Admin usergroup on its own is pointless and it doesn't work because the mod wants ALL of them checked or unchecked. ;)

Many sites use secondary usergroups to identify things like contributing members etc, so their use that way conflicts with how this mod is coded.

Anyway, again... nice effort on behalf of the coder and we appreciate his work, but for us it won't work without a more traditional approach to handling user group exclusions.

Regards,
Doug

Asterix_ita 03-28-2011 12:55 PM

Hello

maybe I did not understand the problem, due to my bad English

Quote:

it should not also require the us to select ALL other secondary groups that may be involved
does not require the selection of others.

I have excluded the admin group.
my account have as primary group admin
as secondary staff (not excluded)

and the ads do not see


I have change excluded staff group
my account have as primary group admin (not excluded)
as secondary staff

and the ads do not see it properly


the instruction I used to check the group is as follows:

Code:

if (is_member_of($this->registry->userinfo,$ctads['groups'])) {
I feel the same used in other addon, I can signal an addon that verifies


thanks

BadgerDog 03-28-2011 01:47 PM

Quote:

Originally Posted by Asterix_ita (Post 2178309)
I have excluded the admin group.
my account have as primary group admin
as secondary staff (not excluded)

and the ads do not see

My apologies as I only speak English, but let's try this ...

You have an option that says:

Select the Usergroup to be excluded from ads second post.

If I check ALL the boxes but NOT the one that says Administrator, then according to your option, the Administrator group ONLY should be able to view the ads.

On our site, any member who belongs to the group Administrator DOES NOT SEE ads. They do not see ads because an Administrator on our site also belongs to other user groups as well, which are checked. So, because those other user groups are checked and kind of process logic you're using, it just doesn't work for us...

Thanks for your efforts ... :)

Rergards,
Doug

Asterix_ita 03-28-2011 02:11 PM

Quote:

If I check ALL the boxes but NOT the one that says Administrator, then according to your option, the Administrator group ONLY should be able to view the ads.
certainly, if the administrator is not covered by other groups with the restriction, the addon follow the stricter rules

in your case probably should create a group no-ads, exclude this, and assigned to admin the secondary group no-ads

BadgerDog 03-28-2011 02:28 PM

Quote:

Originally Posted by Asterix_ita (Post 2178338)
in your case probably should create a group no-ads, exclude this, and assigned to admin the secondary group no-ads

It would be easier to have the check box group option changed to be:

Select the Usergroup to be INCLUDED (permitted) to view ads second post.

Then, only members belonging to whatever usergroup is checked would see the ads.

Solves the problem for us ... ;)

Regards,
Doug

Asterix_ita 03-28-2011 03:55 PM

hi
should be sufficient to make this

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

seach this code

Code:

             
 if (is_member_of($this->registry->userinfo,$ctads['groups']))
                {
                    $ctads['ok'] = false;
                }

change to

Code:

             
 if (!is_member_of($this->registry->userinfo,$ctads['groups']))
                {
                    $ctads['ok'] = false;
                }

Search this phrase
  • $vbphrase[setting_ads_ct_groups_title] on english traslate set: Select the Usergroup to be INCLUDED (permitted)
  • $vbphrase[setting_ads_ct_groups_desc] on english traslate set: only groups check show the second post ads

let me know if it works

Regards,

Asterix

DigitalDark 03-28-2011 04:58 PM

Quote:

Originally Posted by DigitalDark (Post 2177655)
Hi! First of all, thanks for this great mod!

I've a question. It's possible to change the situation of the ads post?

I would like to change before the 1st Post instead after 1st post.
It's possible? What code I've to change?

Thank you!

Thanks

Any one? Thank you

Asterix_ita 03-28-2011 05:13 PM

hi

I checked quickly, your request requires the variation of one plugin and one or two template

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['template'] .= $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['template'] .= $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.template}

I have not tested but should work

Regards
Asterix

DigitalDark 03-28-2011 05:21 PM

Nice, nice nice!! Worked.

This will help a lot, because the human eye looks first at the first content in the screen.

Thank you!

PD: It's appearing "0 0 0" before the ads

example

BadgerDog 03-28-2011 06:08 PM

Quote:

Originally Posted by Asterix_ita (Post 2178398)
let me know if it works

Regards,

Asterix

Worked perfect .... :up:

Ads ONLY appear for selected usergroup membership.

Thank you very much for the customization ....

Can I assume the Forum Exclude can be reversed in a similar way?

Regards,
Doug


All times are GMT. The time now is 08:49 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.01328 seconds
  • Memory Usage 1,761KB
  • 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
  • (5)bbcode_code_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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