Jump to content

  • twitter
  • youtube
  • googleplus
  • facebook
  • rss
  • newsletter


(M31) Auto Decrease Warning 1.0.0


  • Please log in to reply
25 replies to this topic

#1 Michael

Michael

    Management

  • Management
  • 3,129 posts
  • Gender:Male
  • Location:Australia
  • IP.Board Version:IPB 3.1.x
  • First Name:Michael
Donator

Posted 27 February 2009 - 01:29 AM

File Name: (M31) Auto Decrease Warning 1.0.0
File Submitter: Michael
File Submitted: 27 Feb 2009
File Updated: 08 Jun 2010
File Category: IP.Board Modifications

Resource Type: Hook & Task
Version: 1.0.0 (10001) - Compatibility: IP.Board 3.0.x / 3.1.x +
Author: Michael John (DevFuse)

Description: Reduces the warn level for members who have had there last warning more than X days ago. Also includes an option to log the warn decrease in the members warn log.

Click here to download this file

Keep up to date with DevFuse mod development and releases.

Posted Image Posted Image Posted Image Posted Image Posted Image


#2 terabyte

terabyte

    Advanced Member

  • Contributors
  • 67 posts
  • Gender:Male
  • Location:Italy
  • IP.Board Version:IPB 3.1.x

Posted 19 March 2009 - 09:25 AM

Hey Michael I have found a bug in the task :P

You are using the following code:
				$this->DB->build( array('update' => 'members', 'set' => "warn_lastwarn = ".$current_time, 'where' =>"member_id IN (".$members.")" )  );
				$this->DB->build( array('update' => 'members', 'set' => "warn_level=warn_level-1", 'where' =>"member_id IN (".$members.")" )  );	 			
				$this->DB->execute();
Problem is that the first build doesn't have an execute and so it is overwritten by the second call to build right after :o
Also instead of using 2 queries you can use only 1 query in this way:
				$this->DB->update( "members", "warn_level=warn_level-1,warn_lastwarn=".$current_time, "member_id IN (".$members.")", false, true );

Hope that helps :)

#3 Michael

Michael

    Management

  • Management
  • 3,129 posts
  • Gender:Male
  • Location:Australia
  • IP.Board Version:IPB 3.1.x
  • First Name:Michael
Donator

Posted 19 March 2009 - 04:28 PM

Thanks terabyte will make sure that's updated. :) Wasn't sure what those second parameters were for, so was waiting for the unencoded version. Do you know?

Keep up to date with DevFuse mod development and releases.

Posted Image Posted Image Posted Image Posted Image Posted Image


#4 terabyte

terabyte

    Advanced Member

  • Contributors
  • 67 posts
  • Gender:Male
  • Location:Italy
  • IP.Board Version:IPB 3.1.x

Posted 19 March 2009 - 04:57 PM

Yup, I know and I have an unencoded copy but this info is available also from the IP.Downloads conversion documentation:

Quote

Another change that needs to be made is to remove calls to simple_* - these methods largely just redirected to existing methods and have been removed as a result.  So the following code in the same task

            $this->DB->simple_construct( array( 'update' => "downloads_files",
                                                          'set'       => 'file_views=file_views+'.intval($row['views']),
                                                          'where'  => 'file_id='.$row['view_fid'] ) );
            $this->DB->simple_exec();

should be converted like so (*note: an additional parameter is available for the do_update and do_insert methods to flag that the second parameter $set is a preformatted string and does not need to be run through the normal array compiler routines)

            $this->DB->update( "downloads_files", 'file_views=file_views+' . intval($row['views']), 'file_id=' . $row['view_fid'], false, true );

The third parameter is needed to specify if the query is a shutdown query or not, the fourth parameter instead is to tell the DB class that the update query is already formatted so it doesn't need to parse an array value because you are already passed the formatted string.

That fourth parameter is needed if you want to use +1, -1, etc in the update queries because normally if you pass an array that doesn't work :o



EDIT: If you have other questions let me know, an unencoded copy of the source helps a lot the development :P

#5 Michael

Michael

    Management

  • Management
  • 3,129 posts
  • Gender:Male
  • Location:Australia
  • IP.Board Version:IPB 3.1.x
  • First Name:Michael
Donator

Posted 19 March 2009 - 05:35 PM

Thanks terabyte :), must of missed that line. Thanks for the offer, do you mind if I PM you with a few quick ones? I just need to know the new names of some old functions that existed in IPB 2.3. Or following my own rules, maybe I should post in the IPB3 support forums?  :P

Keep up to date with DevFuse mod development and releases.

Posted Image Posted Image Posted Image Posted Image Posted Image


#6 terabyte

terabyte

    Advanced Member

  • Contributors
  • 67 posts
  • Gender:Male
  • Location:Italy
  • IP.Board Version:IPB 3.1.x

Posted 19 March 2009 - 05:47 PM

View PostMichael, on Mar 20 2009, 12:35 AM, said:

Thanks terabyte :) , must of missed that line. Thanks for the offer, do you mind if I PM you with a few quick ones? I just need to know the new names of some old functions that existed in IPB 2.3. Or following my own rules, maybe I should post in the IPB3 support forums?  :P
hahaha, as you wish xD

Or if you have my AIM/MSN just call me there :)
(I'm already going to bed now so maybe you'll find me tomorrow :P)

#7 Sacred

Sacred

    Elite Member

  • Members
  • PipPipPipPip
  • 167 posts
  • Gender:Male
  • Location:Egypt - Cairo
  • IP.Board Version:IPB 3.0.x
  • First Name:Amged Osman

Posted 19 March 2009 - 05:57 PM

