Using of userint, userbit, and userstrWhen building a website it is often required to have password protected pages or pages defined for a special group of users. In addition, a website may have several page types, like news or press releases. Sometimes pages of the same type could be stored under different folders. Finding and displaying those pages to a site visitor could be a complex task. Moreover, a site administrator or a content contributor should have ability to assign page to a group or change the page type in fast and convenient way. For that purposes, SiteSupra has free special fields in the content tables. These fields are userint, userbit, and userstr. A developer can use userint, userbit, and userstr fields to create page types or define user groups a page will be accessible for. A site administrator or a content contributor can assign one of predefined values to the fields so that a block or a module can analyze the fieldsâŔ™ values and decide whether to show a page to site visitor or not. Before you can start using userint, userbit, and userstr they should be properly configured in the .htedit file.
SiteSupra user can easily change userint, userbit, or userstr values using SiteSupra console.
Page properties, userint and userbit SiteSupra user can easy change userint, userbit, or userstr values using SiteSupra console. The value of userint is the key of selected $userIntList array element. The value of userbit is combination of checkboxes states in bitwise representation. For example, if SiteSupra user ticked checkbox Main Menu, the value of userbit field will be 1 or 00000001 in bitwise format. If SiteSupra user ticked Public checkbox and cleared the Main menu checkbox, the value of userbit will be 2 or 00000010. The example below illustrates how to retrieve pages of a selected type. In addition, the script analyzes the value of $isLogged variable and if a site visitor is not logged on, the query will return only pages having checkbox Public ticked.
|