Skip to Content Skip to Menu

ProfileBook (Admin ONLY Delete)

16 years 1 month ago #74000 by ChicagoCallSheet
ProfileBook (Admin ONLY Delete) was created by ChicagoCallSheet
I was trying to figure out some code that I thought others might want as well.
If you have the ProfileBook Tab on CB but you don't want users to Delete comments written by other users about them. Swap this code below into "cb.profilebook.php"
This will allow Users to post comments about other users and Edit what they have written about that user.
It will also disable users from deleting or un-publishing comments written about them, BUT will allow them to write feedback about what was written about them.
AND if their was something that should not be up there, The administrator CAN delete and Un-Publish comments on other users profile.
Hope this helps people out.

*New Code*
[code:1]
if ($isME || $iAmModerator) {

//yes it is so display action links
$base_url = $this->_getAbsURLwithParam($pagingParams);

$return .= "<form name=\"actionForm".$k."\" id=\"actionForm".$k."\" method=\"post\" action=\"".$base_url."\" style=\"display:none;\">"
."<input type=\"submit\" name=\"submitform\" value=\"submit\" style=\"display:none;\" />"
."<input type=\"hidden\" name=\"".$this->_getPagingParamName("id"«»)."\" value=\"".$item->pbid."\" />"
."<input type=\"hidden\" name=\"".$this->_getPagingParamName("published"«»)."\" id=\"published".$k."\" value=\"1\" />"
."<input type=\"hidden\" id=\"formaction".$k."\" name=\"".$this->_getPagingParamName("formaction"«»)."\" value=\"update\" />"
."</form>";

if($item->published==0) {
$published=null;
$publishLink="<a href=\"javascript:document.actionForm".$k.".formaction".$k.".value='publish';document.actionForm".$k.".published".$k.".value=1;document.actionForm".$k.".submit();\">"._pb_Publish."</a>";
}
elseif ($iAmModerator){
$published = "checked=\"checked\"";
$publishLink="<a href=\"javascript:document.actionForm".$k.".formaction".$k.".value='publish';document.actionForm".$k.".published".$k.".value=0;document.actionForm".$k.".submit();\">"._pb_UnPublish."</a>";
}
$popform=null;
$popform .= "<form name=\"adminForm".$k."\" id=\"adminForm".$k."\" method=\"post\" action=\"".$base_url."\">";
$popform .= "<b>"._pb_Publish.":</b><input type=\"checkbox\" name=\"".$this->_getPagingParamName("published"«»)."\" id=\"published".$k."\" value=\"1\" ".$published." />";
$popform .= "<input type=\"hidden\" name=\"".$this->_getPagingParamName("id"«»)."\" value=\"".$item->pbid."\" /><input type=\"hidden\" name=\"".$this->_getPagingParamName("formaction"«»)."\" value=\"update\" />";
$popform .= "<br /><b>"._pb_YourFeedback.":</b><br /><textarea class=\"inputbox\" name=\"".$this->_getPagingParamName("feedback"«»)."\" style=\"height:75px;width:400px;overflow:auto;\" >".htmlspecialchars($item->feedback)."</textarea>";
$popform .= "<br /><input type=\"submit\" value=\""._pb_Update."\" /></form>";
if ($iAmModerator){
$return .= "<a href=\"javascript:if (confirm('".str_replace("'","\\'",_pb_DeleteAreYouSure)."')) { document.actionForm".$k.".formaction".$k.".value='delete';document.actionForm".$k.".submit(); }\">"._pb_Delete
."</a> | ".$publishLink;
}
if ($isME || ($iAmModerator && $item->feedback)) {
$return .= " | <a href=\"javascript:void(0);\" name=\"pbFeedback".$k."\" id=\"pbFeedback".$k."\" onclick=\""
.($iAmModerator && !$isME ? "if (confirm('".str_replace("'","\\'",_pb_EditOthersAreYouSure)."')) " : ""«»)
."return overlib('".str_replace(array("&","\\",'"',"<",">","'","\n","\r"«»), array("&amp;","\\\\","&quot;","&lt;","&gt;","\'","\\n","\\r"«»),$popform)."', STICKY, CAPTION,'"._pb_GiveFeedback."', CENTER,CLOSECLICK,CLOSETEXT,'"._UE_CLOSE_OVERLIB."',WIDTH,350, ANCHOR,'pbFeedback".$k."',ANCHORALIGN,'LR','UR');\">".($item->feedback ? _pb_EditFeedback : _pb_GiveFeedback)."</a> ";
}
$return .= $returnFavor;
}
[/code:1]

Please Log in or Create an account to join the conversation.

  • kingnuss
  • kingnuss
  • OFFLINE
  • Posts: 6
  • Thanks: 0
  • Karma: 0
15 years 5 months ago #98418 by kingnuss
Replied by kingnuss on topic Re:ProfileBook (Admin ONLY Delete)
hey...
this is exactly how I like to use profilebook...
I inserted your code, but no change happens...susers still can delete comments of other users on their profile.
maybe you can give me a hint what I am missing here.
I tried inserting your code at the beginning of cb.profilebook.php, also at the ending...no effect.
using cb 1.2 stable with joomla 1.510
thanks,
Andy

Please Log in or Create an account to join the conversation.

14 years 7 months ago #126408 by davestrand
Replied by davestrand on topic Re:ProfileBook (Admin ONLY Delete)
I am also having this exact problem. I hope there is a fix.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum