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.

New Message Coding

+2
RyouIkeda
Legolover-361
6 posters

Page 2 of 2 Previous  1, 2

Go down

In progress New Message Coding

Post by Legolover-361 Fri 30 Sep - 17:07

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.
Legolover-361
Legolover-361
Forumember

Male Posts : 40
Reputation : -1
Language : English, XHTML, CSS

Back to top Go down


In progress Re: New Message Coding

Post by LGforum Wed 5 Oct - 9:29

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
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

In progress Re: New Message Coding

Post by ankillien Wed 5 Oct - 10:40

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
ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

Back to top Go down

In progress Re: New Message Coding

Post by Legolover-361 Wed 5 Oct - 11:28

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
Legolover-361
Forumember

Male Posts : 40
Reputation : -1
Language : English, XHTML, CSS

Back to top Go down

In progress Re: New Message Coding

Post by LGforum Wed 5 Oct - 18:56

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);
}
});
LGforum
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

In progress Re: New Message Coding

Post by Legolover-361 Thu 6 Oct - 8:01

That still didn't change the text.
Legolover-361
Legolover-361
Forumember

Male Posts : 40
Reputation : -1
Language : English, XHTML, CSS

Back to top Go down

In progress Re: New Message Coding

Post by LGforum Thu 6 Oct - 16:32

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
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

In progress Re: New Message Coding

Post by Legolover-361 Thu 6 Oct - 19:04

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
Legolover-361
Forumember

Male Posts : 40
Reputation : -1
Language : English, XHTML, CSS

Back to top Go down

Page 2 of 2 Previous  1, 2

Back to top

- Similar topics

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