41
41
forum_base = "php/phpBB3"
43
# Process URL for special directives
44
url = urlparse.urlparse(self.path)
45
hierarchical_part = url[2]
47
forum_page = "" # use the default forum page
50
board = re.match('board/(.*?)(/|$)',hierarchical_part)
52
framequery += 'f=' + board.group(1) + "&"
53
forum_page = "viewforum.php"
55
topic = re.search('topic/(.*?)(/|$)',hierarchical_part)
57
framequery += 't=' + topic.group(1)
58
forum_page = "viewtopic.php"
60
# If the tail of the forum url is empty or a known special request
61
# then wrap the page in the headers and footer and load the default or
62
# special page in the ivlebody frame
65
location = forum_page + framequery
67
frameurl = ivle.util.make_path(os.path.join(forum_base,location))
68
ctx['url'] = frameurl + framequery
43
ctx['url'] = ivle.util.make_path(os.path.join(forum_base, self.path))
45
class ForumBoardView(ForumView):
46
def __init__(self, req, board):
47
self.path = 'viewforum.php?f=' + board
49
class ForumTopicView(ForumView):
50
def __init__(self, req, topic):
51
self.path = 'viewtopic.php?t=' + topic
70
53
def make_forum_cookie(user):
71
54
secret = ivle.conf.forum_secret
87
70
class Plugin(ViewPlugin, CookiePlugin):
89
72
('forum', ForumView, {'path': ''}),
73
('forum/+board/:board', ForumBoardView),
74
('forum/+topic/:topic', ForumTopicView),
90
75
('forum/*path', ForumView),