Implementing the Advanced QR Code / Zipped Records Plugins
The zip file you downloaded contains all the files that you'll need to implement this set of Plugins,
including the 3 plugins themselves, 5 ini.php files to create the required editors, 3 sample viewer files to
both test and deploy the plugins, 3 viewers for the included user help files, 3 jwplayer files that you'll
need if you choose to incorporate .mp3 player functions in your viewer, and one readme.txt file.
OK, let's get started.
Create a temporary folder (on your desktop) and move the downloaded zip file into that folder. When you
extract the zip file 5 folders will be created.
A data/schemaPresets folder
A plugins folder
A viewer folder
A jwplayer filesfolder
And a help database folder
__________________________________________________________________
PREPARATION:
Before you can utilize the plugins, you'll have to obtain a free Google URL shortener API key and enter it
into the Advanced QR Generator plugin. You can learn about getting a free API key at:
http://code.google.com/apis/urlshortener/v1/getting_started.html#APIKey
If you're going to use the built in Google Analytics capability then you'll also need to set up a free Google
Analytics account and a Web Property ID for each URL that you want to track. You can set up your free
account at:
http://www.google.com/analytics/
__________________________________________________________________
INSTALLATION:
1) You must set the website URL in the CMSB Admin>general settings. Do not leave it at the default
"Set This" value. The address is used by the QR plugins and needs to be set accurately. An easy way to
test to see if the value is correct, is to click the "View Website" button. If the URL is correct, you should
land on your web site's home page.
2) After you've entered your Google URL shortener API key in the Advanced QR Code Generator,
upload the following plugins included in the Zip file into your cmsAdmin/plugins folder and make them
active in Admin>plugins.
QR Code Generator (Required)
Advanced QR Code Generator
Zip Functions
3) Create two empty folders in your cmsAdmin directory, qrtemp and ziptemp, and make them writeable
(Unix permission 755)
4) **** CAUTION: If you already have a section editor called "help", you'll need to rename it before
uploading these files or creating the help editor. ****
Upload the 5 ini.php files (included in the data/SchemaPresets folder in the zip file) to your
cmsAdmin/data/schemaPresets folder
category_titles.ini.php (the table for the category titles records)
sub_category_titles.ini.php (the table for the sub-category titles records)
listing_pages.ini.php (the table for the listing records that will be created)
exports.ini.php (the table for the Zipped files for download records)
help.ini.php (the table for the help document records)
**** CAUTION: Last Chance... If you already have a section called "help", you'll need to rename it before
you create this new help editor or yours will be overwritten. ****
Use those 5 schema presets to create editors using all the default values.
5) Change the "Load Viewer Library" path, in the 6 .php viewer files to the server path to your CMSB
installation. (Copy this from any viewer created by the admin>code generator. They're all the same.)
6) In the listings.php file change the URL next to the " indicators to your site URL and upload them to your site's root directory
7) In order for the Zip Records plugin to work, you'll need to manually change a block of code in the
cmsAdmin/lib/menus/default/list.php file.
Until the required code changes becomes permanent, you'll have to make this change whenever you
upgrade your CMSB installation.
Look for:
Change the contents of the
from:
__________________________________
_____________________________________
to
______________________________________
__________________________________________________________________
OPTIONAL STEPS
7) The listing_detail.php viewer includes the code required to utilize the free jwplayer
http://www.longtailvideo.com/ to play an uploaded mp3 audio file.
However, to play .mp3s, you'll need to upload the included player.swf, jwplayer.js, and swfobject.js files
to your site's root directory.
9) Implement the user help is a 3 step process. You accomplished the first step when you created the
Help section editor.
Step 2 is to copy the .sql.php database table backup file to your cmsAdmin/data/backups folder
Step 3 is to restore only that table to your existing database.
Near the bottom of Admin>General Settings you'll see the section for Database Settings.
In the "Database Restore" pull down, select the help sql.php file that you just uploaded. You'll see a
warning which can be ignored. Since this table did not exist previously, there's nothing to overwrite.
The records in the help section now contain instructions for using the basic installation of the Advanced
QR Code Generator and Zip Records Plugin.
__________________________________________________________________
TESTING
After you've modified and uploaded the required files, and before you've made any other changes, it's a
good idea to test the operation of the plugins.
1) Log in to your CMS interface and in the "Category" and "Sub-Category" editors, create at least one
category and optionally one or more sub categories.
2) In the "Listing Pages" editor create at least one listing page record, enter some data and upload an
image and possibly a test .mp3 file.
NOTE: If you have issues uploading large files, you may have to change the values of post_max_size =
and upload_max_filesize = in your web host's php.ini file to accommodate the largest files that you
anticipate.
It's not uncommon for hosts to set these values to 2M to limit uploads and posts to 2 megabytes. It's OK
to change those sizes to 60M.
If you can't access the php.ini file, ask your host to change the values for you, or to set up the file so you
can make these and other changes as needed.
__________________________________________________________________
Once you've successfully installed and tested the plugins, and everything works as expected, you can:
Add fields to the editors,
Change the "Field Labels" of the fields, (Don't change the Field Values unless you're an advanced user.)
Modify and style the viewers,
Add topics to the help editor
____________
Following the code examples in the Advanced QR Code Generator Plugin, you can:
Change the name of the table that contains your listings
Change the fields that are automatically added to the long URL that's embedded in the generated QR
Code.
___________
In the Zip Records Plugin you can:
Change the table that contains the records to be Zipped
Change the fields that will be listed in the included .csv file
___________________________________________________________________
CUSTOMIZING THE ZIP RECORDS PLUGIN
1) Insert the name of the table that contains the records to be "Zipped" in the code:
$GLOBALS['QARTZip']['table'] = "your_table_name";
2) List the fields in your_table_name that you want to appear in the .cvs file
NOTE: the last field in the list has no trailing comma. Make sure that you spell the field names correctly.
(except for qrCode which should remain spelled that way)
$GLOBALS['QARTZip']['csvFields'] = array(
'field_1',
'field_2',
field_3',
'field_4',
'qrCode'
);
3) look for:
//Find the uploads we'll need to zip
Change the field name in
AND fieldName = 'qr_code'
to the name of your QR code upload field
4) look for
//Fill zip with uploads
Change the field name in
list($uploadDir, $uploadUrl) = getUploadDirAndUrl($tableSchema['qr_code']);
to the name of your QR Code upload field.
5) If you change the name of the table that contains your QR codes, you'll also need to change that table
name in the first line of the code you revised in cmsAdmin/lib/menus/default/list.php
Look for the code:
Change the table name listing_pages to the name of your table.
___________________________________________________________________
TROUBLESHOOTING:
If things don't seem to work correctly:
1) Make sure that you've upgraded to at least the required CMSB version 2.12, then test the plugins
again.
2) Make sure that your 2 temp directories are writeable (permission 755). Test again.
3) Make sure you didn't miss one of the steps during the installation and test again.
4) Make sure that all of your table names and field names are spelled correctly and retest.
5) Temporarily disable all other plugins (except the 4 required) and test again.
If the Advanced QR and Zip plugins work correctly after step 5, add your plugins back one by one and
check again after each one.
If you find a particular plugin that is causing the issue, see if you can isolate the code that's causing the
problem.
Remember that in a plugin, nothing (not even a blank line or space) can precede the"Plugin Name"
through "Requires at least" code block.
___________________________________________________________________
end of file