FM Design
Would you like to react to this message? Create an account in a few clicks or log in to continue.

IMPORTANT

FM Design is in read-only mode, please click here for more information.

Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Sep 2019, 11:49

» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21

» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28

» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15

» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11

» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24

» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58

» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50

» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22

» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12

» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10

» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51

» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11

» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19

» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34

Recent Tutorials
Top posting users this month

Who is online?
In total there are 21 users online :: 0 Registered, 0 Hidden and 21 Guests

None

[ View the whole list ]


Most users ever online was 515 on Tue 14 Sep 2021, 15:24

[HELP] Error In Application: Actions of moderation code

View previous topic View next topic Go down

omarpop23
omarpop23

Gender : Male
Age : 29
Posts : 140
Points : 3248
Reputation : 25
Location : Egypt
Language : Arabic , English
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
https://www.facebook.com/omarpop23

Postomarpop23 Tue 09 Aug 2016, 09:00

i have an Error In Application: Actions of moderation code

1- when i changed the name of topic and reload the page the name didn't change.
2- i want this code works well in Forumactif Edge


NOTE: take your Time in solving this problem i know you are very busy this days, @Ange Tuteur

Code:
 
var oMTConfig = {
    sErrorMsg: '',
    oTopicTitle: {},
    sTopicHref: '',
    iTopicID: 0,
    sTopicTitle: '',
    sContent:
        '<a title="Moderation Actions" class="ipsModMenu" href="#">&nbsp;</a>',
    sMenu:
        '<ul style="display: none; position: absolute; z-index: 9999;" class="ipbmenu_content" id="topic_mod_menucontent">' +
            '<li style="z-index: 10000;"><a title="rename Topic" href="" id="t_rename" onclick="_rename_Topic();return false;" style="z-index: 10000;">Rename Topic</a></li>' +
            //'<li style="z-index: 10000;"><a title="Highlight Topic" href="" id="t_pin" style="z-index: 10000;">Highlight Topic</a></li>' +
            //'<li style="z-index: 10000;"><a title="Change Icon" href="" id="t_icon" style="z-index: 10000;">Change Icon</a></li>' +
            '<li style="z-index: 10000;"><a title="Close Topic" href="" id="t_lock" style="z-index: 10000;">Close Topic</a></li>' +
            '<li style="z-index: 10000;"><a title="Move Topic" href="" id="t_move" style="z-index: 10000;">Move Topic</a></li>' +
            '<li style="z-index: 10000;"><a title="Trash Topic" href="" id="t_hide" style="z-index: 10000;">Recycle Topic</a></li>' +
            '<li style="z-index: 10000;"><a title="Delete Topic" href="" id="t_delete" style="z-index: 10000;">Delete Topic</a></li>' +
        '</ul>',
    sCSS:
        '<style>' +
        /*'#rename-topic {' +
            'display: block;' +
        '}' +*/
        '.statused tr:hover > .tcr .ipsModMenu, ' +
            '.forumline tr td:hover > .postdetails .ipsModMenu, ' +
            'ul.topiclist.topics.bg_none dl.icon:hover > .lastpost .ipsModMenu, '+
            'table.ipbtable tbody tr:hover > td.row1.lastaction .ipsModMenu{' +
            'visibility: visible;' +
        '}' +
        '.ipsModMenu {' +
            'background: url("http://i55.servimg.com/u/f55/18/17/62/92/modera10.png") no-repeat scroll 0 0 rgba(0, 0, 0, 0);' +
            'display: inline-block;' +
            'height: 15px;' +
            'margin: 0 8px;' +
            'text-indent: -2000em;' +
            'vertical-align: middle;' +
            'width: 15px;' +
            'float: right;' +
            'visibility: hidden;' +
            /*'margin-top: -6px;' +*/
        '}' +
        '.ipbmenu_content {' +
            'font-size: 12px;' +
            'min-width: 85px;' +
            'z-index: 2000;' +
        '}' +
        '.ipbmenu_content {' +
            'background-color: #F7F9FB;' +
            'border: 1px solid #D5DDE5;' +
            'box-shadow: 0 6px 6px rgba(0, 0, 0, 0.3);' +
        '}' +
        '.ipbmenu_content li:first-child {' +
            'padding-top: 0;' +
        '}' +
        '.ipbmenu_content li {' +
            'border-bottom: 1px solid #D5DDE5;' +
            'list-style-type: none !important;' +
        '}' +
        '.ipbmenu_content a {' +
            'display: block;' +
            'padding: 6px 10px;' +
            'text-align: left;' +
            'text-decoration: none;' +
        '}' +
        '.ipbmenu_content a:hover {' +
            'background: none repeat scroll 0 0 #D5DDE5;' +
        '}' +
        '.cancel {' +
            'color: #AD2930;' +
            'font-size: 0.9em;' +
            'font-weight: bold;' +
        '}' +
        '.input_text {' +
            'background: none repeat scroll 0 0 #FFFFFF !important;' +
            'border-color: #848484 #C1C1C1 #E1E1E1 !important;' +
            'border-radius: 2px 2px 2px 2px !important;' +
            'border-style: solid !important;' +
            'border-width: 1px !important;' +
            'padding: 4px !important;' +
            'font: 13px helvetica,arial,sans-serif !important;' +
        '}' +
        '#rename-topic .button2 {' +
            /*'border-color: #212121;' +
            'border-radius: 3px 3px 3px 3px;' +
            'box-shadow: 0 1px 0 0 #5C5C5C inset, 0 2px 3px rgba(0, 0, 0, 0.2);' +
            'border-style: solid;' +
            'border-width: 1px;' +*/
            'cursor: pointer;' +
            'padding: 4px 10px !important;' +
            'min-width: 0 !important;' +
            'font: 13px helvetica,arial,sans-serif !important;' +
        '}' +
        '.input_text:focus {' +
            'border-color: #4E4E4E #7C7C7C #A3A3A3;' +
            'box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);' +
        '}' +
        '#ipsGlobalNotification {' +
            'font-weight: bold;' +
            'left: 50%;' +
            'margin-left: -250px;' +
            'position: fixed;' +
            'text-align: center;' +
            'top: 20px;' +
            'z-index: 10000;' +
        '}' +
        '.popupWrapper {' +
            'background-color: rgba(70, 70, 70, 0.6);' +
            'border-radius: 4px 4px 4px 4px;' +
            'box-shadow: 0 12px 25px rgba(0, 0, 0, 0.7);' +
            'padding: 4px;' +
        '}' +
        '.popupInner {' +
            'background: none repeat scroll 0 0 #FFFFFF;' +
            'box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);' +
            'overflow-x: hidden;' +
            'overflow-y: auto;' +
            'width: 500px;' +
        '}' +
        '.ipsPad {' +
            'padding: 9px;' +
        '}' +
        '</style>',
    sTarget: '',
    sSearch: '',
    sExpression0: '',
    sExpression1: ''
};
/***
* User Definition Variables
***/
oMTConfig.sErrorMsg = 'There was an error, please try again in 10 seconds!!';
oMTConfig.sSavingMsg = 'Update pending, please wait...';
oMTConfig.sDoneMsg = 'The topic title has been updated!';
 
