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 1 of 2 1, 2  Next

View previous topic View next topic Go down

In progress New Message Coding

Post by Legolover-361 on October 1st 2011, 1:07 am

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

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

Back to top Go down

In progress Re: New Message Coding

Post by Legolover-361 on October 2nd 2011, 2:49 am

Does anyone know what the required coding would be?

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 Legolover-361 on October 3rd 2011, 1:38 pm

I really need some help, as the forum I'm working on was supposed to reopen yesterday. Does anyone know what coding I would use to change the "Inbox (0)" text when a user has new messages ("Inbox (1)", "Inbox (2)", etc.)?

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 RyouIkeda on October 3rd 2011, 2:41 pm

Please avoid to double post!


Thanks

RyouIkeda
Forumember

Male Posts : 242
Reputation : 4
Language : English/Filipino/Japan
Location : Phillipines

http://indexmu.forum.st

Back to top Go down

In progress Re: New Message Coding

Post by LGforum on October 3rd 2011, 3:38 pm

Honestly. Why make a new navbar?
Don't try and make a new navbar if you don't know how.

There is nothing wrong with the original navbar, infact you can likely style it too look exactly like your new one. And it will contain all the information, links and features that way.
I recommend just restyling the original navbar.

LGforum
Hyperactive

Male Posts : 2254
Reputation : 254
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

In progress Re: New Message Coding

Post by Sanket on October 3rd 2011, 4:13 pm

HowToKill wrote:Please avoid to double post!


Thanks
Please don't moderate other members, as this is reserved for staff only Wink

Sanket
ForumGuru

Male Posts : 48766
Reputation : 2819
Language : English
Location : Mumbai

http://webartzforum.com

Back to top Go down

In progress Re: New Message Coding

Post by Legolover-361 on October 3rd 2011, 9:34 pm

HowToKill wrote:Please avoid to double post!


Thanks

My posts were separated by at least twenty-four hours, each, and from what I've seen of the rules this is allowed.

@LGforum wrote:Honestly. Why make a new navbar?
Don't try and make a new navbar if you don't know how.

There is nothing wrong with the original navbar, infact you can likely style it too look exactly like your new one. And it will contain all the information, links and features that way.
I recommend just restyling the original navbar.

1. It gives me (and others) practice with coding. Why only customize an already-coded navbar when you can take different, custom coding to make your own?
2. Drop-down menus.
3. More originality and customizability.
4. I want to do something pertaining to programming in my life, whether that means becoming a computer programmer or simply creating a personal website mainly from scratch. Either way, the more experience I have with coding, the better.

Does anyone have any answers that don't involve scrapping the custom navbar?

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 October 3rd 2011, 10:22 pm

Its all possible with current navbar. Through coding. Jquery and javascript, it would be great practise Wink

LGforum
Hyperactive

Male Posts : 2254
Reputation : 254
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

In progress Re: New Message Coding

Post by Legolover-361 on October 3rd 2011, 11:07 pm

Then what's the difference? My current navbar uses HTML, CSS, and JavaScript. I can customize the menus and had no problem installing it onto the forum in the first place.

Do you know the coding to use to change the messages link, or not?

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 Guest on October 4th 2011, 3:06 am

Modify the forumotion navbar = exactly what you want.

Create a completely new navbar = not so much.

You want the number of new PMs. You can write code worthy of entry into a Rube Goldberg contest to get that (I saw an example today Very Happy ), or...you can use the "You have X new messages" PM image title in the forumotion navbar to create exactly what you want.

The choice is yours.

Guest
Guest


Back to top Go down

In progress Re: New Message Coding

Post by ankillien on October 4th 2011, 4:11 am

Hi,

If you know some javascript, I can give you some ideas about this.
First detect the text that is being displayed in the navbar for PM link. If it is "You have no new messages", make your custom link have text "Inbox" and if the text in PM link is not "You have no new messages" make your custom link say "New PM".

You just have to detect the text of the PM link and use if-else statements to do the trick Very Happy

Hope it helps.

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 October 4th 2011, 4:37 am

