<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>Website Membership: auto-subscribe original posts</title>
        <link>https://interactivetools.com/forum/forum-posts.php?Website-Membership-auto-subscribe-original-posts-79970</link>
        <description></description>
        <pubDate>Sat, 11 Jul 2026 20:27:21 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;Website-Membership-auto-subscribe-original-posts-79970" rel="self" type="application/rss+xml" />

                <item>
          <title>Website Membership: auto-subscribe original posts</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2236414#post2236414</link>
          <description><![CDATA[<p>Dave, your reply took some time for me to work through, but in the end, I've accomplished my goal! (And on a Friday... yes!)</p>
<p>This tip you provided was crucial:</p>
<blockquote>
<p>But you've got another table 'topics' in your setup, so you may need to create a new comment on the topic first.  Have a look at the code in wsc_comments_addRecord() for how to go about that.</p>
</blockquote>
<p>The relationships between CMSB, Website Membership, and Website Comments wasn't easy to figure out at first, but it is a complex and powerful relationship, in the end. This is my first install of Website Comments and I am impressed!</p>
<p>Your guidance was invaluable...thanks so much!</p>
<p>~ Deborah</p>]]></description>
          <pubDate>Fri, 27 Mar 2015 16:13:28 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2236414#post2236414</guid>
        </item>
                <item>
          <title>Website Membership: auto-subscribe original posts</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2236362#post2236362</link>
          <description><![CDATA[<p>Hi Deborah, </p>
<p>That's really great.  Ok, so obviously it's a lot of custom code and outside of what we typically support, but let's see if we can find something that will work for you.  </p>
<p>If you look in websiteComments.php there's a few functions that apply to subscriptions:</p>
<ul><li>wsc_thread_isSubscribed($tableOrTag, $recordNum); // check if current user is subscribed to this thread</li>
<li>wsc_thread_subscribe();</li>
</ul><p>wsc_thread_subscribe() is what we want, but it redirects and does some other things, but I can see that it calls <strong>_wsc_thread_subscribe()</strong> which looks like this:</p>
<p><code>// subscribe current user to current comment thread<br />function _wsc_thread_subscribe($tableOrTag, $recordNum) {<br />  global $CURRENT_USER;<br /><br />  // subscribe user (if not already subscribed)<br />  $isSubscribed = wsc_thread_isSubscribed($tableOrTag, $recordNum);<br />  if (!$isSubscribed) {<br />    mysql_insert('_wsc_subscribers', array(<br />      'createdDate=' =&gt; 'NOW()',<br />      'userNum'      =&gt; $CURRENT_USER['num'],<br />      'tableOrTag'   =&gt; $tableOrTag,<br />      'recordNum'    =&gt; $recordNum,<br />    ));<br />  }<br />}</code></p>
<p>Now, we use a leading _ in function names to indicate it's a "private" function not intended to be called externally.  But you can call it, we just can't guarantee it won't change in future (but it probably won't).</p>
<p>But basically, if you can get these values:</p>
<ul><li>tableOrTag - usually a form value in $_REQUEST['_wsc_tableOrTag']</li>
<li>recordNum - usually a form value in $_REQUEST['_wsc_recordNum']</li>
</ul><p>Then you could just call the function after getting the new thread record num.</p>
<p>So adding that to you code might look like this (untested):</p>
<p><code>// add record<br />if (!@$errorsAndAlerts) {<br />mysql_query("INSERT INTO `{$TABLE_PREFIX}topics` SET<br /> title            = '".mysql_real_escape_string( $_REQUEST['title'] )."',<br /> content          = '".mysql_real_escape_string( $_REQUEST['content'] )."',<br /> fullname         = '".mysql_real_escape_string( $_REQUEST['fullname'] )."',<br /> usernum          = '".mysql_real_escape_string( $_REQUEST['usernum'] )."',<br /> createdDate      = NOW(),<br /> updatedDate      = NOW(),<br /> createdByUserNum = '0',<br /> updatedByUserNum = '0'")<br />    or die("MySQL Error Creating Record:&lt;br&gt;\n". htmlspecialchars(mysql_error()) . "\n");<br />    $recordNum = mysql_insert_id();<br /><br /><span style="color:#ff0000;"> // subscribe user to thread they just created</span><br /><span style="color:#ff0000;">  $tableOrTag = "determine what this should be?"; </span><br /><span style="color:#ff0000;"> _wsc_thread_subscribe($tableOrTag, $recordNum);</span><br /><br /><br /> // display thanks msg, clear form<br />    $errorsAndAlerts = "Thanks, we've added that topic!";<br />    $_REQUEST = array();<br />  }<br />}</code></p>
<p>But you've got another table 'topics' in your setup, so you may need to create a new comment on the topic first.  Have a look at the code in wsc_comments_addRecord() for how to go about that.</p>
<p>Hope that helps!  Let me know any questions and if any of that information can get you any further.</p>]]></description>
          <pubDate>Fri, 20 Mar 2015 11:23:49 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2236362#post2236362</guid>
        </item>
                <item>
          <title>Website Membership: auto-subscribe original posts</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2236331#post2236331</link>
          <description><![CDATA[<p>Dave, Everything I'm referring to is being built (so far, just by me) with CMSB and the two plugins, Website Membership (WM) and Website Comments (WC).</p>
<p>The Members Area of the site is only accessible to WM members.</p>
<p>Once logged in, the member can view general content or visit the forum.</p>
<p>Inside the Forum area:</p>
<ul><li>There is a list of previously created forum post titles. The titles link to a detail page with the full post, display of any comments, and the WC comment form.</li>
<li>The original forum posts are submitted via a form that writes to the 'topics' table. (See attached PHP file.) This form is only used for posting a NEW topic.</li>
<li>The member viewing a post can comment, subscribe/unsubscribe (WC plugin).</li>
<li>When a member comments on a post (WC plugin), they are automatically subscribed via email to future post updates.</li>
</ul><p>What I'm challenged with is that when the member starts a new topic (using the attached form), I would like them to be automatically subscribed to comments (comments made via the WC plugin).</p>
<p>I hope I'm describing that well enough. I'm really excited to have gotten this far along with building this!</p>
<p>~ Deborah</p>]]></description>
          <pubDate>Tue, 17 Mar 2015 12:33:08 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2236331#post2236331</guid>
        </item>
                <item>
          <title>Website Membership: auto-subscribe original posts</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2236322#post2236322</link>
          <description><![CDATA[<p>Hi Deborah, </p>
<p>Sounds like you have website membership, website comment AND a forum? </p>
<p>How's it all built and who build it (was it us?) and how does it all work together?</p>
<p>Whatever the mechanism is for "subscribing" to a topic (not sure if that's in the forum or comments) it should be possible with a few lines of custom code to have a user automatically "subscribe" to the topic they just created.  You'd just need to call whatever code gets run as when they normally click on the subscribe link.</p>
<p>Let me know some more details and I'll try to help and/or point you in the right direction.</p>
<p>Thanks!</p>]]></description>
          <pubDate>Tue, 17 Mar 2015 11:57:22 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2236322#post2236322</guid>
        </item>
                <item>
          <title>Website Membership: auto-subscribe original posts</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2236278#post2236278</link>
          <description><![CDATA[<p>Hi. Using my first instance of the Website Membership plugin in conjunction with the Website Comments plugin and am stuck here...</p>
<p>1) The site has a forum accessible only by Website Membership users.</p>
<p>2) Users can post a new topic to the "topics" table. After a topic is submitted, Website Membership members can view the topic and post comments or subscribe to comment updates.</p>
<p>3) If a member posts a new topic, they are not automatically subscribed to that topic for receiving the email comment updates. The person would need to review their own post and click the subscribe link. I don't think most people would think to do this, and think they'll want/expect to receive an email alert when comments to their topic were made by other users.</p>
<p>Is there a way that I can set up the "topics" form submission to automatically subscribe that Website Membership user to Website Comments for that topic?</p>
<p>Deborah</p>]]></description>
          <pubDate>Fri, 13 Mar 2015 16:07:13 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2236278#post2236278</guid>
        </item>
              </channel>
    </rss>
  