window.onload = function() { //jQuery(function () {
    if (_userdata.user_level >= 1) {
        /* Forum versions! */
        var phpBB2 = jQuery('.bodyline');
        var phpBB3 = jQuery('#wrap');
        var punbb = jQuery('#pun-intro');
        var invision = jQuery('#ipbwrapper');
 
        if (phpBB2.length) {
            oMTConfig.sTarget = '.forumline td.row3Right span.postdetails';
            oMTConfig.sExpression0 = 'oClicked.parent().parent().parent().find("td a.topictitle");';
            oMTConfig.sExpression1 = 'jQuery("#page-body .forumline .postbody:first", data).parents("tr:eq(1)").attr("id").split("p")[1];'
        } else if(phpBB3.length) {
            oMTConfig.sTarget = 'ul.topiclist.topics.bg_none dd.lastpost > span';
            oMTConfig.sExpression0 = 'oClicked.parent().parents("dl.icon").find("dd.dterm a.topictitle");';
            oMTConfig.sExpression1 = 'jQuery("#main-content .post:first", data).attr("id").split("p")[1];';
        } else if(punbb.length) {
            oMTConfig.sTarget = '.statused td.tcr';
            oMTConfig.sExpression0 = 'oClicked.parents("tr").find(".tcl.tdtopics a.topictitle");';
            oMTConfig.sExpression1 = 'jQuery(".posthead:first", data).attr("id").split("p")[1];';
        } else if(invision.length) {
            oMTConfig.sTarget = 'table.ipbtable tbody td.row1.lastaction';
            oMTConfig.sExpression0 = 'oClicked.parents("tr").find("td a.topictitle");';
            oMTConfig.sExpression1 = 'jQuery("#main-content .borderwrap .post:first", data).attr("id").split("p")[1];';
        };
 
        jQuery(oMTConfig.sCSS).insertBefore('body');
        jQuery('body').append(oMTConfig.sInfo + oMTConfig.sMenu);
        jQuery(oMTConfig.sTarget).append(oMTConfig.sContent);
 
        jQuery('a.ipsModMenu').click(function () {
            var oClicked = jQuery(this);
            var oTarget = jQuery('#topic_mod_menucontent');
 
            if (oTarget[0].style.display == 'none') {
                oClicked.addClass('menu_active');
 
                oMTConfig.oTopicTitle = eval(oMTConfig.sExpression0);
                oMTConfig.sTopicHref = oMTConfig.oTopicTitle.attr('href');
                oMTConfig.iTopicID = oMTConfig.sTopicHref.substring(2, oMTConfig.sTopicHref.indexOf("-")); // .split(/[\/t-]/)[2]; <- More fast???
                oMTConfig.sTopicTitle = oMTConfig.oTopicTitle.text();
 
                var TID = jQuery('input[name="tid"]').val();
 
                jQuery('#t_lock').attr('href', '/modcp?mode=lock&t=' + oMTConfig.iTopicID  + '&tid=' + TID);
                jQuery('#t_move').attr('href', '/modcp?mode=move&t=' + oMTConfig.iTopicID  + '&tid=' + TID);
                jQuery('#t_hide').attr('href', '/modcp?mode=trash&t=' + oMTConfig.iTopicID  + '&tid=' + TID);
                jQuery('#t_delete').attr('href', '/modcp?mode=delete&t=' + oMTConfig.iTopicID  + '&tid=' + TID);
 
                oTarget
                    .css({
                        'left': (oClicked.offset().left + oClicked.outerWidth()) - oTarget.outerWidth(),
                        'top': oClicked.offset().top + oClicked.outerHeight()
                    })
                    .fadeIn(400);
 
                jQuery(document).mousedown(function() {
                    if(!oTarget.is(":hover")) {
                        jQuery(document).unbind('mousedown');
                        oClicked.removeClass('menu_active');
                        oTarget.fadeOut(400);
                    }
                });
 
            } else {
                oClicked.removeClass('menu_active');
                oTarget.fadeOut(400);
            }
            return false;
        });
    }
}; // });
 
