1
natxocc
Unread topics in newbb2. I think doesn't work well
  • 2005/3/13 14:23

  • natxocc

  • Just popping in

  • Posts: 19

  • Since: 2005/1/23


Example:

I connect from my PC, I go to forums ( I have 3 topics no readed). I read the first one. I disconnect.

Now, from work I want to continue reading topics but... All was readed!!! Now I don't know what topics are not readed.

The conditions are:

Last visit to forums < last post topic = unread topic

and

Last read topic (from cookie) < last post topic = unread topic


Now the question is if I have no cookies (other PC or remove them), why I have my topics readed?

Look at forum.php (inside class directory from newbb) line 514 aprox.

Quote:

// ------------------------------------------------------
/* Necessary and sufficient conditions for an unread topic:
1. the last_post_time must be later than the last_vist;
2. the last_post_time must be later than the topic_lastread;
*/
$is_unread = false;
$lastread = empty($topic_lastread[$myrow['topic_id']])? 0 : $topic_lastread[$myrow['topic_id']];
if(max($GLOBALS['last_visit'], $lastread) < $myrow['last_post_time']) $is_unread = true;
// ------------------------------------------------------


I think is was correct if I use the minium value from 'last_visit' or '$lastread' and not max value. Probably correct was:

Quote:

// ------------------------------------------------------
/* Necessary and sufficient conditions for an unread topic:
1. the last_post_time must be later than the last_vist;
2. the last_post_time must be later than the topic_lastread;
*/
$is_unread = false;
$lastread = empty($topic_lastread[$myrow['topic_id']])? 0 : $topic_lastread[$myrow['topic_id']];
if(min($GLOBALS['last_visit'], $lastread) < $myrow['last_post_time']) $is_unread = true;
// ------------------------------------------------------


It's a suggestion



2
natxocc
Active topics (unread messages for user) in NewBB2
  • 2005/3/10 23:20

  • natxocc

  • Just popping in

  • Posts: 19

  • Since: 2005/1/23


Witch code I need to use for list unread post in newbb2?

I explain. In my block I want an option to see if I have new post to read. If I click it I want a list of unread post, not all of them.

I was seeing the database but I don't understand it. It works very strange.

thanks for all



3
natxocc
New block(module) ntxusuario (beta versión)
  • 2005/2/13 13:15

  • natxocc

  • Just popping in

  • Posts: 19

  • Since: 2005/1/23


I have done my first module for xoops. I'm not an experiencied programmer in PHP(I am an ex-ASP). I have created a block to show information about:

*Welcome message with avatar
*Login connection or personal options if connected
*List of users connected (with the flag from they are) and where thay are navigating

This block(module) has the intention to forget the actuals "USER MENU" and "ONLINE USERS" for this one.

Thay are some utils options in the block (no admin section from now in beta version)

You can download inhttp://www.natxocc.com

go in "descargas (downloads)". No registration required.

TODO:
* Popup message when receive a message
* See "active topics"
* improve code
* improve appearance

Attention, it's a beta module, only for test. (spanish and english language)

When it will be finished I will ask for to put this at xoops.org.



4
natxocc
Re: block visible in all pages!
  • 2005/2/8 19:02

  • natxocc

  • Just popping in

  • Posts: 19

  • Since: 2005/1/23


Quote:

carnuke wrote:
If you make a block, it should have a name and an ID and it will show in Blocks in admin, Correct?


Yes, correct.

Quote:

If so, go to admin>blocks admin click edit for this block you made and in the drop down pages menu make it visible in all pages.


Yes, I do it and it works but my question is different.
When I install the module, BY DEFAULT it only is seeing in "top page" (home page). I want that when I install the module, by default the block could be see in all pages. It's possible?

Thanks.



5
natxocc
Re: block visible in all pages!
  • 2005/2/8 18:37

  • natxocc

  • Just popping in

  • Posts: 19

  • Since: 2005/1/23


no help?...



6
natxocc
Re: block visible in all pages!
  • 2005/2/7 23:52

  • natxocc

  • Just popping in

  • Posts: 19

  • Since: 2005/1/23


well, I made a module but only a block is displayed (in future it will have a admin section).

It is almost finished (see some images):

When connected:
Resized Image

When no connected:
Resized Image

(NOTE: They are images inhttp://localhost. In a server it appears the flag from you are...)

My problem is when I install the module, by default it only is visible at home page. I want it would be visible in all pages by default. Probably I must add a variable in my xoops_version.php to do it.

Well I don't know.

Thanks.



7
natxocc
block visible in all pages!
  • 2005/2/7 22:55

  • natxocc

  • Just popping in

  • Posts: 19

  • Since: 2005/1/23


Sorry about post it here, but I have a blank page at dev.xoops.org and I can't access to it.

I'm developing a new block. By default, this block is only visible at home page. If I change it (other page like my profile) the block dissapear. If I go to admin, blocks, edit, visible at "all" it works correctly (by default it was at "top page")

Is there an option to install the block to see in all pages?
Changing a variable at xoops_version.php probably?

I need that after installing the block it would be accessible from any page.

Thanks.



8
natxocc
block visible in all pages!
  • 2005/2/7 22:55

  • natxocc

  • Just popping in

  • Posts: 19

  • Since: 2005/1/23


Sorry about post it here, but I have a blank page at dev.xoops.org and I can't access to it.

I'm developing a new block. By default, this block is only visible at home page. If I change it (other page like my profile) the block dissapear. If I go to admin, blocks, edit, visible at "all" it works correctly (by default it was at "top page")

Is there an option to install the block to see in all pages?
Changing a variable at xoops_version.php probably?

I need that after installing the block it would be accessible from any page.

Thanks.



9
natxocc
block visible in all pages!
  • 2005/2/7 22:54

  • natxocc

  • Just popping in

  • Posts: 19

  • Since: 2005/1/23


Sorry about post it here, but I have a blank page at dev.xoops.org and I can't access to it.

I'm developing a new block. By default, this block is only visible at home page. If I change it (other page like my profile) the block dissapear. If I go to admin, blocks, edit, visible at "all" it works correctly (by default it was at "top page")

Is there an option to install the block to see in all pages?
Changing a variable at xoops_version.php probably?

I need that after installing the block it would be accessible from any page.

Thanks.



10
natxocc
Re: How to check if user is admin
  • 2005/2/2 19:21

  • natxocc

  • Just popping in

  • Posts: 19

  • Since: 2005/1/23


thanks!

it was useful!!




TopTop
(1) 2 »



Login

Who's Online

161 user(s) are online (99 user(s) are browsing Support Forums)


Members: 0


Guests: 161


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits