.

.

Call Any block Or Extension in any Page in Magento



Here I am  using my left navigation extension in home Page.
I  call Extension block in Home page layout . For Home Page we  will edit in local.xml .
Firstly Find Out the block where we used & call it any layout where you want
Like Our Extension block is this :-
<block type="sidenav/navigation" name="codnitive.home.sidenav.content.top" as="codnitiveSidenavContent" before="slider">
                <action method="setTemplate" modules="codnitivecatalog/sidenav/">
                    <template>codnitive/sidenav/navigation.phtml</template>
                </action>
            </block>


Now we put this block in Home Page . So we have to change in  local.xml
Suppose this is  home  page layout here we add left navigation in index reference & before content & before slider so call it just like this in xml File .
Themename/default/layout/local.xml

local.xml


<cms_index_index>
        <reference name="root">
<block type="sidenav/navigation" name="codnitive-home-side-nav" as="codnitive-home-side-nav" before="slider" template="codnitive/sidenav/navigation.phtml">            
            </block>                                              
               
            <!-- define the block slider -->
            <block type="cms/block" name="slider" as="slider" translate="label" before="content" after="codnitive-home-side-nav">
                <action method="setBlockId"><block_id>home-carousel</block_id></action>
            </block>                                                 
                                                                            
        </reference>                                        
        <reference name="left">
            <block type="catalog/navigation" before="-" name="leftNav" as="leftNav" template="catalog/navigation/leftnav.phtml"/>
        </reference>
        <reference name="content">
            <block type="cms/block" name="home-slider-below-banner" before="-" after="slider">
               <action method="setBlockId"><block_id>home-block-below-slider</block_id></action>
           </block>                                               
                                                                                               
        </reference>
    </cms_index_index>
Now this  navigation block call in .phtml file . Here For Home Page Cms we call 1 column layout.
So we call it in theme name/template/page/html.1column.phtml 
Like this
<?php
// call codinative slider
//call block name
echo $this->getChildHtml('codnitive-home-side-nav');

?>

Get Blog Post Outsite Wordpress


<?php
   require 'blog/wp-load.php';  
   ?>
<?php
//instantiate a WP_Query and get the latest 10 posts
$wp_query = new \WP_Query();
$wp_query->query('showposts=3');
?>
<?php
//Iterate through the returned posts. The starts the WP "Loop"
while ($wp_query->have_posts()) :
  $wp_query->the_post();
?>
<a href="<?php the_permalink() ?>" target="_blank">
                  <?php the_title(); ?>
                  </a>
<?php if(has_post_thumbnail())
              {?>
<a href="<?php the_permalink() ?>" target="_blank"><img src="<?php echo the_post_thumbnail_url('large'); ?>" style="width:100%;" ></a>
                <?php }?>
<?php //$authorId = the_author_ID();
              
                $args = get_avatar_data(the_author_ID(),'' );
               
      $imgurl= $args['url'];
     
      ?>
                    <img src="<?php echo $imgurl; ?>" style="border-radius:100%;width:80px;height:80px;z-index:999;margin-left:-15px !important;" align="middle">
                    <h3><?php echo ucwords(get_author_name());?></h3>
<?php the_time( get_option( 'date_format' ) ); ?>
  <p> <a href="<?php comments_link(); ?>">
    Leave a Comment
</a></p>

Facebook Login in magento programattically

<?php
//header("Content-Type: application/json");
require_once 'app/Mage.php';
//facebook
require_once 'app/code/community/Inchoo/SocialConnect/controllers/FacebookController.php';
require_once 'app/code/community/Inchoo/SocialConnect/Helper/Facebook.php';
require_once 'app/code/community/Inchoo/SocialConnect/Model/Facebook/Client.php';
require_once 'app/code/community/Inchoo/SocialConnect/Model/Facebook/Userinfo.php';

Mage::app('default');  
Mage::getSingleton("core/session", array("name" => "frontend"));
$data=array();

if($_REQUEST['facebookId']=='')
{
    $data['responseCode']='0';
    $data['msg']='Please Enter Facebook Id';
    echo json_encode($data);
return;
}
else
{
    $facebookId=$_REQUEST['facebookId'];  
}

if($_REQUEST['firstName']=='')
{
    $data['responseCode']='0';
    $data['msg']='Please Enter FirstName';
    echo json_encode($data);
return;
    }
else
{
$firstName=$_REQUEST['firstName'];  
}

