예제 #1
0
def contant(request, bookname):
    data_cookies = auth(request)
    name = data_cookies['name']
    if name == 0:
        date_allmassage = None
        date_vip = None
        date_touxiang = None
    else:
        date_allmassage = allmassage_user(name)[0]
        date_vip = get_allmassage_vip(name)[0]
        date_touxiang = get_user_information(name)[0]['pic']
    allbook_massage = name_book_massage(bookname)[0]
    book_title = get_book_title(bookname)
    sum = sum_clicks(bookname)
    return render(
        request, 'contant.html', {
            'name': name,
            'allbook_massage': allbook_massage,
            'book_title': book_title,
            'data_cookies': data_cookies,
            ' date_allmassage': date_allmassage,
            'date_vip': date_vip,
            'date_touxiang': date_touxiang,
            'sum': sum
        })
예제 #2
0
def read_story(request, ID, title_number):
    data_cookies = auth(request)
    name = data_cookies['name']
    if name == 0:
        date_allmassage = None
        date_vip = None
        date_touxiang = None
    else:
        date_allmassage = allmassage_user(name)[0]
        date_vip = get_allmassage_vip(name)[0]
        date_touxiang = get_user_information(name)[0]['pic']
    bookname = ID_bookname(ID)[0]['book_name']
    massage = get_book_title_number(bookname, title_number)[0]
    massage2 = get_book_title_number2(bookname, title_number)
    now = datetime.datetime.now()
    now2 = int(time.time())
    news = select_new(bookname)
    updata_clicks(bookname, title_number)
    update_clicks_all(bookname)
    liuyanneirong = get_liyan(bookname, title_number)
    if name != 0 and massage['title_number'] < 4:
        if get_user_hitory_True(name, massage['title_number'],
                                bookname) == True:
            input_user_history(name, bookname, massage['title_name'],
                               massage['title_number'], now, now2)

            a = 0
        else:
            a = 0
    if name != 0 and massage['title_number'] >= 4:
        if get_user_hitory_True(name, massage['title_number'],
                                bookname) == True:
            a = 1
        if get_user_hitory_True(name, massage['title_number'],
                                bookname) == False:
            a = 0
    else:
        a = 0

    return render(
        request, 'read.html', {
            'massage': massage,
            'date_touxiang': date_touxiang,
            'date_allmassage': date_allmassage,
            'data_cookies': data_cookies,
            'date_vip': date_vip,
            'massage2': massage2,
            'a': a,
            'news': news,
            'liuyanneirong': liuyanneirong
        })
예제 #3
0
def clicks_rank(request):
    data_cookies = auth(request)
    name = data_cookies['name']

    if name == 0:
        date_allmassage = None
        date_vip = None
        date_touxiang = None
    else:
        date_allmassage = allmassage_user(name)[0]
        date_vip = get_allmassage_vip(name)[0]
        date_touxiang = get_user_information(name)[0]['pic']
    massage = clicks_rank_a
    return render(
        request, 'clicks.html', {
            'masssage': massage,
            ' date_allmassage': date_allmassage,
            'date_vip': date_vip,
            'date_touxiang': date_touxiang,
            'data_cookies': data_cookies
        })
예제 #4
0
def booktype(request, booktype):
    data_cookies = auth(request)
    name = data_cookies['name']
    if name == 0:
        date_allmassage = None
        date_vip = None
        date_touxiang = None
    else:
        date_allmassage = allmassage_user(name)[0]
        date_vip = get_allmassage_vip(name)[0]
        date_touxiang = get_user_information(name)[0]['pic']
    allbook_massage = all_book_massage
    return render(
        request, 'book_type.html', {
            'name': name,
            'date_vip': date_vip,
            'date_touxiang': date_touxiang,
            'date_allmassage': date_allmassage,
            'allbook_massage': allbook_massage,
            'data_cookies': data_cookies,
            'booktype': booktype
        })