Changing JavaScript from phpBB3 to punBB
4 posters
Page 1 of 1
Changing JavaScript from phpBB3 to punBB
Hey Guys,
I had this Javascript to change the names in the menu of my forum:
I had this Javascript to change the names in the menu of my forum:
- Code:
$(function() {
changemenu("Início", "INÍCIO");
changemenu("Membros", "MEMBROS");
changemenu("Perfil", "PERFIL");
changemenu("Mensagens privadas", "MENSAGENS");
changemenu("Sair", "SAIR");
changemenu("Login", "ENTRAR");
changemenu("Registrar-se", "CRIAR CONTA");
function changemenu(oldtext, newtext){
var selector = $("ul.linklist.navlinks li a");
for(var i=0; i<selector.size(); i++){
if (selector.eq(i).text()== oldtext){
selector.eq(i).text(newtext);
break;
}
}
}
});
Last edited by ,dArkRay on Fri 27 Sep - 17:33; edited 1 time in total
,dArkRay- Forumember
- Posts : 98
Reputation : 1
Language : English | Portuguese
Re: Changing JavaScript from phpBB3 to punBB
Is everything correct?
No missing symbols or any other letter? Those problems are easy to look at if that doesn't work you could switch it's "forum" to another and try it there
No missing symbols or any other letter? Those problems are easy to look at if that doesn't work you could switch it's "forum" to another and try it there
Guest- Guest
Re: Changing JavaScript from phpBB3 to punBB
Hey RikudouSennin (I also like Naruto, it's very cool!),RikudouSennin wrote:Is everything correct?
No missing symbols or any other letter? Those problems are easy to look at if that doesn't work you could switch it's "forum" to another and try it there
In tried in phpBB3 and now it's not working so something must be wrong
,dArkRay- Forumember
- Posts : 98
Reputation : 1
Language : English | Portuguese
Re: Changing JavaScript from phpBB3 to punBB
Hello ,dArkRay,
If you're editing a script from phpbb3 to punbb you will most likely need to modify the selectors in it. Right now I am seeing this:
'ul.linklist.navlinks li a' which should be '#pun-navlinks li a' for punbb
Use the script I provided below, I tested it and it works on my punbb board. Please remember you'll just have to modify the rename content if you haven't yet to see any changes. (i.e. Home > Homepage)
If you're editing a script from phpbb3 to punbb you will most likely need to modify the selectors in it. Right now I am seeing this:
'ul.linklist.navlinks li a' which should be '#pun-navlinks li a' for punbb
Use the script I provided below, I tested it and it works on my punbb board. Please remember you'll just have to modify the rename content if you haven't yet to see any changes. (i.e. Home > Homepage)
- Code:
$(function() {
changemenu("Início", "INÍCIO");
changemenu("Membros", "MEMBROS");
changemenu("Perfil", "PERFIL");
changemenu("Mensagens privadas", "MENSAGENS");
changemenu("Sair", "SAIR");
changemenu("Login", "ENTRAR");
changemenu("Registrar-se", "CRIAR CONTA");
function changemenu(oldtext, newtext){
var selector = $("#pun-navlinks li a");
for(var i=0; i<selector.size(); i++){
if (selector.eq(i).text()== oldtext){
selector.eq(i).text(newtext);
break;
}
}
}
});
Re: Changing JavaScript from phpBB3 to punBB
(I love naruto lol) but if the codes seth gave to you works just reply ok?,dArkRay wrote:Hey RikudouSennin (I also like Naruto, it's very cool!),RikudouSennin wrote:Is everything correct?
No missing symbols or any other letter? Those problems are easy to look at if that doesn't work you could switch it's "forum" to another and try it there
In tried in phpBB3 and now it's not working so something must be wrong
Guest- Guest
Re: Changing JavaScript from phpBB3 to punBB
Thank you Seth! Everything is working except the log out (sair), tried to change my code but it didn't workedSethC1995 wrote:Hello ,dArkRay,
If you're editing a script from phpbb3 to punbb you will most likely need to modify the selectors in it. Right now I am seeing this:
'ul.linklist.navlinks li a' which should be '#pun-navlinks li a' for punbb
Use the script I provided below, I tested it and it works on my punbb board. Please remember you'll just have to modify the rename content if you haven't yet to see any changes. (i.e. Home > Homepage)
- Code:
$(function() {
changemenu("Início", "INÍCIO");
changemenu("Membros", "MEMBROS");
changemenu("Perfil", "PERFIL");
changemenu("Mensagens privadas", "MENSAGENS");
changemenu("Sair", "SAIR");
changemenu("Login", "ENTRAR");
changemenu("Registrar-se", "CRIAR CONTA");
function changemenu(oldtext, newtext){
var selector = $("#pun-navlinks li a");
for(var i=0; i<selector.size(); i++){
if (selector.eq(i).text()== oldtext){
selector.eq(i).text(newtext);
break;
}
}
}
});
- Code:
$(function() {
changemenu("Início", "INÍCIO");
changemenu("Membros", "MEMBROS");
changemenu("Perfil", "PERFIL");
changemenu("Mensagens privadas", "MENSAGENS");
changemenu("Sair [{USERNAME}]", "SAIR");
changemenu("Login", "ENTRAR");
changemenu("Registrar-se", "CRIAR CONTA");
function changemenu(oldtext, newtext){
var selector = $("#pun-navlinks li a");
for(var i=0; i<selector.size(); i++){
if (selector.eq(i).text()== oldtext){
selector.eq(i).text(newtext);
break;
}
}
}
});
,dArkRay- Forumember
- Posts : 98
Reputation : 1
Language : English | Portuguese
,dArkRay- Forumember
- Posts : 98
Reputation : 1
Language : English | Portuguese
Re: Changing JavaScript from phpBB3 to punBB
I tried this on my forum with both variables, but no luck. However I used the full string and it did rename. You may have to do this for each user you have which would be tedious, unless of course there is a variable for the log out menu.
EX:
EX:
- Code:
changemenu("Log out [ Ange ]", "Log out");
Re: Changing JavaScript from phpBB3 to punBB
Hi, ,dArkRay, when I made that javascript I didn't think in this element of the general menu but I can arrange it now.
Try with this other javascript.
Try with this other javascript.
- Code:
$(function(){
var user = $.trim($("a#logout.mainmenu").text().split("[ ")[1].replace("]",""));
changemenu("Início","INÍCIO");
changemenu("Membros","MEMBROS");
changemenu("Perfil","PERFIL");
changemenu("Mensagens privadas","MENSAGENS");
changemenu("Sair [ " +user+" ]","SAIR [ " +user+" ]");
changemenu("Login","ENTRAR");
changemenu("Registrar-se","NOVO? REGISTA-TE AQUI!");
function changemenu(oldtext,newtext){
var selector=$("#pun-navlinks li a");
for(var i=0;i<selector.size();i++){
if(selector.eq(i).text().toLowerCase()==oldtext.toLowerCase()){
selector.eq(i).text(newtext);
break;
}
}
}
});
Sr.Smith- Forumember
- Posts : 94
Reputation : 11
Language : Spanish
Re: Changing JavaScript from phpBB3 to punBB
You are always great! Thank you pal!Mr.Bond wrote:Hi, ,dArkRay, when I made that javascript I didn't think in this element of the general menu but I can arrange it now.
Try with this other javascript.I hope it helps you.
- Code:
$(function(){
var user = $.trim($("a#logout.mainmenu").text().split("[ ")[1].replace("]",""));
changemenu("Início","INÍCIO");
changemenu("Membros","MEMBROS");
changemenu("Perfil","PERFIL");
changemenu("Mensagens privadas","MENSAGENS");
changemenu("Sair [ " +user+" ]","SAIR [ " +user+" ]");
changemenu("Login","ENTRAR");
changemenu("Registrar-se","NOVO? REGISTA-TE AQUI!");
function changemenu(oldtext,newtext){
var selector=$("#pun-navlinks li a");
for(var i=0;i<selector.size();i++){
if(selector.eq(i).text().toLowerCase()==oldtext.toLowerCase()){
selector.eq(i).text(newtext);
break;
}
}
}
});
,dArkRay- Forumember
- Posts : 98
Reputation : 1
Language : English | Portuguese
Re: Changing JavaScript from phpBB3 to punBB
Topic Solved & Locked
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Similar topics
» help code javascript version - punbb
» How to get phpbb3 version from PunBB?
» Change existing forum from punbb to phpbb3?
» [Important] get Phpbb3 from punbb Forumotion tutorial from leelo
» Changing the Forum Header phpbb3
» How to get phpbb3 version from PunBB?
» Change existing forum from punbb to phpbb3?
» [Important] get Phpbb3 from punbb Forumotion tutorial from leelo
» Changing the Forum Header phpbb3
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum