<p>There are a couple of aspects to consider in your question.</p>

<ol>
<li>Display entries to the author who created them</li>
<li>Display entries which are disabled</li>
</ol>

<p>I'll assume your Channel/Structure is named "<strong><em>Gallery Image</em></strong>"...</p>

<p>First, establish the <strong>User ID</strong> of the logged in <strong>User</strong>:</p>

<pre><code>{% set loggedInUserID = currentUser.id %}
</code></pre>

<p>...then find <strong>Entries</strong> authored by the Logged in User:</p>

<pre><code>{% set galleryEntries = craft.entries.section('galleryImage').authorId(loggedInUserID) %}
</code></pre>

<p>(<a href="https://craftcms.com/docs/templating/craft.entries#authorId" rel="nofollow">Entry Author ID parameter info...</a>)</p>

<p>... then loop through any entries which have a <strong>Status</strong> of "Disabled"</p>

<pre><code>{% for entry in galleryEntries.status('disabled') %}
    &lt;h2&gt;Your draft Gallery entries&lt;/h2&gt;

    ...(template code)...
{% endfor %}
</code></pre>

<p>(<a href="https://craftcms.com/docs/templating/craft.entries#status" rel="nofollow">Entry Status parameter info...</a>)</p>

<hr>

<p>Another variation which you could use, which moves the Status parameter out of the For-Loop, is:</p>

<pre><code>{% set galleryEntries = craft.entries.section('').authorID(loggedInUserID).status('disabled')%}
{% for entry in galleryEntries %}
    &lt;h2&gt;Your draft Gallery entries&lt;/h2&gt;

    ...(template code)...
{% endfor %}
</code></pre>

CC BY-SA 3.0
2016-05-31T14:45:16.957Z
Thanks a lot, from your example I managed to work it out.

I set the entries 

`{% set entries = craft.entries.section('featuredUsers').status(null).order('id desc') %}`

And then matched logged in user to post author, inside for loop

`{% elseif not entry.enabled and entry.authorId == currentUser.id %}`
jarnof
CC BY-SA 3.0
2016-05-31T11:47:47.943Z
2016-05-31T14:22:08.717Z
2016-05-31T14:22:08.717Z
Matt P
<p>I have a simple photo gallery where logged in users can upload photos. I've set the default status for all pictures to disabled, is it possible to show disabled pictures only to user who just published it, and when status is set to enabled everyone can see it?</p>

CC BY-SA 3.0
2016-05-30T23:21:16.170Z
How do you set the default status... with a custom field?  Are the users uploading to an Assets field?
Brad Bell
CC BY-SA 3.0
2016-05-31T07:33:56.737Z
All entries go to "featured users" channel, and status is set to disabled, not using a custom field but the built in system. Entries only have a title and 1 picture on custom asset field.
jarnof
<templating><entries><users><status>
Displaying disabled posts only to post author
# Displaying disabled posts only to post author

(Asked by: username_0 on 2016-05-30)

I have a simple photo gallery where logged in users can upload photos. I've set the default status for all pictures to disabled, is it possible to show disabled pictures only to user who just published it, and when status is set to enabled everyone can see it?

**Tags:** templating, entries, users, status

> **Comments:**
> **username_1**: How do you set the default status... with a custom field?  Are the users uploading to an Assets field?  
> **username_0**: All entries go to "featured users" channel, and status is set to disabled, not using a custom field but the built in system. Entries only have a title and 1 picture on custom asset field.  

---

## 1 answers

### Answer by username_2 on 2016-05-31. Score: 2 | Accepted answer

There are a couple of aspects to consider in your question.

Display entries to the author who created them
Display entries which are disabled

I'll assume your Channel/Structure is named "Gallery Image"...
First, establish the User ID of the logged in User:
{% set loggedInUserID = currentUser.id %}

...then find Entries authored by the Logged in User:
{% set galleryEntries = craft.entries.section('galleryImage').authorId(loggedInUserID) %}

(Entry Author ID parameter info...)
... then loop through any entries which have a Status of "Disabled"
{% for entry in galleryEntries.status('disabled') %}
    Your draft Gallery entries

    ...(template code)...
{% endfor %}

(Entry Status parameter info...)

Another variation which you could use, which moves the Status parameter out of the For-Loop, is:
{% set galleryEntries = craft.entries.section('').authorID(loggedInUserID).status('disabled')%}
{% for entry in galleryEntries %}
    Your draft Gallery entries

    ...(template code)...
{% endfor %}

> **Comments:**
> **username_0**: Thanks a lot, from your example I managed to work it out.  I set the entries   `{% set entries = craft.entries.section('featuredUsers').status(null).order('id desc') %}`  And then matched logged in user to post author, inside for loop  `{% elseif not entry.enabled and entry.authorId == currentUser.id %}`  

---

