Is possible to know if a category has unread forums ?

For support and discussion related to templates, themes, and imagesets in phpBB 3.0.
Get Involved
User avatar
Muad''Dib
Registered User
Posts: 311
Joined: Tue Jun 12, 2007 6:20 pm
Contact:

Re: Is possible to know if a category has unread forums ?

Post by Muad''Dib » Fri Mar 07, 2008 3:41 pm

njs wrote:For that you would have to define a new css style and apply the style you want according to that variable.. Now the sky is the limit in here :D ehehe

Kind regards,
Nuno
I know you got your problem solved, but would you have any way to know how to do that? Or would be willing to help?
Last edited by Muad''Dib on Fri Mar 07, 2008 6:24 pm, edited 1 time in total.

njs
Registered User
Posts: 83
Joined: Mon Feb 18, 2008 10:59 pm
Location: Aveiro, Portugal

Re: Is possible to know if a category has unread forums ?

Post by njs » Fri Mar 07, 2008 5:44 pm

Of course I can help you, but I need to know what you want .. are you expecting a mod for what you need ?

You said you need to change the color of the category row, what theme are you using/want to modify, are you fluent in CSS and HTML ?

Nuno

User avatar
Muad''Dib
Registered User
Posts: 311
Joined: Tue Jun 12, 2007 6:20 pm
Contact:

Re: Is possible to know if a category has unread forums ?

Post by Muad''Dib » Fri Mar 07, 2008 6:30 pm

njs wrote:Of course I can help you, but I need to know what you want .. are you expecting a mod for what you need ?

You said you need to change the color of the category row, what theme are you using/want to modify, are you fluent in CSS and HTML ?

Nuno
Im fairly fluent in html and css. Although when it comes to this phpbb board, i start to get pretty confused.

There is a mod that already does this for unread topics and PM's here:

http://www.phpbb.com/community/viewtopi ... 9&t=586492

More specifically, my post in the link below is as far as i have been able to get with modifying it:

http://www.phpbb.com/community/viewtopi ... 5#p4308825

I like the way that works, but i would also like the same thing to happen to category rows that are unread. Mainly because it would make it just that much easier, when visiting the Index page of my site, to see which categories have unread topics. By default, the only way to tell if the category has unread topics is that the category has a "red" icon instead of a blue one.

njs
Registered User
Posts: 83
Joined: Mon Feb 18, 2008 10:59 pm
Location: Aveiro, Portugal

Re: Is possible to know if a category has unread forums ?

Post by njs » Fri Mar 07, 2008 8:49 pm

The changes I posted a few days ago assert the S_UNREAD_FORUM for a category when there's a forum unread that belongs to that category.

For instance, if you want to change the BG of a category because of unread forums you can do the following:

Open prosilver's forum_list.html and find:

Code: Select all

    <!-- IF forumrow.S_IS_CAT or forumrow.S_FIRST_ROW  or forumrow.S_NO_CAT  -->
        <div class="forabg">
   
and replace it with

Code: Select all

<!-- IF forumrow.S_IS_CAT or forumrow.S_FIRST_ROW  or forumrow.S_NO_CAT  -->
      <!-- IF forumrow.S_UNREAD_FORUM -->
        <div class="forabg-new">
      <!-- ELSE -->
         <div class="forabg">
      <!-- ENDIF -->         
   
in the themes colours.css create a new class

Code: Select all

.forabg-new {
    background-color: #00FF00; // choose which color you like the most
    background-image: url("{T_THEME_PATH}/images/bg_list.gif");
}
   
and that should be all to change the background..

Is this what you needed ?

Regards,
Nuno

User avatar
Muad''Dib
Registered User
Posts: 311
Joined: Tue Jun 12, 2007 6:20 pm
Contact:

Re: Is possible to know if a category has unread forums ?

Post by Muad''Dib » Mon Mar 10, 2008 5:53 pm

Ahh man i thought that would work!! I tried it out and no go..

When viewing the source of the page, it doesnt ever show :

Code: Select all

<div class="forabg-new">
only the original:

Code: Select all

<div class="forabg">

So it seems that it isnt catching that the category has unread forums.


**EDIT**

After looking at what you have provided, that doesnt look like what i want to do either. The above code (if it worked for me) would change the background color where the category name is with bg_list.gif... but thats not where i want the color change to take place. I would like it to take place on the actual category row that has the read or unread icon. Does that make since? I think information is somewhere around this area:

Code: Select all

	<!-- IF not forumrow.S_IS_CAT -->
		<li class="row">
			<dl class="icon" style="background-image: url({forumrow.FORUM_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
But i could be very wrong!

njs
Registered User
Posts: 83
Joined: Mon Feb 18, 2008 10:59 pm
Location: Aveiro, Portugal

Re: Is possible to know if a category has unread forums ?

Post by njs » Mon Mar 10, 2008 11:15 pm

<!-- IF not forumrow.S_IS_CAT --> is for forum rows not for category rows.

I really don't understand what else I can do to help you..

If there's anything I can do, just post it here and I'll try to help.

Nuno

User avatar
Muad''Dib
Registered User
Posts: 311
Joined: Tue Jun 12, 2007 6:20 pm
Contact:

Re: Is possible to know if a category has unread forums ?

Post by Muad''Dib » Mon Mar 10, 2008 11:36 pm

njs wrote:<!-- IF not forumrow.S_IS_CAT --> is for forum rows not for category rows.

I really don't understand what else I can do to help you..

If there's anything I can do, just post it here and I'll try to help.

Nuno
Then it must be a forum row that i want to have the color change take place... I guess i wasnt thinking about this well enough.
Using your example:

Code: Select all

phpBB 3.0.x [Category]
|--3.0.x Styles Forums [Forum]
|----[3.0.x] Styles Development & Discussion [Sub-Forums]
The category name is phpbb 3.0x, and the forum is 3.0.x Styles... Both of these names are shown on the index page. The forum is what has the icon that is either red for unread items, or blue when read.

I appoligize, i must have gotten the two confused. Do you have any other suggestions for me?

njs
Registered User
Posts: 83
Joined: Mon Feb 18, 2008 10:59 pm
Location: Aveiro, Portugal

Re: Is possible to know if a category has unread forums ?

Post by njs » Mon Mar 10, 2008 11:52 pm

Find this piece of code in the forum_list.html

Code: Select all

<!-- IF not forumrow.S_IS_CAT -->
        <li class="row"> 
Replace it with

Code: Select all

<!-- IF not forumrow.S_IS_CAT -->
        <li class="row<!-- IF forumrow.S_UNREAD_FORUM -->-new<!-- ENDIF -->"> 
Now, go to the colours.css in theme folder and insert a new class.. for instance something like this:

Code: Select all

li.row-new {
    border-top-color:  #FFFFFF;
    border-bottom-color: #00608F;
}

li.row-new strong {
    color: #000000;
}

li.row-new:hover {
    background-color: #F6F4D0;
}

li.row-new:hover dd {
    border-left-color: #CCCCCC;
}

.rtl li.row-new:hover dd {
    border-right-color: #CCCCCC;
    border-left-color: transparent;
}
 
And change the colours at your will.
It should do what you want.

Regards,
Nuno

User avatar
Muad''Dib
Registered User
Posts: 311
Joined: Tue Jun 12, 2007 6:20 pm
Contact:

Re: Is possible to know if a category has unread forums ?

Post by Muad''Dib » Tue Mar 11, 2008 3:57 pm

I want to first start off by saying thanks very much njs. You have really helped big time, and im sure it can be frustrating working with a noob like me.

The good news is that after doing what you provided above, it seems it works. When i view the source, forum rows that are unread are changed to row-new. Thats a GREAT thing. However just testing the code you provided even leaving the colors alone, it really messed the look of the forum up. Also, i dont see which part is actually for the background color. Maybe that is defined with "<ul class="topiclist forums">"? which is right above:

Code: Select all

	<!-- ENDIF -->

	<!-- IF not forumrow.S_IS_CAT -->
?? Any ideas with that one?

**EDIT**

That has to be it... I tried something and it think it might work, so ill post back once someone makes a post and i can see if it does in fact work.

**EDIT2**

Well what i tried didnt work either... so gosh i just dont know anymore! It has to be li.row like you already said, but i just dont know where the row gets its background color. What sucks is that the hover color change is clearly defined with li.row:hover .. too bad we couldnt define something like li.row:unread .. lol

**EDIT3**

I GOT IT!!! Sorry im such a noob, but i got it to work as i want.. basically i did this:
Replaced:

Code: Select all

<li class="row">
With:

Code: Select all

