The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

JavaScript problem!

3 posters

Go down

Solved JavaScript problem!

Post by udarsha45 October 17th 2016, 4:39 pm

I tried to add this code, which is located on this site; http://www.punbb.biz/t331-javascript-ipb-sticky-announce-global-announce-style

However the desired results are not appearing for some reason.

Please do help.


Last edited by udarsha45 on October 18th 2016, 4:27 am; edited 1 time in total
udarsha45
udarsha45
Forumember

Male Posts : 626
Reputation : 9
Language : English
Location : Sri Lanka

http://bleach.5forum.net

Back to top Go down

Solved Re: JavaScript problem!

Post by Ch@lo Valdez October 17th 2016, 4:59 pm

please post your url forum
Ch@lo Valdez
Ch@lo Valdez
Forumember

Male Posts : 138
Reputation : 50
Language : spanish

Back to top Go down

Solved Re: JavaScript problem!

Post by udarsha45 October 17th 2016, 5:21 pm

Ch@lo Valdez wrote:please post your url forum


Here; http://www.bleachstory.net
udarsha45
udarsha45
Forumember

Male Posts : 626
Reputation : 9
Language : English
Location : Sri Lanka

http://bleach.5forum.net

Back to top Go down

Solved Re: JavaScript problem!

Post by Ch@lo Valdez October 17th 2016, 6:11 pm

try

Code:

function ann_replace() {
    console.log('//----- Written by Chalo - Open Source 2014-2016 -----//');
    console.log('//--------- http://www.opensourcephpbb3.com ----------//');
    console.log('//------------------- Version: 1.0 -------------------//');
    console.log('//------------------- All version --------------------//');
    var e, a = document.getElementsByTagName('strong'),
        b = 'Global announcement', //<---change it with your custom titles
        c = 'Sticky', //<---change it with your custom titles
        d = 'Announcement', //<---change it with your custom titles
        f = 'Poll',//<---change it with your custom titles
        g = '</span>',
        h = document.createElement('style');
    for (var i = 0; i < a.length; i++) e = a[i], e.innerHTML.match(/(Global announcement)/g) ? e.innerHTML = '<span class="g_a">' + b + g : e.innerHTML.match(/(Sticky)/g) ? e.innerHTML = '<span class="s_a">' + c + g : e.innerHTML.match(/(Announcement)/g) ? e.innerHTML = '<span class="a_a">' + d + g : e.innerHTML.match(/(Poll)/g) && (e.innerHTML = '<span class="p_a">' + f + g);
    h.innerHTML = '.g_a,.s_a,.a_a,.p_a{color:#fff;background:url("http://i57.servimg.com/u/f57/17/68/86/50/stk1010.png")repeat-x0-1px;border-radius:2px;display:inline-block;font-size:9px;font-weight:bold;height:16px;line-height:16px;padding:0 5px;text-shadow:0-1px0rgba(0,0,0,0.2);text-transform:uppercase;vertical-align:middle}.g_a{background-color:#FF4000;}.s_a{background-color:#3693d3;}.a_a{background-color:#ffa500;}.p_a{background-color:pink}';
    document.head.appendChild(h)
};
$(document).ready(function ($) {
    /\/f(\d+).+/g.test(window.location.href) && ann_replace()
});

Ch@lo Valdez
Ch@lo Valdez
Forumember

Male Posts : 138
Reputation : 50
Language : spanish

Back to top Go down

Solved Re: JavaScript problem!

Post by udarsha45 October 18th 2016, 4:26 am

Ch@lo Valdez wrote:try

Code:

function ann_replace() {
    console.log('//----- Written by Chalo - Open Source 2014-2016 -----//');
    console.log('//--------- http://www.opensourcephpbb3.com ----------//');
    console.log('//------------------- Version: 1.0 -------------------//');
    console.log('//------------------- All version --------------------//');
    var e, a = document.getElementsByTagName('strong'),
        b = 'Global announcement', //<---change it with your custom titles
        c = 'Sticky', //<---change it with your custom titles
        d = 'Announcement', //<---change it with your custom titles
        f = 'Poll',//<---change it with your custom titles
        g = '</span>',
        h = document.createElement('style');
    for (var i = 0; i < a.length; i++) e = a[i], e.innerHTML.match(/(Global announcement)/g) ? e.innerHTML = '<span class="g_a">' + b + g : e.innerHTML.match(/(Sticky)/g) ? e.innerHTML = '<span class="s_a">' + c + g : e.innerHTML.match(/(Announcement)/g) ? e.innerHTML = '<span class="a_a">' + d + g : e.innerHTML.match(/(Poll)/g) && (e.innerHTML = '<span class="p_a">' + f + g);
    h.innerHTML = '.g_a,.s_a,.a_a,.p_a{color:#fff;background:url("http://i57.servimg.com/u/f57/17/68/86/50/stk1010.png")repeat-x0-1px;border-radius:2px;display:inline-block;font-size:9px;font-weight:bold;height:16px;line-height:16px;padding:0 5px;text-shadow:0-1px0rgba(0,0,0,0.2);text-transform:uppercase;vertical-align:middle}.g_a{background-color:#FF4000;}.s_a{background-color:#3693d3;}.a_a{background-color:#ffa500;}.p_a{background-color:pink}';
    document.head.appendChild(h)
};
$(document).ready(function ($) {
    /\/f(\d+).+/g.test(window.location.href) && ann_replace()
});


It's working!

Thanks a lot mate!
udarsha45
udarsha45
Forumember

Male Posts : 626
Reputation : 9
Language : English
Location : Sri Lanka

http://bleach.5forum.net

Back to top Go down

Solved Re: JavaScript problem!

Post by brandon_g October 20th 2016, 4:45 pm

Thanks for the help @Ch@lo Valdez . Very Happy

Topic solved and archived ~ brandon_g
Please read our forum rules: ESF General Rules


JavaScript problem! Brando10
Remember to mark your topic JavaScript problem! Solved15 when a solution is found.
General Rules | Tips & Tricks | FAQ | Forgot Founder Password?

JavaScript problem! Scre1476
Team Leader
Review Section Rules | Request A Review | Sticker Points
brandon_g
brandon_g
Manager
Manager

Male Posts : 10106
Reputation : 923
Language : English
Location : USA

https://www.broadcastingduo.com

Back to top Go down

Back to top

- Similar topics

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