[SQL]
PageNow=SELECT now FROM updates WHERE pageid=0 AND area='site'
PageTimeStamp=SELECT pagets FROM updates WHERE area=? AND pageid=?
PageCounter=SELECT counter FROM hits WHERE area=? AND pageid=? AND photoid=?
AdminHits=SELECT h.pageid,h.photoid,h.counter FROM hits AS h ORDER BY $orderby h.pageid,h.photoid
AdminUpdates=SELECT * FROM updates ORDER BY pagets desc
GetUpdate=SELECT * FROM updates WHERE area=? AND pageid=?
SetUpdate=UPDATE updates SET now=? WHERE area=? AND pageid=?
AddUpdate=INSERT INTO updates (now,area,pageid) VALUES (?,?,?)
GetAHit=SELECT counter FROM hits WHERE area=? AND query=?
SetAHit=UPDATE hits SET counter=? WHERE area=? AND pageid=? AND photoid=?
AddAHit=INSERT INTO hits (counter,area,pageid,photoid,query,createdate) VALUES (?,?,?,?,?,?)
PageHits=SELECT h.* \
FROM hits AS h \
WHERE h.pageid=0 AND h.photoid=0 \
ORDER BY h.counter DESC,h.pageid LIMIT 20
PageHits2=SELECT NULL
AllHits=SELECT * FROM hits
DeleteHits=DELETE FROM hits WHERE pageid=? AND area=? AND photoid=?
CheckUser=SELECT userid,nickname,realname,realm FROM users WHERE email=? AND password=SHA1(?)
CheckUserOld=SELECT userid,nickname,realname,realm FROM users WHERE email=? AND password=OLD_PASSWORD(?)
CreateSession=INSERT INTO sessions (timeout,name,userid,realm,folderid,langcode,optionid,labyrinth) VALUES (?,?,?,?,1,?,?,?)
UpdateSession=UPDATE sessions SET $field=? WHERE labyrinth=?
UpdateSessionX=UPDATE sessions SET timeout=?,name=?,userid=?,realm=?,langcode=?,optionid=? WHERE labyrinth=?
CheckSession=SELECT userid,name,realm,folderid FROM sessions WHERE labyrinth=?
TimeStampSession=UPDATE sessions SET timeout=? WHERE labyrinth=?
DeleteSessions=DELETE FROM sessions WHERE timeout < ?
DeleteSession=DELETE FROM sessions WHERE labyrinth=?
CountSessions=SELECT DISTINCT s.userid,s.name as realname FROM sessions AS s \
LEFT JOIN users AS u ON u.userid=s.userid
RetrieveSession=SELECT query FROM sessions WHERE labyrinth=?
StoreSession=UPDATE sessions SET query=? WHERE labyrinth=?
GetUserByID=SELECT * FROM users WHERE userid=?
SearchUserNames=SELECT * FROM users AS u \
WHERE userid > 3 AND accessid < 4 AND email LIKE ? $where \
ORDER BY $order
SearchUsers=SELECT u.*,MAX(a.accessid) as acl FROM users AS u \
INNER JOIN acls AS a ON (u.userid=a.userid and a.folderid=1) \
WHERE u.userid > 2 AND (u.nickname LIKE ? OR u.realname LIKE ?) $where \
GROUP BY u.userid ORDER BY $order
AllFolders=SELECT * FROM folders ORDER BY folderid
GetFolder=SELECT * FROM folders WHERE folderid=?
GetFolderIDs=SELECT folderid FROM folders WHERE ref IN ($folders)
GetFolderAccess=SELECT folderid FROM acls \
(WHERE groupid IN ($groups) OR userid=$userid) AND accessid >= $access
GetPermission=SELECT a.folderid,a.groupid,a.userid,a.accessid \
FROM acls AS a \
INNER JOIN folders AS f ON a.folderid=f.folderid \
WHERE a.folderid IN ($folders) AND (a.groupid IN ($groups) \
OR a.userid = $user) \
ORDER BY f.ref
GetGroupUserMap=SELECT groupid FROM ixusergroup WHERE type=1 AND linkid=?
GetGroupParents=SELECT groupid FROM ixusergroup WHERE type=2 \
AND linkid IN ($groups)
AllAccess=SELECT * FROM access WHERE accessid < ? ORDER BY accessid
UserACLs=SELECT * FROM acls AS l \
INNER JOIN access AS a ON a.accessid=l.accessid \
WHERE l.userid=?
UserACLCheck=SELECT * FROM acls WHERE userid=? AND accessid=? AND folderid=?
UserACLSave=INSERT INTO acls (userid,accessid,folderid) VALUES (?,?,?)
UserACLDelete=DELETE FROM acls WHERE userid=? AND accessid=? AND folderid=?
GroupACLs=SELECT * FROM acls AS l \
INNER JOIN access AS a ON a.accessid=l.accessid \
INNER JOIN groups AS g ON g.groupid=l.groupid \
WHERE l.groupid=?
GroupACLSave=INSERT INTO acls (groupid,accessid,folderid) VALUES (?,?,?)
GroupACLDelete=DELETE FROM acls WHERE groupid=? AND accessid=? AND folderid=?
AllRealms=SELECT * FROM realms
GetRealmByID=SELECT * FROM realms WHERE realmid=?
GetRealmByName=SELECT * FROM realms WHERE realm=?
AllMenus=SELECT * FROM menus
GetMenus=SELECT * FROM menus WHERE realmid=?
GetMenuByID=SELECT * FROM menus WHERE menuid=?
GetOptions=SELECT * FROM options WHERE menuid=?
FindOptions=SELECT * FROM options WHERE menuid IN ($ids)
AddMenu=INSERT INTO menus (title,typeid,realmid) VALUES (?,?,?)
AddOption=INSERT INTO options (menuid,orderno) VALUES (?,?)
SaveMenu=UPDATE menus SET title=?,typeid=?,realmid=? WHERE menuid=?
SaveOption=UPDATE options SET orderno=?,text=?,href=? WHERE optionid=?
DeleteMenu=DELETE FROM menu WHERE menuid IN ($ids)
DeleteOptions=DELETE FROM options WHERE optionid IN ($ids)
GetOptImages=SELECT * FROM optimages AS o \
INNER JOIN images AS i ON o.imageid=i.imageid \
WHERE optionid=? ORDER BY typeid
AddOptImage=INSERT INTO optimages (imageid,optionid,typeid) VALUES (?,?,?)
SaveOptImage=UPDATE optimages SET imageid=? WHERE optionid=? AND typeid=?
DeleteOptImages=DELETE FROM optimages WHERE optionid IN ($ids)
MetaSearchArt=SELECT x.articleid AS id,a.* FROM mxarticles AS x INNER JOIN articles AS a ON a.articleid=x.articleid WHERE metadata IN ($meta)
MetaDetailArt=SELECT a.articleid AS id,a.* FROM articles AS a \
INNER JOIN paragraphs AS p ON a.articleid=p.articleid \
WHERE a.title REGEXP '$meta' OR p.body REGEXP '$meta'
MetaDeleteArt=DELETE FROM mxarticles WHERE articleid=?
MetaUpdateArt=INSERT INTO mxarticles (articleid,metadata) VALUES (?,?)
MetaGetArt=SELECT * FROM mxarticles WHERE articleid=?
MetaUpdateImage=INSERT INTO imetadata (imageid,tag) VALUES (?,?)
MetaDeleteImage=DELETE FROM imetadata WHERE imageid=?
MetaSearchImage=SELECT * FROM photos AS i \
INNER JOIN imetadata AS m ON i.photoid=m.imageid \
WHERE tag IN (?)
MetaGetImage=SELECT * FROM imetadata WHERE imageid=?
AllArticles=SELECT * FROM articles $where ORDER BY createdate DESC $limit
GetArticlesLatest=SELECT title,userid,quickname FROM articles \
WHERE sectionid=1 AND publish=3 ORDER BY createdate DESC
GetArticlesFrontPage=SELECT title,userid,quickname,snippet,imageid,createdate \
FROM articles \
WHERE sectionid=1 AND publish=3 AND front=1 \
ORDER BY createdate DESC
GetArticleByName=SELECT * FROM articles WHERE quickname=?
GetArticleByID=SELECT * FROM articles WHERE articleid=?
AddArticle=INSERT INTO articles (folderid,title,userid,createdate, \
sectionid,quickname,publish) VALUES (?,?,?,?,?,?,?)
SaveArticle=UPDATE articles SET folderid=?,title=?,userid=?, \
sectionid=?,quickname=?,snippet=?,imageid=?,front=?,publish=?, \
createdate=? \
WHERE articleid=?
DeleteArticle=DELETE FROM articles WHERE articleid IN ($ids)
GetContent=SELECT * FROM paragraphs WHERE articleid=? ORDER BY orderno
AddContent=INSERT INTO paragraphs (articleid,orderno,type,imageid,href, \
body,align) \
VALUES (?,?,?,?,?,?,?)
SaveContent=UPDATE paragraphs SET articleid=?,orderno=?,type=?,imageid=?, \
href=?,body=?,align=? WHERE paraid=?
Relocate=UPDATE paragraphs SET orderno=? WHERE paraid=?
DeleteContent=DELETE FROM paragraphs WHERE paraid=?
DeleteArticleContent=DELETE FROM paragraphs WHERE articleid IN ($ids)
PromoteArticle=UPDATE articles SET publish=? WHERE articleid=?
CheckFrontPageArticles=SELECT articleid FROM articles \
WHERE sectionid=1 AND publish=3 AND front=1
SetFrontPageArticle=UPDATE articles SET front=1 WHERE articleid=?
ClearFrontPageArticle=UPDATE articles SET front=0 WHERE articleid=?
GetAllImages=SELECT * FROM images
GetImagesByType=SELECT * FROM images WHERE type=? ORDER BY link,tag
GetDefaultImages=SELECT * FROM images WHERE tag='DEFAULT'
GetImageByID=SELECT * FROM images WHERE imageid=?
AddImage=INSERT INTO images (tag,link,type,href,dimensions) VALUES (?,?,?,?,?)
SaveImage=UPDATE images SET tag=?,link=?,type=?,href=?,dimensions=? WHERE imageid=?
DeleteImage=DELETE FROM images WHERE imageid=?
AllImageStock=SELECT * FROM imagestock
Gallery=SELECT * FROM photos AS i \
WHERE i.photoid >= ? $where \
ORDER BY i.photoid \
LIMIT 10
MetaGallery=SELECT i.* FROM photos AS i \
INNER JOIN imetadata AS m ON i.photoid=m.imageid \
WHERE i.photoid >= ? $where \
ORDER BY i.photoid \
LIMIT 10
GalleryMin=SELECT i.photoid FROM photos AS i \
WHERE i.photoid < ? $where \
ORDER BY i.photoid DESC LIMIT 9
MetaGalleryMin=SELECT i.photoid FROM photos AS i \
INNER JOIN imetadata AS m ON i.photoid=m.imageid \
WHERE i.photoid < ? $where \
ORDER BY i.photoid DESC LIMIT 9
AllUsers=SELECT * FROM users
NewUser=INSERT INTO users (password,accessid,search,realm,nickname,realname,email,imageid,aboutme) \
VALUES (SHA1(?),?,?,?,?,?,?,?,?)
SaveUser=UPDATE users SET realm=?,nickname=?,realname=?,email=?,url=?,imageid=?,aboutme=? WHERE userid=?
DeleteUser=DELETE FROM users WHERE userid IN ($ids)
ValidUser=SELECT * FROM users WHERE userid=? AND password=SHA1(?)
ChangePassword=UPDATE users SET password=SHA1(?) WHERE userid=?
BanUser=UPDATE users SET password=? WHERE userid in ($ids)
FindUser=SELECT userid,password,realname FROM users WHERE email = ?
# Groups
AllGroups=SELECT * FROM groups $where ORDER BY groupname
GroupCount=SELECT COUNT(linkid) AS count FROM ixusergroup WHERE groupid = ? AND type=1 GROUP BY groupid
GetGroup=SELECT * FROM groups WHERE groupid=?
LinkUsers=SELECT i.*,u.email,u.nickname,u.realname FROM ixusergroup AS i \
INNER JOIN users AS u ON i.linkid=u.userid \
WHERE i.type=1 AND i.groupid=? \
ORDER BY u.realname
LinkedUsers=SELECT i.*,g.groupname,g.member FROM ixusergroup AS i \
INNER JOIN groups AS g ON i.groupid=g.groupid \
WHERE i.type=1 AND i.linkid=?
LinkGroups=SELECT i.*,g.groupname FROM ixusergroup AS i \
INNER JOIN groups AS g ON i.linkid=g.groupid \
WHERE i.type=2 AND i.groupid=?
AllGroupIndex=SELECT * FROM ixusergroup WHERE type=2
AddGroup=INSERT INTO groups (groupname,master) VALUES (?,0)
AddLinkIndex=INSERT INTO ixusergroup (type,linkid,groupid) VALUES (?,?,?)
SaveGroup=UPDATE groups SET groupname=? WHERE groupid=?
DeleteGroup=DELETE FROM groups WHERE groupid=?
DeleteGroupIndex=DELETE FROM ixusergroup WHERE groupid=?
DeleteLinkIndices=DELETE FROM ixusergroup WHERE linkid=? AND i.type=?
DeleteLinkIndex=DELETE FROM ixusergroup \
WHERE type=? AND linkid=? AND groupid=?
GetGroupID=SELECT groupid FROM groups WHERE groupname=?
UserGroups=SELECT i.*,g.groupname FROM ixusergroup AS i \
INNER JOIN groups AS g ON i.groupid=g.groupid \
WHERE type=1 AND linkid=?
FindIPAddress=SELECT * FROM ipindex WHERE ipaddr=?
AddIPAddress=INSERT INTO ipindex (author,type,ipaddr) VALUES (?,?,?)
SaveIPAddress=UPDATE ipindex SET author=?,type=? WHERE ipaddr=?
GetTesterAddress=SELECT * FROM ixtester WHERE userid=? AND confirmed=1
FindTesterIndex=SELECT * FROM ixtester WHERE email=?
ConfirmedEmail=INSERT INTO ixtester (userid,email,confirm,confirmed) VALUES (?,?,'',1)
RemoveEmail=DELETE FROM ixtester WHERE userid=? AND email IN ($mails)
UnConfirmedEmail=INSERT INTO ixtester (userid,email,confirm,confirmed) VALUES (?,?,?,0)
ListAllMarkedReports=SELECT * FROM ixmarked
ListMarkedReports=SELECT * FROM ixmarked WHERE email IN ($addrs)
MarkReport=INSERT INTO ixmarked (id,email,cpanid,markdate) VALUES (?,?,?,?)
UnMarkReports=DELETE FROM ixmarked WHERE id IN (ids)
GetAuthorDefault=SELECT * FROM prefs_authors AS a \
INNER JOIN prefs_distributions AS d ON d.pauseid=a.pauseid \
WHERE a.pauseid=? AND d.distribution='-'
GetAuthorDistros=SELECT * FROM prefs_distributions WHERE pauseid=? AND distribution!='-'
GetAuthorDistro=SELECT * FROM prefs_distributions WHERE pauseid=? AND distribution=?
SetAuthorIgnore=UPDATE prefs_distributions SET ignored=? WHERE pauseid=? AND distribution IN ($dists)
UpdateAuthorLogin=UPDATE prefs_authors SET lastlogin=? WHERE pauseid=?
UpdateAuthorActive=UPDATE prefs_authors SET active=? WHERE pauseid=?
UpdateDistroPrefs=UPDATE prefs_distributions SET ignored=?,report=?,grade=?,tuple=?,version=?,patches=?,perl=?,platform=? WHERE pauseid=? AND distribution=?
InsertDistroPrefs=INSERT INTO prefs_distributions (ignored,report,grade,tuple,version,patches,perl,platform,pauseid,distribution) VALUES (?,?,?,?,?,?,?,?,?,?)
DeleteDistroPrefs=DELETE FROM prefs_distributions WHERE pauseid=? AND distribution=?
#[CPANSTATS]
GetAuthorDists=SELECT DISTINCT(dist) FROM cpanstats.uploads WHERE author=? AND type != 'backpan'
GetAuthorDistVersions=SELECT version FROM cpanstats.uploads WHERE author=? AND dist=? ORDER BY released
GetPerlVersions=SELECT DISTINCT(perl) FROM cpanstats.perl_version
AllOSNames=SELECT * FROM cpanstats.osname ORDER BY ostitle