def get_context_data(self, **kwargs):
     context = super(Posts, self).get_context_data(**kwargs)
     context["title"] = FORUM_NAME
     context["category"] = "posts"
     context["forum_path"] = FORUM_PATH
     posts = PhpbbPosts.objects.order_by('-post_time')[:20]
     latest = []
     for post in posts:
         latest.append((
             get_username(post.poster_id).username,
             unquote(post.post_subject),
             phpbb_to_html(post.post_text),
             FORUM_PATH + "viewtopic.php?p=%s#p%s" %
             (post.post_id, post.post_id),
         ))
     context["latest"] = latest
     return context
Exemple #2
0
 def get_context_data(self, **kwargs):
     context = super(Posts, self).get_context_data(**kwargs)
     context["title"] = FORUM_NAME
     context["category"] = "posts"
     context["forum_path"] = FORUM_PATH
     posts = PhpbbPosts.objects.order_by('-post_time')[:20]
     latest = []
     for post in posts:
         latest.append((
             get_username(post.poster_id).username,
             unquote(post.post_subject),
             phpbb_to_html(post.post_text),
             FORUM_PATH+"viewtopic.php?p=%s#p%s" % (
                     post.post_id, post.post_id),
         ))
     context["latest"] = latest
     return context
 def get_context_data(self, **kwargs):
     context = super(Topics, self).get_context_data(**kwargs)
     context["title"] = FORUM_NAME
     context["category"] = "topics"
     context["forum_path"] = FORUM_PATH
     topics = PhpbbTopics.objects.order_by('-topic_time')[:10]
     latest = []
     for topic in topics:
         post = PhpbbPosts.objects.get(post_id=topic.topic_first_post_id)
         latest.append((
             topic.topic_first_poster_name,
             unquote(topic.topic_title),
             phpbb_to_html(post.post_text),
             FORUM_PATH + "viewtopic.php?t=%s" % topic.topic_id,
         ))
     context["latest"] = latest
     return context
Exemple #4
0
 def get_context_data(self, **kwargs):
     context = super(Topics, self).get_context_data(**kwargs)
     context["title"] = FORUM_NAME
     context["category"] = "topics"
     context["forum_path"] = FORUM_PATH
     topics = PhpbbTopics.objects.order_by('-topic_time')[:10]
     latest = []
     for topic in topics:
         post = PhpbbPosts.objects.get(post_id=topic.topic_first_post_id)
         latest.append((
             topic.topic_first_poster_name,
             unquote(topic.topic_title),
             phpbb_to_html(post.post_text),
             FORUM_PATH+"viewtopic.php?t=%s" % topic.topic_id,
         ))
     context["latest"] = latest
     return context
 def get_post_text_html(self, obj):
     return phpbb_to_html(obj.post_text)
Exemple #6
0
 def get_post_text_html(self, obj):
     return phpbb_to_html(obj.post_text)
Exemple #7
0
 def item_description(self, item):
     username = item.topic_first_poster_name
     post = PhpbbPosts.objects.get(post_id=item.topic_first_post_id)
     text = phpbb_to_html(post.post_text)
     return "[<b>%s</b>] %s " % (username, text)
Exemple #8
0
 def item_title(self, item):        
     forum = get_forum(item.forum_id)
     text = phpbb_to_html(item.topic_title)
     return "[%s] %s" % (forum.forum_name, text)
Exemple #9
0
 def item_description(self, item):
     user = get_username(item.poster_id)
     username = user.username
     text = phpbb_to_html(item.post_text)
     return "[<b>%s</b>] %s " % (username, text)