function _rename_Topic() {
    oMTConfig.oTopicTitle.hide();
    var sHtml =
        '<span id="rename-topic">' +
        '<input type="text" maxlength="150" size="50" class="input_text" value="' + oMTConfig.sTopicTitle + '" id="rt_input" style="width: 56%; margin-right: 4px;">' +
            '<input type="submit" id="rt_submit" class="button2" value="Atualizar" onclick="_rt_commit()" style="margin-right: 4px;">' +
            '<a title="Cancelar" class="cancel" id="rt_cancel" href="#" onclick="jQuery(\'#rename-topic\').remove();oMTConfig.oTopicTitle.show();return false;">Cancelar</a>' +
      '</span>';
    oMTConfig.oTopicTitle.before(sHtml);
 
    jQuery('#rt_input').keydown(function (e){
        if(e.keyCode == 13 && jQuery('#rt_input').val() !== ''){
            _rt_commit();
        }
    });
}
 
function _rt_commit() {
    var iPostID = 0, user_Msg = '';
    var sNewTitle = jQuery('#rt_input').val();
    if (sNewTitle == '') return false;
 
    jQuery('body').append('<div id="ipsGlobalNotification"><div class="popupWrapper"><div class="popupInner"><div class="ipsPad">' + oMTConfig.sSavingMsg + '</div></div></div></div>');
    jQuery('#rename-topic').css('opacity', '0.4');
 
    jQuery.get(oMTConfig.sTopicHref, function(data) {
        iPostID = eval(oMTConfig.sExpression1);
    }).done(function(){
        jQuery.get("/post?p=" + iPostID + "&mode=editpost", function(data) {
            user_Msg = jQuery(data).find('#text_editor_textarea[name="message"]').val();
        }).done(function(){
            jQuery.post("/post?p=" + iPostID + "&mode=editpost", {
                subject: sNewTitle,
                message: user_Msg,
                edit_reason: '',
                attach_sig: '1',
                notify: "0",
                post: 1
            }).done(function(){
                jQuery('#ipsGlobalNotification').remove();
                jQuery('#rename-topic').remove();
                oMTConfig.oTopicTitle.show().text(sNewTitle);
                jQuery('body').append('<div id="ipsGlobalNotification"><div class="popupWrapper"><div class="popupInner"><div class="ipsPad">' + oMTConfig.sDoneMsg + '</div></div></div></div>');
                setTimeout(function() {
                    jQuery('#ipsGlobalNotification').remove();
                }, 4000);
            }).fail(function(){
                jQuery('#ipsGlobalNotification').remove();
                oMTConfig.oTopicTitle.show();
                alert(oMTConfig.sErrorMsg);
            });
        }).fail(function(){
            jQuery('#ipsGlobalNotification').remove();
            oMTConfig.oTopicTitle.show();
            alert(oMTConfig.sErrorMsg);
        });
    }).fail(function(){
        jQuery('#ipsGlobalNotification').remove();
        oMTConfig.oTopicTitle.show();
        alert(oMTConfig.sErrorMsg);
    });
}
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12035
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Tue 09 Aug 2016, 12:23

