The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Tools of moderation since the list of the subjects (problem of encoding)

View previous topic View next topic Go down

Tools of moderation since the list of the subjects (problem of encoding)

Post by fascicularia on November 28th 2013, 10:50 am

Hello,
I meet one marigolds with this script with the function " to edit the title of the subject ".

The encoding of my forum is in Windows 1252 and, the function to edit the title does not work any more correctly.

On my test forum which are utf-8 there on the other hand there is none marigolds.

Do you on idea to solve  this encoding problem???

Code:

    var move_img = "http://i55.servimg.com/u/f55/11/93/85/24/daplac10.gif";
    var edit_img = "http://i55.servimg.com/u/f55/11/93/85/24/edit10.gif";
    var lock_img = "http://i55.servimg.com/u/f55/11/93/85/24/locked10.gif";
    var unlock_img = "http://i55.servimg.com/u/f55/11/93/85/24/delock10.gif";
    var trash_img = "http://i55.servimg.com/u/f55/11/93/85/24/corbei10.gif";
    var delete_img = "http://i55.servimg.com/u/f55/11/93/85/24/delete10.gif";
    var cookie = my_getcookie('fa_' + location.hostname.replace(/\./g, '_') + '_sid');
    $(function () {
     if ($('#is_allowed:contains("modérer")').length > 0) {
     $('.mod_tools').each(function () {
     if ($(this).children('img').attr('alt').slice(13, 19) == "verrou") {
     $(this).append('<img src="' + edit_img + '" class="mod_edit"><img src="' + move_img + '" class="mod_move"><img src="' + unlock_img + '" class="mod_unlock"/><img src="' + trash_img + '" class="mod_trash"/><img src="' + delete_img + '" class="mod_delete"/>')
     } else {
     $(this).append('<img src="' + edit_img + '" class="mod_edit"><img src="' + move_img + '" class="mod_move"><img src="' + lock_img + '" class="mod_lock"/><img src="' + trash_img + '" class="mod_trash"/><img src="' + delete_img + '" class="mod_delete"/>')
     }
     })
     }
     $('.mod_unlock').click(function () {
     if (confirm("Êtes-vous sûr ?")) {
     $.get('/modcp.forum?t=' + $(this).closest('tr').find('a.topictitle').attr('href').replace(/^\/t([1-9][0-9]*)[p-].*$/, '$1') + '&mode=unlock&sid=' + cookie);
     $(this).addClass('mod_lock').removeClass('mod_unlock');
     $(this).attr('src', lock_img)
     }
     });
     $('.mod_lock').click(function () {
     if (confirm("Êtes-vous sûr ?")) {
     $.get('/modcp.forum?t=' + $(this).closest('tr').find('a.topictitle').attr('href').replace(/^\/t([1-9][0-9]*)[p-].*$/, '$1') + '&mode=lock&sid=' + cookie);
     $(this).addClass('mod_unlock').removeClass('mod_lock');
     $(this).attr('src', unlock_img)
     }
     });
     $('.mod_move').click(function () {
     $(this).closest('tr').find('a.topictitle').after('<input type="submit" class="move_topic"/>');
     $(this).closest('tr').find('a.topictitle').after($('select[name="selected_id"]').clone().removeAttr("onchange"))
     });
     $('.move_topic').live('click', function () {
     var tempData = $(this);
     $.post("/modcp?tid=" + $("input[name=tid]:first").val(), {
     tid: $("input[name=tid]:first").val(),
     new_forum: tempData.closest('tr').find('select[name="selected_id"] option:selected').val(),
     mode: "move",
     t: tempData.closest('tr').find('a.topictitle').attr('href').replace(/^\/t([1-9][0-9]*)[p-].*$/, '$1'),
     confirm: "Oui"
     },
     function (data) {
     if (data.indexOf('Le(s) sujet(s) sélectionné(s) a/ont été déplacé(s).') != -1) {
     tempData.closest('tr').remove()
     } else if (data.indexOf('Votre session a expiré.') != -1) {
     alert("Votre session a expiré.")
     } else if (data.indexOf('Aucun sujet n\'a été déplacé.') != -1) {
     alert("Aucun sujet n'a été déplacé.")
     } else if (data.indexOf('Le forum que vous avez sélectionné n\'existe pas.') != -1) {
     alert("Le forum que vous avez sélectionné n'existe pas.")
     } else {
     alert("erreur inconnue")
     }
     })
     });
     $('.mod_trash').click(function () {
     if (confirm("Êtes-vous sûr ?")) {
     $.get('/modcp.forum?t=' + $(this).closest('tr').find('a.topictitle').attr('href').replace(/^\/t([1-9][0-9]*)[p-].*$/, '$1') + '&mode=trash&sid=' + cookie);
     $(this).closest('tr').remove()
     }
     });
     $('.mod_delete').click(function () {
     if (confirm("Êtes-vous sûr ?")) {
     var tid = $("input[name=tid]:first").val() || ($("a[href*='&tid=']:first").attr("href") || "").replace(/^.*&tid=([a-f0-9]*)?.*$/, "$1");
     var fid = location.href.replace(/^.*\/f([0-9]+)[p-].*$/, '$1');
     var topic_id = $(this).closest('tr').find('a.topictitle').attr('href').replace(/^\/t([1-9][0-9]*)[p-].*$/, '$1');
     $.post("/modcp?tid=" + tid, {
     f: fid,
     t: topic_id,
     tid: tid,
     mode: "delete",
     confirm: "1"
     });
     $(this).closest('tr').remove()
     }
     });
     $('.mod_edit').click(function () {
     $(this).closest('tr').find('a.topictitle').hide().after('<input type="text"  style="width: 400px" id="new_title" value="' + $(this).closest('tr').find('a.topictitle').text() + '"/><input type="submit" class="edit_title"/>')
     });
     $('.edit_title').live('click', function () {
     var temp = $(this);
     $.get($(this).closest('tr').find('a.topictitle').attr('href'), function (c) {
     var first_post_id = $(".post a[name]", c).first().attr("name");
     if (!first_post_id) {
     return
     }
     $.get("/post?p=" + first_post_id + "&mode=editpost", function (c) {
     $.post("/post", $('form[name="post"]', c).serialize().replace(/(^|&)subject=[^&]+(&|$)/, "$1subject=" + encodeURIComponent($('#new_title').val()) + "$2") + "&post=1", function (c) {
     if (c.indexOf('Message enregistré avec succès') != -1) {
     temp.closest('tr').find('a.topictitle').show().text($('#new_title').val());
     temp.parent().find('#new_title').hide();
     temp.parent().find('.edit_title').hide()
     }
     })
     })
     })
     })
    });
    $("meta[http-equiv='refresh'][content]:first").each(function () {
     window.location.href = $(this).attr("content").replace(/^.*;url=/, "")
    });
    $(function () {
     $('a:contains("Déconnexion")').attr('href', $('a[href^="/login?logout="]').attr('href'))
    });
    $(function () {
     $(function () {
     $(".sceditor-button-link-fascroll").parent().remove()
     })
    });
    $(function () {
     $(function () {
     $.sceditor.command.get('color')._dropDown = function (editor, caller, callback) {
     var content = $("<div />"),
     cmd = $.sceditor.command.get('color');
     if (!cmd._htmlCache) {
     var pre = '<strong style="background-color:#',
     suf = ';" unselectable="on"><span></span></strong>';
     var htmlGen = [pre, 'ffffff,000000,eeece1,1f497d,4f81bd,c0504d,9bbb59,8064a2,4bacc6,f79646'.split(',').join(suf + pre), suf].join('');
     var htmlList = [pre, 'f2f2f2,7f7f7f,ddd9c3,c6d9f0,dbe5f1,f2dcdb,ebf1dd,e5e0ec,dbeef3,fdeada,d8d8d8,595959,c4bd97,8db3e2,b8cce4,e5b9b7,d7e3bc,ccc1d9,b7dde8,fbd5b5,bfbfbf,3f3f3f,938953,548dd4,95b3d7,d99694,c3d69b,b2a2c7,92cddc,fac08f,a5a5a5,262626,494429,17365d,366092,953734,76923c,5f497a,31859b,e36c09,7f7f7f,0c0c0c,1d1b10,0f243e,244061,632423,4f6128,3f3151,205867,974806'.split(',').join(suf + pre), suf].join('');
     var htmlStandard = [pre, 'c00000,ff0000,ffc000,ffff00,92d050,00b050,00b0f0,0070c0,002060,7030a0'.split(',').join(suf + pre), suf].join('');
     var htmlGeneralPanel = ['<div class="editor_color_panel" style="z-index:12;" unselectable="on"><div class="color_general" unselectable="on">', htmlGen, '</div><div class="color_list" unselectable="on">', htmlList, '</div><div class="color_standard" unselectable="on">', htmlStandard, '</div></div>'].join('');
     cmd._htmlCache = htmlGeneralPanel
     }
     content.append(cmd._htmlCache).find('strong').click(function (e) {
     callback($(this).attr('style').substr(17, 7));
     editor.closeDropDown(true);
     e.preventDefault()
     });
     editor.createDropDown(caller, "color-picker", content)
     }
     })
    });
    $(function () {
     $('img#i_icon_mini_new_message').parent().css('color', '#FF0000').prepend('/!\ ')
    });
    $(function () {
     $('a.mainmenu[href^="/login?logout=1&tid="]').text('Déconnexion')
    });
    $(function () {
     _userdata["activate_toolbar"] = 0
    });
    $(function () {
     $(function () {
     $("#text_editor_textarea").length && ($(".sceditor-button-more").parent().remove(), $.sceditor.ShowHideToolbarElements())
     })
    });
    $(function () {
     $('img[src="http://illiweb.com/fa/subsilver/folder_new_big.gif"]').closest('tr').addClass('newpost')
    });
