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 6987945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:00:20+00:00 2026-05-27T19:00:20+00:00

I have created a basic component for Joomla that allows users to list an

  • 0

I have created a basic component for Joomla that allows users to list an item along with some associated images. When the page containing the gallery is viewed a strange folder is created in the root web directory in the format of Resource id #100, the number varies with each item. I have narrowed down the code that is causing this to the following. My question is can some see what I’m doing to cause this and can anyone offer alternatives to the code I’m using to read the files from a particular directory and return the information.

<p id="sl_gallery">
            <?php if( is_file( JPATH_ROOT.'/components/com_eg/images/gallery/'.$this->eg->id.'/main.jpg' ) ) : ?>
            <img src="<?php echo JURI::root().'/components/com_eg/images/gallery/'.$this->eg->id.'/main.jpg' ?>" alt="myimage">
            <?php else: ?>
            <img src="<?php echo JURI::root().'/components/com_eg/images/nolistings.gif'; ?>" alt="myimage" />
            <?php endif; ?>
            <?php
            $TrackDir= opendir(JPATH_ROOT.'/components/com_eg/images/gallery/'.$this->eg->id.'/second/');
            $count = 0;
            if ( !JFolder::exists($TrackDir) ) { JFolder::create($TrackDir); }
                while (($file = readdir($TrackDir)) !== false) {
                    if ($file == "." || $file == "..") { }
                    else {
                        ?>
                       <img src="<?php echo JURI::root().'/components/com_eg/images/gallery/'.$this->eg->id.'/second/'.$file; ?>" alt="myimage" />
                    <?php
                    }
                }
            closedir($TrackDir);  ?>
</p>
  • 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-27T19:00:21+00:00Added an answer on May 27, 2026 at 7:00 pm

    Change this:

    $TrackDir= opendir(JPATH_ROOT.'/components/com_eg/images/gallery/'.$this->eg->id.'/second/');
    $count = 0;
    if ( !JFolder::exists($TrackDir) ) { JFolder::create($TrackDir); }
    

    …to this:

    $TrackDirPath = JPATH_ROOT.'/components/com_eg/images/gallery/'.$this->eg->id.'/second/';
    if ( !JFolder::exists($TrackDirPath) ) { JFolder::create($TrackDirPath); }
    $TrackDir = opendir($TrackDirPath);
    $count = 0;
    

    $TrackDir holds the result of a call to opendir() – this means it will either be a resource or FALSE. When you convert a resource to a string, it results in Resource id # – which you did by (effectively) passing it to mkdir().

    I have stored the path as a string in a variable $TrackDirPath, and passed that to JFolder::create() instead. I have also re-ordered the statements, to make sure that the directory exists before you try to open it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a simple basic component in joomla named, careerform so I want
I have created a basic WCF service in IIS. I am aware that this
I have an application that generates some pretty basic reports. I have installed the
I have created a basic site using ASP.NET routing according to Mike Ormond's example
I have created a pretty basic Flash website for a client and am having
I have a basic hosting package that gives me access to create a MySQL
Have created a c++ implementation of the Hough transform for detecting lines in images.
I have created a PHP-script to update a web server that is live inside
I have created a UserControl that has a ListView in it. The ListView is
I have basic issue that i don't understand, we use HEAT to consume directory

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.