snipt

Ctrl+h for KB shortcuts

PHP

Echo out Name of the user - Magento

1
2
3
4
5
6
7
8
<?php 
    $session = Mage::getSingleton('customer/session');
        if($session->isLoggedIn()) {
        $customer = $session->getCustomer();
        echo $customer->getName();
        echo $customer->getFirstname();
    }
?>
https://snipt.net/embed/a884fcc3cd90a8172d55180eece89d35/
/raw/a884fcc3cd90a8172d55180eece89d35/
a884fcc3cd90a8172d55180eece89d35
php
PHP
8
2019-06-26T14:20:08
True
False
False
Nov 21, 2013 at 03:03 AM
/api/public/snipt/95705/
echo-out-name-of-the-user-magento
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a> <span class="nv">$session</span> <span class="o">=</span> <span class="nx">Mage</span><span class="o">::</span><span class="na">getSingleton</span><span class="p">(</span><span class="s1">&#39;customer/session&#39;</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a> <span class="k">if</span><span class="p">(</span><span class="nv">$session</span><span class="o">-&gt;</span><span class="na">isLoggedIn</span><span class="p">())</span> <span class="p">{</span> </span><span id="L-4"><a name="L-4"></a> <span class="nv">$customer</span> <span class="o">=</span> <span class="nv">$session</span><span class="o">-&gt;</span><span class="na">getCustomer</span><span class="p">();</span> </span><span id="L-5"><a name="L-5"></a> <span class="k">echo</span> <span class="nv">$customer</span><span class="o">-&gt;</span><span class="na">getName</span><span class="p">();</span> </span><span id="L-6"><a name="L-6"></a> <span class="k">echo</span> <span class="nv">$customer</span><span class="o">-&gt;</span><span class="na">getFirstname</span><span class="p">();</span> </span><span id="L-7"><a name="L-7"></a> <span class="p">}</span> </span><span id="L-8"><a name="L-8"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
magento, username

Bash

Shows svn check ins for a specific user in a certain date range.

$ svn log -r {2009-07-09}:{2007-08-17}  | grep -a3 <username>
https://snipt.net/embed/401c7821dc62f278d5f07f55a06e0469/
/raw/401c7821dc62f278d5f07f55a06e0469/
401c7821dc62f278d5f07f55a06e0469
bash
Bash
1
2019-06-23T18:29:15
True
False
False
/api/public/snipt/7334/
shows-svn-check-ins-for-a-specific-user-in-a-certain-date-range
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ svn log -r <span class="o">{</span>2009-07-09<span class="o">}</span>:<span class="o">{</span>2007-08-17<span class="o">}</span> <span class="p">|</span> grep -a3 &lt;username&gt; </span></pre></div> </td></tr></table>
date, log, range, svn, username