MyBB Community Forums

Full Version: MyAlerts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Cannot upload as it isn't main file.
What? The file is in the download package. You need to upload it for MyAlerts to function.
I am using the plugin 'Plugin Uploader' and it says cannot upload as it isn't the main file.
Don't use Plugin uploader then. Upload the files normally via FTP. I'm not going to provide support for a third party plugin that's causing problems.
Done. Still the same.
It shouldn't be. That error only shows if you haven't uploaded the files correctly.
@ Euan, I looked in the code for MyAlerts and the basic setup does not get a postlink; it just takes you to the rep page.

The version available for download on Xekko did not actually send an alert, so based on a post by Shade in this thread this is the modified code I put into post_rep:

if(isset($Alerts))
    {
        $queryString = "SELECT s.*, v.*, u.uid, u.usergroup FROM %salert_settings s LEFT JOIN %salert_setting_values v ON (v.setting_id = s.id) LEFT JOIN %susers u ON (v.user_id = u.uid) WHERE u.uid = ". (int) $post['author'] ." AND s.code = 'rep' LIMIT 1";
        $wantsAlert = $db->fetch_array($db->write_query(sprintf($queryString, TABLE_PREFIX, TABLE_PREFIX, TABLE_PREFIX)));

        if((int) $wantsAlert['value'] == 1)
        {
            $Alerts->addAlert($post['author'], 'rep', $post['pid'], $mybb->user['uid'], array());
        }
    } 


In MyAlerts, when setting up a rep alert, the following data is used:

if ((int) $userSetting['value'] == 1) {
        $Alerts->addAlert($reputation['uid'], 'rep', 0, $mybb->user['uid'], array());
    }

and this is the code for the output:


if ($alert['alert_type'] == 'rep' AND $mybb->settings['myalerts_alert_rep']) {
        $alert['message'] = $lang->sprintf($lang->myalerts_rep, $alert['user'], $mybb->user['uid'], $alert['dateline']);
        $alert['rowType'] = 'reputationAlert';

So no reference to the pid or tid is there.
AH, the post rep one should be very easy. I'll add in a check for if the pid is stored then link to it Smile
Thanks Euan, it would be appreciated. My users are already squeaking that they don't get their link to their liked post Big Grin
I'll add it in today if I get a chance. If not, it'll probably be tomorrow.