bump sortign
This commit is contained in:
parent
ce38da9c23
commit
4d2000738e
14 changed files with 23 additions and 16 deletions
|
@ -164,6 +164,8 @@ def front_all(v, sub=None, subdomain=None):
|
|||
sort=request.values.get("sort", defaultsorting)
|
||||
t=request.values.get('t', defaulttime)
|
||||
ccmode=request.values.get('ccmode', "false").lower()
|
||||
|
||||
if sort == 'bump': t='all'
|
||||
|
||||
if request.host == 'rdrama.net': defaultsubs = 'Exclude subs'
|
||||
else: defaultsubs = 'Include subs'
|
||||
|
@ -324,6 +326,8 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
|
|||
if sort == "hot":
|
||||
ti = int(time.time()) + 3600
|
||||
posts = posts.order_by(-1000000*(Submission.realupvotes + 1 + Submission.comment_count/5 + (func.length(Submission.body_html)-func.length(func.replace(Submission.body_html,'</a>',''))))/(func.power(((ti - Submission.created_utc)/1000), 1.23)))
|
||||
elif sort == "bump":
|
||||
posts = posts.order_by(Submission.bump_utc.desc())
|
||||
elif sort == "new":
|
||||
posts = posts.order_by(Submission.created_utc.desc())
|
||||
elif sort == "old":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue