Chapter 4. Cookies Reference

Cookies are special sequences in text files, replaced by values by server before sending replies.

Cookies are designed the same way as a programming language, so you can get simple loops and tests (but it is NOT a scripting language, if you want one just use perl etc.). Test if user has a flag:


  %if(+G)
  This text is shown only for users with G flag (groupadmins)
  %endif
Here is a loop on all users:

  %for(allusers)
  user: %username
  %endfor
Loop on all connected users:

  %for(allusersconnected)
  user: %username
  %endfor

Table 4-1. Color Cookies

Normal Colors
%!black
%!red
%!green
%!brown
%!blue
%!magenta
%!cyan
%!white

Table 4-2. User Cookies

CookieDescription
%usercreditsAmount of credits
%usercredits2Amount of credits, converted in units (MB,GB,etc)
%userfiles_dlTotal number of files downloaded
%userfiles_ulTotal number of files uploaded
%userflagsFlags
%usergroupUser MAIN group
%usergroupsUser groups (main is first)
%userhomeUser home directory
%useripCurrent ip
%userip_allownumAuthorized ip num
%userlastcmdLast command received
%userlast_loginLast time user logged in
%userleechslotsRemaining leech slots (gadmin)
%usermaxdlMaximum download speed
%usermaxidleIdle time limit
%usermaxulMaximum upload speed
%usernameLogin name
%usernum_loginsMax simultaneous logins
%userpathUser's path (absolute in filesystem)
%userpidUser's connection PID (siteop)
%userpwdUser's current path (relative to home dir)
%userratioUser ratio, or unlimited
%userslotsRemaining slots (gadmin)
%userspeedCurrent user speed (if transferring file)
%usertagUser tagline, or **DELETED**
%usertotal_dlTotal bytes downloaded
%usertotal_dl2Total bytes downloaded, converted in units
%usertotal_ulTotal bytes uploaded
%usertotal_ul2Total bytes uploaded, converted in units

Table 4-3. Group Cookies

CookieDescription
%grouphomeDefault home directory for new members
%groupip_allownumAuthorized ip num
%groupmaxdlMaximum (cumulated) download speed
%groupmaxidleIdle time limit
%groupmaxulMaximum (cumulated) upload speed
%groupnameGroup name
%groupnum_loginsMax number of members connected at the same time
%groupratioDefault ratio, or unlimited
%grouptagGroup tagline
%grouptotal_dlTotal bytes downloaded
%grouptotal_dl2Total bytes downloaded, converted in units
%grouptotal_ulTotal bytes uploaded
%grouptotal_ul2Total bytes uploaded, converted in units

Table 4-4. File Cookies

CookieDescription
%filepathFull path to uploaded/downloaded file [a]
%filecrcCRC of uploaded/downloaded file
%lastfilenameFull path to last uploaded/downloaded file [b]
%lastfilesizeLast transfered file size
%lastfilespeedLast transfered file speed (bytes/sec)
%lastfiletimeLast transfered file time (sec)
Notes:
a. available during an upload/download/file or directory modification
b. available after an upload/download

Table 4-5. Other/General Cookies

CookieDescription
%bwtotaldlCurrent bandwidth used for downloads, in bytes/sec
%bwtotaldl2Current bandwidth used for downloads, in bytes/sec, converted in units
%bwtotalulCurrent bandwidth used for uploads, in bytes/sec
%bwtotalul2Current bandwidth used for uploads, in bytes/sec, converted in units
%sectionnameName of current section
%spacefreeRemaining space on device, converted in units
%spacetotalTotal space on device, converted in units
%include(filename)Include another file, and parse its contents [a]
Notes:
a. You MUST take care to create no recursion in file inclusions