Thanks kh99, that worked (changing the hook to postbit_display_complete)
however, I am trying to use part of Lynne's suggestion so I can make it so in PMs, there are 3 ranks per row, whereas in posts, there are 5 ranks per row;
see here:
PHP Code:
$rowlen = $this->registry->userinfo['field50'];
if ($rowlen <= 0)
if (THIS_SCRIPT == 'private') {
$rowlen = 3; // default columns } else {
$rowlen = 5; // default columns
$ranklist = explode('<br />', $this->post[rank]);
$this->post[rank] = '';
$col = 0;
foreach($ranklist as $r)
{
if ($col >= $rowlen)
{
if ($this->post[rank] != '')
$this->post[rank] .= '<br />';
$col = 0;
}
$this->post[rank] .= $r;
$col++;
}
$this->post[rank] .= "<!-- field50 ='" . $this->registry->userinfo['field50'] . "' -->\r\n";
unset($col, $rowlen, $ranklist);
}
and I tried this:
PHP Code:
if (THIS_SCRIPT == 'private')
$rowlen = $this->registry->userinfo['field50'];
if ($rowlen <= 0)
$rowlen = 3; // default columns
$ranklist = explode('<br />', $this->post[rank]);
$this->post[rank] = '';
$col = 0;
foreach($ranklist as $r)
{
if ($col >= $rowlen)
{
if ($this->post[rank] != '')
$this->post[rank] .= '<br />';
$col = 0;
}
$this->post[rank] .= $r;
$col++;
}
$this->post[rank] .= "<!-- field50 ='" . $this->registry->userinfo['field50'] . "' -->\r\n";
unset($col, $rowlen, $ranklist);
} else {
$rowlen = $this->registry->userinfo['field4111'];
if ($rowlen <= 0)
$rowlen = 5; // default columns
$ranklist = explode('<br />', $this->post[rank]);
$this->post[rank] = '';
$col = 0;
foreach($ranklist as $r)
{
if ($col >= $rowlen)
{
if ($this->post[rank] != '')
$this->post[rank] .= '<br />';
$col = 0;
}
$this->post[rank] .= $r;
$col++;
}
$this->post[rank] .= "<!-- field50 ='" . $this->registry->userinfo['field50'] . "' -->\r\n";
unset($col, $rowlen, $ranklist);
}
that way, if they are on private, ranks show up 3 per row. if they are on a post/thread, it shows up with 5.
i can't have 5 in PMs as it is stretching the pm display. 3 or maybe 4 will be just enough per row in PMs
EDIT: NVM! I did it! Yay!
Thank you both for the help! Here is the code in postbit_display_complete
PHP Code:
if (THIS_SCRIPT == 'private') {
$rowlen = $this->registry->userinfo['field50'];
if ($rowlen <= 0)
$rowlen = 4; // default columns
$ranklist = explode('<br />', $this->post[rank]);
$this->post[rank] = '';
$col = 0;
foreach($ranklist as $r)
{
if ($col >= $rowlen)
{
if ($this->post[rank] != '')
$this->post[rank] .= '<br />';
$col = 0;
}
$this->post[rank] .= $r;
$col++;
}
$this->post[rank] .= "<!-- field50 ='" . $this->registry->userinfo['field50'] . "' -->\r\n";
unset($col, $rowlen, $ranklist);
} else {
$rowlen = $this->registry->userinfo['field50'];
if ($rowlen <= 0)
$rowlen = 5; // default columns
$ranklist = explode('<br />', $this->post[rank]);
$this->post[rank] = '';
$col = 0;
foreach($ranklist as $r)
{
if ($col >= $rowlen)
{
if ($this->post[rank] != '')
$this->post[rank] .= '<br />';
$col = 0;
}
$this->post[rank] .= $r;
$col++;
}
$this->post[rank] .= "<!-- field50 ='" . $this->registry->userinfo['field50'] . "' -->\r\n";
unset($col, $rowlen, $ranklist);
}