Some bugs - Reset overall traffic, MCP etc.

Support zu den Modifikationen (MODs) von Entwickler OXPUS für das phpBB 3.0.x
Antworten
Pico
Beiträge: 26
Registriert: Do 30. Dez 2010, 11:53

Some bugs - Reset overall traffic, MCP etc.

Beitrag von Pico »

Hi.
I found a bug with reset overall traffic (set the overall traffic and categories traffic if needed (each first day of a month).
In class_dlmod.php there is

Code: Alles auswählen

			if ($auto_overall_traffic_month < $current_traffic_month)
			{
				$config['dl_traffic_retime'] = time();
				$config['dl_remain_traffic'] = 0;
				$config['dl_remain_guest_traffic'] = 0;
	
				$sql = 'UPDATE ' . DL_REM_TRAF_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
					'config_value' => '0')) . "	WHERE config_name = 'remain_traffic'";
				$db->sql_query($sql);
	
				$sql = 'UPDATE ' . DL_REM_TRAF_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
					'config_value' => '0')) . "	WHERE config_name = 'remain_guest_traffic'";
				$db->sql_query($sql);
	
				$sql = 'UPDATE ' . DL_CAT_TRAF_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
					'cat_traffic_use' => 0));
				$db->sql_query($sql);
	
				set_config('dl_traffic_retime', $config['dl_traffic_retime'], true);
			}
but it should be

Code: Alles auswählen

			if ($auto_overall_traffic_month < $current_traffic_month)
			{
				$sql = 'UPDATE ' . DL_REM_TRAF_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
					'config_value' => 0));
				$db->sql_query($sql);
	
				$sql = 'UPDATE ' . DL_CAT_TRAF_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
					'cat_traffic_use' => 0));
				$db->sql_query($sql);
	
				set_config('dl_traffic_retime', time(), true);
			}
Reset traffic doesn't work when 0 is between ''. And it doesn't need to be 2 sql queries to one table (remain_guest_traffic and remain_traffic in DL_REM_TRAF_TABLE).

BTW, Download Mod is magnificent :)
Zuletzt geändert von Pico am Fr 31. Dez 2010, 10:56, insgesamt 1-mal geändert.
Benutzeravatar
oxpus
Chief handy-man
Beiträge: 2719
Registriert: Do 13. Dez 2007, 23:06
Wohnort: Irgendwo im I-Net
Kontaktdaten:

Re: Reset overall traffic

Beitrag von oxpus »

Thanks for that hints.
I'll update the mod in the next hours for this.
But please do not drop the lines

Code: Alles auswählen

				$config['dl_traffic_retime'] = time();
				$config['dl_remain_traffic'] = 0;
				$config['dl_remain_guest_traffic'] = 0;
In some cases you can get malfunctions about this values if you do not reset the array keys as shown, because $config will be init long before this point in the class_dlmod.php!!

And so at least the line

Code: Alles auswählen

set_config('dl_traffic_retime', $config['dl_traffic_retime'], true);
shouldn't be changed, too, because $config['dl_traffig_retime'] can get an other value as time() itself if the sql statements may runs longer than 1 second ;)
Karsten Ude
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Pico
Beiträge: 26
Registriert: Do 30. Dez 2010, 11:53

Re: Reset overall traffic

Beitrag von Pico »

Thanks :)

BTW, I have one more suggestion.
Normal user without appropriate permits to moderate downloads (register one) can see link to Moderator Control Panel.
Benutzeravatar
oxpus
Chief handy-man
Beiträge: 2719
Registriert: Do 13. Dez 2007, 23:06
Wohnort: Irgendwo im I-Net
Kontaktdaten:

Re: Reset overall traffic

Beitrag von oxpus »

Okay, the link to the modcp is now fixed, too.
The new mod package is now up-to-date.
Karsten Ude
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Pico
Beiträge: 26
Registriert: Do 30. Dez 2010, 11:53

Re: Some bugs - Reset overall traffic, MCP etc.

Beitrag von Pico »

In statistics in ACP. When you set up filtering with a special character, nothing happens. The special character is changed to "??".
Benutzeravatar
oxpus
Chief handy-man
Beiträge: 2719
Registriert: Do 13. Dez 2007, 23:06
Wohnort: Irgendwo im I-Net
Kontaktdaten:

Re: Some bugs - Reset overall traffic, MCP etc.

Beitrag von oxpus »

Some characters are special chars for the database so the result may malfunction using them.
Sorry, but this is a difficult point there I've no solution at the moment for.
Karsten Ude
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Pico
Beiträge: 26
Registriert: Do 30. Dez 2010, 11:53

Re: Some bugs - Reset overall traffic, MCP etc.

Beitrag von Pico »

Well... Is it possible to change its work as search for file? That may be a solution. You will only tick the fields where you want to search :)
Antworten