";
$html .= "
";
$html .= apply_filters("wpdiscuz_mu_tabs", "");
$html .= "
";
echo $html;
}
}
public function commentText($content, $comment) {
if ($comment && strpos($this->requestUri, self::PAGE_COMMENTS) !== false && $this->options->content["wmuIsShowFilesDashboard"]) {
$content = $this->getAttachments($content, $comment);
}
return $content;
}
public function afterReadMore($content, $comment) {
return $this->getAttachments($content, $comment);
}
private function getAttachments($content, $comment) {
$attachments = get_comment_meta($comment->comment_ID, self::METAKEY_ATTACHMENTS, true);
if ($attachments && is_array($attachments)) {
// get files from jetpack CDN on ajax calls
add_filter("jetpack_photon_admin_allow_image_downsize", "__return_true");
$content .= "";
}
return $content;
}
public function getAttachedImages($attachIds, $currentUser = null, $size = "full", $lazyLoad = true) {
global $pagenow;
$images = "";
if ($attachIds) {
$attachments = get_posts(["include" => $attachIds, "post_type" => "attachment", "orderby" => "ID", "order" => "asc"]);
if ($attachments && is_array($attachments)) {
$style = "";
if ($pagenow == self::PAGE_COMMENTS) {
$style .= "max-height:100px;";
$style .= "width:auto;";
$height = "";
$width = "";
$secondarySizeKey = "";
$secondarySize = "";
} else {
if (count($attachments) > 1) {
$whData = apply_filters("wpdiscuz_mu_image_sizes", ["width" => 90, "height" => 90]);
$width = $whData["width"];
$height = $whData["height"];
} else {
$width = $this->options->content["wmuSingleImageWidth"];
$height = $this->options->content["wmuSingleImageHeight"];
}
if (intval($width)) {
$primarySizeKey = "width";
$primarySize = $width;
$secondarySizeKey = "height";
$secondarySize = $height;
} else {
$primarySizeKey = "height";
$primarySize = $height;
$secondarySizeKey = "width";
$secondarySize = $width;
}
$style .= "max-$primarySizeKey:{$primarySize}px;";
$style .= "$primarySizeKey:{$primarySize}px;";
$style .= "$secondarySizeKey:auto;";
}
if ($pagenow == self::PAGE_COMMENTS) {
$size = "thumbnail";
} else {
foreach ($this->getImageSizes() as $sizeKey => $sizeValue) {
if (!intval($sizeValue["height"]) && !intval($sizeValue["width"])) {
continue;
}
if ($sizeValue[$primarySizeKey] > 0 && $primarySize <= $sizeValue[$primarySizeKey]) {
$size = $sizeKey;
break;
} else {
$size = "full";
}
}
}
$lightboxCls = $this->options->content["wmuIsLightbox"] ? "wmu-lightbox" : "";
$wmuLazyLoadImages = apply_filters("wpdiscuz_mu_lazyload_images", "");
foreach ($attachments as $attachment) {
$deleteHtml = $this->getDeleteHtml($currentUser, $attachment, "image");
$url = $this->helper->fixURLScheme(wp_get_attachment_image_url($attachment->ID, "full"));
$srcData = wp_get_attachment_image_src($attachment->ID, $size);
$srcData = wp_get_attachment_image_src($attachment->ID, $size);
$src = $this->helper->fixURLScheme($srcData[0]);
if ($wmuLazyLoadImages && $lazyLoad) {
$srcValue = "data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";
$dataSrcValue = $src;
} else {
$srcValue = $src;
$dataSrcValue = "";
}
$attachmentId = self::encrypt($attachment->ID);
$alt = get_post_meta($attachment->ID, "_wp_attachment_image_alt", true);
$images .= "