Example #1
0
def index():
    global viewcount
    if not viewcount.get('index'):
        viewcount['index'] = []
    if request.remote_addr not in viewcount.get('index'):
        viewcount['index'].append(request.remote_addr)
        databaselayer.inc("index")
    refresh()
    content = s.return_posts()
    sites = s.return_sites()
    return render_template("index.html", picture=profile_link, **locals())
Example #2
0
def index():
    global viewcount
    if not viewcount.get('index'):
        viewcount['index'] = []
    if request.remote_addr not in viewcount.get('index'):
        viewcount['index'].append(request.remote_addr)
        databaselayer.inc("index")
    refresh()
    content = s.return_posts()
    sites = s.return_sites()
    return render_template("index.html", picture=profile_link, **locals())
Example #3
0
def site_view(name):
    refresh()
    content, sites = s.return_posts(), s.return_sites()
    for i in range(1, len(sites.keys()) + 1):
        if name == sites[i]["con_tit"]:
            content_view = sites[i]["content"]
            con_title = sites[i]["name"]
            break
    content_view = Markup(markdown.markdown(content_view))
    global viewcount
    if not viewcount.get(con_title):
        viewcount[con_title] = []
    if request.remote_addr not in viewcount.get(con_title):
        viewcount[con_title].append(request.remote_addr)
        databaselayer.inc(name)
    return render_template("blog.html", picture=profile_link, **locals())
Example #4
0
def site_view(name):
    refresh()
    content, sites = s.return_posts(), s.return_sites()
    for i in range(1, len(sites.keys()) + 1):
        if name == sites[i]["con_tit"]:
            content_view = sites[i]["content"]
            con_title = sites[i]["name"]
            break
    content_view = Markup(markdown.markdown(content_view))
    global viewcount
    if not viewcount.get(con_title):
        viewcount[con_title] = []
    if request.remote_addr not in viewcount.get(con_title):
        viewcount[con_title].append(request.remote_addr)
        databaselayer.inc(name)
    return render_template("blog.html", picture=profile_link, **locals())
Example #5
0
def blog_view(name):
    refresh()
    content, sites = s.return_posts(), s.return_sites()
    for i in range(0, len(content)):
        if name == content[i]["rel_name"]:
            content_view = content[i]["content"]
            con_title = content[i]["title"]
            con_date = content[i]["date"]
            con_time = content[i]["time"]
            db_id = content[i]["key"]
            break
    content_view = Markup(markdown.markdown(content_view, ['fenced_code', 'codehilite']))
    global viewcount
    if not viewcount.get(db_id):
        viewcount[db_id] = []
    if request.remote_addr not in viewcount.get(db_id):
        viewcount[db_id].append(request.remote_addr)
        databaselayer.inc(db_id)
    return render_template("blog.html", picture=profile_link, **locals())
Example #6
0
def blog_view(name):
    refresh()
    content, sites = s.return_posts(), s.return_sites()
    for i in range(0, len(content)):
        if name == content[i]["rel_name"]:
            content_view = content[i]["content"]
            con_title = content[i]["title"]
            con_date = content[i]["date"]
            con_time = content[i]["time"]
            db_id = content[i]["key"]
            break
    content_view = Markup(
        markdown.markdown(content_view, ['fenced_code', 'codehilite']))
    global viewcount
    if not viewcount.get(db_id):
        viewcount[db_id] = []
    if request.remote_addr not in viewcount.get(db_id):
        viewcount[db_id].append(request.remote_addr)
        databaselayer.inc(db_id)
    return render_template("blog.html", picture=profile_link, **locals())