DevFuse Products (View All Products)
(M31) Auto Decrease Warning 1.0.0
#1
Posted 27 February 2009 - 01:29 AM
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.

#2
Posted 19 March 2009 - 09:25 AM
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 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
~ Please DON'T PM me for support unless I ask you to do so! ~
~ My Site ~ All My Mods ~
Donations are always appreciated ![]()
Latest Releases: (TB) Group Format 4.0.0 ♦ (TB) Hide Quote Button from First Post ♦ (TB) PM on Group Change 2.0.0 ♦ (TB) Manage Notes ♦ (TB) Bump Up Topics 2.0.0 ♦ (TB) Moods 3.0.0 ♦ (TB) Hide Content 3.0.1 (No file edits!) ♦ (TB) Ed2k Links 3.0.0 ♦ (TB) Password Change Reminder 2.0.0 ♦ (TB) Show Reputation in User Info 3.0.0 ♦ (TB) Remove Signatures from Messenger 1.0.0 ♦ (T31) Tickets System 1.1.0 ♦ (T31) Database Optimizer 2.0.0
#4
Posted 19 March 2009 - 04:57 PM
Quote
$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
EDIT: If you have other questions let me know, an unencoded copy of the source helps a lot the development
~ Please DON'T PM me for support unless I ask you to do so! ~
~ My Site ~ All My Mods ~
Donations are always appreciated ![]()
Latest Releases: (TB) Group Format 4.0.0 ♦ (TB) Hide Quote Button from First Post ♦ (TB) PM on Group Change 2.0.0 ♦ (TB) Manage Notes ♦ (TB) Bump Up Topics 2.0.0 ♦ (TB) Moods 3.0.0 ♦ (TB) Hide Content 3.0.1 (No file edits!) ♦ (TB) Ed2k Links 3.0.0 ♦ (TB) Password Change Reminder 2.0.0 ♦ (TB) Show Reputation in User Info 3.0.0 ♦ (TB) Remove Signatures from Messenger 1.0.0 ♦ (T31) Tickets System 1.1.0 ♦ (T31) Database Optimizer 2.0.0
#5
Posted 19 March 2009 - 05:35 PM
Keep up to date with DevFuse mod development and releases.

#6
Posted 19 March 2009 - 05:47 PM
Michael, on Mar 20 2009, 12:35 AM, said:
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
~ Please DON'T PM me for support unless I ask you to do so! ~
~ My Site ~ All My Mods ~
Donations are always appreciated ![]()
Latest Releases: (TB) Group Format 4.0.0 ♦ (TB) Hide Quote Button from First Post ♦ (TB) PM on Group Change 2.0.0 ♦ (TB) Manage Notes ♦ (TB) Bump Up Topics 2.0.0 ♦ (TB) Moods 3.0.0 ♦ (TB) Hide Content 3.0.1 (No file edits!) ♦ (TB) Ed2k Links 3.0.0 ♦ (TB) Password Change Reminder 2.0.0 ♦ (TB) Show Reputation in User Info 3.0.0 ♦ (TB) Remove Signatures from Messenger 1.0.0 ♦ (T31) Tickets System 1.1.0 ♦ (T31) Database Optimizer 2.0.0
#7
Posted 19 March 2009 - 05:57 PM
PM ME YOUR PMS hahah
IPBE Marketplace (Complete Shopping Cart for IPB 3) || iClassifieds System for IPB3
FREE (IPBE) RuneScape HiScores


||
||
||
#11
Posted 22 May 2009 - 12:11 PM
#12
Posted 22 May 2009 - 11:06 PM
#14
Posted 16 June 2009 - 12:43 AM
#15
Posted 25 June 2009 - 05:30 AM
also will this work on 3.0 stable?
Thanks
#17
Posted 25 June 2009 - 05:33 PM
#18
Posted 21 July 2009 - 07:50 PM
TIA
#19
Posted 22 July 2009 - 01:36 AM
sunrisecc, on 21 July 2009 - 07:50 PM, said:
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.

#20
Posted 22 July 2009 - 04:01 AM
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.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users













