PDA

View Full Version : [vBindex] Show Hivemail On vB Index Portal


PirateRadio
11-19-2004, 10:00 PM
Hi,

This is just a fast mod to show your new mail messages from hivemail on vB Index. You must have HiveMail >> vB Integration ( http://manual.hivemail.com/topic/vb_303_130 ) installed first.

Open vbindex.php
find:

if ($deleteshout === true) {
$DB_site->query("DELETE FROM ".TABLE_PREFIX."vbindex_shoutbox WHERE shoutid = '$shoutid'");
$url = "$_SERVER[PHP_SELF]?$session[sessionurl]";
eval(print_standard_redirect('redirect_vbi_shoutde leted'));
}
}

after add:

// HIVEMAIL ADD
// ############################### start new mails ###############################
$show['hive_newemails'] = false;
if ($vboptions['hive_enabled'] and $bbuserinfo['hiveuserid'] != 0 and ($permissions['hivepermissions'] & H_CANHAVEACCOUNT) and ($permissions['hivepermissions'] & H_CANVIEWNEWMAIL)) {
$show['hive_newemails'] = true;
define('FORUM_PLUGIN', true);
require_once($vboptions['hive_filepath'].'/includes/vbulletin_plugin.php');

$unreadmails = $DB_Hive->query("
SELECT *
FROM hive_message
WHERE userid = $bbuserinfo[hiveuserid]
AND NOT(status & ".MAIL_READ.")
");

$mailbits = '';
$nummails = $DB_Hive->num_rows($unreadmails);
if ($nummails > 0)
{
$show['hive_newdetails'] = true;
while ($unread = $DB_Hive->fetch_array($unreadmails)) {
$unread['from'] = iif(empty($unread['name']), $unread['email'], $unread['name'].' <'.$unread['email'].'>');
$unread['dateline'] = date($vboptions['dateformat'].' '.$vboptions['timeformat'], $unread['dateline']);
eval('$mailbits .= "' . fetch_template('hivemail_usercp_mailbit') . '";');
}
}
else
{
$show['hive_newdetails'] = false;
}
}
// END HIVEMAIL ADD

save and upload

Open vbindex_customblock_1 in templates.

Find:

Block $box Content

Replace with:

<!-- HIVEMAIL ADD -->
<if condition="$show['hive_newemails']">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
<tr>
<td class="tcat" colspan="7">
<br>New E-Mail Messages: ($nummails)</span>
</td>
</tr>
</thead>
<tbody id="collapseobj_usercp_submails" style="$vbcollapse[collapseobj_usercp_submails]">
<if condition="$show['hive_newdetails']">
<tr class="thead">
<td class="thead" nowrap="nowrap">From</td>
<td class="thead" nowrap="nowrap">Subject</td>
<td class="thead" nowrap="nowrap">Date Received</td>
</tr>
$mailbits
<else />
<tr>
<td class="alt1" align="center" colspan="7"><strong>Sorry No New E-Mail</strong></td>
</tr>
</if>
<tr>
<td align="$stylevar[right]" colspan="7" class="tfoot">
<span class="smallfont"><a href="$vboptions[hive_url]">Go To Your E-Mail Account</a></span>
</td>
</tr>
</tbody>
</table>
<br />
</if>
<!-- END HIVEMAIL ADD -->



Save and thats it! Enjoy! Also, please hit install!

Skyline_GT
11-19-2004, 11:11 PM
very nice:)
THank

PirateRadio
11-19-2004, 11:24 PM
If you install it, please let me know how it goes :)

Lionel
11-20-2004, 01:41 AM
That works too well. Unfortunately those messages with long usernames and long subjects mess up the page :-(

So what I did, since this appears only when there are new emails, I placed under the navbar. I am using vbadvanced btw. Thanks, I installed.

Lionel
11-20-2004, 01:58 AM
Can you add the option to delete the mail from homepage too without even reading it? (for junk mails)

PixelFx
11-20-2004, 10:21 PM
nice, would be cool to see CMPS mod for this as well :)