Posts by timmylogue

315 posts
  • Bought between 100 and 499 items
  • Has been a member for 7-8 years
  • United States
timmylogue says

Hey dtbaker,
Do you mind helping me out one last time? I’ve been trying to figure it out but no luck.

I’m trying to do the same but inside each directories like “tim” and “scott”, there is another directory called “photos”. All directories have this, but only some contain files (like .jpgs) inside the “photos” directory and some don’t.

I want to display the directories that have any type of file inside the “photos” directory.

I was messing around with it:

$directories_to_display = array();
foreach(glob('users/*') as $directory){
  if(is_dir($directory) && file_exists($directory . '/photos/' )){
     $directories_to_display[] = $directory;
  }
}

Thanks!

315 posts
  • Bought between 100 and 499 items
  • Has been a member for 7-8 years
  • United States
timmylogue says

Thanks dtbaker! Worked!

315 posts
  • Bought between 100 and 499 items
  • Has been a member for 7-8 years
  • United States
timmylogue says

Hey guys,

I’m trying to figure out (with php) how to list directory names that only have the file named “profile.png” inside.

So.. I have about 30 directories inside one main directory called “users”.

Inside the “users” directory, there are other directories like:

  • users/tim
  • users/bob
  • users/scott
  • users/john

  • Only a few of those directories (like tim, scott and john) carry the file named “profile.png”. I would like to display those directories just on a page. Thats it.

    Any help would be appreciated!

    - Tim

    315 posts
    • Bought between 100 and 499 items
    • Has been a member for 7-8 years
    • United States
    timmylogue says

    Nevermind! I got it!

    myDescription_txt.y += Math.round((myDescription_txt.height - myDescription_txt.textHeight));
    
    315 posts
    • Bought between 100 and 499 items
    • Has been a member for 7-8 years
    • United States
    timmylogue says

    So, by default, when you add text to a TextField, the text appears at the top, and works it’s way down to the bottom. I would like to do the opposite: I would like to have it appear at the bottom of the TextField, and move it’s way up to the top.

    I’m using the code below and it sorta works haha. The only issue i’m having is that if the text gets longer and longer, it seems to be pushing the whole TextField down and not keeping it in the same x and y position on stage. (hope I explained that correctly).

    var bottomCoord;
    
    bottomCoord = myDescription_txt.y + myDescription_txt.height;
    myDescription_txt.autoSize = "left";
    
    myDescription_txt.y = bottomCoord - bottomCoord.height;
    myDescription_txt.text = "Pellentesque habitant morbi tristique senectus" 
    

    Anyway to do this?

    315 posts
    • Bought between 100 and 499 items
    • Has been a member for 7-8 years
    • United States
    timmylogue says

    Thanks! I’ll take a look at it.

    - Tim
    315 posts
    • Bought between 100 and 499 items
    • Has been a member for 7-8 years
    • United States
    timmylogue says

    I’m trying to figure out how to remove a child with a specific attribute selected (filename). I have PHP displaying an XML file on a page that loads images. If someone where to click on any image or hit the delete button -

    <a href=""><img src="' . $child['src'] . '" alt="gallery image" />Delete me</a>
    

    ... it would know where to find in the XML file and delete it.



    Here what loads and displays my XML file:

    
    <?php
       $xml = simplexml_load_file('myPhotos.xml');
       //echo $xml->getName() . "<br />";
       foreach ($xml->children() as $child)
        {
            echo '<img src="' . $child['src'] . '" alt="gallery image" />';
        }
    ?>
    
    



    Here is my XML structure:

    
    <slideshow>
    <image src="myPhotosResized/image1.jpg" desc="This is the 1st image!" />
    <image src="myPhotosResized/image2.jpg" desc="This is the 2nd image!" />
    <image src="myPhotosResized/image3.jpg" desc="This is the 3rd image!" />
    <image src="myPhotosResized/image4.jpg" desc="This is the 4th image!" />
    </slideshow>
    
    

    Any help is appreciated! :D

    Tim
    315 posts
    • Bought between 100 and 499 items
    • Has been a member for 7-8 years
    • United States
    timmylogue says

    Shouldnt you be appending $url and $effect to $image instead of root?

    Damnit!
    See… something that simple. I feel dumb :|

    Thank man! Appreciate your help with fixing that.

    Tim

    315 posts
    • Bought between 100 and 499 items
    • Has been a member for 7-8 years
    • United States
    timmylogue says

    I’m generating a xml file. XML’s are not my thing when it comes with php. Everything is great (besides one issue and probably a simple fix) Anyone kind enough to help me?

    PHP script: http://pastie.org/8168404

    My XML generates out like this:

    <?xml version="1.0"?>
    <images>
       <image/>
           <url>manage/myImages/Slide1.JPG</url>
           <effect>blur</effect>
    </images>
    

    But I want my XML to generate out like this:

    <?xml version="1.0"?>
    <images>
       <image>
           <url>manage/myImages/Slide1.JPG</url>
           <effect>blur</effect>
       </image>
    </images>
    

    Thanks :-P
    Tim

    315 posts
    • Bought between 100 and 499 items
    • Has been a member for 7-8 years
    • United States
    timmylogue says

    oh… thanks, this was fixed. I use the delay call function.

    by
    by
    by
    by
    by
    by