News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

PM to New Registered Users

Started by Midgard, December 17, 2004, 07:00:24 AM

Previous topic - Next topic

SleePy

#80
Trying to get the Pm To new registered users to work in rc2. so far i got it all working. but some reason it doesn't send pm. instead i get this error
QuoteYou have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ')
ORDER BY mem.lngfile
LIMIT 0' at line 8
File: /Volumes/MacintoshHD2/Users/SleePy/Sites/SMF/Sources/Subs-Post.php
Line: 709

heres the area around line 709. i bolded 709 though

Quote$request = db_query("
      SELECT
         mem.memberName, mem.realName, mem.ID_MEMBER, mem.emailAddress, mem.lngfile, mg.maxMessages,
         mem.pm_email_notify, mem.instantMessages," . (allowedTo('moderate_forum') ? ' 0' : "
         (mem.pm_ignore_list = '*' OR FIND_IN_SET($from[id], mem.pm_ignore_list))") . " AS ignored,
         FIND_IN_SET($from[id], mem.buddy_list) AS is_buddy, mem.is_activated,
         (mem.ID_GROUP = 1 OR FIND_IN_SET(1, mem.additionalGroups)) AS is_admin
      FROM {$db_prefix}members AS mem
         LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
      WHERE mem.ID_MEMBER IN (" . implode(", ", $all_to) . ")
      ORDER BY mem.lngfile
      LIMIT " count($all_to), __FILE__, __LINE__);
   $notifications = array();
   while ($row = mysql_fetch_assoc($request))
   {
      // Has the receiver gone over their message limit, assuming that neither they nor the sender are important?!
      if (!empty($row['maxMessages']) && $row['maxMessages'] <= $row['instantMessages'] && !allowedTo('moderate_forum') && !$row['is_admin'])
      {

i don't understand why. the mysql code looks correct... and if i get this fixed PM to New Registered Users will work for rc2. i got the rest of the package that Kirby made working for rc2. just this error..
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

DHC

Quote from: M3THOD on January 04, 2006, 06:59:10 PM
how bout update for 1.1/1.2

Yep - I need it for 1.1 RC2

PLEASE !!!!

Ryan


Zombie

Don't leave us hangin!

I would like to see this continue aswell.

RyanJones

Try this...

I believe the part to be fnd has been moved to the Subs-Members.php so search for the same thing in there and do as normal :)

Followed the instructions and it workd in the new file.


Its about line 837...

Cheers,

Ryan Jones
RyanJ (Ryan Jones)

Support Web Standards!

Currently working On: Additions to the Karma system.

ikbenivo


L.G.S

Quote from: RyanJones on February 27, 2006, 08:49:46 AM
Try this...

I believe the part to be fnd has been moved to the Subs-Members.php so search for the same thing in there and do as normal :)

Followed the instructions and it workd in the new file.


Its about line 837...

Cheers,

Ryan Jones

I have no idea what you said:(
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


jonks

Quote from: ikbenivo on April 05, 2006, 05:59:08 AM
Quote from: DHC on February 15, 2006, 03:39:44 PM
Quote from: M3THOD on January 04, 2006, 06:59:10 PM
how bout update for 1.1/1.2

Yep - I need it for 1.1 RC2

PLEASE !!!!

same here  ::)

Yep, and me, this would solve so many problems for me.

JshLnsctt

Quote from: RyanJones on February 27, 2006, 08:49:46 AM
Try this...

I believe the part to be fnd has been moved to the Subs-Members.php so search for the same thing in there and do as normal :)

Followed the instructions and it workd in the new file.


Its about line 837...

Cheers,

Ryan Jones

Thanks ;)

L.G.S

FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


jonks

Have i read this thread worng. Is there actiually already a way for this to be done in rc2?  I'm confused which instructions apply to which versions.

kriskd

Quote from: jonks on April 17, 2006, 02:50:15 PM
Have i read this thread worng. Is there actiually already a way for this to be done in rc2?  I'm confused which instructions apply to which versions.

Same here.  Read the whole thing and still a bit confused.

I have admin approvals on my board and also make the member activate their account.  I'd like an automatic PM to go out to members after they have activated their account.  Currently I'm sending them manually, but fear I'm missing  a few members here and there.

I'm using SMF ver 1.1 RC2
SMF 2.0.2

husmen73 (Gulhin)

#92

Where is code RC2 ???

