Notifications
Clear all

wpForo 1.x.x [Closed] Picture view

9 Posts
3 Users
2 Reactions
2,435 Views
Zazzy
Posts: 18
Topic starter
(@zazzy)
Eminent Member
Joined: 6 years ago

Actually I have 4 questions;

1)How do I set pictures on the entire forum to display as a normal picture instead of displaying as a file format.

2) Is there a way I can display total views of all topics on the forum's statistics panel?

3) How do I make font post font to be set at 12pt by default?

4) How do I remove the panel attached below.

 

8 Replies
Zazzy
Posts: 18
Topic starter
(@zazzy)
Eminent Member
Joined: 6 years ago

For question nunber (1), this is what I mean...

 

 

Sofy
Posts: 4900
 Sofy
Admin
(@sofy)
Support Team
Joined: 7 years ago

Hi @zazzy,

1) How do I set pictures on the entire forum to display as a normal picture instead of displaying as a file format.

wpForo supports image URL auto-embed:

I'd suggest you read Robert's answer in this support topic:

https://wpforo.com/community/how-to-and-troubleshooting-2/how-can-i-actually-make-my-forum-truly-private/#post-21748

This support topic also should be helpful, please check it out: 

https://wpforo.com/community/how-to-and-troubleshooting-2/how-can-i-swtich-off-the-xml-sitemap/paged/2/

Also please read this support topic it also should be helpful:

https://wpforo.com/community/how-to-and-troubleshooting-2/how-to-add-the-image-button-to-mce-toolbar-editor/#post-2401

 2) Is there a way I can display total views of all topics on the forum's statistics panel?

Please read this support topic:

https://wpforo.com/community/how-to-and-troubleshooting-2/remove-post-view-count/#post-20398

3)How do I make font post font to be set at 12pt by default?

The option is located in Dashboard > Forums > Settings > Styles admin page. 

More info here: 

https://wpforo.com/docs/root/wpforo-settings/style-settings/

4) How do I remove the panel attached below.

I don't follow you. Do you mean disabling the whole buttons? 

1 Reply
Zazzy
(@zazzy)
Joined: 6 years ago

Eminent Member
Posts: 18

Out of the 4 questions, you answered question number 3 to my satisfaction.

But; 

In question 1, what I'm asking is, if one uploads a picture using the "choose file" option, after the post is made, the image doesn't give a full image display, rather is displays as a file attachment.

As an admin, I can embed image from the wp-uploads using the image url but an ordinary subscriber can't do that & I wouldn't want a subscriber to have access to the Wp-uploads.

So I want if a user uploads an image using "choose file" let the image be able to display the image & not wrap it like an attachment.

In question 2, I'm not trying the hide the post views. I'm trying to display all post views as an icon on the statistics boards. Example, say 10 topics have 10 views each, I want to have an icon on the statistics board showing "All time post views = 100"

In question 4, yes I meant to disable the whole buttons & leave just the basic ones with bold, italics & the rest. Just view the image again. The buttons in the image I need them disabled.

Posts: 1602
(@anonymous20)
Noble Member
Joined: 9 years ago

For one (1), there is a solution provided here if you did a little search.

But anyways, here it comes ready for you. Add this to your THEME functions.

add_filter('wpforo_content_after', 'wpforo_default_attachment_image_embed', 11);

function wpforo_default_attachment_image_embed($content)
{
if (preg_match_all('|<a class=\"wpforo\-default\-attachment\" href\=\"([^\"\']+)\"[^><]*>.+?<\/a>|is', $content, $data, PREG_SET_ORDER)) {
foreach ($data as $array) {
if (isset($array[1])) {
$file = $array[1];
$e = strtolower(substr(strrchr($file, '.'), 1));
if ($e == 'jpg' || $e == 'jpeg' || $e == 'png' || $e == 'gif') {
$filename = explode('/', $file);
$filename = end($filename);
$html = '<a href="' . esc_url($file) . '" target="_blank"><img class="wpforo-default-image-attachment" src="' . esc_url($file) . '" alt="' . esc_attr($filename) . '" title="' . esc_attr($filename) . '" /></a>';
$content = str_replace($array[0], $html, $content);
}
}
}
}
return $content;
}

 

Posts: 1602
(@anonymous20)
Noble Member
Joined: 9 years ago

Also if you want to have Youtube auto-embed, also add this to your THEME's functions file:

 

add_filter('wpforo_content_after', 'wpforo_custom_video_embed', 10);

function wpforo_custom_video_embed($content)
{

$paterns = array();

$paterns[] = "/<a[^><]+>\s*[a-zA-Z\/\/:\.]*youtube.com\/watch\?v=([a-zA-Z0-9\-_]+)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.]*)/i";

$paterns[] = "/<a[^><]+>\s*[a-zA-Z\/\/:\.]*youtu.be\/([a-zA-Z0-9\-_]+)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.]*)/i";

$content = preg_replace($paterns, "<iframe width=\"420\" height=\"280\" src=\"//www.youtube.com/embed/$1\" frameborder=\"0\" allowfullscreen></iframe>", $content);

return $content;

}
3 Replies
Zazzy
(@zazzy)
Joined: 6 years ago

Eminent Member
Posts: 18

@anonymous20 You sir! is a genius!...You don't know how happy you have made me and how helpful you have been to me. I only asked for the picture view but you added YouTube embed wow! I really appreciate your help and I am grateful. THANK YOU!

Please if you wouldn't mind helping me once more,

how can I set post subscription to manual and disable auto post subscription 

(@anonymous20)
Joined: 9 years ago

Noble Member
Posts: 1602
Posted by: Zazzy

@anonymous20 You sir! is a genius!...You don't know how happy you have made me and how helpful you have been to me. I only asked for the picture view but you added YouTube embed wow! I really appreciate your help and I am grateful. THANK YOU!

Please if you wouldn't mind helping me once more,

how can I set post subscription to manual and disable auto post subscription 

Well not my code but Gvector's team code, i just reposted it here.

Also please open a new topic for each NEW questions you may have, writing all of them in a single topic makes it harder for readers and everyone actually.

Zazzy
(@zazzy)
Joined: 6 years ago

Eminent Member
Posts: 18

Well not my code but Gvector's team code, i just reposted it here.

Also please open a new topic for each NEW questions you may have, writing all of them in a single topic makes it harder for readers and everyone actually.

All the same thanks for reposting it. & Sure, I'll open new topic for further questions if need be.