@dion wrote:Modify the forumotion navbar = exactly what you want.

Create a completely new navbar = not so much.

You want the number of new PMs. You can write code worthy of entry into a Rube Goldberg contest to get that (I saw an example today Very Happy ), or...you can use the "You have X new messages" PM image title in the forumotion navbar to create exactly what you want.

The choice is yours.

I'd honestly prefer the latter, because then I'd know how to create a programmer's equivalent of a Rube Goldberg machine and be able to utilize that knowledge later in life. I probably won't be using Forumotion forever; being able to code from scratch is a valuable skill.

@ankillien wrote:Hi,

If you know some javascript, I can give you some ideas about this.
First detect the text that is being displayed in the navbar for PM link. If it is "You have no new messages", make your custom link have text "Inbox" and if the text in PM link is not "You have no new messages" make your custom link say "New PM".

You just have to detect the text of the PM link and use if-else statements to do the trick Very Happy

Hope it helps.

So you're saying I should use JavaScript to check the text on the default navbar and change the text on the custom navbar to match? That would make sense; the only problem is, I'd have to find the default navbar's coding. Does the default Forumotion navbar have its own template? And if so, how would I use JavaScript to pull information from that template to the overall_header template?

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 Guest on October 4th 2011, 4:40 am

For a simple New/NoNew link, it's even easier than that. The forumotion navbar uses an ID of #i_icon_mini_message for the "No new PM" image, and #i_icon_mini_new_message for the "New PM" image, and only one of them will ever be on a page.

To get the actual count of new PMs, the PM image title is the easiest way.

Guest
Guest


Back to top Go down

In progress Re: New Message Coding

Post by Legolover-361 on October 4th 2011, 5:49 am

Admittedly, my JavaScript isn't the best -- rather rusty, really. I think I get the gist of your suggestion, though:

1. Check the PM image URL.
2. Print the appropriate number within the parenthesis (e.g. with two new messages, the link would be "Inbox (2)").

Now I need the PM image URLs and some quality time with Google and JavaScript tutorials. Razz Could anyone provide the former?

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 Guest on October 4th 2011, 7:04 am

@Legolover-361 wrote:I'd honestly prefer the latter, because then I'd know how to create a programmer's equivalent of a Rube Goldberg machine and be able to utilize that knowledge later in life. I probably won't be using Forumotion forever; being able to code from scratch is a valuable skill.
In the real world it's not common to create applications/pages from scratch -- much of the time you will find yourself re-working code that someone else wrote. And speaking from experience, you learn a lot more this way than you EVER will by coding from scratch.

To answer one of your questions, there is no code for the navbar in any template -- you must use javascript to access the navbar DOM. Which gets me back to my point...if you're going to use javascript anyway, why waste time re-inventing the wheel? You already have a navbar that can be molded into anything you want, and it contains all the information you need.

Guest
Guest


Back to top Go down

In progress Re: New Message Coding

Post by ankillien on October 4th 2011, 8:05 am

@dion wrote:For a simple New/NoNew link, it's even easier than that. The forumotion navbar uses an ID of #i_icon_mini_message for the "No new PM" image, and #i_icon_mini_new_message for the "New PM" image, and only one of them will ever be on a page.

To get the actual count of new PMs, the PM image title is the easiest way.

This would be the easiest way to achieve this.

@Legolover,
The templates do not have the navabar code in them. You have to access the navbar HTML with JavaScript only. To make it easier you can use jquery selectors Smile And you don't have to make any changes in the templates. All you need is to add a javascript in the Admin CP > Modules > Javascript management.

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 October 4th 2011, 3:06 pm

@dion wrote:
@Legolover-361 wrote:I'd honestly prefer the latter, because then I'd know how to create a programmer's equivalent of a Rube Goldberg machine and be able to utilize that knowledge later in life. I probably won't be using Forumotion forever; being able to code from scratch is a valuable skill.
In the real world it's not common to create applications/pages from scratch -- much of the time you will find yourself re-working code that someone else wrote. And speaking from experience, you learn a lot more this way than you EVER will by coding from scratch.

