3.5
INSERT INTO Class SET Class_Name = 'Голосования: Опросы', Class_Group = 'stelmas.ru', DaysToHold = '0', AllowTags = '0', FormPrefix = '', FormSuffix = '".opt($nextLink || $prevLink, "
страницы: ".browse_messages($cc_env, 10)."
")."', RecordTemplate = '$f_AdminButtons";\nif($cc_settings[\'PollStyle\']=="open") {\n \n if(!poll_alreadyAnswered($classID, $f_RowID, $f_ProtectIP, $f_ProtectUsers) && $f_Active && !$admin_mode) {\n \n if($f_MultyAnswer) $InputType="checkbox"; else $InputType="radio";\n \n $result.="\n
";\n \n }\n else {\n\n if(!$f_Active) $ActiveText=" (закрыт)"; else $ActiveText="";\n $result.="\n Голосование
\n $f_Question
$ActiveText
";\n\n //вывод списка ответов\n $icounter=1; while($icounter<11) {\n $tAnswer="f_Answer$icounter";\n $tCount="f_Count$icounter";\n if($$tAnswer) {\n $result.=$$tAnswer.poll_percentLine($classID, $f_RowID, $$tCount, 100, " (%PERCENT%)
")."
";\n }\n ++$icounter;\n }\n\n $result.="\n ".opt($f_Answer11,"Другой".poll_percentLine($classID, $f_RowID, $f_Count11, 100, " (%PERCENT%)
")."
".opt($admin_mode, "$f_AltAnswer
")."
")."\n Проголосовало: $f_TotalCount
";\n $result.= "
";\n \n if($f_Active && $f_ProtectUsers==1 && !Authorize()) $result.="
* Для голосования необходимо авторизоваться
Архив опросов
";\n }\n}\nelse {\n if(!$f_Active) $ActiveText=" (закрыт)"; else $ActiveText="";\n $result.="• $f_Question$ActiveText
";\n}\n$result.="', RecordsPerPage = '20', SortBy = '', RecordTemplateFull = '";\nif($f_RowID) {\n\n if(!poll_alreadyAnswered($classID, $f_RowID, $f_ProtectIP, $f_ProtectUsers) && $f_Active) {\n \n if($f_MultyAnswer) $InputType="checkbox"; else $InputType="radio";\n \n $result.="\n
";\n \n }\n else {\n\n if(!$f_Active) $ActiveText=" (закрыт)"; else $ActiveText="";\n $result.="$f_Question$ActiveText
";\n\n //вывод списка ответов\n $icounter=0; while($icounter<11) {\n $tAnswer="f_Answer$icounter";\n $tCount="f_Count$icounter";\n if($$tAnswer) { \n $result.=$$tAnswer.poll_percentLine($$tCount, $f_TotalCount, $MaxCountValue, 100, "(%PERCENT%)
")."
";\n }\n ++$icounter;\n }\n\n $result.="\n Другой
".poll_alternativeAnswer($classID, $f_RowID)."\n Проголосовало: $f_TotalCount
";\n $result.= "
";\n \n if($f_Active && $f_ProtectUsers==1 && !Authorize()) $result.="
* Для голосования необходимо авторизоваться
Архив опросов
";\n }\n}\n$result.="вернуться к опросам
";\n$result.= "$f_AdminButtons\n$result', TitleTemplate = '$f_Question', AddTemplate = '', EditTemplate = '', AddActionTemplate = '', EditActionTemplate = '', SearchTemplate = '', FullSearchTemplate = '', SubscribeTemplate = '', Settings = '$query_select="GREATEST(a.Count1,a.Count2,a.Count3,a.Count4,a.Count5,a.Count6,a.Count7,a.Count8,a.Count9,a.Count10,a.Count11)";\n$result_vars="\\$MaxCountValue";', AddCond = '', EditCond = '', DeleteTemplate = '', DeleteCond = '', SubscribeCond = '', NL2BR = '0', CheckActionTemplate = '', DeleteActionTemplate = '', CustomSettingsTemplate = '$settings_array = array(\n "PollStyle" => array("type" => "select",\n "default_value" => "open",\n "caption" => "Вывод опросов",\n "validate_regexp" => "",\n "validate_error" => "",\n "values" => array("open" => "раскрывать опросы", "close" => "выводить ссылки на опросы"),\n )\n);';
CREATE TABLE Message%INSERT_ID% (Message_ID int(11) NOT NULL auto_increment,User_ID int(11) NOT NULL default '0',Subdivision_ID int(11) NOT NULL default '0',Sub_Class_ID int(11) NOT NULL default '0',Priority int(11) NOT NULL default '0',Checked tinyint(4) NOT NULL default '1',TimeToDelete date default NULL,TimeToUncheck date default NULL,IP varchar(15) default NULL,UserAgent varchar(255) default NULL,Parent_Message_ID int(11) NOT NULL default '0',Created datetime NOT NULL default '0000-00-00 00:00:00',LastUpdated timestamp(14) NOT NULL,LastUser_ID int(11) NOT NULL default '0',LastIP varchar(15) default NULL,LastUserAgent varchar(255) default NULL,Keyword varchar(255) NOT NULL default '',Question text NOT NULL,Answer1 char(255) NOT NULL,Answer2 char(255) NOT NULL,Answer3 char(255) NULL,Answer4 char(255) NULL,Answer5 char(255) NULL,Answer6 char(255) NULL,Answer7 char(255) NULL,Answer8 char(255) NULL,Answer9 char(255) NULL,Answer10 char(255) NULL,Count1 int NOT NULL DEFAULT '0',Count2 int NOT NULL DEFAULT '0',Count3 int NOT NULL DEFAULT '0',Count4 int NOT NULL DEFAULT '0',Count5 int NOT NULL DEFAULT '0',Count6 int NOT NULL DEFAULT '0',Count7 int NOT NULL DEFAULT '0',Count8 int NOT NULL DEFAULT '0',Count9 int NOT NULL DEFAULT '0',Count10 int NOT NULL DEFAULT '0',MultyAnswer tinyint NOT NULL,SubmitValue char(255) NULL,Active tinyint NOT NULL,Answer11 tinyint NOT NULL,Count11 int NOT NULL DEFAULT '0',AltAnswer text NULL,ProtectIP tinyint NOT NULL,ProtectUsers tinyint NOT NULL,TotalCount int NOT NULL DEFAULT '0', PRIMARY KEY (Message_ID),UNIQUE KEY Sub_Class_ID_2 (Sub_Class_ID,Message_ID,Keyword),KEY User_ID (User_ID),KEY LastUser_ID (LastUser_ID),/*KEY Sub_Class_ID (Sub_Class_ID),*/ KEY Subdivision_ID (Subdivision_ID),KEY Parent_Message_ID (Parent_Message_ID)) TYPE=MyISAM;
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Question', 'Вопрос', 3, '3:60', 1, 1, 0, '', 1);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Answer1', 'Вариант ответа 1', 1, '', 1, 2, 0, '', 1);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Answer2', 'Вариант ответа 2', 1, '', 1, 3, 0, '', 1);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Answer3', 'Вариант ответа 3', 1, '', 0, 4, 0, '', 1);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Answer4', 'Вариант ответа 4', 1, '', 0, 5, 0, '', 1);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Answer5', 'Вариант ответа 5', 1, '', 0, 6, 0, '', 1);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Answer6', 'Вариант ответа 6', 1, '', 0, 7, 0, '', 1);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Answer7', 'Вариант ответа 7', 1, '', 0, 8, 0, '', 1);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Answer8', 'Вариант ответа 8', 1, '', 0, 9, 0, '', 1);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Answer9', 'Вариант ответа 9', 1, '', 0, 10, 0, '', 1);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Answer10', 'Вариант ответа 10', 1, '', 0, 11, 0, '', 1);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Count1', 'Количество голосов за 1', 2, '', 0, 21, 0, '0', 3);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Count2', 'Количество голосов за 2', 2, '', 0, 22, 0, '0', 3);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Count3', 'Количество голосов за 3', 2, '', 0, 23, 0, '0', 3);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Count4', 'Количество голосов за 4', 2, '', 0, 24, 0, '0', 3);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Count5', 'Количество голосов за 5', 2, '', 0, 25, 0, '0', 3);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Count6', 'Количество голосов за 6', 2, '', 0, 26, 0, '0', 3);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Count7', 'Количество голосов за 7', 2, '', 0, 27, 0, '0', 3);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Count8', 'Количество голосов за 8', 2, '', 0, 28, 0, '0', 3);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Count9', 'Количество голосов за 9', 2, '', 0, 29, 0, '0', 3);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Count10', 'Количество голосов за 10', 2, '', 0, 30, 0, '0', 3);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'MultyAnswer', 'Можно выбирать несколько пунктов', 5, '', 1, 31, 0, '', 1);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'SubmitValue', 'Альтернативное значение кнопки', 1, '', 0, 32, 0, '', 1);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Active', 'Активно ли голосование', 5, '', 1, 2, 0, '', 1);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Answer11', 'Альтернативные варианты опроса', 5, '', 1, 13, 0, '', 1);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'Count11', 'Количество голосов за 11', 2, '', 0, 31, 0, '0', 3);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'AltAnswer', 'Список альтернативных ответов', 3, '6:60;html:0;br:1;fck:0;', 0, 34, 0, '', 3);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'ProtectIP', 'Один голос с одного IP', 5, '', 1, 37, 0, '', 1);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'ProtectUsers', 'Голосуют зарег. пользователи', 5, '', 1, 38, 0, '', 1);
INSERT INTO Field (Class_ID, Field_Name, Description, TypeOfData_ID, Format, NotNull, Priority, DoSearch, DefaultState, TypeOfEdit_ID) VALUES (%INSERT_ID%,'TotalCount', 'Кол-во проголосовавших', 2, '', 0, 39, 0, '0', 2);