diff options
author | yorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b> | 2008-07-08 07:27:56 +0000 |
---|---|---|
committer | yorhel <yorhel@1fe2e327-d9db-4752-bcf7-ef0cb4a1748b> | 2008-07-08 07:27:56 +0000 |
commit | db47e11b580efa1938de892e6c08ba47ba2c6cc4 (patch) | |
tree | 3d2133912d93585e7bf36b41a6b1f85c40a0031a /data/tpl | |
parent | 4c821b8138b0f9820cada6be7e051fe00434c54e (diff) |
Wrote an integrated messageboard, and fixed a few (very) small things along the way
git-svn-id: svn://vndb.org/vndb@54 1fe2e327-d9db-4752-bcf7-ef0cb4a1748b
Diffstat (limited to 'data/tpl')
-rw-r--r-- | data/tpl/defs.pl | 70 | ||||
-rw-r--r-- | data/tpl/faq | 75 | ||||
-rw-r--r-- | data/tpl/hist | 2 | ||||
-rw-r--r-- | data/tpl/home | 11 | ||||
-rw-r--r-- | data/tpl/main | 8 | ||||
-rw-r--r-- | data/tpl/myvotes | 1 | ||||
-rw-r--r-- | data/tpl/pedit | 5 | ||||
-rw-r--r-- | data/tpl/ppage | 3 | ||||
-rw-r--r-- | data/tpl/redit | 5 | ||||
-rw-r--r-- | data/tpl/rpage | 3 | ||||
-rw-r--r-- | data/tpl/tedit | 24 | ||||
-rw-r--r-- | data/tpl/tindex | 54 | ||||
-rw-r--r-- | data/tpl/ttag | 57 | ||||
-rw-r--r-- | data/tpl/tthread | 81 | ||||
-rw-r--r-- | data/tpl/useredit | 1 | ||||
-rw-r--r-- | data/tpl/userpage | 1 | ||||
-rw-r--r-- | data/tpl/vnedit | 5 | ||||
-rw-r--r-- | data/tpl/vnlist | 1 | ||||
-rw-r--r-- | data/tpl/vnpage | 18 |
19 files changed, 306 insertions, 119 deletions
diff --git a/data/tpl/defs.pl b/data/tpl/defs.pl index fcc1c443..46269347 100644 --- a/data/tpl/defs.pl +++ b/data/tpl/defs.pl @@ -59,6 +59,17 @@ sub wraplong { # text, margin s/([^\s\r\n]{$m})([^\s\r\n])/$1 $2/g; return $_; } +sub age { + my $a = time-$_[0]; + return sprintf '%d %s', + $a > 60*60*24*365*2 ? ( $a/60/60/24/365, 'years ago' ) : + $a > 60*60*24*(365/12)*2 ? ( $a/60/60/24/(365/12), 'months ago' ) : + $a > 60*60*24*7*2 ? ( $a/60/60/24/7, 'weeks ago' ) : + $a > 60*60*24*2 ? ( $a/60/60/24, 'days ago' ) : + $a > 60*60*2 ? ( $a/60/60, 'hours ago' ) : + $a > 60*2 ? ( $a/60, 'min ago' ) : + ( $a, 'sec ago' ) ; +} sub wordsplit { # split a string into an array of words, but make sure to not split HTML tags @@ -134,6 +145,7 @@ sub summary { # cmd, len, def my $res = ''; my $len = 0; my $as = 0; + my $raw = 0; (my $txt = $_[0]) =~ s/\r?\n/\n /g; for (split / /, $txt) { next if !defined $_ || $_ eq ''; @@ -141,19 +153,31 @@ sub summary { # cmd, len, def s/\&/&/g; s/>/>/g; s/</</g; - while(s/\[url=((https?:\/\/|\/)[^\]>]+)\]/<a href="$1" rel="nofollow">/i) { - $l -= length($1)+6; - $as++; + if(!$raw && s/^\[raw\]//) { + $l -= 5; + $raw++; } - if(!$as && s/(http|https):\/\/(.+[0-9a-zA-Z=\/])/<a href="$1:\/\/$2" rel="nofollow">link<\/a>/) { - $l = 4; - } elsif(!$as) { - s/^(.*[^\w]|)([dvpr][0-9]+)\.([0-9]+)([^\w].*|)$/$1<a href="\/$2.$3">$2.$3<\/a>$4/ || - s/^(.*[^\w]|)([duvpr][0-9]+)([^\w].*|)$/$1<a href="\/$2">$2<\/a>$3/; + if(!$raw) { + $l -= 9 while(s/\[spoiler\]/<b class="spoiler">/i); + $l -= 10 while(s/\[\/spoiler\]/<\/b>/i); + while(s/\[url=((https?:\/\/|\/)[^\]>]+)\]/<a href="$1" rel="nofollow">/i) { + $l -= length($1)+6; + $as++; + } + if(!$as && s/(http|https):\/\/(.+[0-9a-zA-Z=\/])/<a href="$1:\/\/$2" rel="nofollow">link<\/a>/) { + $l = 4; + } elsif(!$as) { + s/^(.*[^\w]|)([tdvpr][0-9]+)\.([0-9]+)([^\w].*|)$/$1<a href="\/$2.$3">$2.$3<\/a>$4/ || + s/^(.*[^\w]|)([tduvpr][0-9]+)([^\w].*|)$/$1<a href="\/$2">$2<\/a>$3/; + } + while(s/\[\/url\]/<\/a>/i) { + $l -= 6; + $as--; + } } - while(s/\[\/url\]/<\/a>/i) { + if(s/\[\/raw\]//) { $l -= 6; - $as--; + $raw=0; } $len += $l + 1; last if $_[1] && $len > $_[1]; @@ -168,21 +192,29 @@ sub summary { # cmd, len, def } -sub ttabs { # [vrp], obj, sel +sub ttabs { # [vrpu], obj, sel my($t, $o, $s) = @_; $s||=''; my @act = ( !$s?'%s':'<a href="/%s">%1$s</a>', $$o{locked} ? '<b>locked for editing</b>' : (), - $p{Authlock} ? + $p{Authlock} && $t ne 'u' ? sprintf('<a href="/%%s/lock">%s</a>', $$o{locked} ? 'unlock' : 'lock') : (), - $p{Authdel} ? ( + $p{Authdel} && $t ne 'u' ? ( sprintf('<a href="/%%s/hide"%s>%s</a>', $t eq 'v' ? ' id="vhide"' : '', $$o{hidden} ? 'unhide' : 'hide') ) : (), - (!$$o{locked} && !$$o{hidden}) || ($p{Authedit} && $p{Authlock}) ? + ($t eq 'u' && $p{Authuseredit}) || ($t ne 'u' && (!$$o{locked} && !$$o{hidden}) || ($p{Authedit} && $p{Authlock})) ? ($s eq 'edit' ? 'edit' : '<a href="'.($p{Authedit}?'/%s/edit':'/u/register?n=1').'" '.($t eq 'v' || $t eq 'r' ? 'class="dropdown" rel="nofollow editDD"':'').'>edit</a>') : (), + $t eq 'u' ? ( + $o->{flags} & $VNDB::UFLAGS->{votes} ? ( $s eq 'vote' ? 'votes' : '<a href="/%s/votes">votes</a>', ) : (), + $o->{flags} & $VNDB::UFLAGS->{list} ? ( $s eq 'list' ? 'list' : '<a href="/%s/list">list</a>', ) : (), + ) : (), + + $t ne 'r' ? ( + $s eq 'disc' ? 'discussions' : '<a href="/t/%s">discussions</a>', ) : (), + $p{Authhist} ? ($s eq 'hist' ? 'history' : '<a href="/%s/hist">history</a>') : (), ); @@ -228,6 +260,14 @@ my %pagetitles = ( home => 'Visual Novel Database', pbrowse => 'Browse producers', userlist => 'Browse users', + tindex => 'Discussion board index', + ttag => sub { + return ($p{ttag}{obj} ? 'Related discussions for ' : '').$p{ttag}{title} }, + tthread => sub { + return $p{tthread}{t}{title} }, + tedit => sub { + return $p{tedit}{p} ? 'Edit post' : + $p{tedit}{t} ? 'Reply to thread' : 'Start a new thread' }, myvotes => sub { return $p{myvotes}{user}{username} eq $p{AuthUsername} ? 'My votes' : ('Votes by '.$p{myvotes}{user}{username}); }, userpage => sub { @@ -288,6 +328,7 @@ my %formerr_names = ( vn => 'Visual novel relations', l_vnn => 'Visual-novels.net link', comm => 'Edit summary', + msg => 'Message', ); my @formerr_msgs = ( sub { return sprintf 'Field "%s" is required.', @_ }, @@ -312,6 +353,7 @@ my %formerr_exeptions = ( nomail => 'No user found with that email address', nojpeg => 'Image is not in JPEG or PNG format!', toolarge => 'Image is too large (in filesize), try to compress it a little', + wrongtag => 'Wrong tag selected!', ); sub formerr { my @err = ref $_[0] eq 'ARRAY' ? @{$_[0]} : (); diff --git a/data/tpl/faq b/data/tpl/faq deleted file mode 100644 index 1c64056e..00000000 --- a/data/tpl/faq +++ /dev/null @@ -1,75 +0,0 @@ -<h2>[[: $p{PageTitle} ]]</h2> -<br /> -<h3>What is a Visual Novel?</h3> -<p> - A visual novel can be seen as a combination of a novel and a computer game: - they're computer games with a large text based storyline and only little - interaction of the player. A typical visual novel consists of text over - an anime-style background image and is accompanied by background music. - Throughout the game, the player usually has to answer a few questions which will - have an effect on the story, thus playing a visual novel a second time while - giving other answers may result in an entirely different plot.<br /> - <br /> - For more information see <a href="http://en.wikipedia.org/wiki/Visual_Novel"> - the Wikipedia article on visual novels</a> or the description on - <a href="http://visual-novels.net/vn/index.php?option=com_content&task=view&id=259&Itemid=47">Visual-Novels.net</a>. - To get a general idea of the genre, try one of the free short visual novels from - <a href="http://at2006.haeleth.net/release.php">al|together 2006</a>. - <br /><br /><br /> -</p> - - -<h3>How about Eroge, H-Games and Dating Sims?</h3> -<p> - An eroge or H-game is basically any Japanese game that features sexual - content. Many visual novels are eroge and many eroge are visual novels, - but this is not a rule. The definition of dating sim is a bit more vague, - but it's usually the same as a visual novel, except that a dating sim - generally uses a gameplay based on statistics.<br /> - <br /> - There are no strict bounds to the definition of "visual novel", most - eroge and dating sims include elements of visual novels, but may - - strictly speaking - not be visual novels themselves. As VNDB aims to - be comprehensive, we simply accept any game that contains elements of a - visual novel and is produced by a Japanese or Japan-related company or - doujin cicle. - <br /><br /><br /> -</p> - - -<h3>Why a Visual Novel Database?</h3> -<p> - The internet is large, very large, but the number of English resources - related to visual novels is only very limited. VNDB attempts to collect - and present as much information as possible that would otherwise be very - hard to find for the English speaking audience. This way fans can easily - keep track of new releases and localizations of their favorite games, - while not having to browse numerous of indistinct Japanese websites. - <br /><br /><br /> -</p> - - -<h3>How can I help VNDB?</h3> -</p> - There are many ways to contribute to VNDB. First of all you can freely - edit all information found on this website, so if you find any errors - just click the "edit" link on the top right of the page. You can also - add new information (visual novels, producers, releases) to the database, - though please search the database before you do in order to prevent - duplicate pages.<br /> - <br /> - To discuss about new features or to help the development of the website - itself, feel free to browse the <a href="http://forum.vndb.org/">forums</a> - or join us on IRC at <a href="irc://irc.synirc.net/vndb">#vndb @ irc.synirc.net</a>. - If you aren't used to IRC or are just to lazy to install a client, you can - still join the chat using <a href="http://cgiirc.synirc.net/">the Webchat</a>. - Just choose a nickname, specify #vndb as channel and hit Login! - <br /><br /><br /> -</p> - - -<h3>Where can I download the Visual Novels?</h3> -<p> - Not here. We do not provide downloads nor links to resources that encourage - the illegal spreading of visual novels. -</p> diff --git a/data/tpl/hist b/data/tpl/hist index 05780bb6..77acb6c2 100644 --- a/data/tpl/hist +++ b/data/tpl/hist @@ -1,4 +1,4 @@ -[[= $d{type} && $d{type} ne 'u' ? ttabs($d{type}, $d{obj}, 'hist') : '' ]]- +[[= $d{type} ? ttabs($d{type}, $d{obj}, 'hist') : '' ]]- <h2 class="rss">[[: $p{PageTitle} ]]</h2> [[ if($d{type} eq 'u' && $#{$d{hist}} < 0) { ]] <p> diff --git a/data/tpl/home b/data/tpl/home index ed0bca63..5ea730ce 100644 --- a/data/tpl/home +++ b/data/tpl/home @@ -10,16 +10,15 @@ and they can vote on all visual novels.<br /><br /> Feel free to <a href="/v">browse around</a>, <a href="/u/register">register an account</a> - or to discuss about the database at our <a href="http://forum.vndb.org/">forums</a>. + or to participate in the discussions about visual novels or VNDB on our <a href="/t">discussion board</a>. </p> -<h3 class="home">VNDB 1.18!</h3> +<h3 class="home">[[: $d{an}{title} ]]- + <p class="actions">by <a href="/u[[= $d{anpost}{uid} ]]">[[: $d{anpost}{username} ]]</a>, -[[= age $d{anpost}{date} ]]</p></h3> <p class="desc"> - Shortly after 1.17, I now present 1.18! This update includes a major change in how you refer - to specific revisions of an entry, adds the ability to select release dates back to 1980, NES - and MSX to the list of platforms, and a few warnings. + [[= summary $d{anpost}{msg}, 200 ]] <br /> - <a href="http://forum.vndb.org/index.php?topic=55.0">Read more...</a> - <a href="http://forum.vndb.org/index.php?board=7.0">news archive</a>. + <a href="/t[[= $d{an}{id} ]]">Read more...</a> - <a href="/t/an">news archive</a>. </p> <ul class="home"> diff --git a/data/tpl/main b/data/tpl/main index 9793c6c9..7d5fc6e5 100644 --- a/data/tpl/main +++ b/data/tpl/main @@ -15,6 +15,7 @@ [[ } ]]- <script src="[[: $p{st} ]]/files/def.js?[[= $VNDB::VERSION ]]" type="text/javascript"></script> [[ if($p{devshit}) { ]]- + <link rel="icon" href="/favicon.gif" type="image/gif" /> <meta name="robots" content="noindex, nofollow" /> [[ } elsif($p{userlist} || $p{userpage} || $p{userlogin} || $p{userreg} || $p{userpass} || $p{myvotes} || $p{vnlist} || $p{hist} || ($p{vnpage} && $p{vnpage}{page} eq 'stats') @@ -65,6 +66,10 @@ [[ if($p{hist}) { %d = %{$p{hist}}; ]] [[+ hist ]][[ }# ]] [[ if($p{rpage}) { %d = %{$p{rpage}}; ]] [[+ rpage ]][[ } ]] [[ if($p{docs}) { %d = %{$p{docs}}; ]] [[+ docs ]][[ } ]] +[[ if($p{tindex}) { %d = %{$p{tindex}}; ]] [[+ tindex ]][[ } ]] +[[ if($p{ttag}) { %d = %{$p{ttag}}; ]] [[+ ttag ]][[ } ]] +[[ if($p{tthread}) { %d = %{$p{tthread}}; ]] [[+ tthread ]][[ } ]] +[[ if($p{tedit}) { %d = %{$p{tedit}}; ]] [[+ tedit ]][[ } ]] [[ if($p{error}) { %d = %{$p{error}}; ]] [[+ error ]][[ } ]] </div> @@ -78,8 +83,8 @@ <li><a href="/p">Producers</a></li> <li><a href="/u/list">Users</a></li> <li><a href="/hist">Recent changes</a></li> + <li><a href="/t">Discussion board</a></li> <li><a href="/d6">FAQ</a></li> - <li><a href="http://forum.vndb.org/">Forum</a></li> </ul> -[[ if(!$p{AuthLoggedin}) { ]]- @@ -103,6 +108,7 @@ <li><a href="/u[[= $p{AuthId} ]]/votes">My votes</a></li> <li><a href="/u[[= $p{AuthId} ]]/list">My visual novel list</a></li> <li><a href="/u[[= $p{AuthId} ]]/hist">My recent changes</a></li> + <li><a href="/t/u[[= $p{AuthId} ]]">My messages</a></li> [[ if($p{Authedit}) { ]]- <li> </li> <li><a href="/v/new">Add visual novel</a></li> diff --git a/data/tpl/myvotes b/data/tpl/myvotes index 9379e98e..231eaf25 100644 --- a/data/tpl/myvotes +++ b/data/tpl/myvotes @@ -1,3 +1,4 @@ +[[= ttabs('u', $d{user}, 'vote') ]] <h2>[[: $p{PageTitle} ]]</h2> [[ if($#{$d{votes}} < 0) { ]]- <p> diff --git a/data/tpl/pedit b/data/tpl/pedit index 363f9619..56c06b92 100644 --- a/data/tpl/pedit +++ b/data/tpl/pedit @@ -6,9 +6,8 @@ </span> [[ } else { ]] <span class="msg"> - It is currently not possible to delete producers from the database, please - use the <a href="http://forum.vndb.org/index.php?board=5.0">forums</a> to request - a deletion. Also refer to the forums for more serious edits or discussions about changes. + Please check the <a href="/t/p[[= $d{id} ]]">discussion board</a> <b>before</b> making + any changes! </span> [[ } if($d{id} && $d{prod}{cid} != $d{prod}{latest}) { ]] <span class="warning"> diff --git a/data/tpl/ppage b/data/tpl/ppage index e829682a..f45366fa 100644 --- a/data/tpl/ppage +++ b/data/tpl/ppage @@ -4,8 +4,7 @@ [[ if($d{prod}{hidden}) { ]]- <span class="warning"> This item has been deleted from the database. File a request on the - <a href="http://forum.vndb.org/index.php?board=5.0">forums</a> - to undelete this page. + <a href="/t/p[[= $d{prod}{id} ]]">discussion board</a> to undelete this page. </span> [[ } ]] [[ if(!$d{prod}{hidden} || $p{Authdel}) { ]]- diff --git a/data/tpl/redit b/data/tpl/redit index 73744517..32d618e3 100644 --- a/data/tpl/redit +++ b/data/tpl/redit @@ -3,9 +3,8 @@ [[ if($d{id}) { ]] <span class="msg"> - It is currently not possible to delete releases from the database, please - use the <a href="http://forum.vndb.org/index.php?board=5.0">forums</a> to request - a deletion. Also refer to the forums for more serious edits or discussions about changes. + Please check the <a href="/t/v[[= $d{rel}{vn}[0]{vid} ]]">discussion board</a> <b>before</b> making + any changes! </span> [[ } if($d{id} && $d{rel}{cid} != $d{rel}{latest}) { ]] <span class="warning"> diff --git a/data/tpl/rpage b/data/tpl/rpage index 11432f80..54267204 100644 --- a/data/tpl/rpage +++ b/data/tpl/rpage @@ -4,8 +4,7 @@ [[ if($d{rel}{hidden}) { ]]- <span class="warning"> This item has been deleted from the database. File a request on the - <a href="http://forum.vndb.org/index.php?board=5.0">forums</a> - to undelete this page. + <a href="/t/v[[= $d{rel}{vn}[0]{vid} ]]">discussion board</a> to undelete this page. </span> [[ } ]] [[ if(!$d{rel}{hidden} || $p{Authdel}) { ]]- diff --git a/data/tpl/tedit b/data/tpl/tedit new file mode 100644 index 00000000..cfcd5a95 --- /dev/null +++ b/data/tpl/tedit @@ -0,0 +1,24 @@ +<h2>[[: $p{PageTitle} ]]</h2> + + +-[[= cform( [ + { type => 'error' }, + { type => 'startform', action => $d{p} ? '/t'.$d{t}{id}.'.'.$d{p}{num}.'/edit' : $d{t} ? '/t'.$d{t}{id}.'/reply' : '/t/'.$d{tag}.'/new' }, + { type => 'static', name => 'Username', text => '<a href="/u'.($d{p}?$d{p}{uid}:$p{AuthId}).'">'.($d{p}?$d{p}{username}:$p{AuthUsername}).'</a>' }, + $d{t} && !($d{p} && $d{p}{num} == 1) ? ( + { type => 'static', name => 'Topic', text => '<a href="/t'.$d{t}{id}.'">'.$d{t}{title}.'</a>.' } + ) : ( + { type => 'input', short => 'title', name => 'Thread title' }, + { type => 'input', short => 'tags', name => 'Tags' }, + $p{Authboardmod} ? ( + { type => 'check', short => 'lock', name => 'Locked' }, + ) : (), + ), + $p{Authboardmod} ? ( + { type => 'check', short => 'hide', name => 'Hidden' }, + ) : (), + { type => 'textarea', short => 'msg', name => 'Message', rows => 10, cols => 60 }, + { type => 'submit', text => 'Submit' }, + { type => 'endform' }, +], $d{form}) ]]- + diff --git a/data/tpl/tindex b/data/tpl/tindex new file mode 100644 index 00000000..ae5625b3 --- /dev/null +++ b/data/tpl/tindex @@ -0,0 +1,54 @@ +<h2>[[: $p{PageTitle} ]]</h2> + +[[ + my %desc = ( + an => 'Yorhel\'s place to make useless announcements...', + db => 'General discussions about VNDB.org. This is the place to be for feature requests and bug reports.', + v => 'Discussions about the visual novels in the database', + p => '...Producers', + r => '...Releases', + u => 'Messages to or discussions about other users on this site.' + ); +]] + + +[[ for my $tag (qw|an db v p u|) { ]]- + +<br /> +<h3>[[: $VNDB::DTAGS->{$tag} ]]</h3> +<!--<p class="desc"> + <i>[[: $desc{$tag} ]]</i> +</p>--> +[[ if(@{$d{$tag}}) { ]]- +<table id="tin"> + <!--<thead><tr> + <td class="tc1">Topic</td> + <td class="tc2">Replies</td> + <td class="tc3">Starter</td> + <td class="tc4">Last post</td> + </tr></thead>--> +[[ for (@{$d{$tag}}) { ]]- + <tr> + <td class="tc1"> + <a href="/t[[= $_->{id} ]]" title="[[= join ', ', sort map $$_[1]?$$_[0].$$_[1]:$$_[0], @{$_->{tags}} ]]">[[: $_->{title} ]]</a> + [[ if($_->{locked}) { ]]- <b>[locked]</b>[[ } ]] + </td> + <td class="tc2">[[= $_->{count}-1 ]]</td> + <td class="tc3"><a href="/u[[= $_->{uid} ]]">[[= $_->{username} ]]</a></td> + <td class="tc4"><a href="/u[[= $_->{luid} ]]">[[= $_->{lusername} ]]</a> @ + <a href="/t[[= $_->{id}.($_->{count}>$d{ppp}?'/'.ceil($_->{count}/$d{ppp}):'').'#'.$_->{count} ]]"> + [[= age $_->{ldate} ]]</a></td> + </tr> +[[ } ]] +</table> +<a class="right" href="/t/[[= $tag ]]">more...</a> +[[ } else { ]]- + <p>No threads yet. + -[[ if($tag eq 'db') { ]] + <a href="/t/[[= $tag ]]/new">Start a new thread.</a> + [[ } ]] + </p> +[[ } ]] +<br /> + +[[ } ]] diff --git a/data/tpl/ttag b/data/tpl/ttag new file mode 100644 index 00000000..3495d319 --- /dev/null +++ b/data/tpl/ttag @@ -0,0 +1,57 @@ +[[= $d{obj} ? ttabs($d{type}, $d{obj}, 'disc') : '' ]]- +<h2>[[: $p{PageTitle} ]]</h2> +<p> + <a href="/t">Discussion board</a> + > <a href="/t/[[= $d{type} ]]">[[: $VNDB::DTAGS->{$d{type}} ]]</a> + [[ if($d{obj}) { ]]- + > <b>[[= $d{tag} ]]</b>:<a href="/t/[[= $d{tag} ]]">[[: $d{title} ]]</a>[[ } ]]- +</p> + +[[ if(@{$d{t}}) { ]]- + +[[ if(!$d{obj} && $d{tag} !~ /(an|db)/) { + my @tags = grep $$_[0] eq $d{type}, map @{$_->{tags}}, @{$d{t}}; my %tags; my $i=0; ]]- +<dl> + <dt>Recent tags</dt> + <dd> + [[ for (@tags) { next if $tags{$$_[1]}++; last if $i++ == 5; ]]- + <b>[[= $$_[0].$$_[1] ]]</b>:<a href="/t/[[= $$_[0].$$_[1] ]]">[[: $$_[2] ]]</a><br />[[ } ]] + </dd> +</dl> +[[ } else { ]] +<br /> +[[ } ]] + + +[[= pagebut('/t/'.$d{tag}) ]] +<table id="tin"> + <thead><tr> + <td class="tc1">Topic</td> + <td class="tc2">#</td> + <td class="tc3">Starter</td> + <td class="tc4">Last post</td> + </tr></thead> +[[ for (@{$d{t}}) { ]]- + <tr> + <td class="tc1"><a href="/t[[= $_->{id} ]]" title="[[= join ', ', sort map $$_[1]?$$_[0].$$_[1]:$$_[0], @{$_->{tags}} ]]">[[: $_->{title} ]]</a></td> + <td class="tc2">[[= $_->{count}-1 ]]</td> + <td class="tc3"><a href="/u[[= $_->{uid} ]]">[[= $_->{username} ]]</a></td> + <td class="tc4"><a href="/u[[= $_->{luid} ]]">[[= $_->{lusername} ]]</a> @ + <a href="/t[[= $_->{id}.($_->{count}>$d{ppp}?'/'.ceil($_->{count}/$d{ppp}):'').'#'.$_->{count} ]]"> + [[= age $_->{ldate} ]]</a></td> + </tr> +[[ } ]] +</table> +[[= pagebut('/t/'.$d{tag}) ]] + +[[ } else { ]] +<p><br /> + <b>No related threads found.</b> +</p> +[[ } ]]- + +-[[ if($p{Authboard} && $d{tag} =~ /^(?:db|[vpru][0-9]+)$/) { ]]- +<br /> +<a class="right" href="/t/[[= $d{tag} ]]/new">create a new thread</a> +[[ } ]] + diff --git a/data/tpl/tthread b/data/tpl/tthread new file mode 100644 index 00000000..915474f7 --- /dev/null +++ b/data/tpl/tthread @@ -0,0 +1,81 @@ +<h2>[[: $p{PageTitle} ]]</h2> +[[ if($d{t}{hidden}) { ]] +<span class="warning">This thread has been deleted!</span> +[[ } ]] + +<dl> + <dt>Posted in</dt> + <dd> + [[ for (sort { $$a[0].$$a[1] cmp $$b[0].$$b[1] } @{$d{t}{tags}}) { ]]- + <a href="/t/[[= $$_[0] ]]">[[: $VNDB::DTAGS->{$$_[0]} ]]</a> + [[ if($$_[1]) { ]]- + > <b>[[= $$_[0].$$_[1] ]]</b>:<a href="/t/[[= $$_[0].$$_[1] ]]">[[: $$_[2] ]]</a>[[ } ]]- + <br /> + [[ } ]] + </dd> +</dl> + +<br /> + +[[ + my $pages=''; + my $lp = ceil($d{t}{count}/$d{ppp}); + if($d{t}{count} > $d{ppp}) { + my @pages = ( + $d{page} == 1 ? '<<' : '<a href="/t%d"><<</a>', + $lp > 2 ? (map + $d{page} == $_ ? $_ : '<a href="/t%d/'.$_.'">'.$_.'</a>', + 2..($lp-1) ) : (), + $d{page} == $lp ? '>>' : '<a href="/t%d/'.$lp.'">>></a>' + ); + $pages = '<p class="browse">'.join(' ', map sprintf($_,$d{t}{id}), @pages).'</p>'; + } +]] + +[[= $pages ]] +<table id="tth"> + [[ for (@{$d{p}}) { ]]- + <tr> + <td class="tc1"> + <a href="/t[[= $d{t}{id} ]].[[= $_->{num} ]]" name="[[= $_->{num} ]]">#[[= $_->{num} ]]</a> + [[ if(!$_->{hidden}) { ]]- + by <a href="/u[[= $_->{uid} ]]">[[: $_->{username} ]]</a><br /> + <i>[[= formatdate('%Y-%m-%d %R', $_->{date}) ]]</i> + [[ } ]] + </td> + <td class="tc2"> + [[ if($p{AuthId} == $_->{uid} && !$_->{hidden} || $p{Authboardmod}) { ]]- + <p class="mod">< <a href="/t[[= $d{t}{id}.'.'.$_->{num} ]]/edit">edit</a> ></p> + [[ } ]] + [[ if(!$_->{hidden}) { ]]- + [[= summary $_->{msg} ]] + [[ if($_->{edited}) { ]]<br /> + <i>last modified -[[= formatdate('%Y-%m-%d %R', $_->{edited}) ]]</i> + [[ } ]] + [[ } else { ]] + <b class="hidden">Post deleted.</b> + [[ } ]] + </td> + </tr> + [[ } ]]- +</table> +[[= $pages ]] + +<br /> +[[ if($lp == $d{page}) { ]] + [[ if($d{t}{locked}) { ]]- + <p> + This thread has been locked, you can't reply anymore. + </p> + [[ } elsif(!$p{AuthLoggedin}) { ]]- + <p> + You need to be <a href="/u/login">logged in</a> to reply to this thread. + </p> + [[ } elsif($p{Authboard} && $lp == $d{page}) { ]]- + <form action="/nospam?/t[[= $d{t}{id} ]]/reply" method="post" accept-charset="utf-8" id="qreply"> + <h3>Quick reply</h3> + <textarea name="msg" id="msg" rows="5" cols="70"></textarea> + <input type="submit" value="Post reply" /> + </form> + [[ } ]] +[[ } ]] diff --git a/data/tpl/useredit b/data/tpl/useredit index f470ce0a..16bc8c44 100644 --- a/data/tpl/useredit +++ b/data/tpl/useredit @@ -1,3 +1,4 @@ +[[= ttabs('u', $d{u}, 'edit') ]] <h2>[[: $p{PageTitle} ]]</h2> -[[ if($d{done}) { ]] diff --git a/data/tpl/userpage b/data/tpl/userpage index 9b14efc9..ef5fc55c 100644 --- a/data/tpl/userpage +++ b/data/tpl/userpage @@ -1,3 +1,4 @@ +[[= ttabs('u', $d{user}) ]] [[ ($d{pv}, $d{pl}) = ($d{user}{flags} & $VNDB::UFLAGS->{votes}, $d{user}{flags} & $VNDB::UFLAGS->{list}); ]] diff --git a/data/tpl/vnedit b/data/tpl/vnedit index c6cbd3ae..6412ad8f 100644 --- a/data/tpl/vnedit +++ b/data/tpl/vnedit @@ -6,9 +6,8 @@ in order to prevent duplicate entries.</span> [[ } else { ]] <span class="msg"> - It is currently not possible to delete visual novels from the database, please - use the <a href="http://forum.vndb.org/index.php?board=5.0">forums</a> to request - a deletion. Also refer to the forums for more serious edits or discussions about changes. + Please check the <a href="/t/v[[= $d{id} ]]">discussion board</a> <b>before</b> making + any changes! </span> [[ } if($d{id} && $d{vn}{cid} != $d{vn}{latest}) { ]] <span class="warning"> diff --git a/data/tpl/vnlist b/data/tpl/vnlist index 64db1c05..0fb20509 100644 --- a/data/tpl/vnlist +++ b/data/tpl/vnlist @@ -1,3 +1,4 @@ +[[= ttabs('u', $d{user}, 'list') ]] <h2>[[: $p{PageTitle} ]]</h2> [[ my $url = sprintf '/u%d/list', $d{user}{id}; diff --git a/data/tpl/vnpage b/data/tpl/vnpage index 22fa98fc..551731a5 100644 --- a/data/tpl/vnpage +++ b/data/tpl/vnpage @@ -2,23 +2,23 @@ <h2>[[: $d{vn}{title} ]]</h2> --[[ if($p{AuthLoggedin}) { ]] -<p class="mod">< user options - - <a href="/u[[= $p{AuthId} ]]/votes" rel="voteDD" class="dropdown">[[= $d{vote}{vid} ? 'your vote: '.$d{vote}{vote} : 'vote' ]]</a> -- <a href="/u[[= $p{AuthId} ]]/list" rel="listDD" class="dropdown">[[= !$d{list}{vid} ? 'add to vn list' : 'status: '.lc $VNDB::LSTAT->[$d{list}{status}] ]]</a> -></p> -[[ } ]]- - [[ if($d{vn}{hidden}) { ]]- <span class="warning"> This item has been deleted from the database. File a request on the - <a href="http://forum.vndb.org/index.php?board=5.0">forums</a> - to undelete this page. + <a href="/t/v[[= $d{vn}{id} ]]">discussion board</a> to undelete this page. </span> [[ } ]] [[ if(!$d{vn}{hidden} || $p{Authdel}) { ]]- +-[[ if($p{AuthLoggedin}) { ]] +<p class="mod">< user options - + <a href="/u[[= $p{AuthId} ]]/votes" rel="voteDD" class="dropdown">[[= $d{vote}{vid} ? 'your vote: '.$d{vote}{vote} : 'vote' ]]</a> +- <a href="/u[[= $p{AuthId} ]]/list" rel="listDD" class="dropdown">[[= !$d{list}{vid} ? 'add to vn list' : 'status: '.lc $VNDB::LSTAT->[$d{list}{status}] ]]</a> +></p> +[[ } ]]- + + [[ if($d{change}) { ]] [[= cdiff($d{prev}, $d{vn}, |