To answer one of your questions, there is no code for the navbar in any template -- you must use javascript to access the navbar DOM. Which gets me back to my point...if you're going to use javascript anyway, why waste time re-inventing the wheel? You already have a navbar that can be molded into anything you want, and it contains all the information you need.

In real life I may often be modifying someone else's code, but wouldn't I be able to better modify it knowing I could write it all myself? And wouldn't being able to write new code help me get a higher-placing job?

Besides which, this is a challenge. I like challenges: When I succeed in something difficult, it feels so much better than when I'm just doing what anyone could do.

If you want to continue this discussion, please bring it to PM; I'd rather not argue in a support forum.

@ankillien wrote:
@dion wrote:For a simple New/NoNew link, it's even easier than that. The forumotion navbar uses an ID of #i_icon_mini_message for the "No new PM" image, and #i_icon_mini_new_message for the "New PM" image, and only one of them will ever be on a page.

To get the actual count of new PMs, the PM image title is the easiest way.

This would be the easiest way to achieve this.

@Legolover,
The templates do not have the navabar code in them. You have to access the navbar HTML with JavaScript only. To make it easier you can use jquery selectors Smile And you don't have to make any changes in the templates. All you need is to add a javascript in the Admin CP > Modules > Javascript management.

To be honest, I've never learned jQuery. I should, apparently. Razz Do you have any idea of what the code for such a program would be? -- and how would I get the default navbar URLs in the first place?

Sorry for all the questions, but I really want to make this work.

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 ankillien on October 4th 2011, 5:56 pm

If you don't have coding knowledge, I'll shoot the codes directly Razz

Code:
$(function(){
$('#i_icon_mini_message').parent('a').text('Inbox');
$('#i_icon_mini_new_message').parent('a').text('Inbox New');
});

Add it in Admin CP > Modules > Javascript management, for all pages.

Hope it helps Very Happy

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 Guest on October 4th 2011, 6:04 pm

@Legolover-361 wrote:In real life I may often be modifying someone else's code, but wouldn't I be able to better modify it knowing I could write it all myself? And wouldn't being able to write new code help me get a higher-placing job?

Besides which, this is a challenge. I like challenges: When I succeed in something difficult, it feels so much better than when I'm just doing what anyone could do.

If you want to continue this discussion, please bring it to PM; I'd rather not argue in a support forum.
I no longer accept PMs here due to the avalanche I started receiving after the post profile toggle and Like/dislike box features were added to this board. So I will reply here.

I guess you just don't see that modifying the current navbar requires your writing new code, it is a challenge, and you will learn techniques that will help you in the future. Oh well, it's your task. My final comment is this: in real life it's most important to accomplish a task in the allotted time with the allotted resources. Your insistence to write this completely on your own has already caused you to miss your deadline. In real life that stubbornness could get you fired. Think about it.

Guest
Guest


Back to top Go down

In progress Re: New Message Coding

Post by Guest on October 4th 2011, 6:06 pm

yes, but leter i will have problem ... the problem is -> when post a new topic the edit bar it isnt!

Guest
Guest


Back to top Go down

In progress Re: New Message Coding

Post by Legolover-361 on October 4th 2011, 6:31 pm

@ankillien wrote:If you don't have coding knowledge, I'll shoot the codes directly Razz

Code:
$(function(){
$('#i_icon_mini_message').parent('a').text('Inbox');
$('#i_icon_mini_new_message').parent('a').text('Inbox New');
});

Add it in Admin CP > Modules > Javascript management, for all pages.

Hope it helps Very Happy

I added it, but nothing happened when I received a PM. I take it I have to add some coding in the custom navbar, perhaps add an ID to the appropriate <a> tag?

@dion wrote:I guess you just don't see that modifying the current navbar requires your writing new code, it is a challenge, and you will learn techniques that will help you in the future. Oh well, it's your task. My final comment is this: in real life it's most important to accomplish a task in the allotted time with the allotted resources. Your insistence to write this completely on your own has already caused you to miss your deadline. In real life that stubbornness could get you fired. Think about it.