if($_REQUEST['lastName']=='')
{
    $data['responseCode']='0';
    $data['msg']='Please Enter LastName';
    echo json_encode($data);
return;
    }
    else
    {
      
$lastName=$_REQUEST['lastName'];          
        }


if($_REQUEST['email']=='')
{
    $data['responseCode']='0';
    $data['msg']='Please Enter Email';
    echo json_encode($data);
return;
    }
    else
    {
        $email=$_REQUEST['email'];
      
        }


if($_REQUEST['token']=='')
{
    $data['responseCode']='0';
    $data['msg']='Please Enter Token';
    echo json_encode($data);
return;
}
else
{
    $token=$_REQUEST['token'];
}

if($firstName!='' && $lastName!='' && $email!=''  && $facebookId!='')
{
    // start here facebook code
  
               // Facebook API green light - proceed
            $client = Mage::getSingleton('inchoo_socialconnect/facebook_client');

          
          //$token = $client->getAccessToken();
          $token=$token;

            $customersByFacebookId = Mage::helper('inchoo_socialconnect/facebook')->getCustomersByFacebookId($facebookId);
            //print_r($customersByFacebookId);
      $customersByFacebookId->count();
            if(Mage::getSingleton('customer/session')->isLoggedIn()) {
                // Logged in user
                if($customersByFacebookId->count()) {
                    // Facebook account already connected to other account - deny
                    Mage::getSingleton('core/session')
                        ->addNotice('Your Facebook account is already connected to one of our store accounts.');
                        $data['responseCode']='1';
                        $data['msg']='Your Facebook account is already connected to one of our store accounts';
                        echo json_encode($data);
                    return;
                }

                // Connect from account dashboard - attach
                $customer = Mage::getSingleton('customer/session')->getCustomer();

                Mage::helper('inchoo_socialconnect/facebook')->connectByFacebookId($customer,$facebookId,$token);

                Mage::getSingleton('core/session')->addSuccess('Your Facebook account is now connected to your store accout. You can now login using our Facebook Connect button or using store account credentials you will receive to your email address.');
              
$data['responseCode']='1';
                        $data['msg']='Your Facebook account is now connected to your store accout. You can now login using our Facebook Connect button or using store account credentials you will receive to your email address';

echo json_encode($data);
                return;
            }

            if($customersByFacebookId->count()) {
                // Existing connected user - login
                $customer = $customersByFacebookId->getFirstItem();

                Mage::helper('inchoo_socialconnect/facebook')->loginByCustomer($customer);

                Mage::getSingleton('core/session')
                    ->addSuccess('You have successfully logged in using your Facebook account.');

$data['responseCode']='1';
                        $data['msg']='You have successfully logged in using your Facebook account';

echo json_encode($data);

                return;
            }

            $customersByEmail = Mage::helper('inchoo_socialconnect/facebook')->getCustomersByEmail($email);

            if($customersByEmail->count()) {              
                // Email account already exists - attach, login
                $customer = $customersByEmail->getFirstItem();
              
                Mage::helper('inchoo_socialconnect/facebook')->connectByFacebookId($customer,$facebookId,$token);

                Mage::getSingleton('core/session')->addSuccess('We have discovered you already have an account at our store. Your Facebook account is now connected to your store account.');
                $data['responseCode']='1';
                $data['msg']='We have discovered you already have an account at our store. Your Facebook account is now connected to your store account';
                echo json_encode($data);

                return;
            }

            // New connection - create, attach, login
            if(empty($firstName)) {
                throw new Exception('Sorry, could not retrieve your Facebook first name. Please try again.');
                $data['responseCode']='0';
                $data['msg']='Sorry, could not retrieve your Facebook first name. Please try again';
                echo json_encode($data);
                return;
              
            }

            if(empty($lastName)) {
                throw new Exception('Sorry, could not retrieve your Facebook last name. Please try again.');
                $data['responseCode']='0';
                $data['msg']='Sorry, could not retrieve your Facebook last name. Please try again';
                echo json_encode($data);
                return;
            }

            Mage::helper('inchoo_socialconnect/facebook')->connectByCreatingAccount($email,$firstName,$lastName,$userInfo->id,$token);

            Mage::getSingleton('core/session')->addSuccess('Your Facebook account is now connected to your new user accout at our store. Now you can login using our Facebook Connect button or using store account credentials you will receive to your email address.');
            $data['responseCode']='1';
            $data['msg']='Your Facebook account is now connected to your new user accout at our store. Now you can login using our Facebook Connect button or using store account credentials you will receive to your email address';
            echo json_encode($data);
            return;
//end here facebook code
  
    }
  
    else
    {
        $data['responseCode']='0';
        $data['msg']='Please Enter Appropriate Fields';
        echo json_encode($data);
return;      
        }
  
 ?>