Thank you in advance for your answers

fascicularia
Forumember

Posts : 121
Reputation : 1
Language : french

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by SLGray on November 28th 2013, 8:15 pm

What exactly does this code do?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36697
Reputation : 2445
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by fascicularia on November 28th 2013, 8:48 pm

Hello SLGray

The script installs the tools of moderation next to the titles of the subjects



The css if you can try



On a forum encoded there utf-8, the script works perfectly.

Marigolds, it's that my forum is in Windows 1252.

The characters as "é" for example change in " Ã © " on the title and in the body of the subject (after updating on the other hand).

fascicularia
Forumember

Posts : 121
Reputation : 1
Language : french

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by SLGray on November 28th 2013, 8:51 pm

What is the version of your forum? Please post your forum's address.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36697
Reputation : 2445
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by fascicularia on November 29th 2013, 2:02 am


fascicularia
Forumember

Posts : 121
Reputation : 1
Language : french

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by SLGray on November 29th 2013, 4:53 am

What do you mean by marigolds? So this code worked on one forum, but not your test forum? What is the version of the working forum?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36697
Reputation : 2445
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by fascicularia on November 29th 2013, 8:02 am

It's also there phpbb2 but in encoding utf-8  .

It's necessary to know that all the forums of Fa dating of before 2009 were under encoding Windows 1252 (this is the case of my forum). It was necessary question at a moment to cross them in encoding utf-8 but it was not made at the moment.

