MyBB Community Forums

Full Version: Inline Moderation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey im having some problems with inline moderation i tried almost every possible solution i could find and had to create this acc just to type this out -.- Heres the "headerinclude"

<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/jquery.js?ver=1804"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/jquery.plugins.min.js?ver=1804"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/general.js?ver=1810"></script>

<script src='https://code.jquery.com/jquery-1.8.3.min.js' type='text/javascript'></script>

<link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link href='http://fonts.googleapis.com/css?family=Roboto+Condensed:400italic,700italic,700,400' rel='stylesheet' type='text/css'>
<script type="text/javascript">
    <!--

    if (document.images)
    {
      preload_image_object = new Image();
      // set image url
      image_url = new Array();
      image_url[0] = "{$mybb->settings['bburl']}/images/e-red/logo.png";
      image_url[1] = "{$mybb->settings['bburl']}/images/e-red/logo_hover.png";

       var i = 0;
       for(i=0; i<=3; i++) 
         preload_image_object.src = image_url[i];
    }

    //-->
</script>



{$stylesheets}
<script type="text/javascript">
	lang.unknown_error = "{$lang->unknown_error}";

	lang.select2_match = "{$lang->select2_match}";
	lang.select2_matches = "{$lang->select2_matches}";
	lang.select2_nomatches = "{$lang->select2_nomatches}";
	lang.select2_inputtooshort_single = "{$lang->select2_inputtooshort_single}";
	lang.select2_inputtooshort_plural = "{$lang->select2_inputtooshort_plural}";
	lang.select2_inputtoolong_single = "{$lang->select2_inputtoolong_single}";
	lang.select2_inputtoolong_plural = "{$lang->select2_inputtoolong_plural}";
	lang.select2_selectiontoobig_single = "{$lang->select2_selectiontoobig_single}";
	lang.select2_selectiontoobig_plural = "{$lang->select2_selectiontoobig_plural}";
	lang.select2_loadmore = "{$lang->select2_loadmore}";
	lang.select2_searching = "{$lang->select2_searching}";

	var cookieDomain = "{$mybb->settings['cookiedomain']}";
	var cookiePath = "{$mybb->settings['cookiepath']}";
	var cookiePrefix = "{$mybb->settings['cookieprefix']}";
	var cookieSecureFlag = "{$mybb->settings['cookiesecureflag']}";
	var deleteevent_confirm = "{$lang->deleteevent_confirm}";
	var removeattach_confirm = "{$lang->removeattach_confirm}";
	var loading_text = '{$lang->ajax_loading}';
	var saving_changes = '{$lang->saving_changes}';
	var use_xmlhttprequest = "{$mybb->settings['use_xmlhttprequest']}";
	var my_post_key = "{$mybb->post_code}";
	var rootpath = "{$mybb->settings['bburl']}";
	var imagepath = "{$theme['imgdir']}";
  	var yes_confirm = "{$lang->yes}";
	var no_confirm = "{$lang->no}";
	var MyBBEditor = null;
	var spinner_image = "{$theme['imgdir']}/spinner.gif";
	var spinner = "<img src='" + spinner_image +"' alt='' />";
	var modal_zindex = 9999;
</script>



<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function($) {
    $('#loginSL input[name="url"]').attr("value", window.location);
    $('a[name="SL"]').on("click", function(event) {
        event.preventDefault();
        var target = $(this).attr("rel");
        var maskHeight = $(document).height();
        var maskWidth = $(window).width();
        $("#mask").css({
            "width": maskWidth,
            "height": maskHeight
        });
        $("#mask").fadeIn(1E3);
        $("#mask").fadeTo("slow", .8);
        var winH = $(window).height();
        var winW = $(window).width();
        $(target).css("top", winH / 2 - $(target).height() / 2);
        $(target).css("left",
            winW / 2 - $(target).width() / 2);
        $(target).fadeIn(2E3)
    });
    $('.SLBox a[rel="closeSL"]').on("click", function(event) {
        event.preventDefault();
        $("#mask, .SLBox").hide()
    });
    $("#mask").on("click", function() {
        $(this).hide();
        $(".SLBox").hide()
    });

    $('input.searchbox').focus(function() {
        $(this).parent('.searchbox_wrap').addClass('isFocused');
    });

    $('input.searchbox').blur(function() {
        $(this).parent('.searchbox_wrap').removeClass('isFocused');
    });

});
</script>
<script type="text/javascript">
!function(a, b, c) {
    var d = /\+/g;
    function e(a) {
        return a;
    }
    function f(a) {
        return decodeURIComponent(a.replace(d, " "));
    }
    function g(a) {
        if (0 === a.indexOf('"')) a = a.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, "\\");
        return h.json ? JSON.parse(a) : a;
    }
    var h = a.cookie = function(d, i, j) {
        if (i !== c) {
            j = a.extend({}, h.defaults, j);
            if (null === i) j.expires = -1;
            if ("number" === typeof j.expires) {
                var k = j.expires, l = j.expires = new Date();
                l.setDate(l.getDate() + k);
            }
            i = h.json ? JSON.stringify(i) : String(i);
            return b.cookie = [ encodeURIComponent(d), "=", h.raw ? i : encodeURIComponent(i), j.expires ? "; expires=" + j.expires.toUTCString() : "", j.path ? "; path=" + j.path : "", j.domain ? "; domain=" + j.domain : "", j.secure ? "; secure" : "" ].join("");
        }
        var m = h.raw ? e : f;
        var n = b.cookie.split("; ");
        var o = d ? null : {};
        for (var p = 0, q = n.length; p < q; p++) {
            var r = n[p].split("=");
            var s = m(r.shift());
            var t = m(r.join("="));
            if (d && d === s) {
                o = g(t);
                break;
            }
            if (!d) o[s] = g(t);
        }
        return o;
    };
    h.defaults = {};
    a.removeCookie = function(b, c) {
        if (null !== a.cookie(b)) {
            a.cookie(b, null, c);
            return true;
        }
        return false;
    };
}(jQuery, document);