i searching :(  there is not RC2
-Kurumsal Kimlik Web Tasarım Hizmeti.
Gülhin Portal Sistemi hakkında yorumlarınızı bekliyorum.
SMF
Referanslar --> http://www.gulhin.com/referanslar-portfoy/
-Web Tasarımı ve Tema Tasarımı Sitesi www.gulhin.com
-TOPLU MAİL GÖNDERİMİ --> http://www.toplumailsms.com
E-Ticaret Sistemi yaptırmak mı istiyorsunuz?

MJJOS

#93
Yes it can be made work with 1.1RC2, what he is saying is, take the original code given by Kirby, and put it into Subs-Members.php

So, for 1.1RC2, in Subs-Members.php, find:
// Admin gets informed here...
adminNotify('approval', $memberID, $regOptions['username']);
}


AFTER that, insert:
   // Set up the message arrays
$pmfrom = array(
'id' => 1,
'name' => 'name or variable',
'username' => 'name or variable'
);
$pmto = array(
'to' => array($memberID),
'bcc' => array()
);

// Give them a warm welcome via PM :)
sendpm($pmto, 'Subject Here', 'Message Here', 0, $pmfrom);


Remember to replace Subject Here with the PM subject, and Message Here with the pm's message.
Thats it, it works perfectly, and that way you wont get that error message that was coming up. I tried it, so it should be fine for most people.

Great idea by the way! Hope that helps.


husmen73 (Gulhin)

-Kurumsal Kimlik Web Tasarım Hizmeti.
Gülhin Portal Sistemi hakkında yorumlarınızı bekliyorum.
SMF
Referanslar --> http://www.gulhin.com/referanslar-portfoy/
-Web Tasarımı ve Tema Tasarımı Sitesi www.gulhin.com
-TOPLU MAİL GÖNDERİMİ --> http://www.toplumailsms.com
E-Ticaret Sistemi yaptırmak mı istiyorsunuz?

L.G.S

Yeah, thanks man. Worked great.
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


husmen73 (Gulhin)

Quote from: MJJOS on May 27, 2006, 09:19:19 AM
Yes it can be made work with 1.1RC2, what he is saying is, take the original code given by Kirby, and put it into Subs-Members.php

So, for 1.1RC2, in Subs-Members.php, find:
// Admin gets informed here...
adminNotify('approval', $memberID, $regOptions['username']);
}


AFTER that, insert:
   // Set up the message arrays
$pmfrom = array(
'id' => 1,
'name' => 'name or variable',
'username' => 'name or variable'
);
$pmto = array(
'to' => array($memberID),
'bcc' => array()
);

// Give them a warm welcome via PM :)
sendpm($pmto, 'Subject Here', 'Message Here', 0, $pmfrom);


Remember to replace Subject Here with the PM subject, and Message Here with the pm's message.
Thats it, it works perfectly, and that way you wont get that error message that was coming up. I tried it, so it should be fine for most people.

Great idea by the way! Hope that helps.

I ADDED codes. BUT THERE ISN'T  VARIATION
-Kurumsal Kimlik Web Tasarım Hizmeti.
Gülhin Portal Sistemi hakkında yorumlarınızı bekliyorum.
SMF
Referanslar --> http://www.gulhin.com/referanslar-portfoy/
-Web Tasarımı ve Tema Tasarımı Sitesi www.gulhin.com
-TOPLU MAİL GÖNDERİMİ --> http://www.toplumailsms.com
E-Ticaret Sistemi yaptırmak mı istiyorsunuz?

navjotjsingh

Quote from: MJJOS on May 27, 2006, 09:19:19 AM
Yes it can be made work with 1.1RC2, what he is saying is, take the original code given by Kirby, and put it into Subs-Members.php

So, for 1.1RC2, in Subs-Members.php, find:
// Admin gets informed here...
adminNotify('approval', $memberID, $regOptions['username']);
}


AFTER that, insert:
    // Set up the message arrays
$pmfrom = array(
'id' => 1,
'name' => 'name or variable',
'username' => 'name or variable'
);
$pmto = array(
'to' => array($memberID),
'bcc' => array()
);

// Give them a warm welcome via PM :)
sendpm($pmto, 'Subject Here', 'Message Here', 0, $pmfrom);


Remember to replace Subject Here with the PM subject, and Message Here with the pm's message.
Thats it, it works perfectly, and that way you wont get that error message that was coming up. I tried it, so it should be fine for most people.

Great idea by the way! Hope that helps.



Thanks for this code. It worked wonderfully!!!!! Thanks a ton.

LuminaRS

I'm using 1.0.7 and cannot seem to get the code to work. It just makes my reg page blank. What's the problem that's causing this?

Oldiesmann

Are there any errors in your forum error log relating to this?
Michael Eshom
Christian Metal Fans

Advertisement: