UNA
|
Public Member Functions | |
addPageMetaInfo ($iId, $mixedImage=false) | |
metaParse ($iId, $s) | |
metaAddAuto ($iId, $aContentInfo, $CNF, $sFormDisplay) | |
metaAdd ($iId, $s) | |
keywordsIsEnabled () | |
keywordsAdd ($iId, $s) | |
keywordsAddOne ($iId, $s, $bDeletePreviousKeywords=true) | |
keywordsAddAuto ($iId, $aContentInfo, $CNF, $sFormDisplay) | |
metaFields ($aContentInfo, $CNF, $sFormDisplay, $bHtmlOnly=false) | |
keywordsParse ($iId, $s) | |
keywordsParseOne ($iId, $s) | |
keywordsGetHashTagUrl ($sKeyword, $iId, $mixedSection=false) | |
keywordsGet ($iId) | |
keywordsSetSearchCondition ($oSearchResult, $sKeyword, $iCmtsSystemId=0) | |
keywordsSetSearchConditionCmts ($oSearchResult, $sKeyword, $iCmtsSystemId=0) | |
keywordsGetAsSQLPart ($sContentTable, $sContentField, $sKeyword) | |
keywordsPopularList ($iLimit, $mContextId=false) | |
locationsIsEnabled () | |
locationsAdd ($iId, $sLatitude, $sLongitude, $sCountryCode, $sState, $sCity, $sZip='', $sStreet='', $sStreetNumber='') | |
locationsAddFromForm ($iId, $sPrefix='', $oForm=null) | |
locationsString ($iId, $bHTML=true, $aParams=array()) | |
locationsStringFromArray ($aLocation, $bHTML=true, $aParams=array()) | |
locationsSetSearchCondition ($oSearchResult, $sCountry=false, $sState=false, $sCity=false, $sZip=false) | |
locationsGetAsSQLPart ($sContentTable, $sContentField, $sCountry=false, $sState=false, $sCity=false, $sZip=false, $aBounds=array()) | |
locationGet ($iId, $sPrefix='') | |
mentionsIsEnabled () | |
mentionsAdd ($iId, $s) | |
mentionsAddAuto ($iId, $aContentInfo, $CNF, $sFormDisplay) | |
mentionsParse ($iId, $s) | |
mentionsGet ($iId) | |
mentionsSetSearchCondition ($oSearchResult, $iProfileId, $iCmtsSystemId=0) | |
mentionsSetSearchConditionCmts ($oSearchResult, $iProfileId, $iCmtsSystemId=0) | |
onDeleteContent ($iId) | |
Static Public Member Functions | |
static | getObjectInstance ($sObject) |
static | getMetatagsDataByTerm ($sMeta, $sMetaItem, $sTerm) |
static | keywordsCameraModel ($aExif) |
static | locationsRetrieveFromForm ($sPrefix='', $oForm=null) |
static | locationsParseComponents ($aAdress, $sPrefix='') |
static | locationsParseAddressComponents ($aAdress, $sPrefix='') |
Protected Member Functions | |
__construct ($aObject) | |
keywordsAddMeta ($iId) | |
locationsAddMeta ($iId) | |
mentionsAddMeta ($iId) | |
_metaAdd ($iId, $s, $sPreg, $sFuncDelete, $sFuncAdd, $sFuncGet, $iMaxItems, $sAlertName) | |
Protected Attributes | |
$_sObject | |
$_aObject | |
$_oQuery | |
$_aMetas = [] | |
Meta-tags for different content. It can handle #keywords, @mentions, locations and meta image for the content.
Keywords are parsed after content add and edit and added to the database, later when content is displayed #keywords are highlighted as links to the search page with all content with this keyword, also keywords are displayed as meta info in page header.
Location info upon content adding/editing is displayed as custom field, it detects current user location and attach location as hidden form fields. When content is displayed location can be shown as clickable links to search page where results are other items from same location, also location is displayed as meta info in page header as latutude and longitude.
Content image can be added as meta info using this class as well.
To add new meta-tags object insert new record into sys_objects_metatags
table:
To simplify operations with metatags in modules which are derived from some 'base' modules, specify it in module config class in 'CNF' array:
Upon content 'add' and 'edit' form submit, call BxDolMetatags\locationsAddFromForm
Upon 'edit' form display call BxDolMetatags\locationGet to fill-in location form input, for example:
To display location call BxDolMetatags\locationsString:
Upon page display call BxDolMetatags\addPageMetaInfo to add location (and all other, including content image) meta information to the page header:
Form object must have location field, usual name for this field is 'location' (this name is used as $sPrefix in some functions), type is 'custom', also form object must be derived from BxBaseModGeneralFormEntry class, which has custom field declaration.
Upon content 'add' and 'edit' form submit, call BxDolMetatags\keywordsAdd
Before displaying the text with hashtags call BxDolMetatags\keywordsParse to highlight keywords:
Upon page display call BxDolMetatags\addPageMetaInfo to add keywords (and all other, including content image) meta information to the page header.
To be able to search by tags metatgs object must be specified in *SearchResult class as 'object_metatags' in 'aCurrent' array.
Upon content 'add' and 'edit' form submit, call BxDolMetatags\mentionsAdd
Before displaying the text with mentions call BxDolMetatags\mentionsParse:
Upon page display call BxDolMetatags\addPageMetaInfo to add all available meta info to the page meta into where possible, however it doesn't adding anyting for mentions for now.
To be able to search by mentions object must be specified in *SearchResult class as 'object_metatags' in 'aCurrent' array.
Upon content 'add' and 'edit' form submit, call BxDolMetatags\metaAdd
or call BxDolMetatags\metaAddAuto, it autodetects fields with metainfo:
Before displaying the text with different metainfo call BxDolMetatags\metaParse:
Upon page display call BxDolMetatags\addPageMetaInfo to add all available meta info to the page meta into where possible.
When content is deleted associated meta data can be deleted by calling BxDolMetatags\onDeleteContent:
|
protected |
Constructor
$aObject | array of metags object options |
|
protected |
meta_keyword
before_added
meta
- [string] by ref, keyword, can be overridden in hook processingcontent_id
- [int] content idobject
- [string] metatags object name
It's equivalent to 'meta_keyword', 'before_added' - hook to override meta keyword before it will be processed except mention value is used in $object_id
keyword_added
meta
- [string] keywordcontent_id
- [int] content idsource
- [string] unique source id
It's equivalent to '{object_name}', 'keyword_added' - hook after a keyword (hashtag) was recognized in provided text
meta_keyword
added
meta
- [string] keywordcontent_id
- [int] content idsource
- [string] unique source idobject
- [string] metatags object name
It's equivalent to 'meta_keyword', 'added' - hook after a keyword (hashtag) was recognized in provided text
BxDolMetatags::addPageMetaInfo | ( | $iId, | |
$mixedImage = false ) |
Add all available meta tags to the head section
|
static |
Get metatags by term
string | $sMeta | - 'keywords' is only supported meta for now |
type | $sMetaItem | |
type | $sTerm |
|
static |
Get metatags object instance by object name
$sObject | object name |
Implements iBxDolFactoryObject.
BxDolMetatags::keywordsAdd | ( | $iId, | |
$s ) |
Add #keywords from the string
$iId | content id |
$s | string with #keywords |
BxDolMetatags::keywordsAddAuto | ( | $iId, | |
$aContentInfo, | |||
$CNF, | |||
$sFormDisplay ) |
Add #keywords from the content fields
$iId | content id |
$aContentInfo | content info array |
$CNF | module config array |
$sFormDisplay | form display object |
|
protected |
Add keywords meta info to the head section
$iId | content id |
BxDolMetatags::keywordsAddOne | ( | $iId, | |
$s, | |||
$bDeletePreviousKeywords = true ) |
Add keyword from the whole string
$iId | content id |
$s | keyword |
keyword_added
meta
- [string] recognized keywordcontent_id
- [int] content idsource
- [string] unique source id
It's equivalent to '{object_name}', 'keyword_added' - hook after a keyword (hashtag) was recognized in provided text except object
parameter with metatags object name was added in $extra_params
|
static |
This function is specifically for formatting "Photo Camera" string, when "Photo Camera" is used as image hashtag
BxDolMetatags::keywordsGet | ( | $iId | ) |
Get list of keywords associated with the content
BxDolMetatags::keywordsGetAsSQLPart | ( | $sContentTable, | |
$sContentField, | |||
$sKeyword ) |
Get part of SQL query for meta keyword
$sContentTable | content table or alias |
$sContentField | content table field or field alias |
$sKeyword | keyword |
BxDolMetatags::keywordsGetHashTagUrl | ( | $sKeyword, | |
$iId, | |||
$mixedSection = false ) |
meta_keyword
url
url
- [string] by ref, keyword URL, can be overridden in hook processingkeyword
- [string] keywordid
- [int] content idobject
- [string] metatags object namesection
- [string] a string with sections (modules) in which a search by keyword will be performed (for default hashtag URL)
BxDolMetatags::keywordsIsEnabled | ( | ) |
Checks if keywords enabled for current metatags object
BxDolMetatags::keywordsParse | ( | $iId, | |
$s ) |
Add links to the #keywords in the string
$iId | content id |
$s | string with #keywords |
BxDolMetatags::keywordsParseOne | ( | $iId, | |
$s ) |
Add link to the provided keyword
$iId | content id |
$s | keyword |
BxDolMetatags::keywordsSetSearchCondition | ( | $oSearchResult, | |
$sKeyword, | |||
$iCmtsSystemId = 0 ) |
Set condition for search results object for meta keyword
$oSearchResult | search results object |
$sKeyword | keyword |
BxDolMetatags::locationGet | ( | $iId, | |
$sPrefix = '' ) |
Get location
$iId | content id |
$sPrefix | field prefix for returning data array |
BxDolMetatags::locationsAdd | ( | $iId, | |
$sLatitude, | |||
$sLongitude, | |||
$sCountryCode, | |||
$sState, | |||
$sCity, | |||
$sZip = '', | |||
$sStreet = '', | |||
$sStreetNumber = '' ) |
Add location for the content
$iId | content id |
$sLatitude | latitude |
$sLongitude | longitude |
$sCountryCode | optional 2 letters country code (ISO 3166-1) |
$sState | optional state/province/territory name |
$sCity | optional city name |
$sZip | optional ZIP/postcode |
$sStreet | optional street name |
$sStreetNumber | optional street number |
BxDolMetatags::locationsAddFromForm | ( | $iId, | |
$sPrefix = '', | |||
$oForm = null ) |
Add location for the content from POST data
$iId | content id |
$sPrefix | field prefix for POST data, or empty - if no prefix |
$oForm | form to use to get POST data, or null - then new form instance will be created |
|
protected |
Add keywords meta info to the head section
$iId | content id |
BxDolMetatags::locationsGetAsSQLPart | ( | $sContentTable, | |
$sContentField, | |||
$sCountry = false, | |||
$sState = false, | |||
$sCity = false, | |||
$sZip = false, | |||
$aBounds = array() ) |
Get part of SQL query for meta locations
$sContentTable | content table or alias |
$sContentField | content table field or field alias |
$sCountry | country and other location info |
BxDolMetatags::locationsIsEnabled | ( | ) |
Checks if locations enabled for current metatags object
|
static |
Parse google's formatted address components into array with the following indexes: lat, lng, country, state, city, zip, street, street_number
|
static |
Parse address components into associative array with the following indexes: lat, lng, country, state, city, zip, street, street_number
|
static |
Retrieve location for the content from POST data
$sPrefix | field prefix for POST data, or empty - if no prefix |
$oForm | form to use to get POST data, or null - then new form instance will be created |
BxDolMetatags::locationsSetSearchCondition | ( | $oSearchResult, | |
$sCountry = false, | |||
$sState = false, | |||
$sCity = false, | |||
$sZip = false ) |
Set condition for search results object for meta locations
$oSearchResult | search results object |
$sCountry | country and other location info |
BxDolMetatags::locationsString | ( | $iId, | |
$bHTML = true, | |||
$aParams = array() ) |
Get locations string with links
$iId | content id |
BxDolMetatags::locationsStringFromArray | ( | $aLocation, | |
$bHTML = true, | |||
$aParams = array() ) |
Get locations string with links
$aLocation | location array |
BxDolMetatags::mentionsAdd | ( | $iId, | |
$s ) |
Add @mentions from the string (most probably @mentions will be some sort of links already, so parsing may have to look for smth like mention name instead of @mention, since there is no usernames for profiles modules and name could contain spaces and othr characters)
$iId | content id |
$s | string with @mentions |
BxDolMetatags::mentionsAddAuto | ( | $iId, | |
$aContentInfo, | |||
$CNF, | |||
$sFormDisplay ) |
Add @mentions from the content of form fields
$iId | content id |
$aContentInfo | content info array |
$CNF | module config array |
$sFormDisplay | form display object |
|
protected |
No mentions meta info in the head section
BxDolMetatags::mentionsGet | ( | $iId | ) |
Get list of profile IDs associated with the content
BxDolMetatags::mentionsIsEnabled | ( | ) |
Checks if mentions enabled for current metatags object
BxDolMetatags::mentionsParse | ( | $iId, | |
$s ) |
Add links to the @mentions in the string (actual tranformation may have to be performed with ready links like mention name)
$iId | content id |
$s | string with @mentions |
BxDolMetatags::mentionsSetSearchCondition | ( | $oSearchResult, | |
$iProfileId, | |||
$iCmtsSystemId = 0 ) |
Set condition for search results object for mentions
$oSearchResult | search results object |
$sMention | smbd |
BxDolMetatags::metaAdd | ( | $iId, | |
$s ) |
Perform
$iId | content id |
$s | string |
BxDolMetatags::metaAddAuto | ( | $iId, | |
$aContentInfo, | |||
$CNF, | |||
$sFormDisplay ) |
Perform
$iId | content id |
$aContentInfo | content info array |
$CNF | module config array |
$sFormDisplay | form display object |
BxDolMetatags::metaFields | ( | $aContentInfo, | |
$CNF, | |||
$sFormDisplay, | |||
$bHtmlOnly = false ) |
Get field names which are subject to parse keywords
BxDolMetatags::metaParse | ( | $iId, | |
$s ) |
Perform
$iId | content id |
$s | string |
BxDolMetatags::onDeleteContent | ( | $iId | ) |
Delete all data associated with the content
$iId | content id |