-
-
Notifications
You must be signed in to change notification settings - Fork 61
fix for waiting block deprecated messages #1527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ggoffy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Point 1:
why [$count] = $xoopsDB->fetchRow($result); and not $count = $xoopsDB->fetchRow($result);
Point 2: do not repeat DB query, suggestion:
$count = $xoopsDB->fetchRow($result);
if ((int)$count > 0) {
$block['modules'][0]['adminlink'] = XOOPS_URL . '/modules/news/admin/index.php?op=newarticle';
[$block['modules'][0]['pendingnum']] = $count ;
$block['modules'][0]['lang_linkname'] = _MB_SYSTEM_SUBMS;
}
|
@ggoffy Point 1: If you only need the count as a single value,
|
|
hi, sorry, didn't realize that fetchRow provides an array :( nevertheless I would avoid second DB query: |
|
Good point - I'll streamline it later |
|
However, sometimes you'll need to run it twice, because some of the functions (like the
|
|
@ggoffy, please check it out - I've made some improvements |
therefore I changed into |
suggestion: |
|
|
@ggoffy thanks for testing it. Regarding removing $index from function checkPendingContent(), is there anywhere an dependency on the index number? |
|
I don't think that there is a dependency, because in the block itself there is only a simple walk through a foreach |
|
@ggoffy your improvements are now included, please check if it works for you |
|
works fine, thank you |
No description provided.