Status
Not open for further replies.

DxtGaming

Customer
Well we have another mod "Private Messages and Email Log"

my site url//misc.php?do=showpm&logid=41387 (only admins can access it)

but the real link is like:

my site url/private.php?do=showpm&pmid=384373

but the notification in vBShout use the logid from the PM log mods for the link:S

When I disable the other mod it work fine but I think that it should not use the ID of the other mod since it does not affect the real link of the PM in private message box

any fix? :o
 
Someone else reported a similar conflict and no, it's not possible to fix it if that mod forcibly overrides the link and ID like it would seem that they're doing. The issue isn't in vBShout, anyway. Sorry :(
 
They are not overriding it at all since when I go to my Pm box the id is still 384373

and vbshout link use 41387 (this number represent the amount of PM that it logged )


That is how he get the log id:
Code:
function rcd_pm_get_total_count($user_name = '', $keywords = '')
{
    global $db;
    
    $keywords_condition = '';
    if ($keywords)
    {
        $keywords_condition = rcd_pm_get_kewords_condition($keywords);
    }
    if (!empty($user_name))
    {
        $sql_draft = 'SELECT
                        pm.logid AS logid
                    FROM
                        ' . TABLE_PREFIX . 'rcd_log_pm AS pm
                    WHERE
                ';
        $sql = 'SELECT DISTINCT  COUNT(cr.logid) AS count
                FROM((' .
            $sql_draft .
            ' fromusername = \'' . $db->escape_string(htmlspecialchars_uni($user_name)) . '\' ' .
            ($keywords_condition ? ' AND ' . $keywords_condition : '') .
            ') UNION (' .
            $sql_draft . ' tousername = \'' . $db->escape_string(htmlspecialchars_uni($user_name)) . '\' ' .
            ($keywords_condition ? ' AND ' . $keywords_condition : '') .
            ')) AS cr';
    }
    else
    {
        $sql = 'SELECT
                    COUNT(pm.logid) AS count
                FROM
                    ' . TABLE_PREFIX . 'rcd_log_pm AS pm';
        if ($keywords_condition)
        {
            $sql .= ' WHERE ' . $keywords_condition;
        }
    }
    $pm = $db->query_first($sql);

    return (int) $pm['count'];
}




EDIT:

I added "{vb:raw pm.pmid}" after the title of my Pms and the id is like 384373 which it is the correct one so he does not override it

Edit 2:

May I know what does "{3}" I mean where does it take the id
Code:
<phrase name="dbtech_vbshout_i_sent_you_a_forum_pm_x" date="1269486591" username="Fillip H." version="4.1.1"><![CDATA[I just sent you a forum PM: [url={1}/private.php?{2}do=showpm&pmid={3}]{4}[/url]]]></phrase>

Edit 3:

In "pmdata_postsave_recipient.php"
Code:
$pmid = $this->dbobject->insert_id();

where is the method insert_id()?
 
Last edited:
The problem is that that mod inserts a new record in the database before vBShout can get the PM ID.

Try shifting plugin locations so that vBShout's plugin is above that mod's.
 
(Pro) Private Message Notification has the same hook location and his "Execution Order
Use this field to enter the order in which code at the same hook will be executed." was 5 so I changed "Log PM" from the other mod to 6 :) (if it can be useful to anyone :))

Thank for the help :)
Fixed
 
Last edited:
Status
Not open for further replies.

Legacy vBShout

vBulletin 3.8.x vBulletin 4.x.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
3,179
Customer rating
5.00 star(s) 1 ratings
Back
Top