Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Kieran

MYBB Sprites and "No New Posts"

Recommended Posts

Thanks. ūüôā And well, it wasn't complete waste of time as it did make me realize the issue's cause. ^^

Do you know why the "Forum Contains New Posts" icons won't go out when all the new posts have been read? This issue has been for ages, long before I moved my boards to self-host. Whenever one clicks on them to turn them off seeing to that they refuse to do it themselves...then they light right up again at the very next page load. Both on the index page and on the subforums. I noticed that the ACP's settings have some kind of an experimental setting that should attempt to mark the parent forums unread when there's no longer unread posts...But it sounds like it only applies to the parent forums and not to the subforums--besides, it doesn't seem to work at all anyway.

Also, I've been trying to google how to create a forum icon sprite to replace the default one so that they new posts / no new posts icons would at least suit the theme of the RPG. Like, instead of those generic speech bubbles I'd like to have autumn leaves for the Old West rpg. Different colour leaf for the new-posts and no-new-posts status. Or bubbling cauldrons for the Harry Potter RPGs. But I can't find a tutorial how to create such sprite, as it seems it has to be one image with four icons instead of four separate images. By the way, is that standard for this element on boards or is mybb's system just needlessly complicated? (Because on Proboards one could just link individual images for those icons.)

Edited by Kieran

Share this post


Link to post
Share on other sites

@Kieran¬†I just split up your topics so that it's easier to keep track of what the problems were and how they were solved. ūüôā

 

Sorry about the late reply on this! I've had a very long work week with very long days.

 

On 6/8/2018 at 8:00 AM, Kieran said:

Do you know why the "Forum Contains New Posts" icons won't go out when all the new posts have been read?

 

Can I grab the link to see if I have the same issue? In the meantime:

- Does everyone report this issue?

- Do you clean out your cache regularly? (Which will clear the read cookies and be why this is happening?)

 

On 6/8/2018 at 8:00 AM, Kieran said:

By the way, is that standard for this element on boards or is mybb's system just needlessly complicated?

 

This is actually best practice because instead of potentially asking someone to download five different images, they're only downloading one. Typically, though, I use font awesome for sprites or just a CSS only shape.

 

But when I did image sprites, I literally downloaded the image and opened it up in photo editor of choice. Then I put the images I wanted on top of the old images (so that the height is exactly the same as the old ones) and then made the edits I wanted. Say, opacity, giving one a different shade etc. Turn off the original layer, save as a png, and then uploaded. That way, I don't need to change the background position at all, just the image URL.

 

Let me know if that makes sense!

Share this post


Link to post
Share on other sites

AAs an addendum to the "Clear your cookies/cache regularly" there are browser settings to remove that stuff on browser exit, you should also check that.

Share this post


Link to post
Share on other sites

Yes, it's every user's issue. And no, I don't clear my browser cache downright regularly but randomly a few times a year, but clearing cache doesn't make any difference. I've tried that several times. The issue is on all my boards. Here's one of them.

 

Also, I thought of doing that just slapping new images over the existing sprite but didn't think it could be that easy. I'll give it a try, then.

Edited by Kieran

Share this post


Link to post
Share on other sites

Forum read is working correctly for me. I've refreshed, closed the browser and opened it again and did a hard refresh. I can not replicate this issue.

 

Cookies are the sort of things that hold onto that kind of information - clearing the cache shouldn't help. Like Morrigan said, some browsers clear all cookies when it's closed. You should check your browser setting. The setting will look something like this:

Capture.PNG

 

I assume that you're not reading the thread and then logging out and expecting the forum to still be read? It doesn't sound like that's what you're talking about but I want to be certain.

 

The other thing you can try is a recount and rebuild of your cache. I don't expect it to help, like I said, I can't replicate this issue on your forum. But it shouldn't hurt.

Share this post


Link to post
Share on other sites

For guests the forum icons don't re-light immediately. However, if you return to the same board i.e. the next day they usually have lighted up again, even if no forum has any new content. For registered members it happens at the next page refresh. Yes, I had tried the recount and rebuilding the cache and it never worked. Also, no I have not logged out after reading a forum's contents. The problem occurs while staying logged in.

Okay, I'm trying to download the forum icon sprite image and slap new images on it and re-upload that version back so I can at least have those icons properly themed. The problem is I can't find the one I need. In the Images folder's main directory is only the default theme's forum_icon_sprite.png. It's not in the Images folder's Icons subfolder either. And in the admin folder and in the cache/themes folder are only css files. So where the heck is the other theme's forum_icon_sprite image?

The theme I'm talking about was made for myBB version 1.6-something but since it's installed and functioning on my board you'd think its images would show up in the file manager?

Edited by Kieran

Share this post


Link to post
Share on other sites

images/forum_icon_sprite.png is the one that you want to download. If you haven't created a new sprite and uploaded it directly to the theme's images subfolder, it won't exist.

 

When you have edited forum_icon_sprite.png and uploaded it to the image's subfolder, you will need to find the following in your CSS:

 

.forum_status {
	height: 30px;
	width: 30px;
	background: url(images/forum_icon_sprite.png) no-repeat 0 0;
	display: inline-block;
}

And adjust the image URL appropriately. Let me know if you need any extra detail!

 

For the read/unread thing:

 

I found this bug tracker.

The original thread is here.

In it, this fix was discussed. I had a look at this and found this change.

 

// LukasAMD Fix
			$unread = false;
			$subforums_exist = false;
            $parent_unread = false;

So I applied it to my test forum and it didn't break it, so might be worth a shot. Like I said, I don't experience this issue so I'm not able to confirm whether or not this will help you.

 

  • So, go to your cpanel and file manager.
  • Public_HTML
  • Inc
  • Download a copy of¬†functions_forumlist.php (if something untoward occurs, just upload this file again to return it back to it's original state.
  • Edit¬†functions_forumlist.php
  • Find this snippet¬†
    	// Foreach of the forums in this parent
    	foreach($fcache[$pid] as $parent)
    	{
    		foreach($parent as $forum)
    		{
    			$subforums = $sub_forums = '';
    			$lastpost_data = array(
    				'lastpost' => 0
    			);
    			$forum_viewers_text = '';
    			$forum_viewers_text_plain = '';

     

  • Directly below it, enter the following:¬†

    // LukasAMD Fix
    			$unread = false;
    			$subforums_exist = false;
                $parent_unread = false;

    So that in the end you get this: 

    	// Foreach of the forums in this parent
    	foreach($fcache[$pid] as $parent)
    	{
    		foreach($parent as $forum)
    		{
    			$subforums = $sub_forums = '';
    			$lastpost_data = array(
    				'lastpost' => 0
    			);
    			$forum_viewers_text = '';
    			$forum_viewers_text_plain = '';
    			
    			// LukasAMD Fix
    			$unread = false;
    			$subforums_exist = false;
                $parent_unread = false;
    
    			// Get the permissions for this forum
    			$permissions = $forumpermissions[$forum['fid']];

    I hope that helps!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.



√ó

Important Information

By using this site, you agree to our Terms of Use, Guidelines and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.