Hi, I use to have pnmessages and now i upgraded to intercom. Intercom gives users the option of having email notifications and by default it is set to "no". What I would like to know, is if there is a way to set the default to "yes" so everyone will get notification of their new message via email. With pnmessages, i believe "yes" was the default I hope there is a way to accomplish this with intercom.
edited by: mikebcoffee, datetimebrief
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- rgasch created topic »Using PageUtil::addVar() to load script code« 11:48 AM
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Intercom Email notifications mandatory
-
- Rank: Registered User
- Registered: Aug 13, 2008
- Last visit: May 31, 2010
- Posts: 39
-
- Rank: Registered User
- Registered: Aug 13, 2008
- Last visit: May 31, 2010
- Posts: 39
I'm trying to drive more traffic to my website and it is easier to do when people receive email notifications. -
- Rank: Softmore
- Registered: Aug 08, 2002
- Last visit: May 21, 2010
- Posts: 122
I asked the same some months ago but I couldn't find the thread anymore.
It seems to me that you should change in pnuserapi.php line 97
Code
$user['__ATTRIBUTES__']['ic_note'] = 1; -
- Rank: Registered User
- Registered: Aug 13, 2008
- Last visit: May 31, 2010
- Posts: 39
I switched value from 0 to 1. Still doesn't work. Default is still set to no. Thanks anyway. -
- Rank: Developer
- Registered: Aug 15, 2002
- Last visit: May 21, 2010
- Posts: 149
Not exactly what you are looking for but a start: Click.
--
Cheers, Sascha
Philivision, Inc. - User of Zikula since 2002... -
- Rank: Softmore
- Registered: Aug 08, 2002
- Last visit: May 21, 2010
- Posts: 122
The hack I suggested works only with new users. Every time a new user is created the option will be set to "yes". Then the user will decide to keep it "yes" or "not".
Of course all the old users have that option set to "no" by default and the script suggested by Roadranner will help you to change all the old settings to yes. -
- Rank: Registered User
- Registered: Aug 13, 2008
- Last visit: May 31, 2010
- Posts: 39
So this is the code, but I am wandering where do you place this code?
Code
<?php
$conn = mysql_pconnect("server","username","password");
mysql_select_db("database", $conn);
$SQL = "SELECT pn_uid,pn_uname FROM zk_users";
$result = mysql_query($SQL) or die(mysql_error());
echo "Setting email notofications on for all users ...<br />";
flush();
while($row = mysql_fetch_array($result)) {
$dato = date("Y-m-d H:i:s");
$SQL = "INSERT INTO zk_objectdata_attributes (oba_attribute_name,oba_object_id,oba_object_type,oba_value,oba_obj_status,oba_cr_date,oba_cr_uid,oba_lu_date,oba_lu_uid) VALUES('ic_note','" . $row[pn_uid] . "','users','1','A','" . $dato . "','" . $row[pn_uid] . "','" . $dato . "','" . $row[pn_uid] . "')";
mysql_query($SQL);
$SQL = "INSERT INTO zk_objectdata_attributes (oba_attribute_name,oba_object_id,oba_object_type,oba_value,oba_obj_status,oba_cr_date,oba_cr_uid,oba_lu_date,oba_lu_uid) VALUES('ic_ar','" . $row[pn_uid] . "','users','0','A','" . $dato . "','" . $row[pn_uid] . "','" . $dato . "','" . $row[pn_uid] . "')";
mysql_query($SQL);
echo "Settings for user <strong>" . $row[pn_uname] . "</strong> done.<br />";
flush();
}
echo "DONE!!";
?> -
- Rank: Registered User
- Registered: Aug 13, 2008
- Last visit: May 31, 2010
- Posts: 39
-
- Rank: Team Member
- Registered: Jul 15, 2004
- Last visit: May 27, 2010
- Posts: 277
Not in InterCom. It looks like a simple PHP-code. Just copy it into a PHP file and open it.
BUT: I didn't check the code. So I cannot recommend this approach. Use at your own risk. -
- Rank: Developer
- Registered: May 07, 2006
- Last visit: May 28, 2010
- Posts: 124
This is just an extra separate PHP script that sets all user attributes that are neccesarry for the notification.
but this will only affect existing users and has to be done periodically to affect the settings of all users.
Flo
--
ifs-net.de -- zksoft.de -
- Rank: Registered User
- Registered: Aug 13, 2008
- Last visit: May 31, 2010
- Posts: 39
Ok so I'm assuming I just create a new PHP file and add this code? But what do I name the file? -
- Rank: Developer
- Registered: Dec 31, 1969
- Last visit: Jun 01, 2010
- Posts: 6859
Whatever you want, doesn't matter. As long as it ends in .php
--
Home Page | Find on Facebook | Follow on Twitter
-
- Rank: Registered User
- Registered: Aug 13, 2008
- Last visit: May 31, 2010
- Posts: 39
Ok. This script must not work with Zikula 1.2.3. I named the file 'pnscript.php' and uploaded it to the modules/intercom directory. Existing users are still set to no.
edited by: mikebcoffee, datetimebrief -
- Rank: Developer
- Registered: Dec 31, 1969
- Last visit: Jun 01, 2010
- Posts: 6859
It's not something that will auto run, you have to call it directly, just like the site's index.php. It doesn't matter where you put it, or what you call it.. All it does is make a change to your data records. Upload it to the root of your site, and instead of domain.com/index.php load domain.com/pnscript.php
--
Home Page | Find on Facebook | Follow on Twitter
-
- Rank: Registered User
- Registered: Aug 13, 2008
- Last visit: May 31, 2010
- Posts: 39
Ok I see. I called the script directly and got this error.
Warning: mysql_pconnect() [function.mysql-pconnect]: Unknown MySQL server host 'server' (1) in /pnscript.php on line 2
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /pnscript.php on line 3
Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/tmp/mysqld.sock' (2) in pnscript.php on line 5
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /pnscript.php on line 5
Can't connect to local MySQL server through socket '/tmp/mysqld.sock' (2)
- Moderated by:
- Support
