Community Forum

User info

Welcome, Guest! Please login or register.

You are here » Community Forum » Service Information » 20 June 2017: New scripts by the service (in Admin Scripts)

20 June 2017: New scripts by the service (in Admin Scripts)

Posts 1 to 14 of 14


Dear friends,
Today we are happy to announce that we have added 5 new scripts to Administration - Scripts section:

  ●  Secure HTML in posts
  ●  Number of unread topics in each forum (on the home page)
  ●  Displaying of similar topics (when creating a new topic)
  ●  Fast posts moving (for moderators and administrators)
  ●  Viewing the location of user (when hovering on nickname in line of "Online" users in the forum statistics)

View details

●  Secure HTML in posts, allows you to use HTML code in posts through the special BB tag [html][/html]. A feature of this script is that it disallows access to the parent page(page of topic with posts) and any changing of it by scripts in HTML inset, also it disables all modals that are caused by the code from the HTML inset. Besides, you are allowed to use all the default BB codes in the HTML inset, including quotes, spoilers etc. The function is available for users of all the groups except Guests.

●  Number of unread topics in each forum. The script displays the number of topics which have new (unread) posts in them, in each forum when viewing the home page.

●  Displaying of similar topics When entering text to the Subject field on the page of creation new topics, the script displays the list of similar topics (10 or less newest topics) that contain entered word(s) in their title. The list of similar topics contains information about forum, author and last post date of each topic.

●  Fast posts moving allows you to move posts to the desired topic right on the page of moderation where you can check the posts for moving, through the modal container in which you can select the topic in forums (through menu of forum selection) or by name (through the search line). After moving the missing posts are being loaded automatically to the page and you see the message of successful moving. If you close the container with message, you are able to continue selecting and moving the postsof the remaining ones.
The feature works on the default page of posts moving (select the option from the moderation menu):
If you have transparent backgrounds on containers in your custom style, you can add background color for post moving modal with this code:

.punbb .move_posts_form .container {

(Write your desired color for background instead of red and add the code to the end of Colors style_cs.css in Custom style section, or wrap the code with tags <style></style> and add it to HTML header if you have default style (not custom).)

●  Viewing the location of user allows to see where an user from the online list is on forum by hovering on his nickname in the Forum statistics.

If you find any problems with new scripts from the list, please write in this topics for faster troubleshooting.



Would be very good also if admin can specify permissions group allowed to use html



This script for HTML in posts is completely safe and there is no need to set any restrictions to its using.



Perhaps the admin wants to create a user level to be able to use certain features in the forum



If you want to set restrictions for some groups of users and disable using of HTML in posts for them, try to add this code to HTML header:

<!-- Access to using HTML in posts only for some groups--><script>
HTMLinPost.Access = [1,2]; //ID of groups with access to using HTML in posts
$().pun_mainReady(function () { if($.inArray(GroupID,HTMLinPost.Access)==-1)$('#addition-area div[onclick*="html]"]').remove();
    var s=+$(this).attr('data-group-id')||GroupID;if($.inArray(s,HTMLinPost.Access)==-1)$(this).find(".html-post-box iframe").replaceWith("--")



HTML in Post ...Cause the image file will not be displayed in the Post Preview
or....The possibility of this script conflicting with other scripts ....?????

Last edited by kami (2017-06-24 09:12:27)



Please give an example, how is it conflicting ...?



Very Sorry, it happened a few hours ago on 2 different forums, but Now after I tried again repeatedly, everything looks back to normal ,,, I do not know exactly what caused it, maybe also because the browser I use or anything else..



Was your question about file uploading through the post form? Or the image was not displayed when you posted it to post preview?
Whatever it was, it cannot be caused by the script for HTML in posts.



I use image file from other hosting with the same tag: 

[img] http other host file[/img]

the image was not displayed when i posted it to post preview?... But once published, the image file can be viewed as usual
But now normal... i am sure you are right

Last edited by kami (2017-06-25 11:57:00)



Please give an example of image (its link) that was not be displayed... Maybe there were some problems with the images on the hosting where there were uploaded, not with MyBB's scripts.



Added after 11 minutes:
Another possible cause is the internet speed used by user to load a large file

Last edited by kami (2017-06-25 14:47:41)



Would be very good also if admin can specify permissions Forum/Category allowed to use html in post



Access settings for HTML in posts (groups and forums)
to HTML header:

<!-- Access to using HTML in posts --><script>
HTMLinPost.Access = { //Admins(id=1) have full access to HTML in posts

//ID  //Forum IDs
  2 : [2,8,42,99],
  4 : [2,42]  //!!Last element without ","

} //Settings of access to using HTML in posts
if($("#pun-viewtopic,#pun-post,#pun-edit").length)$().pun_mainReady(function () {
  var forumID = +$('.crumbs a[href*="viewforum"]:last').attr("href").match(/id=(\d+)$/)[1];
  function tstAccess(group,fid){return ( HTMLinPost.Access[group]&&$.inArray(fid,HTMLinPost.Access[group])!=-1 )||group==1};
  if(!tstAccess(GroupID,forumID))$('#addition-area div[onclick*="html]"]').remove();function remHTML (a){$(a).find(".html-post-box iframe").replaceWith("--")}
  $(".post,#post-preview").has(".html-post-box").map(function(){var s = +$(this).attr('data-group-id')||GroupID;if(!tstAccess(s,forumID))remHTML(this)

Edited 27.06.2017


You are here » Community Forum » Service Information » 20 June 2017: New scripts by the service (in Admin Scripts)