Example #1
0
	def GET(self, categoryid=0, pageidx=1, pagesize=8):
		if categoryid is None:
			categoryid = 0
		if pageidx is None: pageidx = 1
		else: pageidx = int(pageidx)
		if pagesize is None: pagesize = 40
		else: pagesize = int(pagesize)
		if pagesize > 100: pagesize = 40
		categorys = json.loads(appblog.category().GET())
		count = json.loads(appblog.count().GET(categoryid))['count']
		pagecount = count / pagesize + 1
		if count % pagesize == 0:
			pagecount = pagecount - 1
		if pagecount < pageidx:
			pageidx = 1
		blogs = json.loads(appblog.bloglist().GET(categoryid, pageidx, pagesize))
		#mylog.loginfo(appblog.bloglist().GET(categoryid,pageidx,pagesize))
		return render.blogview(
				config=config,
				menuname='/blog',
				login=islogin(), 
				mgrprivilege=mgrprivilege(),
				blogid=None, 
				categoryid=categoryid, 
				categorys=categorys, 
				blogs=blogs,
				pagecount=pagecount,
				pageidx=pageidx,
				pagesize=pagesize)
Example #2
0
	def GET(self, categoryid=None, blogid=None):
		categorys = json.loads(appblog.category().GET())
		blogs = json.loads(appblog.blog().GET(blogid, True))
		#mylog.loginfo(appblog.blog())
		return render.blogview(
				config=config,
				menuname='/blog',
				login=islogin(), 
				mgrprivilege=mgrprivilege(),
				blogid=blogid, 
				categoryid=categoryid,
				categorys=categorys, 
				blogs=blogs)
Example #3
0
	def GET(self, categoryid=None, blogid=None):
		return render.blogview(login=islogin(), mgrprivilege=mgrprivilege(),
				blogcount=30, categoryid=categoryid, blogid=blogid)