The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

New Message Coding

Page 2 of 2 Previous  1, 2

View previous topic View next topic Go down

In progress New Message Coding

Post by Legolover-361 on Sat Oct 01, 2011 12:07 am

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.
avatar
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 on Wed Oct 05, 2011 4:29 pm

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

avatar
LGforum
Hyperactive

Male Posts : 2262
Reputation : 260
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

In progress Re: New Message Coding

Post by ankillien on Wed Oct 05, 2011 5:40 pm

@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.
avatar
ankillien
Energetic

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

http://www.webartzforum.com/

Back to top Go down

In progress Re: New Message Coding

Post by Legolover-361 on Wed Oct 05, 2011 6:28 pm

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. =/
avatar
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 on Thu Oct 06, 2011 1:56 am

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

Male Posts : 2262
Reputation : 260
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

In progress Re: New Message Coding

Post by Legolover-361 on Thu Oct 06, 2011 3:01 pm

That still didn't change the text.
avatar
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 on Thu Oct 06, 2011 11:32 pm

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

Male Posts : 2262
Reputation : 260
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

In progress Re: New Message Coding

Post by Legolover-361 on Fri Oct 07, 2011 2:04 am

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

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

Back to top Go down

Page 2 of 2 Previous  1, 2

View previous topic View next topic Back to top


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