1
irmtfan
how to have a notification category with more than one item_name?
  • 2012/9/11 5:37

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


In my works on newbb module i see that notifications for 'thread' category just work when you use the URL contain topic_id.
eg:
https://xoops.org/modules/newbb/viewtopic.php?topic_id=75499

but notification is not work when you use the URL without topic_id. and in the new version of newbb most of URLs are like this: newbb/viewtopic.php?post_id=XXXX
eg:
xoops.org/modules/newbb/viewtopic.php?post_id=349271

i notice that is because in xoops_version you just can define one unique item_name for each category. therefore we cannot have an array like this:
array('topic_id','post_id')

eg: for newbb:
$modversion['notification']['category'][1]['name'] = 'thread';
$modversion['notification']['category'][1]['title'] = _MI_NEWBB_THREAD_NOTIFY;
$modversion['notification']['category'][1]['description'] = _MI_NEWBB_THREAD_NOTIFYDSC;
$modversion['notification']['category'][1]['subscribe_from'] = 'viewtopic.php';
$modversion['notification']['category'][1]['item_name'] = 'topic_id';
$modversion['notification']['category'][1]['allow_bookmark'] = 1;


so the $xoops_notification["show"]=0 when you dont have topic_id in URL.
my urgent solution is commenting that item_name so notifications are displaying in any URLs contain viewtopic.php but now the issue is the redirect to the topic is not work anymore and the user will redirected to the index.

my questions is what is the best way to solve the above issue?

2
Mamba
Re: how to have a notification category with more than one item_name?
  • 2012/9/12 20:17

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


Quote:
my questions is what is the best way to solve the above issue?

I hope, Alfred reads that and can provide a suggestion...
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

3
irmtfan
Re: how to have a notification category with more than one item_name?
  • 2012/9/13 4:36

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


what is important here is we find this issue thanks to the reports from my community. Now we can find the solution sooner or later.
Honestly many bugs in newbb module is found when i install it in my big forum (almost 20 posts/day) and my community report the bugs to me. I think without my community help we could not find the bugs even in one year.
Also many of these bugs are minor bugs. (displaying issue, smarty issue, ...)
but a few of them are important.
I solved them in irmtfan branch and in the past i reported the changelog in the newbb 4.3 topic.
But It seems Alfred dont like my reports so i stop it and i will just update the SVN in the future without reporting in xoops.org forums.
I still dont know what is wrong with helping a developer to find bugs and help him to find solutions and add features and implement them.
Why Alfred want to find bugs/debug/solutions add features himself alone.

Anyway, i reach to a better solution for this issue. so i revoke my last solution in the SVN.
To solve this i manually set $_Get for topic_id
in viewtopic.php

if ( !empty($post_id) ) {
    
$topic_obj $topic_handler->getByPost($post_id);
    
$topic_id $topic_obj->getVar("topic_id");
// add by irmtfan to show notification when we just have post_id in the URL
$_GET['topic_id'] = $topic_id;


I know that generally setting the $_Get is not good and is poor coding. but i dont know whether the above is not good too.
i hope if Alfred dont like to write here some coders Like Zyspec could advise me
Also now still there is a very minor issue:
- user will redirected to the topic_id instead of post_id after submit a notification in post_id URLs.

4
irmtfan
Re: how to have a notification category with more than one item_name?
  • 2012/9/17 4:02

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Anybody have a better solution?

IMO setting the $_GET is very good but the only issue is redirecting.

Im sure that the final solution should come out from xoops core to accept changing the item_name.

Login

Who's Online

321 user(s) are online (204 user(s) are browsing Support Forums)


Members: 0


Guests: 321


more...

Donat-O-Meter

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

Latest GitHub Commits