snipt

Ctrl+h for KB shortcuts

PHP

"if user does not have an avatar"

<?php global $bp; if(bp_core_fetch_avatar( array( 'item_id' => $bp->loggedin_user->id, 'no_grav' => true, 'html'=> false ) ) != bp_core_avatar_default()) {} ?>
https://snipt.net/embed/af34fde97a9831faab21c9da12be8494/
/raw/af34fde97a9831faab21c9da12be8494/
af34fde97a9831faab21c9da12be8494
php
PHP
1
2019-08-18T18:22:18
True
False
False
/api/public/snipt/53920/
if-user-does-not-have-an-avatar
<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><span class="cp">&lt;?php</span> <span class="k">global</span> <span class="nv">$bp</span><span class="p">;</span> <span class="k">if</span><span class="p">(</span><span class="nx">bp_core_fetch_avatar</span><span class="p">(</span> <span class="k">array</span><span class="p">(</span> <span class="s1">&#39;item_id&#39;</span> <span class="o">=&gt;</span> <span class="nv">$bp</span><span class="o">-&gt;</span><span class="na">loggedin_user</span><span class="o">-&gt;</span><span class="na">id</span><span class="p">,</span> <span class="s1">&#39;no_grav&#39;</span> <span class="o">=&gt;</span> <span class="k">true</span><span class="p">,</span> <span class="s1">&#39;html&#39;</span><span class="o">=&gt;</span> <span class="k">false</span> <span class="p">)</span> <span class="p">)</span> <span class="o">!=</span> <span class="nx">bp_core_avatar_default</span><span class="p">())</span> <span class="p">{}</span> <span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
buddypress

HTML+PHP

Blog post!

1
2
3
Why would I use this as a blog?

`<DOCTYPE html>`
https://snipt.net/embed/6c4b0a35022d7aacf18caf8be9c0379b/
/raw/6c4b0a35022d7aacf18caf8be9c0379b/
6c4b0a35022d7aacf18caf8be9c0379b
html+php
HTML+PHP
3
2016-12-09T19:04:23
True
False
True
Jan 17, 2013 at 04:52 PM
/api/public/snipt/53919/
blog-post
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>Why would I use this as a blog? </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>`<span class="p">&lt;</span><span class="nt">DOCTYPE</span> <span class="na">html</span><span class="p">&gt;</span>` </span></pre></div> </td></tr></table>