Private messages not comming through to CPG Private messages not comming through to CPG
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Private messages not comming through to CPG

Started by Halfhidden, May 11, 2008, 09:50:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Halfhidden

I've installed Stramm mod pack on a fresh install (1.4.18) of Coppermine with a bridge to SMF 1.5. It seems that everything works, buddies, sending PM, watermarks. But although you can send pm's and the recipient gets them they don't show in CPG at all. So you'll have to go to the smf forum to get your private message. I've checked the settings in config>Private messaging. I've broken and rebridged the forum.
I'm a little lost as to why this might be, any ideas please?

Regards,
Steff

Stramm

from the docs...
QuoteAdditional info when logged in (default off)
Config -> Performance settings -> Display buddy status info when logged in, Display pm status info when logged in
displays additional info when a user's logged in, PM info only when you don't use a bridged coppermine

You'd need to edit the mysql query to grab the data from your forums pm table. How that can be done isn't to hard at all. Copy function loginForm from include/themes.inc.php to the theme.php of the theme you're actually using (eg. themse/calssic/theme.php) and modify it to your needs.

Right below if ($CONFIG['display_pms_status']){ are the relevant queries

Halfhidden

Thanks Stramm. My mistake, I can clearly see that PM notification is only supported when not bridged. OK, I'll give it a bash... I've been meaning to get under the hood. it should only take me a month  ;)
seriously I have started to learn php so perhaps in future I can give something back?

Thanks for your help.
Regards,
Steff

Stramm

you also can download the PM plugin. Here I've tried to add smf within the class. Lil bit more complicated. However you can se e the queries.

Halfhidden

Thanks.....Stramm
I'll do that. It will be a great reference.  ;D

Regards,
Steff

Halfhidden

just a bit puzzled. I copied the entire liginform to the theme that I was using (classic at the moment) then altered the query to:
$loginFormHtml = "<div align=\"right\" class=\"smallfont\">".$lang_loginform['welcome']."

<strong>".(USER_NAME)."</strong><br />";

   if ($CONFIG['display_PERSONAL_MESSAGES_status']){
      $result = smf_db_query("SELECT count(*) FROM  {$CONFIG['TABLE_PERSONAL_MESSAGES']} WHERE

owner=".(USER_ID_PM));
      list($tot_all_messages) = @mysql_fetch_array($result);
      mysql_free_result($result);
      $result = smf_db_query("SELECT count(*) FROM  {$CONFIG['TABLE_PERSONAL_MESSAGES']} WHERE

owner=".(USER_ID_PM)." AND showed='0'");
      list($tot_new_messages) = @mysql_fetch_array($result);
      mysql_free_result($result);

      if ($CONFIG['pms_enabled']) {
         $loginFormHtml .= "<a href='pms.php'>".$lang_loginform['pms']."</a>

".$tot_new_messages.$lang_loginform['unread_total'].$tot_all_messages."</div>";

but the pms displays no longer on as it did.... I'm not looking for a lesson on php, just clarification that I don't need to alter other php files such as pms.php

Regards,
Steff

Stramm

It's enough to copy the mentioned function to the theme.php you'Re actually using and to modify it accordingly.

Unless you have coded a function smf_db_query() it's made up code and won't work at all. Same for $CONFIG['TABLE_PERSONAL_MESSAGES']. If you do not have it defined anywhere, it contains nothing. Hmm.. Nearly all looks like wishful thinking and is not likely to work at all.

Have you looked at the plugin I mentioned?? Here you at least get an idea of the query you have to use.

Halfhidden

Your right... enough of the sellotape. It was a wing on a prayer indeed and explains the results. I have just enrolled on a study of php, so I'll hang on until I understand the code before attempt to mash your code again ! ;D
Thanks for the reply.
Regards,
Steff