// получаем результат в случае ошибки $data['password'] = $vreg_password; $data['comusers_nik'] = $vreg_nik; $data['comusers_url'] = $vreg_url; $data['email'] = $vreg_email; if (isset($post['freg_redirect_url'])) { $data['redirect'] = $post['freg_redirect_url']; } else { $data['redirect'] = getinfo('siteurl') . 'registration'; } // функция сама средиректит куда нужно // из-за этого форма ниже не будет отображена в случае успеха $res = mso_comuser_auth($data); // если ошибка, то выводим сообщение echo '<div class="mso-message-alert">' . $res . '</div>'; } } // форма регистрации $action = getinfo('siteurl') . 'registration'; if ($rules = mso_get_option('rules_site', 'general', '')) { $rules = ' (<a href="' . $rules . '" target="_blank">' . tf('Правила сайта') . '</a>)'; } else { $rules = ''; } eval(mso_tmpl_ts('type/registration/units/registration-tmpl.php')); } echo NR . '</div><!-- class="mso-type-loginform" -->' . NR; if ($fn = mso_find_ts_file('main/main-end.php')) { require $fn; } # end file
} eval(mso_tmpl_ts('type/loginform/units/loginform-user-tmpl.php')); } elseif ($comuser = is_login_comuser()) { if (mso_segment(2) == 'error') { mso_redirect('loginform'); } if (!$comuser['comusers_nik']) { $hello = t('Привет!'); } else { $hello = t('Привет,') . ' ' . $comuser['comusers_nik'] . '!'; } eval(mso_tmpl_ts('type/loginform/units/loginform-comuser-tmpl.php')); } else { $redirect_url = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : getinfo('siteurl'); if (mso_segment(2) == 'error') { eval(mso_tmpl_ts('type/loginform/units/loginform-error.php')); } // если разрешена регистрация, то выведем ссылку if (mso_get_option('allow_comment_comusers', 'general', '1')) { $reg = '<a href="' . getinfo('siteurl') . 'registration">' . tf('Регистрация') . '</a> | '; } else { $reg = ''; } $login_form = mso_login_form(array('login' => tf('Логин'), 'password' => tf('Пароль'), 'submit' => '', 'submit_value' => tf('Войти'), 'form_end' => '<div class="mso-loginform-end">' . $reg . '<a href="' . getinfo('siteurl') . 'password-recovery">' . tf('Забыли пароль?') . '</a> | ' . '<a href="' . getinfo('siteurl') . '">' . tf('Вернуться к сайту') . '</a></div>'), $redirect_url, false); eval(mso_tmpl_ts('type/loginform/units/loginform-tmpl.php')); } echo NR . '</div><!-- class="mso-type-loginform" -->' . NR; if ($fn = mso_find_ts_file('main/main-end.php')) { require $fn; } # end file
if (!$comusers_date_birth or $comusers_date_birth == '1970-01-01 00:00:00' or $comusers_date_birth == '0000-00-00 00:00:00') { $comusers_date_birth = ''; } if (getinfo('comusers_id') == $comusers_id) { $edit_link = getinfo('siteurl') . 'users/' . $comusers_id . '/edit'; } else { $edit_link = ''; } eval(mso_tmpl_ts('type/users/units/users-tmpl.php')); // хук, по которому можно вывести дополнительные данные mso_hook('users_add_out', $comuser_info[0]); if ($f = mso_page_foreach('users-add')) { require $f; } if ($comments) { eval(mso_tmpl_ts('type/users/units/users-comments-tmpl.php')); } } // mso_page_foreach if ($f = mso_page_foreach('users-posle')) { require $f; } } else { if ($f = mso_page_foreach('pages-not-found')) { require $f; } else { echo '<h1>' . tf('404. Ничего не найдено...') . '</h1>'; echo '<p>' . tf('Извините, пользователь с указанным номером не найден.') . '</p>'; echo mso_hook('page_404'); } }
$out .= ' <...> ' . implode(' ', $a); } $page_content = $out; $cou = count($all_key) + substr_count(mb_strtolower($page_title, 'UTF8'), $searh_to_text); // кол-во совпадений echo '<p><em>' . tf('Совпадений') . ': ' . $cou . '</em></p>'; echo '<p>' . $page_content . '</p>'; echo '</li>'; } // end foreach echo '</ul>'; mso_hook('pagination', $pagination); } if ($pages or $categories or $tags) { echo '</div></div></div>'; } if (!$pages and !$categories and !$tags) { if ($f = mso_page_foreach('pages-not-found')) { require $f; // подключаем кастомный вывод } else { eval(mso_tmpl_ts('type/search/units/form-tmpl.php')); } } // endif $pages echo NR . '</div><!-- class="mso-type-search" -->' . NR; # конечная часть шаблона if ($fn = mso_find_ts_file('main/main-end.php')) { require $fn; } # end file
function mso_login_form($conf = array(), $redirect = '', $echo = true) { global $MSO; if ($redirect == '') { $redirect = urlencode(mso_current_url()); } $login = isset($conf['login']) ? $conf['login'] : ''; $password = isset($conf['password']) ? $conf['password'] : ''; $submit = isset($conf['submit']) ? $conf['submit'] : ''; $submit_value = isset($conf['submit_value']) ? $conf['submit_value'] : tf('Войти'); $submit_end = isset($conf['submit_end']) ? $conf['submit_end'] : ''; $form_end = isset($conf['form_end']) ? $conf['form_end'] : ''; $login_add = isset($conf['login_add']) ? $conf['login_add'] : ''; $password_add = isset($conf['password_add']) ? $conf['password_add'] : ''; $login_form_auth_title = isset($conf['login_form_auth_title']) ? $conf['login_form_auth_title'] : tf('Вход через:') . ' '; $action = $MSO->config['site_url'] . 'login'; $session_id = $MSO->data['session']['session_id']; $hook_login_form_auth = mso_hook_present('login_form_auth') ? '<span class="login-form-auth-title">' . $login_form_auth_title . '</span>' . mso_hook('login_form_auth') : ''; if ($hook_login_form_auth) { $hook_login_form_auth = trim(str_replace('[end]', ' ', $hook_login_form_auth)); $hook_login_form_auth = '<div class="login-form-auth">' . str_replace(' ', ', ', $hook_login_form_auth) . '</div>'; } if ($echo) { eval(mso_tmpl_ts('type/loginform/units/loginform-common-tmpl.php')); } else { ob_start(); eval(mso_tmpl_ts('type/loginform/units/loginform-common-tmpl.php')); $out = ob_get_contents(); ob_end_clean(); return $out; } }
if ($comusers_activate_string != $comusers_activate_key) { $admin_email = mso_get_option('admin_email', 'general', '-'); eval(mso_tmpl_ts('type/users/units/users-lost-no-activate-tmpl.php')); } else { if ($login_form) { $login_redirect = getinfo('siteurl') . 'users/' . $comusers_id . '/edit'; $lost_link = getinfo('siteurl') . 'users/' . $comusers_id . '/lost'; eval(mso_tmpl_ts('type/users/units/users-loginform-tmpl.php')); } else { $comusers_description = NR . htmlspecialchars(strip_tags($comusers_description)); // чекбоксы $check_subscribe_my_comments = (isset($comusers_meta['subscribe_my_comments']) and $comusers_meta['subscribe_my_comments'] == '1') ? ' checked="checked"' : ''; $check_subscribe_other_comments = (isset($comusers_meta['subscribe_other_comments']) and $comusers_meta['subscribe_other_comments'] == '1') ? ' checked="checked"' : ''; $check_subscribe_new_pages = (isset($comusers_meta['subscribe_new_pages']) and $comusers_meta['subscribe_new_pages'] == '1') ? ' checked="checked"' : ''; $check_subscribe_admin = (isset($comusers_meta['subscribe_admin']) and $comusers_meta['subscribe_admin'] == '1') ? ' checked="checked"' : ''; eval(mso_tmpl_ts('type/users/units/users-form-edit-tmpl.php')); } } } // mso_page_foreach } else { if ($f = mso_page_foreach('pages-not-found')) { require $f; } else { echo '<h1>' . tf('404. Ничего не найдено...') . '</h1>'; echo '<p>' . tf('Извините, пользователь с указанным номером не найден.') . '</p>'; echo mso_hook('page_404'); } } echo NR . '</div><!-- class="mso-type-users-form" -->' . NR; # конечная часть шаблона
if ($f = mso_page_foreach('users-form-lost')) { require $f; } else { $session_id = mso_form_session('f_session_id'); if ($comusers_nik) { echo '<h1>' . $comusers_nik . '</h1>'; } else { echo '<h1>' . tf('Комментатор') . ' ' . $comusers_id . '</h1>'; } echo '<p><a href="' . getinfo('siteurl') . 'users/' . $comusers_id . '">' . tf('Персональная страница') . '</a></p>'; // если активация не завершена, то вначале требуем её завершить if ($comusers_activate_string != $comusers_activate_key) { $admin_email = mso_get_option('admin_email', 'general', '-'); eval(mso_tmpl_ts('type/users/units/users-lost-no-activate-tmpl.php')); } else { eval(mso_tmpl_ts('type/users/units/users-replace-password-tmpl.php')); } } // mso_page_foreach } else { if ($f = mso_page_foreach('pages-not-found')) { require $f; // подключаем кастомный вывод } else { echo '<h1>' . tf('404. Ничего не найдено...') . '</h1>'; echo '<p>' . tf('Извините, ничего не найдено') . '</p>'; echo mso_hook('page_404'); } } echo NR . '</div><!-- class="mso-type-users-form-lost" -->' . NR; if ($fn = mso_find_ts_file('main/main-end.php')) {
echo '</section>'; echo '</div>' . NR; } if ($f = mso_page_foreach('page-comments-posle-list')) { require $f; } if ($page['page_comment_allow'] and $page_text_ok) { // если запрещены комментарии и от анонимов и от комюзеров, то выходим if (mso_get_option('allow_comment_anonim', 'general', '1') or mso_get_option('allow_comment_comusers', 'general', '1')) { $to_login = tf('Вы можете <a href="#LOG#">войти</a> под своим логином или <a href="#REG#"> зарегистрироваться</a> на сайте.'); $to_login = str_replace('#LOG#', getinfo('site_url') . 'login', $to_login); $to_login = str_replace('#REG#', getinfo('site_url') . 'registration', $to_login); if (mso_get_option('new_comment_anonim_moderate', 'general', '1')) { $to_moderate = mso_get_option('form_comment_anonim_moderate', 'general', tf('Комментарий будет опубликован после проверки')); } else { $to_moderate = mso_get_option('form_comment_anonim', 'general', tf('Используйте нормальные имена')); } // если запрещены комментарии от анонимов и при этом нет залогиненности, то форму при простой форме не выводим if (!mso_get_option('allow_comment_anonim', 'general', '1') and !is_login() and !is_login_comuser() and mso_get_option('form_comment_easy', 'general', '0')) { if (mso_get_option('allow_comment_comusers', 'general', '1')) { eval(mso_tmpl_ts('type/page/units/page-comment-to-login-tmpl.php')); } } else { eval(mso_tmpl_ts('type/page/units/page-comment-form-tmpl.php')); } } } if ($comments or $page['page_comment_allow']) { echo NR . '</div><!-- /div.mso-type-page-comments -->' . NR; } # end file
if ($fn = mso_find_ts_file('main/main-start.php')) { require $fn; } echo NR . '<div class="mso-type-password-recovery"><div class="mso-page-only"><div class="mso-page-content mso-type-loginform-content">'; echo $res_post; if ($f = mso_page_foreach('password-recovery')) { require $f; // подключаем кастомный вывод } else { if (is_login()) { eval(mso_tmpl_ts('type/loginform/units/loginform-user-tmpl.php')); } elseif ($comuser = is_login_comuser()) { if (mso_segment(2) == 'error') { mso_redirect('loginform'); } if (!$comuser['comusers_nik']) { $hello = t('Привет!'); } else { $hello = t('Привет,') . ' ' . $comuser['comusers_nik'] . '!'; } eval(mso_tmpl_ts('type/loginform/units/loginform-comuser-tmpl.php')); } else { eval(mso_tmpl_ts('type/password-recovery/units/password-recovery-tmpl.php')); } } echo NR . '</div></div></div><!-- class="mso-type-password-recovery" -->' . NR; # конечная часть шаблона if ($fn = mso_find_ts_file('main/main-end.php')) { require $fn; } # end file