OK, I know this is very specific, but I spent a long time figuring this out for a friend. If you benefit from my experience and get paid by someone to do so, please click on a link or buy one of my books on Amazon.

 

I know a component might do all this for a small fee, but I spent hours and hours looking for the right one, only to be slightly disappointed by the end. The client wanted a form to collect email, name, and optional demographic and financial information, and then to deliver a file (or three) to the customer. The tricky parts were the need to ONLY deliver the files requested and to collect MORE than just email and name.

 

The Search

I really wanted to find a super plugin that could do all I wanted and the client said it was fine to pay for a premium solution. However, I wasn’t even positive which categories would make the most sense to search, and I never found a component that claimed to do exactly what I needed. Of note, I was given one weekend to complete the project.

  • I started by looking at the forms categories of extensions for Joomla. I’d worked with Chronoforms before, but I somehow couldn’t believe I needed a big program like that, plus our hosting company claimed it was doing something suspicious on the server and gave us grief years ago. Anyhow, I looked at all the form creators and moved on. Probably a mistake, but all I wanted was maybe ten fields and a redirect.

  • The next place I searched was in the newsletter components. The client said he wanted to get emails in order to eventually contact those who showed interest in his downloads. I had Jnews all set up as an opt-in and then see the files setup, but all it would collect was email and name, and it didn’t redirect to a single document (newsletter archive) but wanted to show all of them. I was fine with the result. The client was not. Newsletters might come later. All archives would litter the “download” area. It didn’t collect enough information. Other newsletter components seemed to be similar in their lack of information collected and redirect after filling the forms. Pro versions promised more features, but I could not guaranty those features would cover my needs.

  • I decided to try the contact form category of extensions, which included a quick search of the guest book components. I tried B2J Contact, Flexi Contact, POWr Contact Form, and likely one or two more. The “file upload” promise was of course for those contacting you to upload files, but my client wanted it the other way. I’m sure these and other contact forms can do some version of what I was looking for, but I could not create it with a free version and could not verify a paid version had what I needed without more time contacting developers.

  • I tried surveys next. I figured we could collect information and then redirect. However, one promising extension, WebEngage, ended up being free for almost nothing and a monthly subscription (and still nothing that seemed to show a redirect upon completion of the survey would happen), so uninstall. POWr Survey did not have enough power for my needs. I quickly tried the polls section to no avail, as well.

  • I tried a few more search combinations and eventually ended up trying OptDownload and looked at OSDownloads. These components seemed simple enough: get a name and email for a free download. Again, the client wanted more information collected and seemed very convinced that there would be distaste in anyone who wanted to download only File A but had to see the link to File B. Anyhow, most of the download or file sharing extensions are not set up to collect information, so I started to look elsewhere once again.

  • I have not had great luck with standalone scripts not tied into Joomla, but I was getting desperate and running out of weekend. I installed LimeSurvey and monkeyed around with s few other survey and form options. They were all free and possibly useful, but they seemed to have steep learning curves for a project with a time crunch, I was also worried the client would not like the new domain needed and inline frames necessary to make it work.

  • My last-ditch attempt at a final compromise was Google Forms. With Google allowing Drive items to be embedded in other domains, they can be useful, and I’d worked a lot with Google Forms and Sheets while teaching high school, creating surveys and quizzes. You can even get Forms to redirect to another page based on answers. However, the form was still slightly clunky, still an inline frame, and it was redirecting BEFORE form submission, which meant a lot of users skipping the submit button and downloading the file, which could not be a hyperlink, by the way. Less than ten plugins means it’s another Google App nobody is supporting or thinking about innovatively.

  • Here’s one last disclaimer before I discuss my solution: I know there are probably dozens of scripts I tried or programs I didn’t try, many free, that can do what I wanted. However, I had a deadline along with skills leaning mostly towards Joomla and Google Drive in a Joomla site, so if WordPress or Drupal have an easy plugin, I certainly wasn’t looking for it. I have realized while using Joomla that many people post their solutions to the forums, and I have been helped more times than I can count because of the generosity of the community. If you are have reached nearly the end of this article and realize it’s not the right solution for you, be sure you try the Joomla or other script forums.

 

My Solution

