1
OldFriend
Simple, but useful hack for profile viewing..
  • 2006/6/4 19:15

  • OldFriend

  • Just popping in

  • Posts: 99

  • Since: 2005/10/28


I use this profile hack to add "previous" and "next" buttons on top of my users profile templates to make it easier to move fom one user's profile to the next and back.

In Admin->Misc.Tools->Templates
First you must clone your original templates.
Then in UserProfile, click list and then edit profile_userinfo.html

Add these lines to the start of the template and save it.
<{if $xoops_isadmin}>
  <
table><tr align="center"><td>
    <
input type="button" value="Previous" onclick="location='<{$xoops_url}>/modules/profile/userinfo.php?uid=<{$prev_uid}>'" />
    <
input type="button" value="Next" onclick="location='<{$xoops_url}>/modules/profile/userinfo.php?uid=<{$next_uid}>'" />
  td>tr>table>
<{/if}>


Then edit \modules\profile\userinfo.php and find the first and last lines in this code and replace with what I have here.

include_once XOOPS_ROOT_PATH '/modules/system/constants.php';

$uid intval($_GET['uid']);
if (
$uid <= 0) {
    
header('location: '.XOOPS_URL);
    exit();
} else {
  
$prev_uid=$uid-1;
  
$next_uid=$uid+1;
  
$xoopsTpl->assign('prev_uid'$prev_uid);
  
$xoopsTpl->assign('next_uid'$next_uid);
}

$gperm_handler = & xoops_gethandler'groupperm' );


Upload your new version of userinfo.php and Bob's your Uncle.

2
migoe
Re: Simple, but useful hack for profile viewing..
  • 2006/6/19 7:34

  • migoe

  • Just popping in

  • Posts: 68

  • Since: 2003/4/2 9


Dear OldFriend,

how can i make this work in 2.0.13? Your code doesn't work - blank screen - PHP-Debug tells

Fatal errorCall to a member function on a non-object in /is/htdocs/81641/www.mysite.de/userinfo.php on line 47


In line 47 there ist this code

$xoopsTpl->assign('prev_uid'$prev_uid);


migoe
whttp://www.liedermacher-forum.de | German Singers and Songwriters

http://www.weltladen-rothenburg.de | German Site about Fair trade Project

3
OldFriend
Re: Simple, but useful hack for profile viewing..
  • 2006/6/19 18:17

  • OldFriend

  • Just popping in

  • Posts: 99

  • Since: 2005/10/28


Sorry migoe, I've never even downloaded 2.0 so I can't help you at the moment.

I've only ever used 2.2

If I get time, in the next few days I'll download 2.0 and have a look for you.

4
migoe
Re: Simple, but useful hack for profile viewing..
  • 2006/6/19 22:22

  • migoe

  • Just popping in

  • Posts: 68

  • Since: 2003/4/2 9


Dear OldFriend, that would be very friendly of you and I would be very grateful

migoe
whttp://www.liedermacher-forum.de | German Singers and Songwriters

http://www.weltladen-rothenburg.de | German Site about Fair trade Project

Login

Who's Online

422 user(s) are online (336 user(s) are browsing Support Forums)


Members: 0


Guests: 422


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