In page view video, which variable has the ID of the owner of the video / album?
Does anyone know how I get the ID of the owner of a video or album? What global variable dolphin has this ID?
Thank you!
In page view video, which variable has the ID of the owner of the video / album?
Does anyone know how I get the ID of the owner of a video or album? What global variable dolphin has this ID?
Thank you! |
i think this is it: $this->aFileInfo['medProfId'], caredesign.net |
No such global variable. https://www.deanbassett.com |
Thanks guys!!
But $this->aFileInfo['medProfId']; returns an empty value.
Yes, the URL is m/videos/view/NameOfVideo
But I'm trying to use this variable inside the function _getActionsBox (&$a, $isJustPosted)
It governs the comments of the video page. |
try setting it to a variable - i too have had issues using those types of dolphin coding. Example: $Author_ID = $this->aFileInfo['medProfId']; caredesign.net |
Yes, I did it. But unfortunately it returns empty value. I tried to put in SESSION and Cookie, and even then it returns empty value when I try to get this variable within this function. |
what exactly is your code you are trying to use - could you post it? It may be something so small, that you are missing it. I do it myself so many times. After looking at a site for so long, your brain tends to tell your eyes what it should be instead of your eyes telling your brain what is actually there. caredesign.net |
The file is BxBaseCmtsView.php
This file have a function used to manage existing comments.
Watch it:
function _getActionsBox(&$a, $isJustPosted) {
$aAuthor2 = $this->aFileInfo['medProfId'];
$n = $this->getAllowedEditTime(); $isEditAllowedPermanently = ($a['cmt_author_id'] == $this->_getAuthorId() && $this->isEditAllowed()) || $this->isEditAllowedAll(); $isRemoveAllowedPermanently = ($a['cmt_author_id'] == $this->_getAuthorId() && $this->isRemoveAllowed()) || $this->isRemoveAllowedAll();
$sRet = '<tr id="cmt-jp-'.$a['cmt_id'].'" class="cmt-foot bx-def-font-small"><td class="' . $this->_sStylePrefix . '-cont-l"> '.$aAuthor2.'</td><td class="' . $this->_sStylePrefix . '-cont-m">'; $sRet .= '<span class="cmt-posted-ago">' . $a['cmt_ago'] . '</span>';
if($this->_aSystem['is_mood']) $sRet .= '<span class="bullet">·</span><span class="cmt-mood-text">' . _t($this->_aMoodText[$a['cmt_mood']]) . '</span>';
if($isRemoveAllowedPermanently) $sRet .= '<span class="bullet">·</span><a class="cmt-comment-manage-delete" title="' . _t('_Delete') . '" href="javascript:void(0)" onclick="' . $this->_sJsObjName . '.cmtRemove(this, \'' . $a['cmt_id'] . '\'); return false;">'._t('_Delete').'</a>';
if((($isJustPosted && $n) || $isEditAllowedPermanently) && strpos($a['cmt_text'], 'video_comments') === false) $sRet .= '<span class="bullet">·</span><a class="cmt-comment-manage-edit" title="'._t('_Edit').'" href="javascript:void(0)" onclick="' . $this->_sJsObjName . '.cmtEdit(this, \'' . $a['cmt_id'] . '\'); return false;">'._t('_Edit').'</a>';
if($a['cmt_replies']) $sRet .= '<span class="bullet">·</span>' . $this->_getRepliesBox($a);
if(!$isJustPosted && $this->isPostReplyAllowed()) $sRet .= '<span class="bullet">·</span>' . $this->_getPostReplyBoxTo($a);
if ($isJustPosted && $n && !$isEditAllowedPermanently) $sRet .= '<span class="bullet">·</span>' . _t('_edit_available_for_N_seconds', $n);
$sRet .= '</td><td class="' . $this->_sStylePrefix . '-cont-r"> </td></tr>'; return $sRet; } -------------------------- in bold is what I added to test if I could get the ID correctly.
But this function only get the IDs of who is the owner of the comment and who is visiting the page. I want to get the ID of the owner of the video on that page and use this ID within this function. |
Thanks guys!!
But $this->aFileInfo['medProfId']; returns an empty value.
Yes, the URL is m/videos/view/NameOfVideo
But I'm trying to use this variable inside the function _getActionsBox (&$a, $isJustPosted)
It governs the comments of the video page. Well than that's a problem. Because ...... https://www.deanbassett.com |
How about this. https://www.deanbassett.com |
Actually, scratch that. I am guessing that is the comment author. and not the video author. https://www.deanbassett.com |
I'm using Dolphin 7.14 BoonEx Video Module.
Yes, this function is in a file that is included in the box of comments within this page. I used the feature inspect code of chrome can identify where comments on the video were generated in code and got in this function. It is correct. I have tested the use of 'echo' with common variables and they appeared in the comments. |
Actually, scratch that. I am guessing that is the comment author. and not the video author.
Yes, this get o ID of comment author. But thanks. I'll keep trying to get this variable from other parts of this page. It appears in other parts of the page, but I can not has assigned it into this function.
I'll keep trying. Thank you! |
Well, I managed to make it work using SESSION. But I do not think very safe to use the ID of another member via SESSION.
I will use the Username. But I do not know how to get the username of who is logging. I know just take your ID. Does anyone know how I get the username of the user who is logging and visiting a page? Thanks! |
The function is getUsername(); https://www.deanbassett.com |
Thank you! this worked!
I want the owner of the video has the possibility to delete comments of other members in your video.
In the current module videos from BoonEx, only the owner of the comment and the admin can delete. That is, if someone to post an offensive comment against the owner of the video, this owner could not delete the comment.
Now I gotta link 'delete' appear for the owner of the video too. I clicked and it worked. But I need to do more tests because in two tests received access denied message from javascript, but the other 4 tests, it worked and deleted the comment. |
I don't get where you are coming from here. Yes, Boonex did not put it where owners could delete comments left on their content, which is an oversight. I have requested that this be fixed and Deano put in a ticket but who knows when the ticket will be answered. You need to get the owner of the content. My guess was that one needed to add classes for comments to the module; as the blog modules does, to handle the comments. Geeks, making the world a better place |
I managed to fix this problem in BoonEx video now. It's working. :)
Now the video owner can delete comments from other members on your video's page. :D |
I managed to fix this problem in BoonEx video now. It's working. :)
Now the video owner can delete comments from other members on your video's page. :D Would you like to share your solution? Geeks, making the world a better place |
Of course!!! :) I was here searching for the files I changed, after testing several times. Let's go...
1. In file /templates/base/scripts/BxBaseCmtsView.php 1.1 Search for: $n = $this->getAllowedEditTime(); 1.2 Just above, add the code: $aAuthorV = $_SESSION["UserVideo"]; $iVisitorUsername = getUsername(); 1.3 Then, three lines below, search for the line that starts with ... $isRemoveAllowedPermanently = 1.4 Change it: $isRemoveAllowedPermanently = ($a['cmt_author_id'] == $this->_getAuthorId() && $this->isRemoveAllowed()) || $this->isRemoveAllowedAll(); to... $isRemoveAllowedPermanently = ($a['cmt_author_id'] == $this->_getAuthorId() && $this->isRemoveAllowed()) || $iVisitorUsername==$aAuthorV || $this->isRemoveAllowedAll();
2. In file /modules/boonex/videos/classes/BxVideosTemplate.php 2.1 Search for: $aUnit = array( 2.2 Just above, add the code: $_SESSION["UserVideo"]=$aInfo['NickName'];
Done!!! Is ready!!! I recommend clearing your cache before testing! And make a backup of the two files before changing them. Worked with me. Now the author of the video may delete comments for other members on the pages of your videos. :) |