- @description: result of subscribe to mailing list action
-*/
-function m_subscribe_result()
-{
- global $SubscribeResult;
-
- if(strlen($SubscribeResult))
- return language($SubscribeResult);
- return "";
-}
-
-/*
- @description: email address of user subscribing to mailing list
-*/
-function m_subscribe_address()
-{
- global $SubscribeAddress;
-
- if(strlen($SubscribeAddress))
- return $SubscribeAddress;
- return "";
-}
-
-/*
- @description: Error message of subscribe to mailing list action
-*/
-function m_subscribe_error()
-{
- global $SubscribeError;
-
- if(strlen($SubscribeError))
- return language($SubscribeError);
- return "";
-}
-
-
-/*
- @description: Displays a prompt for a form field
- @attrib: _Form:: Form name for the field
- @attrib: _Field:: Field Name
- @attrib: _LangText:lang: Language var to use for field label
- @attrib: _plaintext:: Plain text to use for field label (langtext is used by default if both are set)
- @attrib: _Template:tpl: template used to display the field label (if not set "<inp:form_prompt />" is used
- @attrib: _ErrorTemplate:tpl: If the field is in an error state (ie missing input) this template is used. Will default to the normal template if not set
- @description: Generates the ACTTION property for a FORM tag used by In-Portal
- @attrib: _Template:tpl: If set, this is the template the form submits to (default is the current template)
- @attrib: _Form:: The form name<br>Possible Values:
- <UL>
- <LI>login: user login
- <LI>logout: user logout
- <LI>forgotpw: Form to prompt the user for forgotten password information
- <LI>forgotpw_confirm: confirmation form for forgotpw
- <LI>suggest: form to suggest the site to a friend
- <LI>suggest_confirm: form to confirm suggestion of the site to a friend
- <LI>m_subscribe: form to subscribe to the mailing list
- <LI>subscribe_confirm: form to confirm subscription to the mailing list
- <LI>m_unsubscribe: form to unsubscribe from the mailing list
- <LI>unsubscribe_confirm: form to confirm un-subscription from the mailing list
- <LI>m_acctinfo: user account information
- <LI>m_profile: system-level profile information
- <LI>m_register: New User registration form
- <LI>m_addcat: Suggest Category form
- <LI>m_addcat_confirm: Confirmation for add category
- <LI>m_simplesearch: Perform a simple search
- <LI>m_simple_subsearch: Search within results
- <LI>m_adv_searchtype: Form to select type of advanced search
- <LI>m_adv_subsearch: Advanced Search
- <LI>error_access: form displayed on the access denied template
- <LI>error_template: Form displayed on the template error page
- <LI>m_set_theme: Form displayed for theme selection
- </UL>
- @attrib: _SubscribeTemplate:tpl: The destination template with "m_subscribe", "subscribe_confirm", "unsubscribe_confirm" _Form actions. Can be reused in other scenarios as programmed.
- @attrib: _UnSubscribeTemplate:tpl: The destination template for "m_subscribe" _Form action. Can be reused in other scenarios as programmed.
- @attrib: _ConfirmTemplate:tpl: The destination template for "m_unsubscribe", "suggest" _Form actions. Can be reused in other scenarios as programmed.
- @attrib: _DestTemplate:tpl: The destination template for "suggest_confirm", "suggest" _Form actions. Can be reused in other scenarios as programmed.
- @attrib: _ErrorTemplate:tpl: The destination template extensively used in most of _Form actions in case of error.
- @attrib: _Referer:bool: The destination template will be taken from referer page we can from.
- @description: List all subcategories a user is allowed to view
- @attrib: _columns:int: Numver of columns to display the categories in (defaults to 1)
- @attrib: _maxlistcount:int: Maximum number of categories to list
- @attrib: _FirstItemTemplate:tpl: Template used for the first category listed
- @attrib: _LastItemTemplate:tpl: Template used for the last category listed
- @attrib: _ItemTemplate:tpl: default template used for category list items
- @attrib: _NoTable:bool: If set to 1, the categories will not be listed in a table. If a table is used, all HTML attributes are passed to the TABLE tag
- @description: List all categories matched in a search
- @attrib: _columns:int: Numver of columns to display the categories in (defaults to 1)
- @attrib: _maxlistcount:int: Maximum number of categories to list
- @attrib: _ShortList:bool: If set, the Perpage_Category_Short setting is used instead of Perpage_Category
- @attrib: _FirstItemTemplate:tpl: Template used for the first category listed
- @attrib: _LastItemTemplate:tpl: Template used for the last category listed
- @attrib: _ItemTemplate:tpl: default template used for category list items
- @attrib: _NoTable:bool: If set to 1, the categories will not be listed in a table. If a table is used, all HTML attributes are passed to the TABLE tag
- @description: returns a text based on user permissions. Text from inside of the tag will be returned if text attributes are not specified and user has permissions to category, or if _NoPerm attribute set to 1 and user doesn't have permissions. Otherwise entire section will be excluded.
- @attrib: _Text:lang: Template to link to if the user has access
- @attrib: _PlainText:: This template is used if the user does not have a permission listed in the _perm attribute. If this attirbute is not included and the user does not have access, the "login" template is used.
- @attrib: _DenyText:lang: Template to link to if the user has access
- @attrib: _PlainDenyText:: This exact text is used if the user does not have a permission listed in the _perm attribute and _DenyText attribute is not set.
- @attrib: _perm:: A list of permissions to check. If the user has any of the the permissions in the list, the link will be generated.
- @attrib: _System:bool: Set this attribute if one of the permissions in the list is a system permission (ie: LOGIN)
- @attrib: _Category:int: Set the current category to this ID. If not set, the current category is unchanged
- @attrib: _MatchAllPerms:int: Checks for all listed Permissions to be TRUE. Note: this attribute is rarely used.
- @attrib: _NoPerm:int: The whole tag will return inner text if user has no permissions and attribute set to 1. Default value is 0.
- @example: <inp:m_perm_text _Text="!lu_allow_language_tag!" _PlainText="Just a text" _DenyText="!lu_deny_language_tag!" _PlainDenyText="Just a plain text" _Perm="login" _MatchAllPerms="1" _NoPerm="0">Some HTML here!</inp>
-*/
-function m_perm_text($attribs = array())
-{
- global $var_list, $var_list_update, $m_var_list_update, $objCatList, $objSession;
- @attrib:CatId:int: Category ID of category, or current category if not set
- @attrib:_ListItem: Comma-separated list of item types (ie: Link, Topic, Category, News) The items are listed in the order this list provides, then by priority.
- Each item should have its own template passed in as an attribute (_{ItemType}Template)
-*/
-function m_related_items($attribs)
-{
- global $objItemTypes, $objCatList, $content_set;
- $sessql = "SELECT DISTINCT(PortalUserId) FROM $stable";
- if(count($online_friends)>0)
- {
- $sql = "SELECT $ftable.ResourceId,$ftable.ItemTypeId, $ptable.PortalUserId FROM $ftable ";
- $sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) WHERE ItemTypeId=6 AND ";
- $sql .= " $ptable.PortalUserId NOT IN (".implode(",",$online_friends).") AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId'];
- }
- else
- {
- $sql = "SELECT $ftable.ResourceId,$ftable.ItemTypeId, $ptable.PortalUserId FROM $ftable ";
- $sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) WHERE ItemTypeId=6 AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId'];
- $sessql = "SELECT DISTINCT(PortalUserId) FROM $stable";
-
- if(count($online_friends)>0)
- {
- $sql = "SELECT count($ftable.ResourceId) as ItemCount FROM $ftable ";
- $sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) WHERE ItemTypeId=6 AND ";
- $sql .= " $ptable.PortalUserId NOT IN (".implode(",",$online_friends).") AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId'];
- }
- else
- {
- $sql = "SELECT count($ftable.ResourceId) as ItemCount FROM $ftable ";
- $sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) WHERE ItemTypeId=6 AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId'];
- }
- $rs = $ado->Execute($sql);
- return $rs->fields["ItemCount"];
- }
-}
-
-/*
- @description: Returns the number of users the current user has marked as 'friend' today
- $sql = "SELECT count(*) as c FROM ".GetTablePrefix()."Favorites WHERE ItemTypeId=6 and PortalUserId=".$objSession->Get("PortalUserId")." AND Modified>$today";
- $rs = $ado->Execute($sql);
- if($rs && !$rs->EOF)
- $ret = $rs->fields["c"];
- return $ret;
-}
-
-/*
- @description: Returns the number of items in a search result
+ @description: result of subscribe to mailing list action
+*/
+function m_subscribe_result()
+{
+ global $SubscribeResult;
+
+ if(strlen($SubscribeResult))
+ return language($SubscribeResult);
+ return "";
+}
+
+/*
+ @description: email address of user subscribing to mailing list
+*/
+function m_subscribe_address()
+{
+ global $SubscribeAddress;
+
+ if(strlen($SubscribeAddress))
+ return $SubscribeAddress;
+ return "";
+}
+
+/*
+ @description: Error message of subscribe to mailing list action
+*/
+function m_subscribe_error()
+{
+ global $SubscribeError;
+
+ if(strlen($SubscribeError))
+ return language($SubscribeError);
+ return "";
+}
+
+
+/*
+ @description: Displays a prompt for a form field
+ @attrib: _Form:: Form name for the field
+ @attrib: _Field:: Field Name
+ @attrib: _LangText:lang: Language var to use for field label
+ @attrib: _plaintext:: Plain text to use for field label (langtext is used by default if both are set)
+ @attrib: _Template:tpl: template used to display the field label (if not set "<inp:form_prompt />" is used
+ @attrib: _ErrorTemplate:tpl: If the field is in an error state (ie missing input) this template is used. Will default to the normal template if not set
+ @description: Generates the ACTTION property for a FORM tag used by In-Portal
+ @attrib: _Template:tpl: If set, this is the template the form submits to (default is the current template)
+ @attrib: _Form:: The form name<br>Possible Values:
+ <UL>
+ <LI>login: user login
+ <LI>logout: user logout
+ <LI>forgotpw: Form to prompt the user for forgotten password information
+ <LI>forgotpw_confirm: confirmation form for forgotpw
+ <LI>suggest: form to suggest the site to a friend
+ <LI>suggest_confirm: form to confirm suggestion of the site to a friend
+ <LI>m_subscribe: form to subscribe to the mailing list
+ <LI>subscribe_confirm: form to confirm subscription to the mailing list
+ <LI>m_unsubscribe: form to unsubscribe from the mailing list
+ <LI>unsubscribe_confirm: form to confirm un-subscription from the mailing list
+ <LI>m_acctinfo: user account information
+ <LI>m_profile: system-level profile information
+ <LI>m_register: New User registration form
+ <LI>m_addcat: Suggest Category form
+ <LI>m_addcat_confirm: Confirmation for add category
+ <LI>m_simplesearch: Perform a simple search
+ <LI>m_simple_subsearch: Search within results
+ <LI>m_adv_searchtype: Form to select type of advanced search
+ <LI>m_adv_subsearch: Advanced Search
+ <LI>error_access: form displayed on the access denied template
+ <LI>error_template: Form displayed on the template error page
+ <LI>m_set_theme: Form displayed for theme selection
+ </UL>
+ @attrib: _SubscribeTemplate:tpl: The destination template with "m_subscribe", "subscribe_confirm", "unsubscribe_confirm" _Form actions. Can be reused in other scenarios as programmed.
+ @attrib: _UnSubscribeTemplate:tpl: The destination template for "m_subscribe" _Form action. Can be reused in other scenarios as programmed.
+ @attrib: _ConfirmTemplate:tpl: The destination template for "m_unsubscribe", "suggest" _Form actions. Can be reused in other scenarios as programmed.
+ @attrib: _DestTemplate:tpl: The destination template for "suggest_confirm", "suggest" _Form actions. Can be reused in other scenarios as programmed.
+ @attrib: _ErrorTemplate:tpl: The destination template extensively used in most of _Form actions in case of error.
+ @attrib: _Referer:bool: The destination template will be taken from referer page we can from.
+ @description: List all subcategories a user is allowed to view
+ @attrib: _columns:int: Numver of columns to display the categories in (defaults to 1)
+ @attrib: _maxlistcount:int: Maximum number of categories to list
+ @attrib: _FirstItemTemplate:tpl: Template used for the first category listed
+ @attrib: _LastItemTemplate:tpl: Template used for the last category listed
+ @attrib: _ItemTemplate:tpl: default template used for category list items
+ @attrib: _NoTable:bool: If set to 1, the categories will not be listed in a table. If a table is used, all HTML attributes are passed to the TABLE tag
+ @description: List all categories matched in a search
+ @attrib: _columns:int: Numver of columns to display the categories in (defaults to 1)
+ @attrib: _maxlistcount:int: Maximum number of categories to list
+ @attrib: _ShortList:bool: If set, the Perpage_Category_Short setting is used instead of Perpage_Category
+ @attrib: _FirstItemTemplate:tpl: Template used for the first category listed
+ @attrib: _LastItemTemplate:tpl: Template used for the last category listed
+ @attrib: _ItemTemplate:tpl: default template used for category list items
+ @attrib: _NoTable:bool: If set to 1, the categories will not be listed in a table. If a table is used, all HTML attributes are passed to the TABLE tag
+ @description: returns a text based on user permissions. Text from inside of the tag will be returned if text attributes are not specified and user has permissions to category, or if _NoPerm attribute set to 1 and user doesn't have permissions. Otherwise entire section will be excluded.
+ @attrib: _Text:lang: Template to link to if the user has access
+ @attrib: _PlainText:: This template is used if the user does not have a permission listed in the _perm attribute. If this attirbute is not included and the user does not have access, the "login" template is used.
+ @attrib: _DenyText:lang: Template to link to if the user has access
+ @attrib: _PlainDenyText:: This exact text is used if the user does not have a permission listed in the _perm attribute and _DenyText attribute is not set.
+ @attrib: _perm:: A list of permissions to check. If the user has any of the the permissions in the list, the link will be generated.
+ @attrib: _System:bool: Set this attribute if one of the permissions in the list is a system permission (ie: LOGIN)
+ @attrib: _Category:int: Set the current category to this ID. If not set, the current category is unchanged
+ @attrib: _MatchAllPerms:int: Checks for all listed Permissions to be TRUE. Note: this attribute is rarely used.
+ @attrib: _NoPerm:int: The whole tag will return inner text if user has no permissions and attribute set to 1. Default value is 0.
+ @example: <inp:m_perm_text _Text="!lu_allow_language_tag!" _PlainText="Just a text" _DenyText="!lu_deny_language_tag!" _PlainDenyText="Just a plain text" _Perm="login" _MatchAllPerms="1" _NoPerm="0">Some HTML here!</inp>
+*/
+function m_perm_text($attribs = array())
+{
+ global $var_list, $var_list_update, $m_var_list_update, $objCatList, $objSession;
+ @attrib:CatId:int: Category ID of category, or current category if not set
+ @attrib:_ListItem: Comma-separated list of item types (ie: Link, Topic, Category, News) The items are listed in the order this list provides, then by priority.
+ Each item should have its own template passed in as an attribute (_{ItemType}Template)
+*/
+function m_related_items($attribs)
+{
+ global $objItemTypes, $objCatList, $content_set;
+ $sessql = "SELECT DISTINCT(PortalUserId) FROM $stable";
+ if(count($online_friends)>0)
+ {
+ $sql = "SELECT $ftable.ResourceId,$ftable.ItemTypeId, $ptable.PortalUserId FROM $ftable ";
+ $sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) WHERE ItemTypeId=6 AND ";
+ $sql .= " $ptable.PortalUserId NOT IN (".implode(",",$online_friends).") AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId'];
+ }
+ else
+ {
+ $sql = "SELECT $ftable.ResourceId,$ftable.ItemTypeId, $ptable.PortalUserId FROM $ftable ";
+ $sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) WHERE ItemTypeId=6 AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId'];
+ $sessql = "SELECT DISTINCT(PortalUserId) FROM $stable";
+
+ if(count($online_friends)>0)
+ {
+ $sql = "SELECT count($ftable.ResourceId) as ItemCount FROM $ftable ";
+ $sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) WHERE ItemTypeId=6 AND ";
+ $sql .= " $ptable.PortalUserId NOT IN (".implode(",",$online_friends).") AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId'];
+ }
+ else
+ {
+ $sql = "SELECT count($ftable.ResourceId) as ItemCount FROM $ftable ";
+ $sql .="INNER JOIN $ptable ON ($ftable.ResourceId=$ptable.ResourceId) WHERE ItemTypeId=6 AND $ftable.PortalUserId = ".$logedin_user; //$u->Data['ResourceId'];
+ }
+ $rs = $ado->Execute($sql);
+ return $rs->fields["ItemCount"];
+ }
+}
+
+/*
+ @description: Returns the number of users the current user has marked as 'friend' today
+ $sql = "SELECT count(*) as c FROM ".GetTablePrefix()."Favorites WHERE ItemTypeId=6 and PortalUserId=".$objSession->Get("PortalUserId")." AND Modified>$today";
+ $rs = $ado->Execute($sql);
+ if($rs && !$rs->EOF)
+ $ret = $rs->fields["c"];
+ return $ret;
+}
+
+/*
+ @description: Returns the number of items in a search result