Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6688707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:26:03+00:00 2026-05-26T05:26:03+00:00

JomSocial, by default, uses 3 files to display the Index page for its users:

  • 0

JomSocial, by default, uses 3 files to display the “Index” page for its users:

frontpage.index.php -> Contains an if/then to check for logged in users, loads frontpage.members.php if logged in, or frontpage.guest.php if not logged in. Then it displays recent activity, regardless of whether the user is logged in or not.

frontpage.members.php -> Has no particular actions (code below)

frontpage.guest.php -> Displays a login box.

The problem with this default setup is this: It displays recent activity streams for everyone, including guests. I ONLY want logged in users to be able to see the activity stream. I have tried to recode it myself, but I keep getting PHP errors (I’m not a PHP coder)… so I’m hoping for some help.

frontpage.index.php contents

<script type="text/javascript">joms.filters.bind();</script>

<!-- begin: #cFrontpageWrapper -->
<div id="cFrontpageWrapper">
    <?php 
    /**
     * if user logged in 
     *      load frontpage.members.php
     * else 
     *      load frontpage.guest.php
     */  
    echo $header;
    ?>

    <!-- begin: .cLayout -->
    <div class="cLayout clrfix">
        <!-- begin: .cSidebar -->
        <div class="cSidebar clrfix">
            <?php $this->renderModules( 'js_side_top' ); ?>     
            <?php if( $this->params->get('showsearch') == '1' || ($this->params->get('showsearch') == '2' && $my->id != 0 ) ) { ?>
            <?php
            /**
             * ----------------------------------------------------------------------------------------------------------           
             * Searchbox section here
             * ----------------------------------------------------------------------------------------------------------            

            // A COUPLE HUNDRED LINES OF CODE TO DISPLAY SEARCH, RECENT ACTIVITIES, ETC.

            <!-- Recent Activities -->
            <?php } ?>

        </div>
        <!-- end: .cMain -->

    </div>
    <!-- end: .cLayout -->

</div>
<!-- begin: #cFrontpageWrapper -->

What I need is to figure out how to set things so that the .clayout section ONLY shows up if the user is logged in. The problem is, I can’t figure out how to modify this code accordingly. It’s the asterisks around the if/then/else section that are confusing me. Can someone show me how to recode it?

It should go more like this:

if user logged in
  load frontpage.members.php
  //DISPLAY CLAYOUT INFO
else
  load frontpage.guest.php
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:26:04+00:00Added an answer on May 26, 2026 at 5:26 am

    Include if condition to check whether user is a registered user or gust. Please see the following code.

    <script type="text/javascript">joms.filters.bind();</script>
    
    <!-- begin: #cFrontpageWrapper -->
    <div id="cFrontpageWrapper">
        <?php 
        /**
         * if user logged in 
         *      load frontpage.members.php
         * else 
         *      load frontpage.guest.php
         */  
        echo $header;
        ?>
    
        <?php 
        $user =& JFactory::getUser();
        if (!$user->guest) { 
        ?>
    
    
        <!-- begin: .cLayout -->
        <div class="cLayout clrfix">
            <!-- begin: .cSidebar -->
            <div class="cSidebar clrfix">
                <?php $this->renderModules( 'js_side_top' ); ?>     
                <?php if( $this->params->get('showsearch') == '1' || ($this->params->get('showsearch') == '2' && $my->id != 0 ) ) { ?>
                <?php
                /**
                 * ----------------------------------------------------------------------------------------------------------           
                 * Searchbox section here
                 * ----------------------------------------------------------------------------------------------------------            
    
                // A COUPLE HUNDRED LINES OF CODE TO DISPLAY SEARCH, RECENT ACTIVITIES, ETC.
    
                <!-- Recent Activities -->
                <?php } ?>
    
            </div>
            <!-- end: .cMain -->
    
        </div>
        <!-- end: .cLayout -->
    
    </div>
    <!-- begin: #cFrontpageWrapper -->
    
      <?php } ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jomsocial installation at http://social.drishtant.com/social-network-for-social-impact How can I embed the jomsocial component
I am using jomsocial multi profile for user registration . Some profile needs administration
i have a mediawiki and jomsocial challenge. My goal is to encourage knowledge transfer
I need to upgrade Joomla! 1.7.2 Stable to 2.5 (Its a live site) Some
I am using Jomsocial and I managed to restrict access to profile details if
I have created a custom PHP script which uploads information submitted by a form
how to integration Facebook into jomsocial(joomla component)? my site link is http://speedfive.com
I have created Restful web service in jomsocial environment. It's on the local machine.
I am developing a website with JomSocial component. There are few more component that
We are using Kunena and Jomsocial and everything works great. Is it possible to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.