Frequently Asked Questions v2 |
FAQ Main / Answer Detail |
Which parameters can I use with slice.php3
Author: Honza actionapps@ecn.cz |
|
The slice.php3 is the main script used to display items from database. The alternative for this script is view.php3. The main ussage of slice.php3 script is to include it into some .shtml file by the SSI include command - like:
<!--#includevirtual="/aaa/slice.php3?slice_id=a91256ed53287912d74495d781076bd6"-->
<!--#includevirtual="/aaa/slice.php3?slice_id=a91256ed53287912d74495d781076bd6&listlen=10&no_scr=1"-->
The slice.php3 is there from the beginning of ActionApps, so some of the parameters are quite old. Such parameters are still implemented, but in many cases it is better to use newer - more powerfull substitution for the parametr. That's why the list is prioritized from the most common parameters (which should be used) to the old parameters (which use is deprecated).
The only way, how to display data from slices, where 'Reading Password' is set. See: http://apc-aa.sourceforge.net/faq/#slice_pwdParameter | Required | Description |
slice_id | Yes | id of displayed slice |
conds[] | No | very usefull for complex conditions - see How to setup the searchform? for conds parameter setting (it can be used as url parameter too - not only form Forms, as described in search section) Example:conds[0][category........]=Environment&conds[1][category.......1]=Waste |
defaultCondsOperator | No | replaces LIKE for conds with not specified operator - simplified syntax of conds[] uses LIKE operator as default - you can change it by this operator to RLIKE for example (RLIKE is better in many cases - at least it is much faster from database point of view) Example: defaultCondsOperator=RLIKE&conds[0][category........]=Environment |
neverAllItems | No | if set, don't show anything when everything would be shown (if no conds[] are set) - good for search pages, where on the top (or bottom) is searchform - normaly, for the first time (when you did not send the searchform), all items are shown - if you want to have there only blank page intead, use this parameter |
sort[] | No | see conds[] - very usefull for complex sorting Example:sort[0][pub_date........]=d&sort[1][headline........]=a (a ...ascending order; d ... descending order) |
x | No | the same as sh_itm, but short_id is used instead (implemented for shorter item url (see 1767 alias)) |
iview | No | changes the design of index item listing to the design defined in specified view. The view should be of 'Item listing' type. Example: iview=49 - listing of items generated by slice.php3 will use format-strings as defined in view No. 49 |
fview | No | changes the design of fulltext to the design defined in specified view. The view should be of 'Fulltext view' type. Example: fview=48 - the item displayed by the slice.php3 script will use format-strings as defined in view No. 48 |
dview | No | uses specified view for discussions instead of the one specified on 'Slice Admin' -> 'Design - Fulltext' page. (good for testing new discussion view, ...) Example: dview=18 - view 18 is used as tepmlate for discussion design in this slice |
listlen | No | change number of listed items in compact view Example: listlen=10 |
slice_pwd | No | Example: slice_pwd=VerySecret |
no_scr | No | if true, no page scroller is displayed Example: no_scr=1 |
group_n | No | displayes only the n-th group (in listings where items are grouped by some field (category, for example)) - good for display all the items of last magazine issue Example: ( group_n=1 ) |
slicetext | No | displays just the text instead of any output - can be used for hiding the output of slice.php3 Example: slicetext=%20 |
highlight | No | when true, shows only highlighted items in compact view Example: highlight=1 |
als[alias] | No | user alias definition - you can define your own aliases in url (for both - slice.php3 and view.php3). Aliases names MUST!!! be 8 characters long. Don't forgot, that the alias value have to be urlencoded. Example: als[MY_ALIAS]=Summary%20Page (or maybe better: als%5BMY_ALIAS%5D=Summary%20Page) defines alias _#MY_ALIAS. If used in formatstring ('Admin - Design Index' for example), it prints 'Summary Page' |
inc | No | for dispalying another file instead of slice data (for example some static html file) Example: inc=/contact.html |
items[id] | No | array of items to show one after one as fulltext (ids are the long ones - see sh_itm, but there is special 'x' character before each index). Example: items[x5462876e8ab29ac95462876e8ab29ac9]=1&items[x65ac876e8a555b29543ea76e8ab29a34]=1 (doesn't matter which value is given to element (1 or 'on' or ...) - good for display of the form, where you select which item to show) |
hidefulltext=1 | No | if you add this parameter to url, the fulltext is not shown when you go to page, where the specific item should be displayed. The discussions under the fulltext are not hidden. It is usefull, if you want to show discussions for the item on separate page. On the other hand, probably better results You can get by using fview parameter. |
banner=2-38 | No | by this parameter you are able to display any view (38 in or case) inserted just after the second (2) item in view (number 23). The item shown in inserted view (38) is selected randomly, possibly with weight specified in weight field (number.........1) - just like in random parameter described above. If you do not want use random item (banner), use 'norandom' keyword in place of 'weight field' (good for displaying nested newsbox). See also banner parameter for view.php3. The example of included banner is on http://ecn.cz. Example: banner=2-38 or banner=2-38-number.........1 or banner=2-38-norandom |
nocache=1 | No | URL parameter for page refresh - the items are not taken from cache (- no matter if allready cached or not). Cache is updated. |
searchlog | No | if you add searchlog parameter to the slice.php3 script on some search page, all searches (by conds[]) are logged into database table searchlog. There are logged not only the conds[] parameters, but also the time, which database spent on the query. The access to the log is for superadministrators only, right now. You will find it on 'AA' -> 'Misc - | ' page in AA admin interface (or you can look into searchlog table in the database).
scr_url=script_name | No | scr_url parameter is answer to problem mentioned in apc-aa-general mailinglist (apc-aa-general mailinglist). If you try to include the slice.php3 into your php3 script by calling include("http://www.sitename.org/apc-aa/slice.php3...");, the page scroller do not work, becouse the called script (slice.php3) do not know from which script it was called. But the scroller should know it - scroller should point to the same page - to the calling one. By scr_url parameter you can define the name of calling script. Example: include("http://www.sitename.org/apc-aa/slice.php3?...&scr_url=%2Fscripts%2Findex.php"); ('%2F' stands for ' / ' character). |
sh_itm | No | id of item to show - if specified, selected item is shown in full text Example: index.shtml?sh_itm=01ac1b10fae13c0a61c5292ba72d70b1 |
restrict | No | field id used with "res_val" and "exact" for restricted output (display only items with "restrict" field = "res_val" Example:restrict=category........&res_val=Environment&exact=1 |
res_val | No | see restrict |
exact | No | if set, restrict field must match res_val exactly (=) otherwise substring is sufficient (LIKE '%res_val%') |
order | No | order field id - if other than publish date add minus sign for descending order Example: order=headline........- |
timeorder | No | if rev - reverse publish date order (less priority than "order") Example: timeorder=rev |
scr_go | No | sets page scroller to specified page Example: scr_go=2 |
encap | Yes for not encapsulated | determines wheather this file is SSI included to .shtml file (<--#include virtual="... ) or called directly as slice.php3 Example:encap=false |
cat_id | No | select only items in category with id cat_id Deprecated - better to use restrict and res_val parameters - or even better conds[] parameter |
cat_name | No | select only items in category with name cat_name as substring Deprecated - better to use restrict and res_val parameters - or even better conds[] parameter |
srch | No | true if this script have to show search results Not supported from AA v1.5 |
|
Last Edit: Aug 17 2011
<aafaq id=1767> ~ToDo: 1767 Which parameters can I use with slice.php3 </aafaq>
This FAQ interface was developed by Jason at Commons.ca
|
APC
ActionApps is a free software content management system initiated by
the Association for Progressive Communications (APC) APC - Internet and ICTs for social justice and development |