121
black_beard
Re: Newbb 4.3

hello,
I have corrected two bugs that are reported here

the first :

Replace line 286 in ./class/user.php

$ranks[$myrow['rank_id']]['rank_image'] = "XOOPS_UPLOAD_URL "/rank/" htmlspecialchars($ranks[$myrow['rank_id']]['rank_image'], ENT_QUOTES) . "' alt='' />";


by

$ranks[$myrow['rank_id']]['rank_image'] = "XOOPS_UPLOAD_URL "/" htmlspecialchars($ranks[$myrow['rank_id']]['rank_image'], ENT_QUOTES) . "' alt='' />";


And for the second bug fix

Replace line 235 in ./post.php

if (rename(XOOPS_CACHE_PATH "/" $attachments_tmp[$key][0], XOOPS_ROOT_PATH "/" $xoopsModuleConfig['dir_attachments'] . "/" $attachments_tmp[$key][0])) {


by

if (is_file(XOOPS_ROOT_PATH "/" $xoopsModuleConfig['dir_attachments'] . "/" $attachments_tmp[$key][0])) {

122
irmtfan
Re: Newbb 4.3
  • 2012/7/23 10:19

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


black_beard:
I cant reproduce your reported bugs.
The correct path for "ranks" is uploads/ranks in xoops 2.5.5
But for backward compatibility the old ranks are in uploads folder.
so there should be a function for reading from both paths (uploads & uploads/ranks)
I sent a post in this topic:
https://xoops.org/modules/newbb/viewtopic.php?post_id=347636#forumpost347636
also your quoted codes are incorrect. the correct current code is here:
source: http://xoops.svn.sourceforge.net/viewvc/xoops/XoopsModules/newbb/branches/alfred/newbb/class/user.php?revision=9650&view=markup
$ranks[$myrow['rank_id']]['rank_image'] = "XOOPS_UPLOAD_URL "/ranks/" htmlspecialchars($ranks[$myrow['rank_id']]['rank_image'], ENT_QUOTES) . "' alt='' />";


About your second reported bug im not sure what you want to solve?
Files are attached correctly in newbb/uploads and i dont have any issue with them.

123
Cesagonchu
Re: Newbb 4.3

irmtfan,

I don't know what Xoops version you use, but if you download it here, and if you download the LATEST newbb version (9883 last revision) here, you will see attachements doesn't work.

124
irmtfan
Re: Newbb 4.3
  • 2012/7/24 11:01

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Quote:

I don't know what Xoops version you use, but if you download it here, and if you download the LATEST newbb version (9883 last revision) here, you will see attachements doesn't work.


I dont have any problem in my test website but i still have problem in running website.
all configurations are the same. now it is 2 hours that im investigating the issue.

That solution that black_beard wrote is not worked for running website. it is really strange.
the file is in newbb/uploads but just it didnt show up in the post.

Maybe Alfred knows better.


125
Anonymous
Re: Newbb 4.3
  • 2012/7/24 22:02

  • Anonymous

  • Posts: 0

  • Since:


The "show more" user link does not work here at xoops.org. Is it a local issue or a problem with the revision used? The 4.3 version I installed at nlxoopx.nl a few weeks ago does not have this failure...

126
Mamba
Re: Newbb 4.3
  • 2012/7/24 22:35

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


Quote:
The "show more" user link does not work here at xoops.org. Is it a local issue or a problem with the revision used?

I'll need to check it - I suspect, it is related to JavaScript used in our theme.
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

127
irmtfan
Re: Newbb 4.3
  • 2012/7/25 5:10

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Hopefully i could find the issue after more than 3 hours of investigation.
firstly i saw that the file is uploaded in uploads/newbb
then i went to table _bb_posts and saw that the "attachment" field is filled.
It was very strange to me. I test many other ways and try many things but i couldnt find the root if the issue.
my test website is in the subdomain of running website so all configurations are the same. i just copy the newbb folder from running website to the test subdomain then install and test but everything was correct.

finally i tried to simulated the issue step by step. I installed a 3.08 in my test website then send some post with attachments and then upgraded it to latest SVN.
Then i tried to attach more files but failed. So i found that the problem is in upgrade process.
I look at the structure of tables and BINGO********* i found the issue.

The issue is the "attachment" field type is increased from VARCHAR(255) in 3.08 to TEXT in 4.3 to can handle more data.
I manually changed the field with the help of phpmyadmin:
ALTER TABLE  `****_bb_postsCHANGE  `attachment`  `attachmentTEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL

and the problem is solved.

It cost 3 hours for me but just 3 Mins for you to found it!

Mamba:
do not consume more time just replace with the Latest SVN. The "show more" is works fine in my running and test websites.
im sure that xoops.org also have all the bugs i found and report here because you upgrade from 3.08 just like me.

also please take a look at sig permissions. it dont show users sig i forums.

Alfred:
Below please find the sum up of current remained bugs that should be solved in SVN:

1- It dont display the record edit when you dont fill the reason.
solution:
in newbb/class/post.php around line 245
replace this:
if ($edit_msg != "") { 
                    
$post_edit _MD_EDITEDBY " " $edit_user " " _MD_ON " " formatTimestamp(intval($edit_time)) . "
"
._MD_EDITEDMSG " " .$edit_msg.""
                }

with this:
$post_edit _MD_EDITEDBY " " $edit_user " " _MD_ON " " formatTimestamp(intval($edit_time)).""
                if (
$edit_msg != "") { 
                    
$post_edit .= _MD_EDITEDMSG " " .$edit_msg.""
                }


2- It just record the last edit. to record all edits.
solution:
in newbb/class/post.php
line 246
$post_edit _MD_EDITEDBY .....

replace with
$post_edit .= _MD_EDITEDBY .....


3- in upgrade from 3.08 to 4.3 it dont upgrade in the mysql table _bb_posts field "attachment" from VARCHAR(255) to TEXT.
(the value/length is 255 in 3.08 and should be removed)

solution???? Please add to the upgrade process script.

128
irmtfan
Re: Newbb 4.3
  • 2012/7/25 8:52

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


another functional bug:
I saw some posts that not showed in the forums but sender insist that he/she sent it.
I look at the db and i could find those posts.
But the strange thing is "approved" value is set to 2.
As far as i could find the approved should be -1,0,1
I could find 13 posts with "approved"=2 and one post with "approved"=98
when i change the value to 1 the post will show up in topic.

i just can found this setVar for approved value:
in newbb/post.php:
$approved $topic_handler->getPermission($forum_obj$topic_status'noapprove');
    
$post_obj->setVar('approved'$approved);


i follow the getPermission function here:
in newbb/class/topic.php
// get permission
    // parameter: $type: 'post', 'view',  'reply', 'edit', 'delete', 'addpoll', 'vote', 'attach'
    // $gperm_names = "'forum_can_post', 'forum_can_view', 'forum_can_reply', 'forum_can_edit', 'forum_can_delete', 'forum_can_addpoll', 'forum_can_vote', 'forum_can_attach', 'forum_can_noapprove'";
    
function getPermission($forum$topic_locked 0$type "view")
    {
        global 
$xoopsUser$xoopsModule;
        static 
$_cachedTopicPerms;
        
mod_loadFunctions("user""newbb");
        if (
newbb_isAdmin($forum)) return 1;

        
$forum_id is_object($forum) ? $forum->getVar('forum_id') : intval($forum);
        if ( 
$forum_id ) return false;

        if (
$topic_locked && 'view' != $type) {
            
$permission 0;
        } else {
            
$perm_handler =& xoops_getmodulehandler('permission''newbb');
            
$permission $perm_handler->getPermission("forum"$type$forum_id);
        }
        return 
$permission;
    }


So i follow the getPermission function here:
in newbb/class/permission.php
function getPermission($type$gperm_name "access"$id 0)
    {
        global 
$xoopsUser$xoopsModule;
        
        if (
$GLOBALS["xoopsUserIsAdmin"] && $xoopsModule->getVar("dirname") == "newbb") {
            return 
true;
        }
        
        
$groups is_object($xoopsUser) ? $xoopsUser->getGroups() : array(XOOPS_GROUP_ANONYMOUS);
        if ( !
$groups ) return false;
        if ( !
$allowed_groups $this->getGroups("{$type}_{$gperm_name}"$id) ) return false;
        
        return 
count(array_intersect($allowed_groups$groups));
    }


It seems that count(array_intersect ... is doing the wrong job.
The user is belong to 5 different groups.
Im still investigate it to find a solution.

edit:
It seems it is because those users are belong to some groups that those groups have the permission to send post without approval.
So at the above function it count them double.

As a temporary solution i set the need approval permission for all forums to registered users group_no=2.

But i still think newbb should correctly do it even when a user have double or triple permission.
It is still a bug in my idea.

edit number 2:

eg change that line to the below:
if( count(array_intersect($allowed_groups$groups)) )  {
return 
true;
} else {
return 
false;
}

I think the above solution is good. maybe need some alteration in codes.



129
irmtfan
Re: Newbb 4.3
  • 2012/7/26 4:33

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


everybody please also take a look in this topic:
https://xoops.org/modules/newbb/viewtopic.php?post_id=348063#forumpost348063
They need to have "text links" instead of images.

In newbb/class/icon.php and In assignImage function, It just return a true which is useless:
function assignImage($image$alt ""$extra "")
    {
        
$this->setImage($image$alt$extra);
        return 
true;
    }

IMO it should return a variable and that variable is alt variable, because it is just used in newbb/include/functions.render.php in newbb_displayImage function like this:
function newbb_displayImage($image$alt ""$display true$extra "class='forum_icon'")
{
    
$icon_handler newbb_getIconHandler();
    if (empty(
$display)) {
        return 
$icon_handler->assignImage($image$alt$extra);
    } else {
        return 
$icon_handler->getImage($image$alt$extra);
    }
}

So one can see it will be used when there is display=false (the user dont need images)
I think when the display for icons is false it should return the alt variable to show text links like below:
function assignImage($image$alt ""$extra "")
    {
        
$this->setImage($image$alt$extra);
        return 
$alt;
    }

Also one can easily add this display=true/false configuration to newbb preferences.

Alfred:
IMO we need your advise for the above. could you implement it?
Thank you.


130
irmtfan
Re: Newbb 4.3
  • 2012/7/28 11:07

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Quote:

The issue is the "attachment" field type is increased from VARCHAR(255) in 3.08 to TEXT in 4.3 to can handle more data.

I checked 3.08 codes and found that it is incorrect and "attachment" field type in 3.08 is text too.
I check all CBB old versions but i cant find VARCHAR(255) so I wonder why in my running website it was VARCHAR(255)?
Anyway i think all reported bugs for newbb 4.3 have been solved.

Login

Who's Online

278 user(s) are online (157 user(s) are browsing Support Forums)


Members: 0


Guests: 278


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