@description: result of subscribe to mailing list action
*/
functionm_subscribe_result()
{
global$SubscribeResult;
if(strlen($SubscribeResult))
returnlanguage($SubscribeResult);
return"";
}
/*
@description: email address of user subscribing to mailing list
*/
functionm_subscribe_address()
{
global$SubscribeAddress;
if(strlen($_GET["subscribe_email"]))
return$_GET["subscribe_email"];
return"";
}
/*
@description: Error message of subscribe to mailing list action
*/
functionm_subscribe_error()
{
global$SubscribeError;
if(strlen($SubscribeError))
returnlanguage($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>m_sort_cats: Sort categories
<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: Used in conjuction with l_list_cats. This function generates the page navigation
for the list. If this tag is called before the list tag, this function will load
the links. For that reason, the _ListType attribute is required if the pagnav
tag preceeds the l_list_links tag in the template. Generally, it is good practice to
duplicate all attributes set for l_list_links.
@attrib: _PagesToList:int: Number of pages to list (default is 10)
@attrib: _ShortList:bool: If set, uses the shortlist configuration value for links
@attrib: _label:lang: language tag to include in the output if there are pages to list. If there are no pages listed, this text will not be included (resulting in an empty output)
@attrib: _ListType::Determines the type of list to generate<br>
Possible values:<UL>
<LI>Category: List links from the current category (default)
//$sql = "SELECT * FROM ".$objSearchConfig->SourceTable." WHERE TableName='$table' AND AdvancedSearch=1 ORDER BY DisplayOrder";
$sql="SELECT sc.* FROM ".$objSearchConfig->SourceTable." AS sc LEFT JOIN ".GetTablePrefix()."CustomField AS cf ON sc.CustomFieldId = cf.CustomFieldId WHERE (TableName='$table' OR ((TableName='".GetTablePrefix()."CustomField' OR TableName='CustomField') AND cf.Type = $ItemType)) AND AdvancedSearch=1 ORDER BY sc.DisplayOrder";
@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>
@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)
@description: Returns the MetaKeywords field for a category, or the system MetaKeywords value if the category doesn't have a value for MetaKeywords
@attrib: _CatId:int: Category to use (The current category is used by default)
*/
functionm_meta_keywords($attribs=array())
{
global$objCatList,$objConfig;
$catid=(int)$attribs["_catid"];
if(!$catid)
{
$catid=$objCatList->CurrentCategoryID();
}
if($catid)
{
$c=$objCatList->GetItem($catid);
$keywords=$c->Get("MetaKeywords");
}
if(!strlen($keywords))
{
$keywords=$objConfig->Get("Category_MetaKey");
}
return$keywords;
}
/*
@description: Returns the MetaDescription field for a category, or the system MetaDescription value if the category doesn't have a value for MetaDescription
@attrib: _CatId:int: Category to use (The current category is used by default)
*/
functionm_meta_description($attribs=array())
{
global$objCatList,$objConfig;
$catid=(int)$attribs["_catid"];
if(!$catid)
{
$catid=$objCatList->CurrentCategoryID();
}
if($catid)
{
$c=$objCatList->GetItem($catid);
$desc=$c->Get("MetaDescription");
}
if(!strlen($desc))
{
$desc=$objConfig->Get("Category_MetaDesc");
}
return$desc;
}
/*
@description: return the number of items in the database
@attrib: _ItemType:: Name of item to count
@attrib: _ListType:: Type of item to count (ie: favorites, editor's pick, etc)
@attrib: _CategoryCount:int: Limit scope to the current category
@attrib: _SubCats:bool: Count items in all subcategories (_CategoryCount must be set)
@attrib: _Today:bool: Count items added today
@attrib: _GroupOnly:bool: Only count items the current user can view
$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