Commits

Julio Flores-Schwarzbeck committed 1c6c80f

Version 1.1.1, fix bugs editing posts and fixed anonymous postings messages

Comments (0)

Files changed (7)

controllers/default.py

         forum_id = topic.forum_id
 
         if req.edit_topic:
-            if req.title and req.content and req.creation_user and \
-            req.creation_date and req.modifying_user and req.modifying_date:
+            if (req.title and req.content and req.creation_date and
+                req.modifying_date):
                 title = parse_content(req.title)
-                creation_user = req.creation_user
+                #creation_user = req.creation_user
                 creation_date = req.creation_date
-                modifying_user = req.modifying_user
+                #modifying_user = req.modifying_user
                 modifying_date = req.modifying_date
 
                 if topic.parent_flag:
                                                is not None
                     db(db.zf_topic.id==topic_id).update(title=title,
                         content=req.content,
-                        creation_user_id=creation_user,
+                        #creation_user_id=creation_user,
                         creation_date=creation_date,
-                        modifying_user_id=modifying_user,
+                        #modifying_user_id=modifying_user,
                         modifying_date=modifying_date,
                         locked_flag=locked_flag,
                         sticky_flag=sticky_flag,
                     # Just Update child-required fields
                     db(db.zf_topic.id==topic_id).update(title=title,
                         content=req.content,
-                        creation_user_id=creation_user,
+                        #creation_user_id=creation_user,
                         creation_date=creation_date,
-                        modifying_user_id=modifying_user,
+                        #modifying_user_id=modifying_user,
                         modifying_date=modifying_date)
                 redirect(URL(r=request, c='default', f='view_topic',
                              args=[parent_topic_id]))
 from auth import CustomAuthentication
 
 # Control Migrations
-migrate = True # False if DB Schema already exists (? - Read Docs Pls)
+migrate = False # False if DB Schema already exists (? - Read Docs Pls)
 fake_migrate = False # True to regen table info for EXISTING tables (run once)
 
-#db=SQLDB("mysql://username:passwd@localhost:3306/pyforum")
+#db=SQLDB("mysql://web2py:py2web@techfuel.net:3306/pyforum")
 db = DAL('sqlite://pyforum.sqlite', migrate=migrate)
 
  # Instantiate Authentication

models/pyforum_info.py

-pyforum_info = {'Program Version': '1.1.0',
-                'Date Released': 'Aug 16, 2011',
+pyforum_info = {'Program Version': '1.1.1',
+                'Date Released': 'Aug 17, 2011',
                 'Author': 'Julio Flores Schwarzbeck',
                 'Email': '<a href="mailto:julio@techfuel.net" title="">julio@techfuel.net</a>',
                 'is_beta': False}

views/default/add_topic.html

         <tbody>
             <tr>
                 <td>{{=XML(T('Author'))}}:</td>
-                <td>{{=forumhelper.get_display_name()}}</td>
+                <td>{{=forumhelper.get_display_name(None, 'Anonymous User')}}</td>
             </tr>
             <tr>
                 <td><span class="required">*</span> {{=XML(T('Title'))}}:</td>

views/default/edit_topic.html

         <tbody>
             <tr>
                 <td>{{=XML(T('Author'))}}:</td>
-                <td>{{=topic.creation_user}}</td>
+                <td>{{=forumhelper.get_display_name(topic.creation_user_id)}}</td>
             </tr>
             <tr>
                 <td><span class="required">*</span> {{=XML(T('Title'))}}:</td>
                 </tr>
             {{pass}}
             <tr>
-                <td><span class="warning">*</span> {{=XML(T('Creator'))}}:</td>
+                <td><span class="warning">*</span> {{=XML(T('Creation'))}}:</td>
                 <td>
-                    <input type="text" id="creation_user" name="creation_user" value="{{=request.vars.get('creation_user', topic.creation_user)}}" style="width:200px;" />
-                    @
                     <input type="text" id="creation_date" name="creation_date" value="{{=request.vars.get('creation_date', topic.creation_date.strftime('%Y-%m-%d %H:%M:%S'))}}" style="width:200px;" />
                 </td>
             </tr>
             <tr>
-                <td><span class="warning">*</span> {{=XML(T('Modificator'))}}:</td>
+                <td><span class="warning">*</span> {{=XML(T('Modification'))}}:</td>
                 <td>
-                    <input type="text" id="modifying_user" name="modifying_user" value="{{=request.vars.get('modifying_user', topic.modifying_user)}}" style="width:200px;" />
-                    @
                     <input type="text" id="modifying_date" name="modifying_date" value="{{=request.vars.get('modifying_date', topic.modifying_date.strftime('%Y-%m-%d %H:%M:%S'))}}" style="width:200px;" />
                 </td>
             </tr>

views/default/view_forum.html

                                     <br /><span class="small">{{=parse_content(this_topic.content[:view_info['zfsp_topic_teaser_length']], mode='forumpreview')}} ..</span>
                                 {{pass}}
                             </td>
-                            <td class="cell3d center-xy">{{=forumhelper.get_member_property('zfmp_display_name', this_topic.creation_user_id, 'Anonymous User')}}</td>
+                            <td class="cell3d center-xy">{{if this_topic.creation_user_id:}}<a href="{{=URL(r=request, c='pm', f='message_new', args=[this_topic.creation_user_id])}}" title="">{{=forumhelper.get_display_name(this_topic.creation_user_id, 'Anonymous User')}}</a>{{else:}}Anonymous User{{pass}}</td>
                             <td class="cell3d center-xy">{{=topic_replies_info[this_topic.id]}}</td>
                             <td class="cell3d center-xy">{{=this_topic.hits}}</td>
                             <td class="cell3d center-xy">

views/default/view_topic.html

                         </tr>
                         <tr class="shadedarker">
                             <td class="cell3d">{{=XML(T('By'))}}:</td>
-                            <td class="cell3d">{{=auth_user.get_user_name()}}, {{=XML(T('on'))}} {{=XML(T(str(request.now.strftime('%A, %d %B, %Y'))))}}</td>
+                            <td class="cell3d">{{=forumhelper.get_display_name(None, 'Anonymous User')}}, {{=XML(T('on'))}} {{=XML(T(str(request.now.strftime('%A, %d %B, %Y'))))}}</td>
                         </tr>
                         <tr class="shadedarker">
                             <td class="cell3d" style="vertical-align:middle;">{{=XML(T('Contents'))}}:</td>