Notifications
Clear all

[Solved] wpforo advanced attachments You are not permitted to view this attachment

4 Posts
1 Users
1 Reactions
785 Views
Posts: 4
Customer
Topic starter
(@peter-ivantsov)
Member
Joined: 2 years ago
3 Replies
Posts: 4
Customer
Topic starter
(@peter-ivantsov)
Member
Joined: 2 years ago

i figuer it out when i insert image and in source code its showing.<figure contenteditable="false" data-attachids="137">
 
when I deleted it and change to the normal "IMG Tag" the images are showing in Recent Posts

image

like this one 

image

so i went in this file wpforo-advanced-attachments - >>> includes ->>> class.wpForoAttachmentsTools

i have changed this code 

if( $attach_html ) $attach_html = '<figure data-attachids="' . $attachids . '" contenteditable="false">' . $attach_html . '</figure>';

to this one 

if( $attach_html ) $attach_html;

 

i have removed this figure tag and images working fine in Recent Posts
but the problem is : when click on image not opening in popup and slider are not working. 

so please i need images to show in Recent Posts but working fine / normal as its working 

any help please 

Reply
Posts: 4
Customer
Topic starter
(@peter-ivantsov)
Member
Joined: 2 years ago

I want to images to be showing in Recent Posts or if the image will not showing then not show this msg 
You are not permitted to view this attachment

and want to make images redirect to the post 

Reply
Posts: 4
Customer
Topic starter
(@peter-ivantsov)
Member
Joined: 2 years ago

i did it 😀

change this code in this file
 wpforo-advanced-attachments - >>> includes ->>> class.wpForoAttachmentsTools

foreach( $attachs as $attach ) {
								$fileurl  = preg_replace( '#^https?\:#is', '', $attach['fileurl'] );
$filepath = wpforo_fix_upload_dir( $fileurl );
if( file_exists( $filepath ) ) {
$file_display_name = urldecode( basename( $attach['filename'] ) );
	$attach_html       .= sprintf(
	'<br/><div class="wpfa-item wpfa-file" style="border: 1px dotted #bbb; padding: 5px 10px; font-size: 13px; margin: 5px 2px;"><a class="attach_cant_view" style="cursor: pointer;"> <span style="color: #666;" > %1$s : </span> %2$s </a> </div>',
						wpforo_phrase( 'Attachment', false ),
										$file_display_name
						

to this one 

foreach( $attachs as $attach ) {
   $fileurl  = preg_replace( '#^https?\:#is', '', $attach['fileurl'] );
		$filepath = wpforo_fix_upload_dir( $fileurl );
		if( file_exists( $filepath ) ) {
	$file_display_name = urldecode( basename( $attach['filename'] ) );
		$attach_html       .= sprintf(

		'<br/><div class="wpfaami-boxed" style="min-width: 100px;min-height: 100px;">
<img  style="max-width: 100xpx ;max-height: 100px" title="" src="' .  $fileurl  . '" alt=" ">  </div>',


 wpforo_phrase( 'Attachment', false ),
 $attach_html

				);
								}
							}
						}

					}

Reply
Share:
Scroll to top