Можете в 42-й строке вместо
SetScriptTimeOut(20000);
указать таймаут в 30000 (30 секунд). Или выполнить скрипт повторно.
Чат со мной
SetScriptTimeOut(20000);
// CheckEmptyUsersFields service script
//------------------------------------------------------------------------------------
// If you have users with empty fields, you can export full list of them to a CSV file
// and analyze it in Excel.
// -----------------------------------------------------------------------------------
// ver 1.0 / 19 Feb 2016, (c) Alexey Pikurov, [email protected]
// help (russian) - https://www.nsoft-s.com/forum/viewtopic.php?f=1&t=4129
//------------------------------------------------------------------------------------
const
EXPORT_FILE_NAME = 'c:\users_report.csv';
CHECK_WHAT = '<COMMON>,<WORK>,<HOME>';
//CHECK_WHAT = '<MY>';
//MY_SET = 'FotoCRC32';
COMMON_FIELDS_MIN_SET = 'FirstName;MiddleName;LastName;Birthday;Sex;FotoCRC32;';
WORK_FIELDS_SET = 'Email;WorkPosition;WorkCompanyName;WorkOffice;WorkPhone;WorkFax;' +
'WorkPager;WorkStreetAddress;WorkCity;WorkState;WorkZIP;WorkCountry;WorkWWW;';
HOME_FIELDS_SET = 'MaritalStatus;HomePhone;HomeFax;HomeCellular;HomeStreetAddress;HomeCity;HomeState;HomeZIP;HomeCountry;HomeWWW;';
function CheckDate(dt: double): boolean;
var
iYears: integer;
begin
iYears := YearsBetween(Now, dt);
if (iYears > 100) or (iYears < 16) then result := false
else result := true;
end;
var
sUsersList, sJSON, sOut, sUserData, sTitle,
sNick, sFirstName, sMiddleName, sLastName, sBirthday, sSex, sFoto,
sEmail, sWorkPosition, sWorkCompanyName, sWorkOffice, sWorkPhone, sWorkFax,
sWorkPager, sWorkStreetAddress, sWorkCity, sWorkState, sWorkZIP, sWorkWWW,
sWorkCountry, sMaritalStatus, sHomePhone, sHomeFax, sHomeCellular,
sHomeStreetAddress, sHomeCity, sHomeState, sHomeZIP, sHomeCountry, sHomeWWW: string;
iMaritalStatus, iHomeCountry, iUIN, iSex, iFotoCRC32, iWorkCountry: integer;
dtBirthday: double;
bFlag: boolean;
begin
SetScriptTimeOut(40000);
sUsersList := mGetUINSListByRole(-1);
DeleteFile(EXPORT_FILE_NAME);
sOut := '';
sTitle := 'UIN;Nick;';
if pos('<COMMON>', CHECK_WHAT) <> 0 then sTitle := sTitle + COMMON_FIELDS_MIN_SET;
if pos('<WORK>', CHECK_WHAT) <> 0 then sTitle := sTitle + WORK_FIELDS_SET;
if pos('<HOME>', CHECK_WHAT) <> 0 then sTitle := sTitle + HOME_FIELDS_SET;
//if pos('<MY>', CHECK_WHAT) <> 0 then sTitle := sTitle + MY_SET;
AddLineToFile(sTitle, EXPORT_FILE_NAME);
while length(sUsersList) > 0 do begin
bFlag := false;
iUIN := StrToInt(GetNextSt(sUsersList, ','));
sJSON := mGetUserDataAsJSON(iUIN, 'Nick;' + COMMON_FIELDS_MIN_SET + WORK_FIELDS_SET + HOME_FIELDS_SET);
AddLineToFile(sJSON, 'c:\temp\' + inttostr(iUIN) + '.txt');
JSONGetString(sJSON, 'Nick', sNick);
sUserData := inttostr(iUIN) + ';' +
DecorateStForCSV(sNick) + ';';
// COMMON -----------------------------------------------------------------------------------------
if pos('<COMMON>', CHECK_WHAT) <> 0 then begin
JSONGetString(sJSON, 'FirstName', sFirstName);
JSONGetString(sJSON, 'MiddleName', sMiddleName);
JSONGetString(sJSON, 'LastName', sLastName);
JSONGetDateTime(sJSON, 'Birthday', dtBirthday);
if CheckDate(dtBirthday) then sBirthday := FormatDateTime('dd.mm.yyyy', dtBirthday)
else sBirthday := '';
JSONGetInteger(sJSON, 'Sex', iSex);
case iSex of
0: sSex := '';
1: sSex := 'male';
2: sSex := 'female';
end;
JSONGetInteger(sJSON, 'FotoCRC32', iFotoCRC32);
if iFotoCRC32 = 0 then sFoto := '' else sFoto := 'yes';
if (length(sFirstName) = 0) or (length(sMiddleName) = 0) or (length(sLastName) = 0) or
(length(sBirthday) = 0) or (length(sSex) = 0) or (length(sFoto) = 0) then bFlag := true;
sUserData := sUserData +
DecorateStForCSV(sFirstName) + ';' +
DecorateStForCSV(sMiddleName) + ';' +
DecorateStForCSV(sLastName) + ';' +
DecorateStForCSV(sBirthday) + ';' +
sSex + ';' +
sFoto + ';';
end;
// WORK --------------------------------------------------------------------------------------------
if pos('<WORK>', CHECK_WHAT) <> 0 then begin
JSONGetString(sJSON, 'Email', sEmail);
JSONGetString(sJSON, 'WorkPosition', sWorkPosition);
JSONGetString(sJSON, 'WorkCompanyName', sWorkCompanyName);
JSONGetString(sJSON, 'WorkOffice', sWorkOffice);
JSONGetString(sJSON, 'WorkPhone', sWorkPhone);
JSONGetString(sJSON, 'WorkFax', sWorkFax);
JSONGetString(sJSON, 'WorkPager', sWorkPager);
JSONGetString(sJSON, 'WorkStreetAddress', sWorkStreetAddress);
JSONGetString(sJSON, 'WorkCity', sWorkCity);
JSONGetString(sJSON, 'WorkState', sWorkState);
JSONGetString(sJSON, 'WorkZIP', sWorkZIP);
JSONGetInteger(sJSON, 'WorkCountry', iWorkCountry);
if iWorkCountry = 0 then sWorkCountry := ''
else sWorkCountry := 'yes';
JSONGetString(sJSON, 'WorkWWW', sWorkWWW);
if (length(sEmail) = 0) or (length(sWorkPosition) = 0) or (length(sWorkCompanyName) = 0) or
(length(sWorkOffice) = 0) or (length(sWorkPhone) = 0) or (length(sWorkFax) = 0) or
(length(sWorkPager) = 0) or (length(sWorkStreetAddress) = 0) or (length(sWorkCity) = 0) or
(length(sWorkState) = 0) or (length(sWorkZIP) = 0) or (length(sWorkCountry) = 0) then bFlag := true;
sUserData := sUserData +
DecorateStForCSV(sEmail) + ';' +
DecorateStForCSV(sWorkPosition) + ';' +
DecorateStForCSV(sWorkCompanyName) + ';' +
DecorateStForCSV(sWorkOffice) + ';' +
DecorateStForCSV(sWorkPhone) + ';' +
DecorateStForCSV(sWorkFax) + ';' +
DecorateStForCSV(sWorkPager) + ';' +
DecorateStForCSV(sWorkStreetAddress) + ';' +
DecorateStForCSV(sWorkCity) + ';' +
DecorateStForCSV(sWorkState) + ';' +
DecorateStForCSV(sWorkZIP) + ';' +
DecorateStForCSV(sWorkCountry) + ';' +
DecorateStForCSV(sWorkWWW) + ';';
end;
// HOME -------------------------------------------------------------------------------------------
if pos('<HOME>', CHECK_WHAT) <> 0 then begin
JSONGetInteger(sJSON, 'MaritalStatus', iMaritalStatus);
if iMaritalStatus = -1 then sMaritalStatus := '' else sMaritalStatus := 'yes';
JSONGetString(sJSON, 'HomePhone', sHomePhone);
JSONGetString(sJSON, 'HomeFax', sHomeFax);
JSONGetString(sJSON, 'HomeCellular', sHomeCellular);
JSONGetString(sJSON, 'HomeStreetAddress', sHomeStreetAddress);
JSONGetString(sJSON, 'HomeCity', sHomeCity);
JSONGetString(sJSON, 'HomeState', sHomeState);
JSONGetString(sJSON, 'HomeZIP', sHomeZIP);
JSONGetInteger(sJSON, 'HomeCountry', iHomeCountry);
if iHomeCountry = -1 then sHomeCountry := '' else sHomeCountry := 'yes';
JSONGetString(sJSON, 'HomeWWW', sHomeWWW);
if (length(sMaritalStatus) = 0) or (length(sHomePhone) = 0) or (length(sHomeFax) = 0) or
(length(sHomeCellular) = 0) or (length(sHomeStreetAddress) = 0) or (length(sHomeCity) = 0) or
(length(sHomeState) = 0) or (length(sHomeZIP) = 0) or (length(sHomeCountry) = 0) then bFlag := true;
sUserData := sUserData +
DecorateStForCSV(sMaritalStatus) + ';' +
DecorateStForCSV(sHomePhone) + ';' +
DecorateStForCSV(sHomeFax) + ';' +
DecorateStForCSV(sHomeCellular) + ';' +
DecorateStForCSV(sHomeStreetAddress) + ';' +
DecorateStForCSV(sHomeCity) + ';' +
DecorateStForCSV(sHomeState) + ';' +
DecorateStForCSV(sHomeZIP) + ';' +
DecorateStForCSV(sHomeCountry) + ';';
end;
// -------------------------------------------------------------------------------------------------
if bFlag then sOut := sOut + sUserData + #13#10;
end;
AddLineToFile(sOut, EXPORT_FILE_NAME);
end.
// CheckEmptyUsersFields service script
//------------------------------------------------------------------------------------
// If you have users with empty fields, you can export full list of them to a CSV file
// and analyze it in Excel.
// -----------------------------------------------------------------------------------
// ver 1.1 / 4 Feb 2020, (c) Alexey Pikurov, [email protected]
// help (russian) - https://www.nsoft-s.com/forum/viewtopic.php?f=1&t=4129
//------------------------------------------------------------------------------------
const
EXPORT_FILE_NAME = 'c:\temp\users_report.csv';
CHECK_WHAT = '<COMMON>,<WORK>,<HOME>';
COMMON_FIELDS_MIN_SET = 'FirstName;MiddleName;LastName;Birthday;Sex;FotoCRC32;';
WORK_FIELDS_SET = 'Email;WorkPosition;WorkCompanyName;WorkOffice;WorkPhone;WorkFax;' +
'WorkPager;WorkStreetAddress;WorkCity;WorkState;WorkZIP;WorkCountry;WorkWWW;';
HOME_FIELDS_SET = 'MaritalStatus;HomePhone;HomeFax;HomeCellular;HomeStreetAddress;HomeCity;HomeState;HomeZIP;HomeCountry;HomeWWW;';
function CheckDate(dt: double): boolean;
var
iYears: integer;
begin
iYears := YearsBetween(Now, dt);
if (iYears > 100) or (iYears < 16) then result := false
else result := true;
end;
var
sUsersList, sJSON, sOut, sUserData, sTitle,
sNick, sFirstName, sMiddleName, sLastName, sBirthday, sSex, sFoto,
sEmail, sWorkPosition, sWorkCompanyName, sWorkOffice, sWorkPhone, sWorkFax,
sWorkPager, sWorkStreetAddress, sWorkCity, sWorkState, sWorkZIP, sWorkWWW,
sWorkCountry, sMaritalStatus, sHomePhone, sHomeFax, sHomeCellular,
sHomeStreetAddress, sHomeCity, sHomeState, sHomeZIP, sHomeCountry, sHomeWWW: string;
iMaritalStatus, iHomeCountry, iUIN, iSex, iFotoCRC32, iWorkCountry: integer;
dtBirthday: double;
bFlag: boolean;
iCount: integer;
begin
SetScriptTimeOut(120000);
sUsersList := mGetUINSListByRole(-1);
DeleteFile(EXPORT_FILE_NAME);
sOut := '';
sTitle := 'UIN;Nick;';
if pos('<COMMON>', CHECK_WHAT) <> 0 then sTitle := sTitle + COMMON_FIELDS_MIN_SET;
if pos('<WORK>', CHECK_WHAT) <> 0 then sTitle := sTitle + WORK_FIELDS_SET;
if pos('<HOME>', CHECK_WHAT) <> 0 then sTitle := sTitle + HOME_FIELDS_SET;
AddLineToFile(sTitle, EXPORT_FILE_NAME, 1);
iCount := 0;
while length(sUsersList) > 0 do begin
bFlag := false;
iUIN := StrToInt(GetNextSt(sUsersList, ','));
sJSON := mGetUserDataAsJSON(iUIN, 'Nick;' + COMMON_FIELDS_MIN_SET + WORK_FIELDS_SET + HOME_FIELDS_SET);
JSONGetString(sJSON, 'Nick', sNick);
sUserData := inttostr(iUIN) + ';' +
DecorateStForCSV(sNick) + ';';
// COMMON -----------------------------------------------------------------------------------------
if pos('<COMMON>', CHECK_WHAT) <> 0 then begin
JSONGetString(sJSON, 'FirstName', sFirstName);
JSONGetString(sJSON, 'MiddleName', sMiddleName);
JSONGetString(sJSON, 'LastName', sLastName);
JSONGetDateTime(sJSON, 'Birthday', dtBirthday);
if CheckDate(dtBirthday) then sBirthday := FormatDateTime('dd.mm.yyyy', dtBirthday)
else sBirthday := '';
JSONGetInteger(sJSON, 'Sex', iSex);
case iSex of
0: sSex := '';
1: sSex := 'male';
2: sSex := 'female';
end;
JSONGetInteger(sJSON, 'FotoCRC32', iFotoCRC32);
if iFotoCRC32 = 0 then sFoto := '' else sFoto := 'yes';
if (length(sFirstName) = 0) or (length(sMiddleName) = 0) or (length(sLastName) = 0) or
(length(sBirthday) = 0) or (length(sSex) = 0) or (length(sFoto) = 0) then bFlag := true;
sUserData := sUserData +
DecorateStForCSV(sFirstName) + ';' +
DecorateStForCSV(sMiddleName) + ';' +
DecorateStForCSV(sLastName) + ';' +
DecorateStForCSV(sBirthday) + ';' +
sSex + ';' +
sFoto + ';';
end;
// WORK --------------------------------------------------------------------------------------------
if pos('<WORK>', CHECK_WHAT) <> 0 then begin
JSONGetString(sJSON, 'Email', sEmail);
JSONGetString(sJSON, 'WorkPosition', sWorkPosition);
JSONGetString(sJSON, 'WorkCompanyName', sWorkCompanyName);
JSONGetString(sJSON, 'WorkOffice', sWorkOffice);
JSONGetString(sJSON, 'WorkPhone', sWorkPhone);
JSONGetString(sJSON, 'WorkFax', sWorkFax);
JSONGetString(sJSON, 'WorkPager', sWorkPager);
JSONGetString(sJSON, 'WorkStreetAddress', sWorkStreetAddress);
JSONGetString(sJSON, 'WorkCity', sWorkCity);
JSONGetString(sJSON, 'WorkState', sWorkState);
JSONGetString(sJSON, 'WorkZIP', sWorkZIP);
JSONGetInteger(sJSON, 'WorkCountry', iWorkCountry);
if iWorkCountry = 0 then sWorkCountry := ''
else sWorkCountry := 'yes';
JSONGetString(sJSON, 'WorkWWW', sWorkWWW);
if (length(sEmail) = 0) or (length(sWorkPosition) = 0) or (length(sWorkCompanyName) = 0) or
(length(sWorkOffice) = 0) or (length(sWorkPhone) = 0) or (length(sWorkFax) = 0) or
(length(sWorkPager) = 0) or (length(sWorkStreetAddress) = 0) or (length(sWorkCity) = 0) or
(length(sWorkState) = 0) or (length(sWorkZIP) = 0) or (length(sWorkCountry) = 0) then bFlag := true;
sUserData := sUserData +
DecorateStForCSV(sEmail) + ';' +
DecorateStForCSV(sWorkPosition) + ';' +
DecorateStForCSV(sWorkCompanyName) + ';' +
DecorateStForCSV(sWorkOffice) + ';' +
DecorateStForCSV(sWorkPhone) + ';' +
DecorateStForCSV(sWorkFax) + ';' +
DecorateStForCSV(sWorkPager) + ';' +
DecorateStForCSV(sWorkStreetAddress) + ';' +
DecorateStForCSV(sWorkCity) + ';' +
DecorateStForCSV(sWorkState) + ';' +
DecorateStForCSV(sWorkZIP) + ';' +
DecorateStForCSV(sWorkCountry) + ';' +
DecorateStForCSV(sWorkWWW) + ';';
end;
// HOME -------------------------------------------------------------------------------------------
if pos('<HOME>', CHECK_WHAT) <> 0 then begin
JSONGetInteger(sJSON, 'MaritalStatus', iMaritalStatus);
if iMaritalStatus = -1 then sMaritalStatus := '' else sMaritalStatus := 'yes';
JSONGetString(sJSON, 'HomePhone', sHomePhone);
JSONGetString(sJSON, 'HomeFax', sHomeFax);
JSONGetString(sJSON, 'HomeCellular', sHomeCellular);
JSONGetString(sJSON, 'HomeStreetAddress', sHomeStreetAddress);
JSONGetString(sJSON, 'HomeCity', sHomeCity);
JSONGetString(sJSON, 'HomeState', sHomeState);
JSONGetString(sJSON, 'HomeZIP', sHomeZIP);
JSONGetInteger(sJSON, 'HomeCountry', iHomeCountry);
if iHomeCountry = -1 then sHomeCountry := '' else sHomeCountry := 'yes';
JSONGetString(sJSON, 'HomeWWW', sHomeWWW);
if (length(sMaritalStatus) = 0) or (length(sHomePhone) = 0) or (length(sHomeFax) = 0) or
(length(sHomeCellular) = 0) or (length(sHomeStreetAddress) = 0) or (length(sHomeCity) = 0) or
(length(sHomeState) = 0) or (length(sHomeZIP) = 0) or (length(sHomeCountry) = 0) then bFlag := true;
sUserData := sUserData +
DecorateStForCSV(sMaritalStatus) + ';' +
DecorateStForCSV(sHomePhone) + ';' +
DecorateStForCSV(sHomeFax) + ';' +
DecorateStForCSV(sHomeCellular) + ';' +
DecorateStForCSV(sHomeStreetAddress) + ';' +
DecorateStForCSV(sHomeCity) + ';' +
DecorateStForCSV(sHomeState) + ';' +
DecorateStForCSV(sHomeZIP) + ';' +
DecorateStForCSV(sHomeCountry) + ';';
end;
// -------------------------------------------------------------------------------------------------
if bFlag then begin
sOut := sOut + sUserData + #13#10;
inc(iCount);
if (iCount mod 500) = 0 then begin
AddLineToFile(sOut, EXPORT_FILE_NAME, 1);
sOut := '';
end;
end;
end;
if length(sOut) > 0 then AddLineToFile(sOut, EXPORT_FILE_NAME, 1);
end.
После обновления проблема устранена
Пример скрипта для ограничения отправки сообщений[…]
Здравствуйте. Обновим справку и я дам вам ссылку в[…]
Рендеринг реакций в админке ещё не сделан. Также[…]
MyChat Client [-] (18.12.2024) (win32) конс[…]
Вроде получилось исправить. Отправил вам письмо с […]
Пора подумать про коммерческую версию, значит :)
Только что заметил, что у меня тоже история сообще[…]
Было бы неплохо еще создать настройку о мьюте на р[…]
Fixed. Обновитесь, пожалуйста .
Спасибо! Обновлюсь и подожду повтора ошибки