Twitter Login from outside in magento programattically

<?php
require_once 'app/Mage.php';

//twitter
require_once 'app/code/community/Inchoo/SocialConnect/controllers/TwitterController.php';
require_once 'app/code/community/Inchoo/SocialConnect/Helper/Twitter.php';
require_once 'app/code/community/Inchoo/SocialConnect/Model/Twitter/Client.php';
require_once 'app/code/community/Inchoo/SocialConnect/Model/Twitter/Userinfo.php';
Mage::app('default');  
Mage::getSingleton("core/session", array("name" => "frontend"));
?>
<?php
$data=array();

//get twitterid

  $twitterid = $_REQUEST['twitId'];
if($twitterid=='')
{
    $data['responseCode']='0';
    $data['msg']='Please Enter Twitter Id';
    echo json_encode($data);
return;
}


// get first name & last name

$fullname= $_REQUEST['fullName'];
//print_r($fullname);
 $fname = $fullname[0];

if($fname=='')
{
    $data['responseCode']='0';
    $data['msg']='Please Enter FirstName';
    echo json_encode($data);
return;
    }
  
 $lastname = $fullname[1];
if($lastname=='')
{
    $data['responseCode']='0';
    $data['msg']='Please Enter LastName';
    echo json_encode($data);
return;
    }



// get token
  $token=$_REQUEST['token'];

if($token=='')
{
    $data['responseCode']='0';
    $data['msg']='Please Enter Token';
    echo json_encode($data);
return;
}


//start for email by screen Name
$screen_name=$_REQUEST['screenName'];
  $email = sprintf('%s@twitter-user.com', strtolower($screen_name));

//end for email by screen Name

if($fname!='' && $lastname!=''  && $token!='' && $twitterid!='')
{
    // start here twitter code
  
    //$client = Mage::getSingleton('inchoo_socialconnect/twitter_client');
    //print_r($clientnew);

      //$token = $client->getAccessToken();
      
       /* $userInfo = (object) array_merge(
                (array) ($userInfo = $client->api('/account/verify_credentials.json', 'GET', array('skip_status' => true))),
                array('email' => sprintf('%s@twitter-user.com', strtolower($userInfo->screen_name)))
        );
*/
        $customersByTwitterId = Mage::helper('inchoo_socialconnect/twitter')->getCustomersByTwitterId($twitterid);
      
      

        if(Mage::getSingleton('customer/session')->isLoggedIn()) {          
      
            // Logged in user
            if($customersByTwitterId->count()) {
                // Twitter account already connected to other account - deny
                Mage::getSingleton('core/session')->addNotice('Your Twitter account is already connected to one of our store accounts.');
              
                    $data['responseCode']='1';
                  
                    $data['msg']='Your Twitter account is already connected to one of our store accounts';
                    $data['id']=Mage::getSingleton('core/session')->getCustomer()->getId();
echo json_encode($data);
                return;
            }
            // Connect from account dashboard - attach
            $customer = Mage::getSingleton('customer/session')->getCustomer();
           Mage::helper('inchoo_socialconnect/twitter')->connectByTwitterId($customer,$twitterid,$token);
/*         
 Mage::getSingleton('core/session')->addSuccess('Your Twitter account is now connected to your store accout. You can now login using our Twitter Connect button or using store account credentials you will receive to your email address.');*/
            $data['responseCode']='1';
            $data['msg']='Your Twitter account is now connected to your store accout. You can now login using our Twitter Connect button or using store account credentials you will receive to your email address';
            $data['id']=$customer->getId();          
echo json_encode($data);
            return;
        }

        if($customersByTwitterId->count()) {
            // Existing connected user - login
            $customer = $customersByTwitterId->getFirstItem();

           $twittcustomer = Mage::helper('inchoo_socialconnect/twitter')->loginByCustomer($customer);

            Mage::getSingleton('core/session')->addSuccess('You have successfully logged in using your Twitter account.');
          
            $data['responseCode']='1';
            $data['msg']='You have successfully logged in using your Twitter account';
            $data['id']=$customer->getId();
             echo json_encode($data);          

            return;
        }

        $customersByEmail = Mage::helper('inchoo_socialconnect/twitter')->getCustomersByEmail($email);

        if($customersByEmail->count()) {
            // Email account already exists - attach, login
            $customer = $customersByEmail->getFirstItem();

           $twittcustomer= Mage::helper('inchoo_socialconnect/twitter')->connectByTwitterId($customer,$twitterid,$token);

            Mage::getSingleton('core/session')->addSuccess('We have discovered you already have an account at our store. Your Twitter account is now connected to your store account.');
            $data['responseCode']='1';
            $data['msg']='We have discovered you already have an account at our store. Your Twitter account is now connected to your store account';
            //$data['id']=Mage::getSingleton('core/session')->getCustomer->getId();
            echo json_encode($data);
            return;
        }

        // New connection - create, attach, login
        if(empty($fname)) {
            throw new Exception('Sorry, could not retrieve your Twitter last name. Please try again.');
            $data['responseCode']='0';
            $data['msg']='Sorry, could not retrieve your Twitter last name. Please try again';
            echo json_encode($data);
        }

        Mage::helper('inchoo_socialconnect/twitter')->connectByCreatingAccount($email,$fname,$twitterid,$token);
        Mage::getSingleton('core/session')->addSuccess('Your Twitter account is now connected to your new user accout at our store.');             
        Mage::getSingleton('core/session')->addNotice(sprintf('Since Twitter doesn\'t support third-party access to your email address, we were unable to send you your store accout credentials. To be able to login using store account credentials you will need to update your email address and password using our <a href="%s">Edit Account Information</a>.'), Mage::getUrl('customer/account/edit'));       
        $data['responseCode']='0';
        $data['msg']='Your Twitter account is now connected to your new user accout at our store.Since Twitter doesn\'t support third-party access to your email address, we were unable to send you your store accout credentials. To be able to login using store account credentials you will need to update your email address and password';     
     echo json_encode($data);
          
            return;
  
    //end here twitter code
  
    }
  
    else
    {
        $data['responseCode']='0';
        $data['msg']='Please Enter Appropriate Fields';
        echo json_encode($data);
return;      
        }
  
  
  

 ?>

Google Login from Outside in magento Programattically


I used Inchoo Social Login Extension in Magento For My web Application. And also I need social login webservices For my magento android app. Here I have done webservices for Google login By using Inchoo Social Extension.

<?php
require_once 'app/Mage.php';
require_once 'app/code/community/Inchoo/SocialConnect/controllers/GoogleController.php';
require_once 'app/code/community/Inchoo/SocialConnect/Helper/Google.php';
require_once 'app/code/community/Inchoo/SocialConnect/Model/Google/Client.php';
require_once 'app/code/community/Inchoo/SocialConnect/Model/Google/Userinfo.php';

//facebook
require_once 'app/code/community/Inchoo/SocialConnect/controllers/FacebookController.php';
require_once 'app/code/community/Inchoo/SocialConnect/Helper/Facebook.php';
require_once 'app/code/community/Inchoo/SocialConnect/Model/Facebook/Client.php';
require_once 'app/code/community/Inchoo/SocialConnect/Model/Facebook/Userinfo.php';

Mage::app('default');   
Mage::getSingleton("core/session", array("name" => "frontend"));
$data=array();

$googleid = $_REQUEST['googleid'];
if($googleid=='')
{
    $data['responseCode']='0';
    $data['msg']='Please Enter Google Id';
    echo json_encode($data);
return;
}

// get first name & last name

 $gname=$_REQUEST['fullname'];
//print_r($gname);
 $fullname= explode(' ',$gname);

 $firstname = $fullname[0];
if($firstname=='')
{
    $data['responseCode']='0';
    $data['msg']='Please Enter FirstName';
    echo json_encode($data);
return;
    }
   
 $lastname = $fullname[1];
if($lastname=='')
{
    $data['responseCode']='0';
    $data['msg']='Please Enter LastName';
    echo json_encode($data);
return;
    }

//get Email Id
 $email=$_REQUEST['email'];
if($email=='')
{
    $data['responseCode']='0';
    $data['msg']='Please Enter Email';
    echo json_encode($data);
return;
    }

// get token

 $token1=str_replace('.','',$_REQUEST['token']);
$token2=str_replace("'","",$token1);
$token=str_replace(",","",$token2);