<li class="row<!-- IF forumrow.S_UNREAD_FORUM --> background-color: #000000;<!-- ENDIF -->">
Once i do some more testing, ill make a write up for this.. THANKS SO MUCH njs!
Last edited by Muad''Dib on Tue Mar 11, 2008 6:19 pm, edited 2 times in total.

User avatar
Muad''Dib
Registered User
Posts: 311
Joined: Tue Jun 12, 2007 6:20 pm
Contact:

Re: Is possible to know if a category has unread forums ?

Post by Muad''Dib » Tue Mar 11, 2008 6:14 pm

Ok, here is my writeup:

http://www.phpbb.com/community/viewtopi ... 5#p4673715

Thanks again njs!! You rock.

njs
Registered User
Posts: 83
Joined: Mon Feb 18, 2008 10:59 pm
Location: Aveiro, Portugal

Re: Is possible to know if a category has unread forums ?

Post by njs » Tue Mar 11, 2008 9:36 pm

Hello

I'm glad I could help :D

After checking your post, there's no need to change functions_display.php that's for categories only :D the thing you wanted to do can be done just using the template system :)

That's it..

Kind regards,
Nuno

User avatar
Muad''Dib
Registered User
Posts: 311
Joined: Tue Jun 12, 2007 6:20 pm
Contact:

Re: Is possible to know if a category has unread forums ?

Post by Muad''Dib » Tue Mar 11, 2008 9:41 pm

njs wrote:Hello

I'm glad I could help :D

After checking your post, there's no need to change functions_display.php that's for categories only :D the thing you wanted to do can be done just using the template system :)

That's it..

Kind regards,
Nuno
Interesting ... i know i had to use:

Code: Select all

<!-- IF forumrow.S_UNREAD_FORUM -->
in order for it to recognize unread topics in the forum. I tried at first using:

Code: Select all

<!-- IF messagerow.S_UNREAD -->
but that did not work.
What did i miss so that i could just use the template system?

njs
Registered User
Posts: 83
Joined: Mon Feb 18, 2008 10:59 pm
Location: Aveiro, Portugal

Re: Is possible to know if a category has unread forums ?

Post by njs » Tue Mar 11, 2008 9:44 pm

Everything is fine as you have, and the edit you made to the functions_display.php is not needed, you can use the original file instead of the modified one.

Nuno

User avatar
Muad''Dib
Registered User
Posts: 311
Joined: Tue Jun 12, 2007 6:20 pm
Contact:

Re: Is possible to know if a category has unread forums ?

Post by Muad''Dib » Wed Apr 01, 2009 11:35 pm

njs,

Again i want to thank you for your help with this...

Today i was fooling around with phpbb and I enabled debug for the first time.

I found that there was a problem with "frows".

I eventually fixed it by adding: "$frows = null;".

This however made me start to think more about what you said about not having to make the changes to functions_display.php.

However, without the changes there i could not use: <!-- IF forumrow.S_UNREAD_FORUM -->.

Were you saying that without those changes i could use: <!-- IF messagerow.S_UNREAD --> to accomplish the same things?

So basically instead of using:

Code: Select all

<li class="row<!-- IF forumrow.S_UNREAD_FORUM --> background-color: #000000;<!-- ENDIF -->">
Could i use:

Code: Select all

<li class="row<!-- IF messagerow.S_UNREAD --> background-color: #000000;<!-- ENDIF -->">
Or am i way off base here?

I think a little better explanation would be in order...

Thanks very much for your time.

*EDIT1*

Or are you saying that "forumrow.S_UNREAD_FORUM" is defined already somewhere else?

*EDIT2*

Yep thats what you meant! I guess i should try stuff before i just post away.

Thanks again njs!

User avatar
Raimon
Former Team Member
Posts: 12088
Joined: Tue May 30, 2006 5:31 pm
Location: Netherlands
Name: Raimon Meuldijk
Contact:

Re: Is possible to know if a category has unread forums ?

Post by Raimon » Thu Apr 02, 2009 12:19 am

Use a style attribute otherwise you color will not work ;)

so the code need to be ;

Code: Select all

<li class="row"<!-- IF messagerow.S_UNREAD --> style="background-color: #000000;"<!-- ENDIF -->>
did you notice the style= ;)
Need phpBB installation, extenstions, Styles or integrate phpBB with you website?
Contact me for fair prices and good service!

Locked

Return to “[3.0.x] Styles Support & Discussion”