Previous Thread
Next Thread
Print Thread
Hop To
#196057 09/02/2007 2:47 PM
Joined: Mar 2007
Posts: 20
P
stranger
stranger
P Offline
Joined: Mar 2007
Posts: 20
Hello! I have a couple of questions:

First, is there a way to add one forum to everyone's watched forum list?

Second, is there a way to change these default settings for currently registered members:

By default should anything added to your Watch Lists be emailed to you?

Do you want to be notified via email when you receive a private message?

(I'd also like it to default to the yes setting for new registrants too, but that seems like a different question.)



Thanks for your support!

Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
Since this stuff is stored into the database, yes, you can add this for every user with the right database querie.

As for getting it default to every user, you would need to add a little code in ubb in the new user stuff to add a watch for them.

Last edited by blaaskaak; 09/02/2007 4:41 PM.

[Linked Image from siemons.org]
Joined: Mar 2007
Posts: 20
P
stranger
stranger
P Offline
Joined: Mar 2007
Posts: 20
Do you know what the queries would be? I'll tinker with the code to set the defaults. Thanks.


Joined: Jun 2006
Posts: 16,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
Likes: 116
By default should anything added to your Watch Lists be emailed to you?
Code
UPDATE `ubbt_USER_PROFILE` SET `USER_EMAIL_WATCHLISTS` = '1';

By default should any Private Messages also be emailed to you?
Code
UPDATE `ubbt_USER_PROFILE` SET `USER_NOTIFY_ON_PM` = 'yes';


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Mar 2007
Posts: 20
P
stranger
stranger
P Offline
Joined: Mar 2007
Posts: 20
Gizmo, you rock!

Do you know what the query would be to add a specific forum to all users watched list?

Thanks for your sharing your wisdom!

Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
Originally Posted by Gizmo
By default should anything added to your Watch Lists be emailed to you?
Code
UPDATE `ubbt_USER_PROFILE` SET `USER_NOTIFY_ON_PM` = 'yes';


that would be PM's smile

Code
ALTER TABLE `ubbt_USER_PROFILE` CHANGE `USER_EMAIL_WATCHLISTS` `USER_EMAIL_WATCHLISTS` TINYINT( 1 ) NOT NULL DEFAULT '1'

Would set the watchlist e-mails default on for new users.

Code
ALTER TABLE `ubbt_USER_PROFILE` CHANGE `USER_NOTIFY_ON_PM` `USER_NOTIFY_ON_PM` CHAR( 3 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'yes'

Would set the wachlist e-mail stuff default on for new users.

As for adding users to the watchlist, it depends. Do you want to force it on again if they turn it off themselves?


[Linked Image from siemons.org]
Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
A beginning:

query 1:

This would remove any of the forced watched forums. If you are gonna mass add users, be sure to clear any previous ones to prevent double entries. You could change query 2 to avoid adding double entries, but this works fine too.

The number 150 must be replaced with the forum id of the forum you want to force the watch too.

Code
DELETE FROM ubbt_WATCH_LISTS WHERE WATCH_ID =150 AND WATCH_TYPE = 'f'

query 2:

Add all users to watch forum 150 (replace with your forum of choice).

Code
INSERT INTO ubbt_WATCH_LISTS( USER_ID, WATCH_ID, WATCH_NOTIFY_IMMEDIATE, WATCH_TYPE ) 
SELECT USER_ID, 150, 1, 'f'
FROM ubbt_USERS

These queries would be great to run once in a while (together with the 2 from gizmo) if you want to keep forcing them.

If not, you need to run the suggested queries in this topic once, and add a little code to the new user stuff that would insert the watch into the watchlist.


[Linked Image from siemons.org]
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
i'd change that last query to 'REPLACE INTO ubbt_WATCH_LISTS...'

then you replace, if already there, else it inserts

small thing wink and good stuff blaask!!

oh and you must have mysql 4.1 for subqueries (i sure hope we go that route soon! wink )

Joined: Jun 2006
Posts: 16,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
Likes: 116
Originally Posted by blaaskaak
that would be PM's smile
was in a hurry lol


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Mar 2007
Posts: 20
P
stranger
stranger
P Offline
Joined: Mar 2007
Posts: 20
LOL!

This is great guys! Thanks a ton for all your support!

Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
Originally Posted by Sirdude
then you replace, if already there, else it inserts

Ah, that way you can also skip delete query #1.

But what if somebody changed the WATCH_NOTIFY_IMMEDIATE value to 0, wouldn't it add a new record?

edit: REPLACE INTO will actually perfo...rm an update (as the name suggests).. Seeing this there would not be must advantage in using replace into.

Last edited by blaaskaak; 09/03/2007 6:54 AM. Reason: blaaskaak did some surfing reading up the replace into stuff

[Linked Image from siemons.org]
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
there's no KEY in that table to worry about wink

but do it the way you feel comfortable

Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
Originally Posted by Sirdude
there's no KEY in that table to worry about wink


It's not the key I'm worried about, it's double entries smile


[Linked Image from siemons.org]
Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
Originally Posted by blaaskaak
It's not the key I'm worried about, it's double entries smile


And double entries it is. Because it has no key, it has no way of knowing whether to add or to replace. On this table, the result with insert into and replace into gives the same result.


[Linked Image from siemons.org]
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
okie dokie {insert padding to 15chars} laugh

Joined: Mar 2007
Posts: 20
P
stranger
stranger
P Offline
Joined: Mar 2007
Posts: 20
Okay, I have another question about all this now. Several of my users are responding to the watched topics emails directly, and bypassing the forum...

Which language file or template would I modify to add a line to the emails that get automatically generated? I want to add something that says "please do not respond to this automated email account, instead please respond directly on the forum."

??? Thanks for all your support!

Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
Just look at a string that is currently in the e-mail in the language editor. It's pretty easy to find the language strings used for just about everything in the forum.


[Linked Image from siemons.org]
Joined: Jun 2006
Posts: 16,292
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,292
Likes: 116
The best bet when dealing with language files, is to use the built in "search" on the editor page in the control panel; simply search for the "words" you want to change.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Mar 2007
Posts: 20
P
stranger
stranger
P Offline
Joined: Mar 2007
Posts: 20
Hmmmm... So, the email that gets generated says:

[user name] replied to a Watched Topic at the site:
[link to post]

[displays actual user post]

And I want to add a string after that post..... How do I do that from the language editor page? I'm thinking I can't.

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
hrm.. you got a good one there Peter. no, you can't do that without monkeying around with things.. now for 7.3 and the email overhaul dealio..

the answer is YES wink

SD #199962 10/25/2007 10:36 PM
Joined: Mar 2007
Posts: 20
P
stranger
stranger
P Offline
Joined: Mar 2007
Posts: 20
Hmmmm... Is there no way to insert a new wordlet or something into a template that allows me to do this?

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
well emails aren't template based, until 7.3. so the only way to do it would be to edit domailthread.inc.php and add your text to the email body.

easy to do, if you are a coder..

but not built into the cpanel at all right now.

tell me what you want to add and i can PM you what you need to do smile for me, it's perty easy to do.

SD #199967 10/26/2007 12:12 AM
Joined: Mar 2007
Posts: 20
P
stranger
stranger
P Offline
Joined: Mar 2007
Posts: 20
Sirdude,

If I add this:
Code
$mailbody .="$newline$newlinePlease do not respond to this email.  Instead, visit the above link on the forums and join the conversation.";
	

To line 150 of domailthread.inc.php, that will work, yes? Thanks for telling me where to look!

-Peter

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
oops.. i was confused as to which file.. you aren't doing the mail thread.. but the notify stuff..

lemme check that one. ....

/me looks up code.. smile

SD #199969 10/26/2007 12:33 AM
Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
it would be addpost.inc.php.. add what you posted before

PHP Code
$subject = "{$ubbt_lang['REPLY_SUB']} $Title : $Subject"; 

~line 790ish

and just change $mailbody to $msg and you are good to go smile

SD #200006 10/26/2007 11:11 PM
Joined: Mar 2007
Posts: 20
P
stranger
stranger
P Offline
Joined: Mar 2007
Posts: 20
Dude! You rock! Works beautifully.

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
cool beans Peter.. glad it helped smile


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
2 members (Gizmo, Nightcrawler), 553 guests, and 186 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)