After 2009 the news forums were all in encoding utf-8.

The test forum is identical in the js, css, templates and the pages html. The only difference it is this encoding which makes that the function " edit the title " raises problem on a forum and not on the other one.

The purpose of the request for assistance is to adapt the scrript for a forum that is in Windows 1252

I tried to change the encoding of the script but without success. I tried to change the meta tag forum but also without success.

For the meta tag, it must be said that as Fa will not have changed on the server to the old forums, any action on my part at the templates will not logically nothing.

For what's of concern on a forum in Windows 1252 I have explained earlier in my subject.

The encoding of the script is just after refreshing the page, the characters will become special characters in the title and in the body of the subject.

for example : é changes to à ©

The trouble is effective only the "edit the title." Other functions (lock, unlock, delete and tranfer topic) work equally well for a forum in Windows 1252 encoding for a forum in utf-8 encoding.

fascicularia
Forumember

Posts : 121
Reputation : 1
Language : french

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by fascicularia on December 2nd 2013, 11:54 am

bump

fascicularia
Forumember

Posts : 121
Reputation : 1
Language : french

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by fascicularia on December 3rd 2013, 11:22 am

bump

fascicularia
Forumember

Posts : 121
Reputation : 1
Language : french

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by fascicularia on December 5th 2013, 10:06 am

Bump

fascicularia
Forumember

Posts : 121
Reputation : 1
Language : french

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by fascicularia on December 6th 2013, 11:47 am

bump

fascicularia
Forumember

Posts : 121
Reputation : 1
Language : french

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by fascicularia on December 9th 2013, 8:52 am

bump ...

fascicularia
Forumember

Posts : 121
Reputation : 1
Language : french

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by fascicularia on December 12th 2013, 10:55 am

bump

fascicularia
Forumember

Posts : 121
Reputation : 1
Language : french

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by fascicularia on December 14th 2013, 11:17 am

bump

fascicularia
Forumember

Posts : 121
Reputation : 1
Language : french

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by SLGray on December 14th 2013, 7:35 pm

Where did you get the code that you used? Have you tried contacting whoever created it?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 36697
Reputation : 2445
Language : English
Location : United States

http://ztwds.forumotion.com/

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by fascicularia on December 15th 2013, 1:29 am

Hi SLgray, I manage simply to change the encoding of the script. That's why I come to ask for your help

We are good on a support of assistance of the administrators of the forums or  not????

fascicularia
Forumember

Posts : 121
Reputation : 1
Language : french

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by fascicularia on December 17th 2013, 6:26 pm

Bump

fascicularia
Forumember

Posts : 121
Reputation : 1
Language : french

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by Ange Tuteur on December 18th 2013, 12:00 am

Hello fascicularia,

I have tested the code you have supplied however, I cannot get it working. This makes it difficult to try and resolve your problem if I cannot test properly.

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by fascicularia on December 18th 2013, 12:18 am

Hello SethC1995,
here's the css to add



fascicularia
Forumember

Posts : 121
Reputation : 1
Language : french

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by Ange Tuteur on December 18th 2013, 12:48 am

Tried on phpbb2, phpbb3, punbb, invision and still nothing.

It may be because my board is English, I'm seeing some dependence on the :contains selector. All the content in this script is French, so most likely this isn't going to work for me. Confused

Have you tried asking the creator of this or on the French support ?

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Re: Tools of moderation since the list of the subjects (problem of encoding)

Post by fascicularia on December 18th 2013, 1:06 am

Hello, I am the creator of the script. My concern is to encode the script for Windows 1252.

Otherwise, it works correctly on utf-8but with a concern in Windows 1252.

fascicularia
Forumember

Posts : 121
Reputation : 1
Language : french

Back to top Go down

View previous topic View next topic Back to top


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