]> www.wagner.pp.ru Git - oss/stilllife.git/commitdiff
*** empty log message ***
authorVictor Wagner <vitus@wagner.pp.ru>
Mon, 24 Mar 2008 14:34:48 +0000 (14:34 +0000)
committerVictor Wagner <vitus@wagner.pp.ru>
Mon, 24 Mar 2008 14:34:48 +0000 (14:34 +0000)
templates/basicset/newforum.html [new file with mode: 0644]
templates/basicset/newtopic.html [new file with mode: 0644]
templates/basicset/page.js

diff --git a/templates/basicset/newforum.html b/templates/basicset/newforum.html
new file mode 100644 (file)
index 0000000..93d100e
--- /dev/null
@@ -0,0 +1,28 @@
+<HTML><HEAD>
+<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
+<TITLE>Still Life - Создать тему</TITLE>
+<script language="JavaScript" src="templates/form.js"></script>
+<script language="JavaScript" src="templates/common.js"></script>
+</HEAD><BODY bgcolor="#ccffcc">
+<H3>Тестовый форум Still Life</h3>
+<form method="POST"  type="multipart/form-data" action="forum" name="newtopic">
+<table border=0>
+<tr><td>Название</td><td><input type=text name="title" size=30>
+</td></tr>
+<tr><td>Имя в URL</td><td><input type=text name="urlname" size=30></td></tr>
+<tr><td>Аннотация</td><td><textarea name="abstract" rows=5 cols=50></textarea></td></tr>
+<tr><td>Формат</td><td><select name="abstract_format"><option
+name="text">Текст без разметки</option>
+<option name="bbcode">BBCode</option>
+<option name="html">Html</option>
+</select></td></tr>
+<tr><td>Картинка</td><td><input type="file" name="logo"></td></tr>
+<tr><td colspan=2  class="error"></td></tr>
+<tr><td colspan=2 align=right"><input type=submit name="newtopic"
+value="Создать">
+</table>
+
+</form>
+
+</BODY>
+</HTML>
diff --git a/templates/basicset/newtopic.html b/templates/basicset/newtopic.html
new file mode 100644 (file)
index 0000000..16946b1
--- /dev/null
@@ -0,0 +1,27 @@
+<HTML><HEAD>
+<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
+<TITLE>Still Life - Создать тему</TITLE>
+<script language="JavaScript" src="templates/form.js"></script>
+<script language="JavaScript" src="templates/common.js"></script>
+</HEAD><BODY bgcolor="#ccffcc">
+<H3>Тестовый форум Still Life</h3>
+<form method="POST"  type="multipart/form-data" action="forum" name="newtopic">
+<table border=0>
+<tr><td>Название</td><td><input type=text name="title" size=30>
+</td></tr>
+<tr><td>Имя в URL</td><td><input type=text name="urlname" size=30></td></tr>
+<tr><td>Аннотация</td><td><textarea name="abstract" rows=5 cols=50></textarea></td></tr>
+<tr><td>Формат</td><td><select name="abstract_format"><option
+name="text">Текст без разметки</option>
+<option name="bbcode">BBCode</option>
+<option name="html">Html</option>
+</select>
+<tr><td colspan=2  class="error"></td></tr>
+<tr><td colspan=2 align=right"><input type=submit name="newtopic"
+value="Создать">
+</table>
+
+</form>
+
+</BODY>
+</HTML>
index fd43ccdf0985ecb553117fbc46257b04792f5b42..9dc4c99cb65f85eae12400d4fb5232f57f769952 100644 (file)
@@ -1,6 +1,8 @@
 // Библиотека стандартных функций, используемых на страницах форума
 //
-// Извлекает из кук имя текущего пользователя и возвращает его 
+// Извлекает из кук имя текущего пользователя и возвращает его, а также
+// сохраняет в глобальной переменной forumUser;
+var forumUser;
 function getUserName() {
        var cookietext =document.cookie;
        var pos = cookietext.indexOf("sluser=");
@@ -11,9 +13,28 @@ function getUserName() {
        var end = cookietext.indexOf(";",start);
        if (end == -1) end=cookietext.length;
        var value= cookietext.substring(start,end);
+       forumUser = value;
        return unescape(value);
 }
+//
+// Шаблон страницы содержит два специальных тэга link с rel=forum-script
+// и rel=forum-user-list
+// Эта функция извлекает их в глобальные переменные forumScriptUrl
+// и userListUrl;
+var forumScriptUrl;
+var userListUrl;
+function getBaseURLs() {
+       var links=document.getElementsByTagName("link");
+       for (i=0;i<links.length;i++) {
+               if (links[i].rel == "forum-script") {
+                       forumScriptUrl = links[i].href;
+               } else if (links[i].rel = "forum-user-list") {
+                       userListUrl = links[i].href;
+               }
+       }       
+}
 function showUser(username) {
+       getBaseURLs();
        if (!username) {
                return ;
        }       
@@ -23,8 +44,21 @@ function showUser(username) {
                        while (links[i].childNodes.length>0) {
                                links[i].removeChild(links[i].childNodes[0]);
                        }       
+                       if (username.substring(0,7) == "http://") {
+                               links[i].href=username;
+                               username=username.substring(7,username.length);
+                       } else {
+                               links[i].href=userListUrl+"/" + username;
+                       }       
                        links[i].appendChild(document.createTextNode(username));
-               }
+               } else if (links[i].href.substring(0,forumScriptUrl.length)==
+                       forumScriptUrl && links[i].href.indexOf("login=")!=-1) {
+                       while (links[i].childNodes.length>0) {
+                               links[i].removeChild(links[i].childNodes[0]);
+                       }       
+                       links[i].appendChild(document.createTextNode("Выйти"));
+                       links[i].href=forumScriptUrl+"?logout=1";
+               }               
        }       
 }
 //