1
BelaS
Removal of post listing cap in userinfo.php
  • 2003/11/7 17:40

  • BelaS

  • Just popping in

  • Posts: 62

  • Since: 2003/5/26


Hi Xoopsers,

I've been muddling over a little problem and have been unable to unearth a solution in the forums as yet. I would like to change the number of postings by user listed from each module in userinfo.php. It is currently set at 5 per module. I'd like to increase this to 20, or possibly all, but can't find where the limit of 5 is specified anywhere.

In this case, I'm looking to change things on a poetry site where users would like to have all their posted poems listed in their user profile - sort of a low-budget personal home page solution: http://www.everypoet.net/xoops/modules/news/

A user profile example: http://www.everypoet.net/xoops/userinfo.php?uid=430

I'd like to be able to avoid forcing visitors to click "show all" to display the complete list of News (defined on this site as "Poetry") postings by that particular user - but would like to display a complete list such as that generated by clicking "show all", but embedded within the primary user profile page.

Any insights would be greatly appreciated.

Béla

2
ackbarr
Re: Removal of post listing cap in userinfo.php

To adjust the # number of records displayed for each module in the userinfo.php page, do the following:

on line ~157 change:
$results =& $module->search(''''50$thisUser->getVar('uid'));

to:
$results =& $module->search('''', [b]20[/b], 0$thisUser->getVar('uid'));


and on line ~170 change:
if ($count == 5) {
    
$showall_link '.$mid.'&uid='.$thisUser->getVar('uid').'">'._US_SHOWALL.'';
} else {
    
$showall_link '';
}

to:
if ($count == [b]20[/b]) {
    
$showall_link '.$mid.'&uid='.$thisUser->getVar('uid').'">'._US_SHOWALL.'';
} else {
    
$showall_link '';
}


Please note that these instructions are for 2.0.5 and if using a different version of XOOPS the location of these lines might be slightly different.

3
BelaS
Re: Removal of post listing cap in userinfo.php
  • 2003/11/7 18:11

  • BelaS

  • Just popping in

  • Posts: 62

  • Since: 2003/5/26


Worked like a charm. Thanks, ackbarr!

Regards,

Béla

4
caelon
Re: Removal of post listing cap in userinfo.php
  • 2003/11/7 21:21

  • caelon

  • Just popping in

  • Posts: 11

  • Since: 2003/2/21


On a slightly related note (because it involves forums and userinfo.php), the password-protected forums do not show up on the View Account page and there does not seem to be a place in userinfo.php to change that behavior. Am I missing something or will it require digging deeper into the code to find where to change this?

5
ackbarr
Re: Removal of post listing cap in userinfo.php

The search functions automatically filter out protected records. If you want to include these records in the userinfo page, you'll need to modify the module's search function itself. Take a look at the modules's xoops_version.php script to learn which file contains that module's search function.

6
Hober
Re: Removal of post listing cap in userinfo.php
  • 2003/11/7 23:34

  • Hober

  • Just popping in

  • Posts: 40

  • Since: 2003/6/13


I'm looking at line 34 of newbb/include/search.inc.php, where it makes an SQL query. If you look at the end, where it says WHERE f.forum_type=0 might be it checking if the forum is protected.

$sql "SELECT p.post_id,p.topic_id,p.forum_id,p.post_time,p.uid,p.subject FROM ".$xoopsDB->prefix("bb_posts")." p LEFT JOIN ".$xoopsDB->prefix("bb_posts_text")." t ON t.post_id=p.post_id LEFT JOIN ".$xoopsDB->prefix("bb_forums")." f ON f.forum_id=p.forum_id WHERE f.forum_type=0";


You might try adding a quick fix to disable that

$sql "SELECT p.post_id,p.topic_id,p.forum_id,p.post_time,p.uid,p.subject FROM ".$xoopsDB->prefix("bb_posts")." p LEFT JOIN ".$xoopsDB->prefix("bb_posts_text")." t ON t.post_id=p.post_id LEFT JOIN ".$xoopsDB->prefix("bb_forums")." f ON f.forum_id=p.forum_id WHERE f.forum_type=0[color=FF0000] OR ''=''[/color]";


But don't take my word for it, and be ready to change it back if it doesn't work.

Login

Who's Online

235 user(s) are online (124 user(s) are browsing Support Forums)


Members: 0


Guests: 235


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