vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Setting a plugin to activate at a certain post count (https://vborg.vbsupport.ru/showthread.php?t=207783)

MTGDarkness 03-09-2009 05:06 AM

Setting a plugin to activate at a certain post count
 
In userdata presave:

PHP Code:

if ($this->fetch_field('userid') == 36)
{
//if($this->fetch_field('posts?') == 666)
$this->do_unset('posts');
//}


Not sure what to do with the posts thing. I imagine it's very similar syntax.

In case anyone wonders, I'm trying to be very mean to a certain poster who is bragging all the time about being about to hit 3000 posts.

--------------- Added [DATE]1236662338[/DATE] at [TIME]1236662338[/TIME] ---------------

Bump?

MTGDarkness 03-10-2009 01:37 PM

Help?

Lynne 03-10-2009 02:03 PM

Exactly what are you trying to do? Make it so if he makes a post then his post count is not increased?

MTGDarkness 03-10-2009 02:09 PM

When he reaches a certain post count, it stops his post count.

Lynne 03-10-2009 02:59 PM

Instead of doing an unset (I'm not sure how you would do that), why not just set it to the postcount you want it to stay at?
PHP Code:

if ($this->fetch_field('userid') == 36)
{
if(
$this->fetch_field('posts') >= 666)
{
$this->set('posts'666);
}


Although, looking more into it there, it doesn't look like the posts are actually saved there. It looks like it is passed back in the $userinfo array. So, I think you may want to do something more along these lines (again, not tested, play with it on a test site):
PHP Code:

if ($this->fetch_field('userid') == 36)
{
if(
$this->fetch_field('posts') >= 666)
{
$posts 666;
            
$userinfo = array(
                
'userid' => $userid// we need an userid for is_member_of's cache routine
                
'posts' => $posts
            
);
}



MTGDarkness 03-10-2009 03:10 PM

do_unset('posts') was the snippet you gave to me when I asked about this on a slightly less advanced level. But this should work. Thanks. :)

Lynne 03-10-2009 03:27 PM

I gave it to you? Hehe. I'm not fully caffeinated yet... that is my excuse and I'm sticking to it!

MTGDarkness 03-10-2009 05:36 PM

I take it back. You didn't directly give it to me, you just put it up in some thread. :p So technically, it comes from you.

Lynne 03-10-2009 05:41 PM

Hmm, OK, if you say so. :)

So, did you get this to work? You should post what you did so if someone else wants to do this to a user, they can get the code here (would be fun to do something with it for April Fools).

MTGDarkness 03-10-2009 05:43 PM

I'm not sure if it works or not, it hasn't triggered yet.
http://forums.mtgdarkness.com/test-a...th-post-t2126/
I'm using it on the OP of that thread, set to 2999. https://vborg.vbsupport.ru/external/2009/03/102.jpg

Lynne 03-10-2009 08:10 PM

Do you have a test site? Or a test account? If you don't have a test site, use a test account and change the id in your plugin to the id of your test account and change the post count for your test account to just trigger it. You should be able to test it that way.


All times are GMT. The time now is 05:58 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.01126 seconds
  • Memory Usage 1,737KB
  • 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
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (11)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