Hi @omarpop23,

Just to confirm ; you want this plugin converted to work on Forumactif Edge specifically, yes ?
omarpop23
omarpop23

Gender : Male
Age : 29
Posts : 140
Points : 3248
Reputation : 25
Location : Egypt
Language : Arabic , English
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
https://www.facebook.com/omarpop23

Postomarpop23 Tue 09 Aug 2016, 15:12

Ange Tuteur wrote:Hi @omarpop23,

Just to confirm ; you want this plugin converted to work on Forumactif Edge specifically, yes ?

All versions if you can, because there is many people need this code Yes
omarpop23
omarpop23

Gender : Male
Age : 29
Posts : 140
Points : 3248
Reputation : 25
Location : Egypt
Language : Arabic , English
Browser : Browser : Google Chrome Forum Version : Forum Version : Forumactif Edge
https://www.facebook.com/omarpop23

Postomarpop23 Tue 09 Aug 2016, 15:12

Ange Tuteur wrote:Hi @omarpop23,

Just to confirm ; you want this plugin converted to work on Forumactif Edge specifically, yes ?

All versions if you can, because there is many people need this code and they are useing PHPBB2 Yes
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12035
Reputation : 2375
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Tue 09 Aug 2016, 15:38

Alright, I'll try to look over the code when I get some free time. Salute
Sponsored content

PostSponsored content

View previous topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

 
Permissions in this forum:
You cannot reply to topics in this forum