Some Extra Code

ust installed on a forum.
With the postbit_legacy template, I have used the following code for the template:

replaced
HTML Code:
Code:
report.php?$session[sessionurl]p=$post[postid]
with

HTML Code:
Code:
<if condition="THIS_SCRIPT=='private'">mh_pmwbrp_report.php?$session[sessionurl]do=reportpm&pmid=$post[pmid]<else />report.php?$session[sessionurl]p=$post[postid]</if>
The same would probably be needed if you were coding for the normal postbit template.

******

The PM Workbench to field shows "array" when looking at pm's. So I have taken the code from vbulletin's private.php file and added to the specific file as per below:

admincp/mh_pmwbrd.php

replace
HTML Code:
Code:
        while ($pm = $vbulletin->db->fetch_array($pms))
        {

            $pmrow = array(
                    "<a href=\"mh_pmwbrd.php?do=readpmtext&pmtextid=$pm[pmtextid]\">$pm[title]</a>"
                ,    $pm['fromusername']
                ,    (is_array(unserialize($pm['touserarray'])) ? implode(", ", array_values(unserialize($pm['touserarray']))) : null)
                , vbdate($vbulletin->options['dateformat'] . ', ' . $vbulletin->options['timeformat'], $pm['dateline'])
                ,    "<input type=\"checkbox\" name=\"action[" . $pm['pmtextid'] . "]\">"
                );
            print_cells_row($pmrow);
        }
with
HTML Code:
Code:
        while ($pm = $vbulletin->db->fetch_array($pms))
        {


            $cclist = array();
            $bcclist = array();
            $touser = unserialize($pm['touserarray']);
            foreach($touser AS $key => $item)
            {
                if (is_array($item))
                {
                    foreach($item AS $subkey => $subitem)
                    {
                        ${$key.'list'}[]=$subitem;
                    }
                }
                else
                {
                    $bcclist[]=$item;
                }
            }

            $pmrow = array(
                    "<a href=\"mh_pmwbrd.php?do=readpmtext&pmtextid=$pm[pmtextid]\">$pm[title]</a>"
                ,    $pm['fromusername']
                ,    implode(", ",$bcclist).implode(", ",$cclist)
                , vbdate($vbulletin->options['dateformat'] . ', ' . $vbulletin->options['timeformat'], $pm['dateline'])
                ,    "<input type=\"checkbox\" name=\"action[" . $pm['pmtextid'] . "]\">"
                );
            print_cells_row($pmrow);
        }

******

and another two file changes:

1. same admincp/mh_pmwbrd.php file

after the following line

HTML Code:
Code:
    $pmtext = mh_pmwb_fetch_pmtext($vbulletin->GPC['pmtextid'], true);
add
HTML Code:
Code:
    $cclist = array();
    $bcclist = array();
    $touser = unserialize($pmtext['touserarray']);
    foreach($touser AS $key => $item)
    {
        if (is_array($item))
        {
            foreach($item AS $subkey => $subitem)
            {
                ${$key.'list'}[]=$subitem;
            }
        }
        else
        {
            $bcclist[]=$item;
        }
    }
replace
HTML Code:
Code:
    print_label_row($vbphrase['mh_pmwb_to_users'] . ":", (is_array(unserialize($pmtext['touserarray'])) ? implode(", ", array_values(unserialize($pmtext['touserarray']))) : null));
with
HTML Code:
Code:
    print_label_row($vbphrase['mh_pmwb_to_users'] . ":",    implode(", ",$bcclist).implode(", ",$cclist) );
2. admincp/mh_pmwbrp.php file

after
HTML Code:
Code:
    $pmreport = mh_pmwbrp_fetch_pmreport($vbulletin->GPC['pmreportid'], true, true);
add
HTML Code:
Code:
    $cclist = array();
    $bcclist = array();
    $touser = unserialize($pmreport['touserarray']);
    foreach($touser AS $key => $item)
    {
        if (is_array($item))
        {
            foreach($item AS $subkey => $subitem)
            {
                ${$key.'list'}[]=$subitem;
            }
        }
        else
        {
            $bcclist[]=$item;
        }
    }
replace
HTML Code:
Code:
    print_label_row($vbphrase['mh_pmwb_to_users'] . ":", (is_array(unserialize($pmreport['touserarray'])) ? implode(", ", array_values(unserialize($pmreport['touserarray']))) : null));
with
HTML Code:
Code:
    print_label_row($vbphrase['mh_pmwb_to_users'] . ":",     implode(", ",$bcclist).implode(", ",$cclist));
so how have I done? I think I now have them all?
 
Back
Top