|
| getObjectAuthorId ($iObjectId=0) |
|
| isUndo () |
|
| getType () |
|
| getMinValue () |
|
| getMaxValue () |
|
| getStatCounter () |
|
| getStatRate () |
|
| getSocketName () |
|
| actionVote () |
|
| vote ($aVoteData=[], $aRequestParamsData=[]) |
|
| actionGetVotedBy () |
|
| isAllowedVote ($isPerformAction=false) |
|
| msgErrAllowedVote () |
|
| isAllowedVoteView ($isPerformAction=false) |
|
| msgErrAllowedVoteView () |
|
| isAllowedVoteViewVoters ($isPerformAction=false) |
|
| msgErrAllowedVoteViewVoters () |
|
| init ($iId) |
|
| getSystemId () |
|
| getSystemName () |
|
| getSystemInfo () |
|
| getId () |
|
| setId ($iId) |
|
| isEnabled () |
|
| isPerformed ($iObjectId, $iAuthorId, $iAuthorIp=0) |
|
| getVote ($iObjectId=0, $bForceGet=false) |
|
| getTrack ($iObjectId, $iAuthorId) |
|
| getConditions ($sMainTable, $sMainField) |
|
| getConditionsTrack ($sMainTable, $sMainField, $iAuthorId=0) |
|
| getSqlParts ($sMainTable, $sMainField) |
|
| getSqlPartsTrack ($sMainTable, $sMainField, $iAuthorId=0) |
|
| getSqlPartsTrackAuthor ($sMainTable, $sMainField, $iObjectId=0) |
|
| addMarkers ($aMarkers) |
|
| getElementAPI ($aParams=[]) |
|
| getCounterAPI ($aParams=[]) |
|
| getQueryObject () |
|
| checkAction ($sAction, $isPerformAction=false) |
|
| checkActionErrorMsg ($sAction) |
|
| onObjectDelete ($iObjectId=0) |
|
|
| __construct ($sSystem, $iId, $iInit=true, $oTemplate=false) |
|
| _isDuplicate ($iObjectId, $iAuthorId, $iAuthorIp, $bVoted) |
|
| _isCount ($aVote=array()) |
|
| _isAllowedVoteByObject ($aObject) |
|
| _getVoteData () |
|
| _putVoteData ($iObjectId, $iAuthorId, $iAuthorIp, $aData, $bPerformUndo) |
|
| _returnVoteData ($iObjectId, $iAuthorId, $iAuthorIp, $aData, $bVoted, $aParams=[]) |
|
| _returnVoteDataForSocket ($aData, $aMask=[]) |
|
| _prepareRequestParamsData ($aParams, $aParamsAdd=array()) |
|
| _getVote ($iObjectId=0, $bForceGet=false) |
|
| _isVote ($iObjectId=0, $bForceGet=false) |
|
| _getTrack ($iObjectId, $iAuthorId) |
|
| _getIconDo ($bVoted) |
|
| _getTitleDo ($bVoted) |
|
| _getTitleDoBy ($aParams=[]) |
|
| _useIconAs ($aParams=[]) |
|
| _getAuthorId () |
|
| _getAuthorPassword () |
|
| _getAuthorIp () |
|
| _getAuthorInfo ($iAuthorId=0) |
|
| _getAuthorObject ($iAuthorId=0) |
|
| _trigger () |
|
| _triggerValue ($iValue) |
|
| _replaceMarkers ($mixed) |
|
| _prepareParamsData ($aParams) |
|
| _getRequestParamsData ($aKeys=array()) |
|
| _getTmplContentElementBlock () |
|
| _getTmplContentElementInline () |
|
| _getTmplContentDoAction () |
|
| _getTmplContentDoActionLabel () |
|
| _getTmplContentCounter () |
|
| _getTmplContentCounterLabel () |
|
Vote for any content
Related classes:
AJAX vote for any content. Stars and Plus based representations are supported.
To add vote section to your feature you need to add a record to 'sys_objects_vote' table:
- ID - autoincremented id for internal usage
- Name - your unique module name, with vendor prefix, lowercase and spaces are underscored
- TableMain - table name where summary votigs are stored
- TableTrack - table name where each vote is stored
- PostTimeout - number of seconds to not allow duplicate vote
- MinValue - min vote value, 1 by default
- MaxValue - max vote value, 5 by default
- IsUndo - is Undo enabled for Plus based votes
- IsOn - is this vote object enabled
- TriggerTable - table to be updated upon each vote
- TriggerFieldId - TriggerTable table field with unique record id, primary key
- TriggerFieldRate - TriggerTable table field with average rate
- TriggerFieldRateCount - TriggerTable table field with votes count
- ClassName - your custom class name, if you overrride default class
- ClassFile - your custom class path
You can refer to BoonEx modules for sample record in this table.
Example of usage
To get Star based vote you need to have different values for MinValue and MaxValue (for example 1 and 5) and IsUndo should be equal to 0. To get Plus(Like) based vote you need to have equal values for MinValue and MaxValue (for example 1) and IsUndo should be equal to 1. After filling the other paramenters in the table you can show vote in any place, using the following code:
if (!$o->isEnabled()) return '';
echo $o->getElementBlock();
static getObjectInstance($sSys, $iId, $iInit=true, $oTemplate=false)
Definition BxDolVote.php:105
Memberships/ACL:
Alerts(hooks)
Alerts type/unit - every module has own type/unit, it equals to ObjectName. The following alerts are rised:
- rate - comment was posted
- $iObjectId - entry id
- $iSenderId - rater user id
- $aExtra['rate'] - rate