The Poetics Of Coding

I was using “wp-bootstrap-navwalker”, but on each new project have to install this class, and most of the time face bugs.
So decided to use any new way, and get and idea to use jQuery to add required Bootstrap class to simple WordPress menu.

Below is the code that can give a magic.

   $('#menu-main-menu').addClass('nav navbar-nav navbar-center').attr('data-in','fadeInDown').attr('data-out','fadeOutUp');
      $('#menu-main-menu li').addClass('dropdown');
   $('#menu-main-menu li a').attr('class','dropdown-toggle').attr('data-toggle','dropdown');
   $('#menu-main-menu li ul').removeClass('sub-menu').addClass('dropdown-menu');
   $('#menu-main-menu li ul li a').removeAttr('class').removeAttr('data-toggle');

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>';


%d bloggers like this: