Well... I achieved my goal. The means are rather ugly (with only a week and a half of php under my belt and an iframe, why wouldn't they be). Below is how I did it on XOOPS 2.2, just in case someone else wants to refine it.
First, I created a form field called MNK. This would hold a number representing a users level.
Secondly, I made a copy of userinfo.php (in the folder for the profile module) and started hammering away at it. I shriveled it down and tried to squeeze it into a function (I don't know if the function really makes it any better).
I didn't want to pull the information for all the custom fields, just specific ones -- so I removed the loop that is in the standard userinfo.php. The result follows.
<?php
include '../../mainfile.php';
include_once XOOPS_ROOT_PATH . '/modules/system/constants.php';
$uid = intval($_GET['uid']);
if ($uid <= 0) {
}
function ffSig($xoopsUser, $uid) {
if (is_object($xoopsUser) && $uid == $xoopsUser->getVar('uid')) {
include XOOPS_ROOT_PATH.'/header.php';
$thisUser =& $xoopsUser;
} else {
$member_handler =& xoops_gethandler('member');
$thisUser =& $member_handler->getUser($uid);
if (!is_object($thisUser) || !$thisUser->isActive()) {
redirect_header("index.php",3,_PROFILE_MA_SELECTNG);
exit();
}
}
$profile_handler =& xoops_gethandler('profile');
$fields =& $profile_handler->loadFields();
$pcJobMnk = $fields['MNK']->getOutputValue($thisUser);
echo $pcJobMnk;
}
ffSig($xoopsUser, $uid);
?>
This seems to take the user ID from the url and writes the value of the variable for that user. I thought about using some Smarty stuff, but this was already too much for me to comprehend.
Next I edited my newbb_thread.html template, the following code was inserted just before the signature.
<iframe class="ffxisig"
src="http://www.website.com/xoops/modules/profile/userinfo2.php?uid=<{$topic_post.poster.uid}>"
width=310 height=110 scrolling="no" frameborder="0"></iframe>
(I need to clean up the iframe code so it takes further advantage of CSS.)
Seems very hackish to me (I hate the iframe
). But the best I could come up with.
In summation, I don't totally know what the php file does. The forum seems to open an iframe that passes the user id variable to the php file. The php page retrieves the information for the user ID that the variable represents and prints it to the page displayed within the iframe.
It seems to retrieve the information I'm looking for. Any optimization tips?