if($token=='')
{
    $data['responseCode']='0';
    $data['msg']='Please Enter Token';
    echo json_encode($data);
return;
}

if($firstname!='' && $lastname!='' && $email!='' && $token!='' && $googleid!='')
{
    // start here google code
   
     // Google API green light - proceed
            $client = Mage::getSingleton('inchoo_socialconnect/google_client');

            //$userInfo = $client->api('/userinfo');
            //$token = $client->getAccessToken();
            $token=$token;

            $customersByGoogleId = Mage::helper('inchoo_socialconnect/google')->getCustomersByGoogleId($googleid);

            if(Mage::getSingleton('customer/session')->isLoggedIn()) {
                // Logged in user
                if($customersByGoogleId->count()) {
                    // Google account already connected to other account - deny
                    Mage::getSingleton('core/session')->addNotice('Your Google account is already connected to one of our store accounts.');
                    $data['responseCode']='1';
                    $data['msg']='Your Google account is already connected to one of our store accounts';
echo json_encode($data);
return;
          
                }

                // Connect from account dashboard - attach
                $customer = Mage::getSingleton('customer/session')->getCustomer();

                Mage::helper('inchoo_socialconnect/google')->connectByGoogleId($customer,
                    $googleid,
                    $token
                );

                Mage::getSingleton('core/session')->addSuccess('Your Google account is now connected to your store accout. You can now login using our Google Connect button or using store account credentials you will receive to your email address.');
               
$data['responseCode']='1';
$data['msg']='Your Google account is now connected to your store accout. You can now login using our Google Connect button or using store account credentials you will receive to your email address';

echo json_encode($data);
return;
             
            }

            if($customersByGoogleId->count()) {
               
                // Existing connected user - login
                $customer = $customersByGoogleId->getFirstItem();

                Mage::helper('inchoo_socialconnect/google')->loginByCustomer($customer);

                Mage::getSingleton('core/session')->addSuccess('You have successfully logged in using your Google account.');
                $data['responseCode']='1';
                $data['msg']='You have successfully logged in using your Google account';
echo json_encode($data);
return;               
            }

            $customersByEmail = Mage::helper('inchoo_socialconnect/facebook')
                ->getCustomersByEmail($email);

            if($customersByEmail->count())  {
                // Email account already exists - attach, login
                $customer = $customersByEmail->getFirstItem();
               
                Mage::helper('inchoo_socialconnect/google')->connectByGoogleId(
                    $customer,
                    $googleid,
                    $token
                );

                Mage::getSingleton('core/session')->addSuccess('We have discovered you already have an account at our store. Your Google account is now connected to your store account.');
                $data['responseCode']='1';
                $data['msg']='We have discovered you already have an account at our store. Your Google account is now connected to your store account';
echo json_encode($data);
return;              
            }
                       

            // New connection - create, attach, login
            if(empty($firstname)) {
                throw new Exception('Sorry, could not retrieve your Google first name. Please try again.'
                );
                $data['responseCode']='0';
                $data['msg']='Sorry, could not retrieve your Google first name. Please try again';
                echo json_encode($data);
return;
            }

            if(empty($lastname)) {
                throw new Exception('Sorry, could not retrieve your Google last name. Please try again.'
                );
               
                $data['responseCode']='0';
                $data['msg']='Sorry, could not retrieve your Google last name. Please try again';
                echo json_encode($data);
return;
            }

            Mage::helper('inchoo_socialconnect/google')->connectByCreatingAccount($email,$firstname,$lastname,$googleid,            $token );

            Mage::getSingleton('core/session')->addSuccess('Your Google account is now connected to your new user accout at our store. Now you can login using our Google Connect button or using store account credentials you will receive to your email address.');
   
    $data['responseCode']='1';
    $data['msg']='Your Google account is now connected to your new user accout at our store. Now you can login using our Google Connect button or using store account credentials you will receive to your email address';
   
    echo json_encode($data);
return;
       
    //end here google code   
    }
   
    else
    {
        $data['responseCode']='0';
        $data['msg']='Please Enter Appropriate Fields';
        echo json_encode($data);
return;       
        }

 ?>

Unknown collation: 'utf8mb4_unicode_ci' Cpanel

I have a wordpress database on my local machine that I want to transfer to a hosted phpMyAdmin on Cpanel. However when I try to import the database into the environment, I keep getting this error.

#1273 - Unknown collation: 'utf8mb4_unicode_ci' 

