New Message Coding
+2
RyouIkeda
Legolover-361
6 posters
Page 2 of 2
Page 2 of 2 • 1, 2
New Message Coding
First topic message reminder :
Hello, all.
I'm working on a new skin for the Bionicle: Next Generation message board (don't complain about its appearance -- it's still a work-in-progress). I've added a new, custom menu (also still a work-in-progress), but I don't know how to code the "Messages" text to change when the user has one or more new messages.
The type of menu isn't important, as I already know where to place the new coding. I'd just like to know what that coding is.
Help would be greatly appreciated.
Hello, all.
I'm working on a new skin for the Bionicle: Next Generation message board (don't complain about its appearance -- it's still a work-in-progress). I've added a new, custom menu (also still a work-in-progress), but I don't know how to code the "Messages" text to change when the user has one or more new messages.
The type of menu isn't important, as I already know where to place the new coding. I'd just like to know what that coding is.
Help would be greatly appreciated.
Legolover-361- Forumember
- Posts : 40
Reputation : -1
Language : English, XHTML, CSS
Re: New Message Coding
I'd recommend changing the script above to this.
- Code:
$(function(){
var pm_text = $('a.mainmenu[href="/privmsg?folder=inbox"]').text();
if(pm_text){
$('ul#nav a[href="/privmsg"] span').html(pm_text);
}
});
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: New Message Coding
LGforum wrote:I'd recommend changing the script above to this.
- Code:
$(function(){
var pm_text = $('a.mainmenu[href="/privmsg?folder=inbox"]').text();
if(pm_text){
$('ul#nav a[href="/privmsg"] span').html(pm_text);
}
});
Yes, but it will show the traditional and ugly 'You have no new messages' text.
ankillien- Energetic
- Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL
Re: New Message Coding
I wouldn't mind the "traditional and ugly" You have no new messages text as long as the text changes whenever someone has a new message; the problem is, the coding doesn't work. =/
Legolover-361- Forumember
- Posts : 40
Reputation : -1
Language : English, XHTML, CSS
Re: New Message Coding
Try this:
[code]
$(function(){
var pm_text = $('a[href$="/privmsg?folder=inbox"]').text();
if(pm_text){
$('ul#nav a[href="/privmsg"] span').html(pm_text);
}
});
[code]
$(function(){
var pm_text = $('a[href$="/privmsg?folder=inbox"]').text();
if(pm_text){
$('ul#nav a[href="/privmsg"] span').html(pm_text);
}
});
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: New Message Coding
That still didn't change the text.
Legolover-361- Forumember
- Posts : 40
Reputation : -1
Language : English, XHTML, CSS
Re: New Message Coding
- Code:
$(function(){
var pm_text = $('a.mainmenu[href="/privmsg?folder=inbox"]').text();
if(pm_text){
x=$('#shop').get();
y=$(x).find('span')[0];
y.innerHTML=pm_text;
}
});
What about this...
LGforum- Hyperactive
- Posts : 2265
Reputation : 264
Language : English
Location : UK
Re: New Message Coding
I appreciate your efforts, but again the code isn't working. I should start looking into jQuery, I suppose, to figure out what's wrong myself.
Legolover-361- Forumember
- Posts : 40
Reputation : -1
Language : English, XHTML, CSS
Page 2 of 2 • 1, 2
Similar topics
» How would i do about coding message number
» Profile Message coding
» A link to a users wall "Visitors Messages" in their Message Profile + A Pop-up Message When a User Posts a Message There! PunBB
» How to have the message that will replace the hidden message before it show ?
» Message Layout (profile box when you post message)
» Profile Message coding
» A link to a users wall "Visitors Messages" in their Message Profile + A Pop-up Message When a User Posts a Message There! PunBB
» How to have the message that will replace the hidden message before it show ?
» Message Layout (profile box when you post message)
Page 2 of 2
Permissions in this forum:
You cannot reply to topics in this forum