OMG @ both of you

PM ME YOUR PMS hahah

#8 Michael

Michael

    Management

  • Management
  • 3,129 posts
  • Gender:Male
  • Location:Australia
  • IP.Board Version:IPB 3.1.x
  • First Name:Michael
Donator

Posted 19 March 2009 - 07:14 PM

View PostSacred, on Mar 20 2009, 10:57 AM, said:

OMG @ both of you

PM ME YOUR PMS hahah

Might be best if I post in the forums then, so others can see the answers.

Keep up to date with DevFuse mod development and releases.

Posted Image Posted Image Posted Image Posted Image Posted Image


#9 rainbow2009

rainbow2009

    Newbie

  • Members
  • Pip
  • 1 posts
  • IP.Board Version:IPB 3.0.x

Posted 24 April 2009 - 07:24 PM

"Might be best if I post in the forums then, so others can see the answers"----------> Absolutely agree :rolleyes:
:whistle: :santa:  
pret auto

#10 singeroi

singeroi

    Newbie

  • Unverified
  • Pip
  • 1 posts
  • IP.Board Version:IPB 3.0.x

Posted 08 May 2009 - 07:19 PM

what a conversation lol. but thanks a lot for the mod.
pret personnel

#11 Graeme

Graeme

    Newbie

  • Members
  • Pip
  • 1 posts
  • IP.Board Version:IPB 3.0.x
  • First Name:Graeme Standing

Posted 22 May 2009 - 12:11 PM

Has this been tried and tested with 3.0 RC1?

#12 darK

darK

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts
  • Gender:Male
  • Location:cHina
  • Interests:fAmily, friends, money, gaming.
  • IP.Board Version:IPB 3.0.x
  • First Name:Soso

Posted 22 May 2009 - 11:06 PM

Well, It's working for me. I'm using IPB 3.0 RC1 =)
Think twice before you do something.

#13 Michael

Michael

    Management

  • Management
  • 3,129 posts
  • Gender:Male
  • Location:Australia
  • IP.Board Version:IPB 3.1.x
  • First Name:Michael
Donator

Posted 23 May 2009 - 01:24 AM

I've done some minor testing with RC1 and haven't found any problems. Pretty simple mod, nothing that changes in RC2 or the final should affect it too much.

Keep up to date with DevFuse mod development and releases.

Posted Image Posted Image Posted Image Posted Image Posted Image


#14 bobtom

bobtom

    Newbie

  • Unverified
  • Pip
  • 1 posts
  • IP.Board Version:IPB 3.0.x

Posted 16 June 2009 - 12:43 AM

wonderful! thanks for the info..  :santa:

pret personnel

Edited by bobtom, 16 June 2009 - 12:44 AM.


#15 zero5854

zero5854

    Newbie

  • Members
  • Pip
  • 4 posts
  • Gender:Male
  • IP.Board Version:IPB 3.0.x
  • First Name:James

Posted 25 June 2009 - 05:30 AM

I think I am confused? Doesnt ipb already do this? IE Hence why in ACP you set how many days the warning duration is? I just wanted to know the difference? Not trying to be rude :)

also will this work on 3.0 stable?

Thanks

#16 Michael

Michael

    Management

  • Management
  • 3,129 posts
  • Gender:Male
  • Location:Australia
  • IP.Board Version:IPB 3.1.x
  • First Name:Michael
Donator

Posted 25 June 2009 - 06:22 AM

This doesn't mod doesn't affect the warning, only the warn level. IPB doesn't reduce the warn level. Yes just updated for IPB3 stable.

Keep up to date with DevFuse mod development and releases.

Posted Image Posted Image Posted Image Posted Image Posted Image


#17 zero5854

zero5854

    Newbie

  • Members
  • Pip
  • 4 posts
  • Gender:Male
  • IP.Board Version:IPB 3.0.x
  • First Name:James

Posted 25 June 2009 - 05:33 PM

ok then ill give it a shot! Thanks

#18 sunrisecc

sunrisecc

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts
  • Gender:Male
  • Location:Toronto, Ontario, Canada
  • IP.Board Version:IPB 3.2.x
  • First Name:Seymour

Posted 21 July 2009 - 07:50 PM

What is the Log Member ID used for? I do not have a member_id=1 anymore. Do I set it to my member_id? I am the admin.

TIA
Seymour

#19 Michael

Michael

    Management

  • Management
  • 3,129 posts
  • Gender:Male
  • Location:Australia
  • IP.Board Version:IPB 3.1.x
  • First Name:Michael
Donator

Posted 22 July 2009 - 01:36 AM

View Postsunrisecc, on 21 July 2009 - 07:50 PM, said:

What is the Log Member ID used for? I do not have a member_id=1 anymore. Do I set it to my member_id? I am the admin.

TIA

It adds a log to the members warn log, when it adds a positive warning explaining that it was from this mod, reducing the warn level. Who ever you fill in as the member id will be the author of that positive warning. Can be anyone, yeah your member id.

Keep up to date with DevFuse mod development and releases.

Posted Image Posted Image Posted Image Posted Image Posted Image


#20 sunrisecc

sunrisecc

    Advanced Member

  • Members
  • PipPipPip
  • 36 posts
  • Gender:Male
  • Location:Toronto, Ontario, Canada
  • IP.Board Version:IPB 3.2.x
  • First Name:Seymour

Posted 22 July 2009 - 04:01 AM

Thank you.

I must change the default as I have no member = 1 to my id. Just wanted to be sure.

Edited by sunrisecc, 22 July 2009 - 04:02 AM.

Seymour




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users