In real life, I wouldn't necessarily be using Forumotion. Also, in this case, I won't be fired -- it's not a real job, I'm not being paid for it. If I were being paid to meet a deadline, of course I'd go with whatever works, but if I want to make a site mainly from scratch someday, continuing with this custom navbar will help.

I honestly don't see what the problem is. What's wrong with wanting to code a custom navbar? I'm not insulting anyone or doing anything wrong.

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 October 4th 2011, 6:42 pm

Your right your not. I think we're all just suggesting its easier and likely MORE practise to change the current one to your liking.

It would honestly be more of a challenge, accessing the navbar and manipulating it the way you'd like. You'll likely learn a lot about Node navigation and access too.

Infact completely revamping the current navbar would classify as creating your custom navbar. Smile

I actually recently made a site from scratch. Even when you make a site from scratch, its rarely from scratch. You often use software templates, or already configured menu scripts, or a default css which you customize to your liking. I recommend looking at Adobe Dreamweaver, one of the great site making softwares out there.

I wish you luck.

LGforum
Hyperactive

Male Posts : 2254
Reputation : 254
Language : English
Location : UK

http://www.avacweb.com/

Back to top Go down

In progress Re: New Message Coding

Post by ankillien on October 4th 2011, 7:00 pm

Legolover-361,

My code will modify the original navbar, not your custom navbar. I have tested the codes and it works.

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 October 4th 2011, 7:47 pm

Ah, therein lies the problem -- I was testing with the custom navbar. Do you think it would be possible to modify your code to change the custom navbar rather than the default one?

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 Guest on October 4th 2011, 7:55 pm

i want this say :

1 new message

2 new message

3 new message


.....

Guest
Guest


Back to top Go down

In progress Re: New Message Coding

Post by bHulleT.w on October 4th 2011, 9:19 pm

i WISH U GOOD LUCK !

bHulleT.w
Forumember

Male Posts : 244
Reputation : 13
Language : Estonian - Html - Php - Css - MySQL
Location : Closet :3

Back to top Go down

In progress Re: New Message Coding

Post by ankillien on October 5th 2011, 4:10 am

@Legolover-361 wrote:Ah, therein lies the problem -- I was testing with the custom navbar. Do you think it would be possible to modify your code to change the custom navbar rather than the default one?

Yes, but its your custom navbar so you need to figure out yourself or I need the full code of the custom navbar to give you a copy-paste code.

Respect_Me wrote:i want this say :

1 new message

2 new message

3 new message


.....

Sorry, the code for this is not available with me but I can suggest you a trick. You need to make an ajax call to the inbox page and make it return the total number of new pm images. You can use the returned result to display as PM counter.

I do not have a copy-paste code for this. You need to figure it out yourself.

@bHulleT.w wrote:i WISH U GOOD LUCK !

Avoid posting in any threads unless you are actually contributing to the ongoing discussion.

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 October 5th 2011, 2:37 pm

@ankillien wrote:Yes, but its your custom navbar so you need to figure out yourself or I need the full code of the custom navbar to give you a copy-paste code.

A'ight, here's the complete code, including CSS, JavaScript, and HTML.

Code:
<head>
<style type = "text/css">
/* ================================================================
This copyright notice must be kept untouched in the stylesheet at
all times.

The original version of this stylesheet and the associated (x)html
is available at http://www.stunicholls.com/menu/pro_dropdown_2/stuHover.js
Copyright (c) 2005-2007 Stu Nicholls. All rights reserved.
This stylesheet and the associated (x)html may be modified in any
way to fit your requirements.
=================================================================== */

.preload1 {background: url(http://www.brickshelf.com/gallery/Legolover-361/Banners/BNG/three_1.png);}
.preload2 {background: url(http://www.brickshelf.com/gallery/Legolover-361/Banners/BNG/three_1a.png);}

#nav {padding:0; margin:0; list-style:none; height:38px; background:#E6E6E6 url(http://www.brickshelf.com/gallery/Legolover-361/Banners/BNG/three_0.png) repeat-x; position:relative; z-index:500; font-family:arial, verdana, sans-serif; }
#nav li.top {display:block; float:left; height:38px; position:relative; top:0px; right:-250px;}
#nav li a.top_link {display:block; float:left; height:35px; line-height:33px; color:#ffffff; text-decoration:none; font-size:11px; font-weight:bold; padding:0 0 0 12px; cursor:pointer; background: url(http://www.brickshelf.com/gallery/Legolover-361/Banners/BNG/three_0.png);}
#nav li a.top_link span {float:left; display:block; padding:0 24px 0 12px; height:35px; background: url(http://www.brickshelf.com/gallery/Legolover-361/Banners/BNG/three_0.png) right top no-repeat;}
#nav li a.top_link span.down {float:left; display:block; padding:0 24px 0 12px; height:35px; background: url(http://www.brickshelf.com/gallery/Legolover-361/Banners/BNG/three_0a.png) no-repeat right top;}

#nav li:hover a.top_link {color:#fff; background: url(http://www.brickshelf.com/gallery/Legolover-361/Banners/BNG/three_1.png) no-repeat;}
#nav li:hover a.top_link span {background:url(http://www.brickshelf.com/gallery/Legolover-361/Banners/BNG/three_1.png) no-repeat right top;}
#nav li:hover a.top_link span.down {background:url(http://www.brickshelf.com/gallery/Legolover-361/Banners/BNG/three_1a.png) no-repeat right top;}

/* Default list styling */

#nav li:hover {position:relative; z-index:200;}
#nav li:hover ul.sub
{left:1px; top:38px; background: #7b8994; padding:3px; border:1px solid #88A1B5; white-space:nowrap; width:90px; height:auto; z-index:300;}
#nav li:hover ul.sub li
{display:block; height:20px; position:relative; float:left; width:90px; font-weight:normal;}
#nav li:hover ul.sub li a
{display:block; font-size:11px; height:18px; width:88px; line-height:18px; text-indent:5px; color:#E6E6E6; text-decoration:none;border:1px solid #88A1B5;}
#nav li ul.sub li a.fly
{background:#a1afbc url(http://www.brickshelf.com/gallery/Legolover-361/Banners/BNG/arrow.gif) 80px 6px no-repeat;}
#nav li:hover ul.sub li a:hover
{background:#a1afbc; color:#fff; border-color:#E6E6E6;}
#nav li:hover ul.sub li a.fly:hover
{background:#a1afbc url(http://www.brickshelf.com/gallery/Legolover-361/Banners/BNG/arrow_over.gif) 80px 6px no-repeat; color:#fff;}


#nav li:hover li:hover ul,
#nav li:hover li:hover li:hover ul,
#nav li:hover li:hover li:hover li:hover ul,
#nav li:hover li:hover li:hover li:hover li:hover ul
{left:90px; top:-4px; background: #6A90C3; padding:3px; border:1px solid #5c731e; white-space:nowrap; width:90px; z-index:400; height:auto;}

#nav ul,
#nav li:hover ul ul,
#nav li:hover li:hover ul ul,
#nav li:hover li:hover li:hover ul ul,
#nav li:hover li:hover li:hover li:hover ul ul
{position:absolute; left:-9999px; top:-9999px; width:0; height:0; margin:0; padding:0; list-style:none;}

#nav li:hover li:hover a.fly,
#nav li:hover li:hover li:hover a.fly,
#nav li:hover li:hover li:hover li:hover a.fly,
#nav li:hover li:hover li:hover li:hover li:hover a.fly
{background:#6a812c url(http://www.brickshelf.com/gallery/Legolover-361/Banners/BNG/arrow_over.gif) 80px 6px no-repeat; color:#fff; border-color:#fff;}

#nav li:hover li:hover li a.fly,
#nav li:hover li:hover li:hover li a.fly,
#nav li:hover li:hover li:hover li:hover li a.fly
{background:#bbd37e url(http://www.brickshelf.com/gallery/Legolover-361/Banners/BNG/arrow.gif) 80px 6px no-repeat; color:#000; border-color:#bbd37e;}
</style>
<style type = "text/javascript">
stuHover = function() {
   var cssRule;
   var newSelector;
   for (var i = 0; i < document.styleSheets.length; i++)
      for (var x = 0; x < document.styleSheets[i].rules.length ; x++)
         {
         cssRule = document.styleSheets[i].rules[x];
         if (cssRule.selectorText.indexOf("LI:hover") != -1)
         {
             newSelector = cssRule.selectorText.replace(/LI:hover/gi, "LI.iehover");
            document.styleSheets[i].addRule(newSelector , cssRule.style.cssText);
         }
      }
   var getElm = document.getElementById("nav").getElementsByTagName("LI");
   for (var i=0; i<getElm.length; i++) {
      getElm[i].onmouseover=function() {
         this.className+=" iehover";
      }
      getElm[i].onmouseout=function() {
         this.className=this.className.replace(new RegExp(" iehover\\b"), "");
      }
   }
}
if (window.attachEvent) window.attachEvent("onload", stuHover);
</style>
<span class="preload1"><
</span>
</head>
<body>
<span class="preload2"></span>
<ul class = "topnav">
<ul id="nav">
        <li class="top"><a href="/forum" id="services" class="top_link"><span class="down">Forums</span></a>
      <ul class="sub">
         <li><a href="/portal">Portal</a></li>
                        <br />
         <li><a href="/faq">FAQ</a></li>
      </ul>
   </li>
<!-- BEGIN switch_user_logged_in -->
   <li class="top"><a href="/profile?mode=editprofile" id="services" class="top_link"><span class="down">Profile</span></a>
      <ul class="sub">
         <li><a href="/profile?mode=editprofile&page_profil=preferences&tt=1">Preferences</a></li>
                        <br />
         <li><a href="/groups">Usergroups</a></li>
      </ul>
   </li>
   <li class="top"><a href="/memberlist" id="contacts" class="top_link"><span>Memberlist</span></a>
   </li>
   <li class="top"><a href="/privmsg" id="shop" class="top_link"><span class="down">Inbox</span></a>
      <ul class="sub">
         <li><a href="/privmsg?folder=sentbox">Sentbox</a></li>
                        <br />
         <li><a href="/privmsg?folder=outbox">Outbox</a></li>
      </ul>
   </li>
   <li class="top"><a href="/chatbox/index.forum?" id="contacts" class="top_link"><span>Chatbox</span></a>
        <li class="top"><a href="/login?logout" id="contacts" class="top_link"><span>Logout</span></a></li>
<!-- END switch_user_logged_in -->
<!-- BEGIN switch_user_logged_out -->
   <li class="top"><a href="/login" id="contacts" class="top_link"><span>Login</span></a>
   <li class="top"><a href="/register" id="contacts" class="top_link"><span>Register</span></a>
<!-- END switch_user_logged_out -->
   <li class="top"><a href="http://www.bionextgen.com/" id="privacy" class="top_link"><span class="down">Outposts</span></a>
      <ul class="sub">
         <li><a href="http://www.bionextgen.com/">Weebly</a></li>
         <li><a href="http://twitter.com/#!/BionicleNextGen">Twitter</a></li>
         <li><a href="http://www.facebook.com/pages/Bionicle-The-Next-Generation/141276059220055">Facebook</a></li>
      </ul>
   </li>
</ul>
</ul>
</body>

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 ankillien on October 5th 2011, 2:49 pm

Add this javascript for all pages...

Code:
$(function(){
var pm_text = $('a.mainmenu[href="/privmsg?folder=inbox"]').text();
if(pm_text != "You have no new messages"){
  $('ul#nav a[href="/privmsg"] span').text('New PM!');
}
});

Tested on my forum and it works.

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 October 5th 2011, 4:06 pm

For some reason it always says "New PM!" even when there is none.

Legolover-361
Forumember

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

Back to top Go down

Page 1 of 2 1, 2  Next

View previous topic View next topic Back to top


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