The Poetics Of Coding

I was trying to call my component model to plugin.

JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_idlmessaging/models','IdlmessagingModel');
$questionmodel = JModelLegacy::getInstance('Question', 'IdlmessagingModel');

But was facing with error “Call to a member function on boolean ”

So the simple solution is you have to import your component tables from administrator too by using

$questionmodel->addTablePath(JPATH_ADMINISTRATOR . '/components/com_idlmessaging/tables');

So full code will be

JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_idlmessaging/models','IdlmessagingModel');
$questionmodel = JModelLegacy::getInstance('Question', 'IdlmessagingModel');
$questionmodel->addTablePath(JPATH_ADMINISTRATOR . '/components/com_idlmessaging/tables');


I am a freelancer and have a startup at my house situated at Fort Abbas (Bahawalnagar).
In last days I was in need to hire few guys so can expand my setup, nearest university is IUB (The Islamia University Bahawalpur). So scheduled an interview with few students, was astonished after knowing that they not know PHP, HTML5 and other modern technologies of web.
So I decided to check the University syllabus.
University is taking Web Programming as Paper 4 under title “Introduction to web programming”.

They are still teaching HTML4.0 and HTML5 was launched at 16 September 2014.

For Frontend Development

they are teaching “VB Scripting”, and you know all modern browsers Firefox, Chrome, safari and even Microsoft new browser IE11 Edge not supporting this.
VBScript is no longer supported in IE11 edge mode
So how a student that learn this, definitely they need old browsers with old version of windows OR they will just prepare for paper without knowing the use or writing programs.
All the modern frontend programming is in Javascript.

For Backend Development

University is teaching Simple ASP, and book recommend is “Mastering Active Server Pages by A. Russell Jones”
Check here on Amazon, book latest version was written in 2000, also check rating of this book.
So it’s not ASP.NET they are teaching old one.

It is mandatory to work with VB Script, ASP and MS Access to complete a project.
Most of the current hosting companies not supporting MS Access with ASP. So how a student can get benefit from his/her project. So they mostly submit a project provided by the college.

This is just one aspect or one paper, I am sure condition with others will be same.

So my question is how a college graduate can get a job in this scenario, or can compete market.

Just add

<referenceBlock name="" remove="true"/>

at the end just before in default.xml

Over on our new server I was trying to make magmi password protected. Magmi directory was accessible before setting .htaccess password protection.
After that magento started showing 404 and on my site 404 was set to home page.

So there was 2 task, first we have to stop apache rewrite on this directory, second in case of authentication failier have to shown a 401 message or page.

ErrorDocument 401 “Unauthorized Access”
RewriteEngine off

After that your normal authentication code

AuthType Basic
AuthName “Administration”
AuthUserFile “/home/user/admin/.htpasswd/magmi/web/passwd”
require valid-user

Just make sure that path of AuthUserFile is correct and “passwd” file exists with user,pass information.

Hope it will give you some comfort 🙂

You have to edit src in embedded iframe, mostly we got code just like this

Just add “?title=0&byline=0&portrait=0″ at the end of src link
src will look like src=”; and whole embedded code will look like this

Amazon API documentation is good, but it’s really hard to understand the timestamp and signature things, it’s really takes all my time to understand how i can create signature for my request. There was no clear idea. Second thing is versions of it’s API, you couldn’t get idea what will work in which version.
Any how let’s check how we can show amazon’s product reviews on mangento product page.

1. First you have to get your API AWSAccessKeyId, AWSSecretKey
2. Create a custom attributes to enter ASIN number of the product, for which we will show reviews.
3. I am going to show reviews in reivew tab on product page.
Use the following code.

$product_id = $this->getProduct()->getId();
$_product = Mage::getModel('catalog/product')->load($product_id);
$product_asin = $_product->getData('asin');
	$AWSAccessKeyId   = "**************";
    $SecretAccessKey = "*****************";
    $AssociateTag    = "laptopbattery";

    $ItemId = $product_asin; //10 or 13 digit isbn
    $Timestamp = gmdate("Y-m-d\TH:i:s\Z");
    $Timestamp = str_replace(":", "%3A", $Timestamp);
    $ResponseGroup = "Reviews";
    $ResponseGroup = str_replace(",", "%2C", $ResponseGroup);

    $String = "AWSAccessKeyId=$AWSAccessKeyId&AssociateTag=$AssociateTag&IdType=ASIN&ItemId=$ItemId&Operation=ItemLookup&ResponseGroup=$ResponseGroup&Service=AWSECommerceService&Timestamp=$Timestamp&Version=2011-08-01";

    $String = str_replace("\n", "", $String);

    $Prepend = "GET\\n/onca/xml\n";
    $PrependString = $Prepend . $String;

    $Signature = base64_encode(hash_hmac("sha256", $PrependString, $SecretAccessKey, True));

    $Signature = str_replace("+", "%2B", $Signature);
    $Signature = str_replace("=", "%3D", $Signature);

    $BaseUrl = "";
   	$SignedRequest = $BaseUrl . $String . "&Signature=" . $Signature;

    $xml  = simplexml_load_file($SignedRequest);
	$iframurl = $xml->Items->Item->CustomerReviews->IFrameURL;
	echo '<iframe src="'.$iframurl.'" width="100%" style="border:0; height:1000px"></iframe>';



Mostly facing issues while installing magento2 are missing extensions.
and dreamhost will definitely give little tough time, but if you are well known with dreamhost it will not cost much
Below is the picture of my missing extension on dreamhost php5.6
magento2 extensions missing

so just login to your FTP and open “php” directory which should be on your top root.

dreamhost phprc

dreamhost phprc

just add missing extension in this file
always_populate_raw_post_data = -1

Now you have to give server a refresh, if you are familiar with SSH that is very good. otherwise simply restart server from your panel
after login to SSH (if you are on windows you can use putty for this connection, and your login users should be set as ca be login as ssh in your panel)
and run this command
killall -9 php56.cgi (for php 5.6)
killall -9 php55.cgi (for php 5.5)
that’s is now everything should work on the go.

Next error will be the MySql version “That’s the thing that Dreamhost can only be solve”. Magento 2 required MySql5.6.x and Dreamhost still runing 5.2.x

%d bloggers like this: