nycran-blog
nycran-blog
Andy's Coding Notes
9 posts
Don't wanna be here? Send us removal request.
nycran-blog · 12 years ago
Text
HTML5 video not playing on an ipad when inside a colorbox window
There's a known bug where HTML5 video will not play on an iPad when you embed it within a colorbox window.  The video appears, but tapping the play button does nothing.  The fix that works for me is unfathomable but that's life eh?  Hope this helps someone.
// catch the event that fires when colorbox has opened and completed rendering the contents         $(document).bind("cbox_complete", function() {             // Get the HTML that encapsulates the video object in the colourbox window.             var video_html = $("#cboxLoadedContent").html();                         // Clear the colourbox content entirely             $("#cboxLoadedContent").html("");             // And put it back in again.  Why this works is beyond reason.             $("#cboxLoadedContent").html(video_html);         });
0 notes
nycran-blog · 12 years ago
Text
PHP $_POST Arrray blank - Amazon Web Services -.htaccess
If you're using Amazon EC2 and your find that your $_POST array is blank when you're using mod_rewrite, you need to issue:
sudo a2enmod rewrite
As root user.
Then restart the web server.
Thanks for this wonderfully intuitive setting Amazon.
0 notes
nycran-blog · 14 years ago
Text
Installing the ChildBrowser plugin for Phonegap / iOS
A few things:
1. When you add the plugin folder to the XCode plugins directory, make sure you select the "Group" option, not the reference option.
2. You need to open the Phonegap.plist file, and add the following plist item where the extensions are listed:
Left: ChildBrowserCommand Right: ChildBrowserCommand
3. Make sure you call var cb = ChildBrowser.install();
into the phonegap DeviceReady event.
0 notes
nycran-blog · 14 years ago
Text
CodeIgniter 2, SWFUpload and Internet Explorer
If you're using SWFUpload (a flash based file uploader) with code igniter you might encounter a problem where the flash player does not send the CI session cookies back to CI properly when uploading a file, and thus the user is logged out after the upload.
The solution is to stop the session script from running at all when the user agent is 'shockwave'.
I added this to the CI_Session class
if (stristr($this->CI->input->user_agent(),'shockwave')) return;
just after line 102.
This isn't fabulous as it creates a security hole, but it works.
0 notes
nycran-blog · 14 years ago
Text
Magento Installation Notes
Set file permissions
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
chmod o+w var var/.htaccess includes includes/config.php app/etc
chmod 550 pear
chmod 550 mage #for magento 1.5+
chmod -R o+w media
chmod -R o+w var
Remember to copy in .htaccess file from a working project (Politix)
Change base url settings in core_config_data mysql table
If you need to gain access to the admin zone, just change the email address to your own and then follow the password reset routine.
4 notes · View notes
nycran-blog · 14 years ago
Text
MySQL Delete Trigger Syntax
CREATE TRIGGER delete_address BEFORE DELETE ON nc_articles FOR EACH ROW DELETE FROM nc_address WHERE address_type = 'article' AND foreign_id = OLD.article_id;
45 notes · View notes
nycran-blog · 14 years ago
Text
Interspire - Adding new text fields to products in the CMS
To add new fields into Interspire's product details page in the CMS
1. Add your fields into mysql.
2. Add the new fields into lib/entities/entity.product.php
3. Add the extra fields into admin/templates/product.form.tpl as required. 4. Add extra fields into admin/includes/classses/class.product.php EditProductStep1 (circa line 4045) _GetProductData (circa line 1286)
0 notes
nycran-blog · 14 years ago
Text
Interspire Multiple WYSIWYG editors
The problem is that when Interspire includes multiple editors, multiple tinyMCE.init javascript calls are made, which seems to confuse TinyMCE. The correct way of including multiple editors is to have a single .init call, passing in the names of all of the textareas to make editors into the 'elements' parameter. So here's what I did: $GLOBALS['WYSIWYG'] = GetClass('ISC_ADMIN_EDITOR')->GetWysiwygEditor($wysiwygOptions); $GLOBALS['WYSIWYG2'] = GetClass('ISC_ADMIN_EDITOR')->DrawPlainTextEditor($wysiwygOptions2); $GLOBALS['WYSIWYG3'] = GetClass('ISC_ADMIN_EDITOR')->DrawPlainTextEditor($wysiwygOptions3); Note the first call makes just 1 WYSIWYG field, and the other two are rendered as just text fields. Next, I modified admin/templates/Snippets/EditorTinyMCECommon.html so elements : "{{ WysiwygId|safe }}", was changed to elements : "{{ WysiwygId|safe }},wysiwyg2,wysiwyg3",
24 notes · View notes
nycran-blog · 14 years ago
Text
Interspire Page Caching and Datastore
When adding new fields to the pages table, you may want to access these fields in your code, say in the PagesMenu display include for example. To do this, add the new fields into lib/class.datastore.php
and then edit and save a page in the CMS.  This will cause the cache to update with the new fields and values and you can then access them in code.
15 notes · View notes