Solution : This can be solved by running a PHP script. Save this code to a file and run it entering the database name, user and password and it'll change the collation from utf8mb4/utf8mb4_unicode_ci to utf8/utf8_general_ci
<!DOCTYPE html>
<html>
<head>
  <title>DB-Convert</title>
  <style>
    body { font-family:"Courier New", Courier, monospace;" }
  </style>
</head>
<body>
<h1>Convert your Database to utf8_general_ci!</h1>
<form action="db-convert.php" method="post">
  dbname: <input type="text" name="dbname"><br>
  dbuser: <input type="text" name="dbuser"><br>
  dbpass: <input type="text" name="dbpassword"><br>
  <input type="submit">
</form>
</body>
</html>
<?php
if ($_POST) {
  $dbname = $_POST['dbname'];
  $dbuser = $_POST['dbuser'];
  $dbpassword = $_POST['dbpassword'];
  $con = mysql_connect('localhost',$dbuser,$dbpassword);
  if(!$con) { echo "Cannot connect to the database ";die();}
  mysql_select_db($dbname);
  $result=mysql_query('show tables');
  while($tables = mysql_fetch_array($result)) {
          foreach ($tables as $key => $value) {
           mysql_query("ALTER TABLE $value CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci");
     }}
  echo "<script>alert('The collation of your database has been successfully changed!');</script>";
}

?>


Rewrite URL after redirecting 404 / 500 error htaccess


.htaccess is a configuration file for use on web servers running the Apache Web 
Server software. When a .htaccess file is placed in a directory which is in turn 
'loaded via the Apache Web Server', then the .htaccess file is detected and executed
 by the Apache Web Server software. 
These .htaccess files can be used to alter the configuration of the Apache Web Server
 software to enable/disable additional functionality and features that the Apache
 Web Server software has to offer. These facilities include basic redirect 
functionality, for instance if a 404 file not found error occurs, or for more
advanced functions such as content password protection or image hot link prevention.
 
 
ErrorDocument 404 http://example.com/404/
ErrorDocument 500 http://example.com/500/
# or map them to one error document:
# ErrorDocument 404 /pages/errors/error_redirect.php
# ErrorDocument 500 /pages/errors/error_redirect.php

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^/404/$
RewriteRule ^(.*)$ /pages/errors/404.php [L]

RewriteCond %{REQUEST_URI} ^/500/$
RewriteRule ^(.*)$ /pages/errors/500.php [L]

# or map them to one error document:
#RewriteCond %{REQUEST_URI} ^/404/$ [OR]
#RewriteCond %{REQUEST_URI} ^/500/$
#RewriteRule ^(.*)$ /pages/errors/error_redirect.php [L]

 

Display Currency Code Or Symbol in invoice pdf without changing core files

1.Download font that support Any Symbol Like  Indian Rupee symbol. recommended dejavu-sans font.
http://dejavu-fonts.org/wiki/Download
https://sourceforge.net/projects/dejavu/files/dejavu/2.36/dejavu-sans-ttf-2.36.zip/download

2.Place the font in lib directory(projectname/lib).

3.open app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php and app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php

copy paste both files under local
a) app/code/local/Mage/Sales/Model/Order/Pdf/Abstract.php b) app/code/loacl/Mage/Sales/Model/Order/Pdf/Items/Abstract.php

and replace

$font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/LinLibertineFont/LinLibertine_Re-4.4.1.ttf');

with

$font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . '/lib/dejavu-sans/DejaVuSans.ttf');

(in _setFontRegular(), _setFontBold(), _setFontItalic() functions in both files.)

Admin -> System --> Manage Currency -->Symbols --> Copy your symbol and save.

Magento Code Pool

Magento has three code pools:
community
core
local
Core: It contains all Magento default modules
Community and local: We use these code pools for our custom module development.

app/code/core - Holds modules that are distributed with the base Magento and make up the core functionality.
app/code/community - Holds modules that are developed by third-parties
app/code/local - Holds custom modules you developed, including Mage code overrides.
Magento use two code pool for our customization
Magento actually uses three code pools. It will load local first, community second, and core third. It uses three for organization purposes and to help solve issues when two+ 3rd party extensions are trying to rewrite the same thing.
Magento don't use single code pool for customization.
It was done this was to try to have some code organization. Also, when you have 3rd party conflicts, the local is great to help solve those issues. The local is also great to have extensions that only that site will ever have.