@@ -469,7 +475,7 @@ if type_value==13 or type_value==71:
#
eliftype_value==4:
header()
for (genre_id,genre_section,cnt)inopdsdb.getgenres_sections():
for (genre_id,genre_section,cnt)inopdsdb.getgenres_sections(cfg.DUBLICATES_SHOW,np):
id='14'+str(genre_id)
entry_start()
entry_head(genre_section,None,id_value)
@@ -483,7 +489,7 @@ elif type_value==4:
#
eliftype_value==14:
header()
for (genre_id,genre_subsection,cnt)inopdsdb.getgenres_subsections(slice_value):
for (genre_id,genre_subsection,cnt)inopdsdb.getgenres_subsections(slice_value,cfg.DUBLICATES_SHOW,np):
id='24'+str(genre_id)
ifcfg.ALPHA:id='30'+id
entry_start()
@@ -498,7 +504,7 @@ elif type_value==14:
#
iftype_value==24:
header()
for (book_id,book_name,book_path,reg_date,book_title,annotation,docdate,format,fsize,cover,cover_type)inopdsdb.getbooksforgenre(slice_value,cfg.MAXITEMS,page_value,cfg.DUBLICATES_SHOW,alpha):
for (book_id,book_name,book_path,reg_date,book_title,annotation,docdate,format,fsize,cover,cover_type)inopdsdb.getbooksforgenre(slice_value,cfg.MAXITEMS,page_value,cfg.DUBLICATES_SHOW,alpha,np):
else:period=" and (registerdate>now()-INTERVAL %s DAY)"%new_period
ifnew_period==0:
sql="select min(a.genre_id), a.section, count(*) as cnt from "+TBL_GENRES+" a, "+TBL_BGENRES+" b where a.genre_id=b.genre_id group by a.section order by a.section"
else:
sql="select min(a.genre_id), a.section, count(*) as cnt from "+TBL_GENRES+" a, "+TBL_BGENRES+" b, "+TBL_BOOKS+" c where a.genre_id=b.genre_id and b.book_id=c.book_id and c.avail!=0 "+dstr+period+" group by a.section order by a.section"
else:period=" and (registerdate>now()-INTERVAL %s DAY)"%new_period
ifnew_period==0:
sql="select a.genre_id, a.subsection, count(*) as cnt from "+TBL_GENRES+" a, "+TBL_BGENRES+" b where a.genre_id=b.genre_id and section in (select section from "+TBL_GENRES+" where genre_id="+str(section_id)+") group by a.subsection order by a.subsection"
else:
sql="select a.genre_id, a.subsection, count(*) as cnt from "+TBL_GENRES+" a, "+TBL_BGENRES+" b, "+TBL_BOOKS+" c where a.genre_id=b.genre_id and b.book_id=c.book_id and c.avail!=0 "+dstr+period+" and section in (select section from "+TBL_GENRES+" where genre_id="+str(section_id)+") group by a.subsection order by a.subsection"
else:period=" and (registerdate>now()-INTERVAL %s DAY)"%new_period
having=''
ifalpha==1:having=" and INSTR('АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЬЫЪЭЮЯ',UPPER(substr(a.title,1,1)))>0"
elifalpha==2:having=" and INSTR('0123456789',UPPER(substr(a.title,1,1)))>0"
elifalpha==3:having=" and INSTR('ABCDEFGHIJKLMNOPQRSTUVWXYZ',UPPER(substr(a.title,1,1)))>0"
elifalpha==4:having=" and INSTR('ABCDEFGHIJKLMNOPQRSTUVWXYZАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЬЫЪЭЮЯ0123456789',UPPER(substr(a.title,1,1)))=0"
sql="select SQL_CALC_FOUND_ROWS a.book_id,a.filename,a.path,a.registerdate,a.title,a.annotation,a.docdate,a.format,a.filesize,a.cover,a.cover_type from "+TBL_BOOKS+" a, "+TBL_BGENRES+" b where a.book_id=b.book_id and b.genre_id="+str(genre_id)+dstr+" and a.avail!=0"+having+" order by a.lang desc, a.title "+limitstr
sql="select SQL_CALC_FOUND_ROWS a.book_id,a.filename,a.path,a.registerdate,a.title,a.annotation,a.docdate,a.format,a.filesize,a.cover,a.cover_type from "+TBL_BOOKS+" a, "+TBL_BGENRES+" b where a.book_id=b.book_id and b.genre_id="+str(genre_id)+" and a.avail!=0"+dstr+period+having+" order by a.lang desc, a.title "+limitstr