Getting YaNC Working With CB 1.2 RC4

15 years 3 months ago #84403 by tthalken
Getting YaNC Working With CB 1.2 RC4 was created by tthalken
How I GOT Community Builder To Work With The Yanc Newsletter
It took me a long time of researching and pouring through code for a couple of simple fixes, but in it's current state Yanc does not work well with Community Builder. I thought I would write this to help anyone else who had to start from scratch like I did.

YaNC seems like a great product, however it seems that development has stalled. It is not native to Joomla 1.5, so you do need legacy mode enabled in Joomla.

Background
I am hosting a Joomla site through Siteground. I am currently using Joomla 1.5.8. I have Community Builder 1.2 RC4 installed. I am using the trunk version of Yanc.

I want a user to be able to manage their newsletter mailings only from Community Builder.

I am not going to go through how to install Community Builder.

Install Yanc Trunk Version
You can download the trunk version of Yanc from:
forum.joomla-addons.org/index.php?topic=2776.0
(Note: You must have a user account on the forum to see the download)
Install the trunk version from the downloaded file.
(NOTE: DO NOT TRY TO UPGRADE YANK TRUNK USING THE UPGRADE OPTION FROM THE YANK COMPONENT MANAGEMENT. YOU WILL KILL IT!)

Enable The Community Builder YANK Plugin
Go to the Community Builder Plugin Manager and enable the YaNC Newsletters plugin. This will add a tab to the user's profile that allows users to edit (subscribe and unsubscribe) their newsletters.

Fix Magic Quotes In Yanc
I had problems with slashes getting added to my templates and mailings. If this is not a problem for you, you can skip this step.

I use siteground as my provider. The have magic_quotes_gpc on by default. I cannot change php settings from the .htaccess file, so I need a php.ini file in each directory where the change is needed. I just created a php.ini file in the administrator directory with the setting:
[code:1]magic_quotes_gpc = Off[/code:1]
Allowing Subscription Settings Only From Within Community Builder.
I found that Community Builder subscriptions do not work well with Yanc subscriptions. If a user subscribes and unsubscribes from Yanc the changes do not reflect properly in Community builder. Community Builder changes do reflect properly in Yanc.

I needed a way to keep the two looking the same. I decided to remove the unsubscribe option from the Yanc component configuration I turned off "Send Unsubscribe Message". In Yanc component Manage Templates I removed the [UNSUBSCRIBE] tag and gave instructions to log on to their profile and unsubscribe from there.

Users still need to confirm their subscriptions from the link on the confirmation e-mail. I changed the confirmation process to only popup that their subscription was active and then navigate to an article I wrote that explains the subscription and how to unsubscribe (this is article id 129 on my system).

This will bypass the default Yanc page where a user can subscribe and unsubscribe.

Modify the file /administrator/components/com_yanc/classes/subscriber.php under the function confirm($hash) and change the line that reads:
[code:1]echo "<script> alert('". Y_FRONT_SUBSCRIPTION_CONFIRMED . "'); document.location.href='index.php?option=$option&Itemid=$Itemid';</script>\n";

to:

echo "<script> alert('". Y_FRONT_SUBSCRIPTION_CONFIRMED . "'); document.location.href='index.php?view=article&id=129';</script>\n";[/code:1](your article id will be different)

Now all of my subscriptions and unsubscriptions are managed from within the Community Builder profile (Newsletters) tab.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.150 seconds

Facebook Twitter LinkedIn