In the end, I’d say I did have to compromise a little bit in order to mostly meet the needs of the client, but when he sees the results, he will not be able to complain. After going through all of the above and getting nearly nowhere, I came back to Chronoforms, knowing it had the tools I was looking for if I could figure them out. First, of course, I had to make sure PHP 5.3 was enabled (which it wasn’t), so my solution kind of starts from there.

  • The .htaccess file needs the following added if you’re getting non-loading scripts that need PHP 5.something or higher:

AddHandler application/x-httpd-php53 .php

AddHandler application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml  

Add the code after any Joomla stuff and before the <Files 403… part if you have it.

The added code worked for me using Lunarpages, but your success may vary.

  • Unfortunately, Chronoforms still didn’t work well on my site even after PHP 5.3 was enabled, but I decided to give Breezingforms a shot at this point. Hopefully, you can just start with Breezingforms installing nicely on Joomla.

  • I also installed Phoca Download. For me, it was later in the process, but it would work best to do it now. Because it’s simpler than the Breezingforms part, just install the component, create enough categories for all the redirects you’ll need, and get ready to populate those categories with the files you want to distribute.

  • When you have a category in Phoca Downloads for every redirect, then create a hidden menu and add a Phoca Download Category page for each of the redirecting urls. This way, they won’t be visible in the main menu. Quick version of the hidden menu is to create a new menu and not assign it to a position. When publish anything to it, get the url in the Link section when you “Add New Menu Item.” Just copy the Link you see to the end of your live site url  after the menu item is saved = hidden pages everywhere.

 

Now you’ll have to create a new form in Breezingforms and figure out how it all works. Not simple, but you’ll get through it.

  • One of your elements needs to be a “Select from list” type. If you’re creating the option of both Item A and Item B, then Item C has to be a combination, as the redirect at the end does not want to go to two separate places (which is also why this does not work with checkboxes, the client’s preferred method). Anyhow, I needed to create seven options:

1. A only

2. B only

3. C only

4. A B and C

5. A and B

6. A and C

7. B and C

 

As seen in List view on my site:

0;Energy Boom, The Next Crash, and Whatever;value1

0;Energy Boom and The Next Crash;value2

0;Energy Boom only;value3

0;Energy Boom and Whatever;value4

0;The Next Crash and Whatever;value5

0;The Next Crash only;value6

0;Whatever only;value7

  • If you have more than three options, it probably gets more complicated and might be too silly to put in a single dropdown menu. Also, I had the all three item option on top because I assumed most people would want all three free files. “Value1” is also what shows up in your “Manage Records” section, so you might rather it say something descriptive.

  • Next it gets even more complicated as you need to tie the form submission to a specific redirect. To do this, start with the form title itself highlighted and choose the “Advanced” tab.

  • Under Form Options, click “More Options”

  • Click the “Submit Pieces”

  • Under End Submit choose “Custom,” which should be empty

  • Add the following code, changing your own values (value1),  urls (http://passiveninja.com…) and element Name (bfQuickMode3572370):

$this->execPieceByName('ff_InitLib');

$value = ff_getSubmit('bfQuickMode3572370');

switch( $value ){

  case 'value1': header('Location: http:/passiveninja.com/index.php?option=com_phocadownload&view=category&id=2'); exit; break;

 case 'value2': header('Location: http://passiveninja.com/index.php?option=com_phocadownload&view=category&id=6'); exit; break;

 case 'value3': header('Location: http://passiveninja.com/index.php?option=com_phocadownload&view=category&id=4'); exit; break;

  • If you later customize any of the values or names, you have to make sure it’s reflected in the redirect you’ve set up.

  • Repeat for all the values you want redirected.

  • Keep in mind that this is not some kind of registered user system and you’re not really protecting your files from those who might want them. You’re just trying to get some email addresses and brief survey information in return for some files others might want, and you’re making it look like a custom job.

Written by Brian Jaeger, owner of Satisfamily, McNewsy, PassivNinja, Educabana, RealWisconsinNews, ManCrushFanClub, WildWestAllis, SitcomLifeLessons, and VoucherSchool.

0
0
0
s2sdefault

Pennies From Heaven AKA Welfare for Writers

The reason why we have ads on this page is because that's one way writers make money online. Your presence on this site right now might make a penny for our family. Clicking on an ad might get us closer to $.50. Buying something online as a result of clicking on a link can make us a few dollars. We will not get rich from this money, but every penny helps out. Every like or share or repost or follow. Please, make a donation to our family by clicking.