Search code examples
phpmessageinbox

Show custom page content


First thanks all for helping.

I'm trying to show custom content on inbox page. My code looks like that:

 <?php 
$page = basename($_SERVER['REQUEST_URI']);
if ($page == 'messages' || $page == "/" || $page == 'inbox') {
?>
@if ($buttons or $showSearchBox)
<div class="toolbar top">
    {!! $buttons !!}

    @if ($showSearchBox)
        <div class="model-search-box">
    @if (user()->countMessages() > 0)
        <div class="inbox-notify">
    You have unread messages, please read that!
    </div>
    @endif
            {!! Form::open(['url' => URL::current().'/search']) !!}
                    {!! Form::text('search', $searchString, array('placeholder'=>'Search in messages ), ['class' => 'search-string']) !!}
                    {!! Form::submit(trans('app.search'), ['class' => 'button-search']) !!}
            {!! Form::close() !!}
        </div>
    @endif
  </div>
@endif
    <?php } ?>

But this code works only on "messages/inbox" page. How can i too add this content on "messages/outbox" page? Sorry for bad english. I'm newbiee on this :)


Solution

  •  <?php 
        $page = basename($_SERVER['REQUEST_URI']);
        if ($page == 'messages' || $page == "/" || $page == 'inbox' || $page == 'outbox') {
        ?>
        @if ($buttons or $showSearchBox)
        <div class="toolbar top">
            {!! $buttons !!}
    
            @if ($showSearchBox)
                <div class="model-search-box">
            @if (user()->countMessages() > 0)
                <div class="inbox-notify">
            You have unread messages, please read that!
            </div>
            @endif
                    {!! Form::open(['url' => URL::current().'/search']) !!}
                            {!! Form::text('search', $searchString, array('placeholder'=>'Search in messages ), ['class' => 'search-string']) !!}
                            {!! Form::submit(trans('app.search'), ['class' => 'button-search']) !!}
                    {!! Form::close() !!}
                </div>
            @endif
          </div>
        @endif
            <?php } ?>