PDA

View Full Version : Display vBMS status in vBAdvanced CMPS


thejaxx
12-09-2004, 01:08 AM
This module for vBAdvanced CMPS will give you a block that shows your users how many total and new emails they have along with a link to the vBMS portion of your site. It will also remove the pop notification at the top of the site when new email arrives.

Name: CMPS vBMS E-Mail Block

Templates to edit: 3 Total (1 created)

Time to install: Less then 5 minutes.

I started messing around because some users and myself didn't like the actual block that popped up in the header when you recieved e-mail. So with the help of Filburt and Phlogiston, was able to get it up and running.

This is my first attempt at actually creating something of this sort, so be easy on me. :p

Its actually quite easy to set up. You will, of course, need vBulletin's Mail System (http://www.webdesignforums.net/vbms/).

Step 1

Create a new vBA CMPS module with the following info:

Module Title: vbms
File to Include: None
Template to Include: vbms

Do not activate it yet.

Step 2

Goto your Style Manager and create a new template titled:

adv_portal_vbms

Paste the following code:


<!-- vbms module -->

<if condition="$vboptions['vbms_enabled']">
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<thead>
<tr>
<td class="tcat"><span class="smallfont"><strong>$vba_options[portal_blockbullet] <a href="$vboptions/vbms.php?$session[sessionurl]">vB WebMail</a></strong></span>
</td>
</tr>
</thead>
<tr>
<td class="$getbgrow" width="100%">
<b>
<if condition="$vbms_newmessages['newcount'] == 1">
$vbphrase[vbms_one_unread_message]
<else />
<phrase 1="$vbms_newmessages[newcount]">$vbphrase[vbms_x_unread_messages]</phrase>
</if>

</b>
<br />
<br />
You have $messagecount emails total.
<br />
<br />
<span class="smallfont"><phrase 1="$vboptions[bburl]/vbms.php?$session[sessionurl]">$vbphrase[vbms_to_read_your_email]</phrase></span>
</td>
</tr>
</table>
<br />
</if>

<!-- End vbms module -->

You may want to edit vB WebMail for your own title as you see fit.

Save it.

Step 3

Open your phpinclude_start file.

Find (should be top line):


require_once("./includes/vbms_frontend_init.php");

Below paste:


$result = $DB_site->query_first("SELECT COUNT(messageid) AS messagecount FROM " . TABLE_PREFIX . "vbms_message WHERE userid = " . $bbuserinfo['userid']);
$messagecount = $result['messagecount'];

Save it.

Step 4

This step will get rid of the table that popups at the top of the site telling you you have new mail. If you want to keep it, skip this step.

Now open your header template.

Remove everything between (including the comments):


<!-- vBMS new mail notification -->

and

<!-- / vBMS new mail notification -->

Save it.

Step 5

Go back to the vbms module you created earlier and now turn it on. Check your site, you should now see the new block where you placed it.

If you do not see a # in the 'You have # messages that have not been read', check your require_once path and the code you put in at step 3.

That's it.

[B]*Advanced Users*

Phlogiston pointed out to me earlier today that the queries in step 3 could also be placed in the vbms_frontend_init.php file, thereby allowing you to expand upon it to get further info, such as folders, subject previews, etc. So if you want, you can instead place the queries in that file just above the ?> closing tag.

Once again, I wanted to give credit and thanks to Filburt (http://www.webdesignforums.net/vbms/) his help and patience.

And to my co-author who made me realize how stupid some mistakes can really be, Phlogiston (http://www.spoiltcat.com/member.php?u=5).

phlogiston
12-09-2004, 01:20 AM
quick & easy to install with no file changes and only one extra query - a much better way to show new email than the default vbms box if you've got CMPS,
I recommend this ;)

Our Sponsors
 

Slave
02-01-2005, 01:42 PM
hmm .. this is doing my head in :(

I have vbms and I've tried the above .. but whatever I do the module doesn't show up on the page??

phlogiston .. if you're still about any chance of a bit of help getting this working?

gorp
02-01-2005, 02:46 PM
webdesignforums.net seems to be a dead link.. does anyone have a new one?

Our Sponsors
 

Slave
02-01-2005, 05:22 PM
webdesignforums.net is working .. I think they were having problems a few hours ago ..

phlogiston
02-02-2005, 05:12 AM
If the module doesn't show up at all on the page it could be for a few reasons, check that you have it enabled in the CMPS settings and for it set to show on the page first!
Then make sure that the vbms is enabled.

Do you see <!-- vbms module --> in your page source? If that's there then the module is running but it's not recognising that the vbms is enabled, if it is missing then the CMPS module is most likely not active on that page - fix both of these in the admincp.

After that it gets more tricky why it wouldn't show at all, you should at least get something even if it doesn't work as expected! :(

Slave
02-02-2005, 06:14 PM
Thanks for the reply phlogiston .. :)

Ok ..

Module is turned ON.
vBMS is turned ON, working and "Enable header notification?" is ON

I've searched for <!-- vbms module --> in the page source and it's not there .. Even with everything turned on above.

I've even tried to take out the if statement within the template, which I take would mean that even with vBMS off it would still show something, and still nothing shows up .. :(

All my other modules are working fine and showing correctly .. so I'm not sure what's going on?

gorp
02-05-2005, 11:33 AM
I bought vbms because of this hack and it is excellent, and this module is a wonderful addition to vba cmps as well as vbms! bravo!!

EricS
02-08-2005, 01:18 PM
Thanks, This looks like a nice addon.