function readCookie(a) {
    var b = document.cookie.split(";");
    var c = a + "=";
    for (var d = 0; d < b.length; d++) {
        var e = b[d];
        while (" " == e.charAt(0)) e = e.substring(1, e.length);
        if (0 == e.indexOf(c)) return e.substring(c.length, e.length);
    }
    return null;
}

function setCookie(a, b, c) {
    var d = new Date();
    d.setTime(d.getTime() + 24 * c * 60 * 60 * 1e3);
    var e = "expires=" + d.toGMTString();
    document.cookie = a + "=" + b + "; " + e;
}

var optionalStylesheet = document.getElementsByClassName("stylesheet_optional");

var blueStylesheet = document.getElementById("stylesheet_blue");

var greenStylesheet = document.getElementById("stylesheet_green");

var storedThemeColor = readCookie("themeColor");

var currentFiconPath;

function changeColor(a) {
    var b = document.getElementsByClassName("ficon");
    for (var c = 0, d = b.length; c < d; c++) b[c].src = b[c].src.replace(/ficons\/((green|blue)\/)?/, "ficons/" + a + "/");
}

var gs = document.createElement("link");

gs.type = "text/css";

gs.className = "stylesheet_optional";

gs.id = "stylesheet_blue";

gs.rel = "stylesheet";

gs.title = "mystyle";

gs.href = "images/e-red/sinisterly_v2/color_blue.css";

var bs = document.createElement("link");

bs.type = "text/css";

bs.className = "stylesheet_optional";

bs.id = "stylesheet_green";

bs.rel = "stylesheet";

bs.title = "mystyle";

bs.href = "images/e-red/sinisterly_v2/color_green.css";

var head = document.getElementsByTagName("head")[0];

var links = head.getElementsByTagName("link");

for (var x = 0; x < links.length; x++) {
    var href = links[x].href;
    if (href.indexOf("/color_green.css") > 0 || href.indexOf("/color_blue.css") > 0) head.removeChild(links[x]);
}

if ("green" == storedThemeColor) head.appendChild(bs); else if ("blue" == storedThemeColor) head.appendChild(gs);

jQuery.noConflict();

jQuery(document).ready(function(a) {
    a(".option").click(function() {
        if (a(this).hasClass("default")) {
            a.cookie("themeColor", "default", {
                expires: 7
            });
            a("img.ficon").each(function() {
                var b = a(this).attr("src");
                var c = b.replace(currentFiconPath, "");
                a(this).attr("src", c);
            });
            currentFiconPath = "";
        } else {
            var b = a(this).attr("id");
            a.cookie("themeColor", b, {
                expires: 7
            });
            a("img.ficon").each(function() {
                var c = a(this).attr("src");
                var d = c.replace("ficons/" + currentFiconPath, "ficons/" + b + "/");
                a(this).attr("src", d);
            });
            currentFiconPath = b;
        }
        a("link.stylesheet_optional").remove();
        a("head").append('<link type="text/css" class="stylesheet_optional" id="stylesheet_' + a.cookie("themeColor") + '" rel="stylesheet" title="mystyle" href="images/e-red/sinisterly_v2/color_' + a.cookie("themeColor") + '.css">');
    });
    a(".dltc").click(function() {
        a.cookie("themeColor", null);
        alert(a.cookie("themeColor"));
    });
});
</script>
<style>.option{display:inline-block;width:6px;height:6px;padding:5px;border-radius:2px;}#red{background:#EC3737;}#blue{background:#00b0ec;}#green{background:#62ec00;}#red:hover,#blue:hover,#green:hover{cursor:pointer;}</style>

Also anyone know why this is happening with sinister.ly?
[Image: krbAwnd.png]
Answer in a stick thread: https://community.mybb.com/thread-206896.html

You're looking at the wrong template set because this:

var cookieSecureFlag = "{$mybb->settings['cookiesecureflag']}";

is in your code above, but is not in the source HTML of the page.
So what do i do to fix this?
I have done it in class_page.php

Nvm somehow i resetted the head thingy and it fixed itself? like wtf? but alright i guess.
Yes, the change would have needed to be manually applied to the headerinclude template, and reverting it to default would have done that (but also removed any other changes made to it).