Show
Ignore:
Timestamp:
02/08/08 02:44:39 (2 years ago)
Author:
eevee
Message:

Database refactoring. Renamed columns and tables to be more consistent and more readable. (#58)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • veekun/trunk/templates/forum/common.tt

    r386 r406  
    3434[%             END %] 
    3535[%         END %] 
    36  [% '<dt>' IF style == 2 %]<img src="/images/icons/pm/[% user.pmicon %].png" alt="Send private message" title="Send private message" class="disabled"/> [% 'PM<dd>not yet' IF style == 2 %] 
     36 [% '<dt>' IF style == 2 %]<img src="/images/icons/pm/[% user.pm_icon %].png" alt="Send private message" title="Send private message" class="disabled"/> [% 'PM<dd>not yet' IF style == 2 %] 
    3737 </dl> 
    3838[% END %] 
     
    4444 <p>[% IF form.exists('subject'); '<label>Subject: '; form.get_tag('subject'); '</label>'; END %]</p> 
    4545 <p>[% IF form.exists('blurb'); '<label>Blurb: '; form.get_tag('blurb'); '</label>'; END %]</p> 
    46  <p>[% form.get_tag('id') %][% IF form.exists('message'); form.get_tag('message'); END %]</p> 
     46 <p>[% form.get_tag('id') %][% IF form.exists('content'); form.get_tag('content'); END %]</p> 
    4747 <p> <input type="submit" name="submit" value="Post"/> <input type="submit" name="submit" value="Preview"/> <input type="reset" value="Clear"/> </p> 
    4848</form> 
     
    5353[% BLOCK post_buttons -%][%# post, thread, forum %] 
    5454[%     is_deleted = post.flags.match('deleted') %] 
    55 [%     IF c.can_i("postedit", post) OR post.userid == c.user.obj.id; can_edit = 1; END %] 
    56 [%     IF c.can_i("postdelete", post) OR (post.userid == c.user.obj.id AND post.id == thread.lastpostid); can_delete = 1; END %] 
     55[%     IF c.can_i("postedit", post) OR post.user_id == c.user.obj.id; can_edit = 1; END %] 
     56[%     IF c.can_i("postdelete", post) OR (post.user_id == c.user.obj.id AND post.id == thread.last_post_id); can_delete = 1; END %] 
    5757[%     IF c.can_i("postnuke"); can_nuke = 1; END %]  
    5858[%     RETURN UNLESS can_edit || can_delete || can_nuke %] 
     
    9393 <div class="sidebar"> 
    9494  <img src="/images/icons/delete.png" alt=""/> 
    95   This post by <a href="[% c.uri('Users', 'info', post.userid) %]">[% post.user.name %]</a> has been deleted. 
     95  This post by <a href="[% c.uri('Users', 'info', post.user_id) %]">[% post.user.name %]</a> has been deleted. 
    9696[%         IF c.can_i("postdelete", post) %] 
    9797  <a href="/forum/post/[% post.id %]/undelete">Restore it?</a>  Or <a href="/forum/post/[% post.id %]/edits">read it</a>? 
     
    103103    <div class="sidebar-wrapper"><div class="sidebar"> 
    104104[%     groups = post.user.groups.split(' '); primary_group = groups.shift %] 
    105         <div class="username"><a href="[% c.uri('Users', 'info', post.userid) %]"><img src="/images/groups/[% UserGroups.$primary_group.icon %]" alt="[% UserGroups.$primary_group.name %]" title="[% UserGroups.$primary_group.name %]"/> [% post.user.name %]</a></div> 
    106         <div class="title[% IF post.user.customtitle -%] custom">[% post.user.customtitle %][% ELSE %]">[% UserGroups.$primary_group.name %][% END %]</div> 
     105        <div class="username"><a href="[% c.uri('Users', 'info', post.user_id) %]"><img src="/images/groups/[% UserGroups.$primary_group.icon %]" alt="[% UserGroups.$primary_group.name %]" title="[% UserGroups.$primary_group.name %]"/> [% post.user.name %]</a></div> 
     106        <div class="title[% IF post.user.custom_title -%] custom">[% post.user.custom_title %][% ELSE %]">[% UserGroups.$primary_group.name %][% END %]</div> 
    107107        <div class="avatar">[% IF post.user.is_dumb %]<img src="/images/dumb.png" alt="PSA: THIS USER IS DUMB" class="dumb"/>[% END %][% IF post.user.avatar %]<img src="/images/avatars/[% post.user.avatar %]" alt="">[% ELSE %]No avatar[% END %]</div> 
    108108        <div class="postbar"> 
    109             <span class="postrank">[%# postrank(post.user.postct) %]</span> 
    110             <span class="postcount">Posts: [% post.user.postct %]</span> 
    111             [% INCLUDE postbar posts=post.user.postct %] 
     109            <span class="postrank">[%# postrank(post.user.post_count) %]</span> 
     110            <span class="postcount">Posts: [% post.user.post_count %]</span> 
     111            [% INCLUDE postbar posts=post.user.post_count %] 
    112112        </div> 
    113113    </div></div> 
     
    124124    </div> 
    125125    <div class="content"> 
    126 [%     IF post.newspic %] 
    127         <img src="/images/news/[% post.user.newspic %]" alt="[% post.name %]'s newspic" class="forum-post-newspic"/> 
     126[%     IF post.news_pic %] 
     127        <img src="/images/news/[% post.user.news_pic %]" alt="[% post.name %]'s news pic" class="forum-post-newspic"/> 
    128128[%     END %] 
    129129[%     IF post.lastedit %] 
     
    131131[%     END %] 
    132132        <div class="message"> 
    133 [%+    post.message | bbcode | indent(12) %] 
     133[%+    post.content | bbcode | indent(12) %] 
    134134        </div> 
    135135[%     IF post.user.signature %] 
     
    172172    </a> <!-- [ <a>2</a>, <a>3</a>, <a>4</a>, ... <a>9</a>, <a>10</a> ] --> 
    173173[%     IF show_forum %] 
    174     <div class="inforum">in forum "<a href="/forum/[% thread.forumid %]">[% thread.forum.name %]</a>"</div> 
    175 [%     END %] 
    176 </td> 
    177 <td class="postinfo"><a href="[% c.uri('Users', 'info', thread.firstpost.userid) %]">[% thread.firstpost.user.name %]</a> <a href="/forum/post/[% thread.firstpost.id %]">[% thread.firstpost.time | date %]</a></td> 
    178 <td class="count">[%# this is stupid fix it lati, but if all posts are deleted this will show -1 %][% IF thread.postct > 0; thread.postct - 1; ELSE; thread.postct; END %]</td><td class="count">[% thread.hitct %]</td> 
     174    <div class="inforum">in forum "<a href="/forum/[% thread.forum_id %]">[% thread.forum.name %]</a>"</div> 
     175[%     END %] 
     176</td> 
     177<td class="postinfo"><a href="[% c.uri('Users', 'info', thread.firstpost.user_id) %]">[% thread.firstpost.user.name %]</a> <a href="/forum/post/[% thread.firstpost.id %]">[% thread.firstpost.time | date %]</a></td> 
     178<td class="count">[%# this is stupid fix it lati, but if all posts are deleted this will show -1 %][% IF thread.post_count > 0; thread.post_count - 1; ELSE; thread.post_count; END %]</td><td class="count">[% thread.view_count %]</td> 
    179179<td class="postinfo"> 
    180 [%     IF thread.postct <= 1 -%] 
     180[%     IF thread.post_count <= 1 -%] 
    181181- 
    182182[%     ELSE %] 
    183 <a href="[% c.uri('Users', 'info', thread.lastpost.userid) %]">[% thread.lastpost.user.name %]</a> <a href="/forum/post/[% thread.lastpost.id %]">[% thread.lastpost.time | date %]</a> 
     183<a href="[% c.uri('Users', 'info', thread.lastpost.user_id) %]">[% thread.lastpost.user.name %]</a> <a href="/forum/post/[% thread.lastpost.id %]">[% thread.lastpost.time | date %]</a> 
    184184[%     END -%] 
    185185</td> 
     
    188188[% END -%] 
    189189 
    190 [% BLOCK threads_message %][%# message -%] 
    191 <tr><td class="forum-message" colspan="7">[% message %]</td></tr> 
     190[% BLOCK threads_message %][%# content -%] 
     191<tr><td class="forum-message" colspan="7">[% content %]</td></tr> 
    192192[% END -%] 
    193193 
     
    222222    </a> 
    223223</td> 
    224 <td class="count">[% forum.threadct %]</td><td class="count">[% forum.postct %]</td> 
     224<td class="count">[% forum.thread_count %]</td><td class="count">[% forum.post_count %]</td> 
    225225<td class="postinfo"> 
    226 [%     IF forum.lastpostid %] 
     226[%     IF forum.last_post_id %] 
    227227[%         IF 25 < forum.lastpost.thread.subject.length; subject = last_thread.subject.substr(0, 22) _ '...'; ELSE; subject = forum.lastpost.thread.subject; END -%] 
    228 [%             subject %] <a href="[% c.uri('Users', 'info', forum.lastpost.userid) %]">[% forum.lastpost.user.name %]</a> <a href="/forum/post/[% forum.lastpostid %]">[% forum.lastpost.time | date %]</a> 
     228[%             subject %] <a href="[% c.uri('Users', 'info', forum.lastpost.user_id) %]">[% forum.lastpost.user.name %]</a> <a href="/forum/post/[% forum.last_post_id %]">[% forum.lastpost.time | date %]</a> 
    229229[%     ELSE %] 
    230230(no posts) 
     
    235235[% END %] 
    236236 
    237 [% BLOCK forums_message %][%# message -%] 
    238 <tr><td class="message" colspan="5">[% message %]</td></tr> 
     237[% BLOCK forums_message %][%# content -%] 
     238<tr><td class="message" colspan="5">[% content %]</td></tr> 
    239239[% END %] 
    240240