JavaScript problem!
3 posters
Page 1 of 1
JavaScript problem!
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.
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
Re: JavaScript problem!
please post your url forum
Ch@lo Valdez- Forumember
- Posts : 138
Reputation : 50
Language : spanish
Re: JavaScript problem!
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- Forumember
- Posts : 138
Reputation : 50
Language : spanish
Re: JavaScript problem!
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!
Re: JavaScript problem!
Thanks for the help @Ch@lo Valdez .
Topic solved and archived ~ brandon_g
|
Remember to mark your topic when a solution is found.
General Rules | Tips & Tricks | FAQ | Forgot Founder Password?
Team Leader
Review Section Rules | Request A Review | Sticker Points
Similar topics
» Problem with IPS Steps Javascript
» Christmas Javascript Problem
» Problem with a refresh javascript
» Javascript in all pages problem
» Javascript activation problem
» Christmas Javascript Problem
» Problem with a refresh javascript
» Javascript in all pages problem
» Javascript activation problem
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum