Idk if it requires JS but yah. If anyone knows what to do please help
Now solved. Thank you sooo much Wagner!
Last edited by FineryWorkshop on February 12th 2015, 10:11 pm; edited 1 time in total
This is a Hitskin.com skin preview
Install the skin • Return to the skin page
What? XD It's not an image. Like I said above, I made my own navigation menu.Wagner' wrote:Which is the link of the image to unread messages of your forum? This need to be different than the read messages.. So we can do a request to this page "/privmsg?folder=inbox" and check how many images are there...
Hello,Wagner' wrote:Which is the link of the image to unread messages of your forum? This need to be different than the read messages.. So we can do a request to this page "/privmsg?folder=inbox" and check how many images are there...
Forum of the Forums Forumotion Rules | Tips & Tricks | FAQ | Did you forget your password? |
Ohhh Thank you XDLuffy wrote:Hello,Wagner' wrote:Which is the link of the image to unread messages of your forum? This need to be different than the read messages.. So we can do a request to this page "/privmsg?folder=inbox" and check how many images are there...
@FineryWorkshop what Wagner is trying to say is that if you tell him the image you use for the unread messages in your inbox he could make the script to read how many messages are in your inbox. What you need to do is only send him the images and hopefully he can do it for you. He was not talking about the navigation bar images..
Luffy
Here If you can do it thank you so much! I'll be sure to add you on the credit page.Wagner' wrote:Which is the link of the image to unread messages of your forum? This need to be different than the read messages.. So we can do a request to this page "/privmsg?folder=inbox" and check how many images are there...
// Make the request to the inbox folder and store the content on the "data" variable.
$.get('/privmsg?folder=inbox', function(data) {
// Here you can update the unread messages link.
var unread_image = 'http://i38.servimg.com/u/f38/18/44/35/81/offlin10.png';
// Here we store the number of unread messages.
var unread = $('.main-content .status img[src="' + unread_image + '"]', data).length;
// And here, we can use this number as we want...
// If unread messages are greater than 0, do something.
if( unread > 0 ) {
// Here you need to edit the element you want to display that number.
// For example: $('#my_element').text( unread );
// As I don't know your page link, i'll just add an example
alert('You have ' + unread + 'unread messages.');
}
});
alert('You have ' + unread + 'unread messages.');
<script></script>
Forum of the Forums Forumotion Rules | Tips & Tricks | FAQ | Did you forget your password? |
YesLuffy wrote:Have you added the
tags at the beginning and and at the end of the code?
- Code:
<script></script>
I sent it in a PM, I hope that's okayWagner' wrote:Can you send the link of the page, please? And tell me where you want to display this infos.
$(function() {
$.get('/privmsg?folder=inbox', function(data) {
var unread_image = 'http://i38.servimg.com/u/f38/18/44/35/81/offlin10.png';
var unread = $('.main-content .status img[src="' + unread_image + '"]', data).length;
$('.navbar ul li ul li a[href="http://fineryworkshop.forumotion.com/privmsg?folder=inbox"]').append(unread);
});
});
Okay, so I put it in and it added that I have 0 PMs but when I sent myself one from a different account it didn't pop up for me? It still stayed 0Wagner' wrote:Here, this should work
- Code:
$(function() {
$.get('/privmsg?folder=inbox', function(data) {
var unread_image = 'http://i38.servimg.com/u/f38/18/44/35/81/offlin10.png';
var unread = $('.main-content .status img[src="' + unread_image + '"]', data).length;
$('.navbar ul li ul li a[href="http://fineryworkshop.forumotion.com/privmsg?folder=inbox"]').append(unread);
});
});
$(function() {
$.get('/privmsg?folder=inbox', function(data) {
var unread = $('ul.pmlist li dl[style="background-image: url(http://2img.net/i/fa/prosilver/topic_unread.gif);"]', data).length;
$('.navbar ul li ul li a[href="http://fineryworkshop.forumotion.com/privmsg?folder=inbox"]').append(unread);
});
});
Omg, it works! Thank you SO much for your help ♥Wagner' wrote:Sorry, i forgot to adapt the selectors to your forum, here, this will work:
- Code:
$(function() {
$.get('/privmsg?folder=inbox', function(data) {
var unread = $('ul.pmlist li dl[style="background-image: url(http://2img.net/i/fa/prosilver/topic_unread.gif);"]', data).length;
$('.navbar ul li ul li a[href="http://fineryworkshop.forumotion.com/privmsg?folder=inbox"]').append(unread);
});
});