Skip to:
Content
Pages
Categories
Search
Top
Bottom

Album+ Upgrade: Different Album Categories and show all pictures form all Users -> Need Help

  • Avatar of alex
    alex
    Participant

    @serio1

    Hi,

    I really like the Album+, but i need a few more functions.
    I’m very limited in coding PHP, but i’m on a good way right now. I want to make a Social Network that have images as the main-content. Every user should be able to upload Pictures to pre-defined categories. The Categories should be displayed as a single page (show all pictures from all user-albums from a specific category).

    Here is what i have done:

    The User can select a Category in the upload form, the picture will be moved to the right directory which is also build in the same process.

    The Folder Structure is like this right now:

    - Album
    — User 1


    Categorie 1


    Categorie 2
    — User 2


    Categorie 1


    Categorie 2

    I also wrote a little PHP Script, which read all directories and filter the one, which i want. The Script returns all images from the specific categorie and displays them.

    And here is my first Problem:
    How can i get a Link to the IMG which refers to the user-Album -> picture (thats the link right now: …wordpress/members/admin/album/picture/51/ )
    I think i need a Link like this: …wordpress/members/admin/album/picture/the_picture_filename/ – how can i do that?

    Here is the Code of the PHP file which searchs the directories and displays the image from one category (the PHP file is located in the theme-folder)

    Code:
    $recursiveIterator = new RecursiveDirectoryIterator(‘./wp-content/uploads/album’);
    $recursiverecursiveIterator = new RecursiveIteratorIterator($recursiveIterator,RecursiveIteratorIterator::SELF_FIRST);

    foreach($recursiverecursiveIterator as $element) {
    if ( $element->isDir() ) {

    $ordner = $element;

    $handle2 = opendir($ordner);
    while ($file = readdir ($handle2)) {
    if (is_dir($ordner.”/”.$file)) {
    $foo = substr($ordner, strrpos($ordner, ‘/’) ); // Backslah in Slash ändern
    $foo = str_replace(‘\’,’/’, $foo);
    $foo = substr($foo, strrpos($foo, ‘/’) );
    }
    }

    closedir ($handle2);

    if ($foo == “/walls”) { // ordner anwählen
    $handle = opendir($ordner);
    while ($file = readdir ($handle)) {
    if($file != “.” && $file != “..”) {
    if(is_dir($ordner.”/”.$file)) {
    } else {
    // kompletter Pfad
    $compl = $ordner.”/”.$file;
    $compl = str_replace(‘\’,’/’, $compl);

    $url = get_bloginfo(‘url’);
    $compl = str_replace( ‘./wp-content/’ , ‘/wp-content/’ , $compl);
    $compl = $url.$compl;

    $suffix = substr($compl, -7);
    $suffix2 = substr($compl, -8);
    if ($suffix == ’100.jpg’ || $suffix == ’100.gif’ || $suffix == ’100.Jpg’ || $suffix == ’100.JPG’ || $suffix == ’100.GIF’ || $suffix == ’100.Gif’ ||
    $suffix2 == ’100.jpeg’ || $suffix2 == ’100.JPEG’ || $suffix2 == ’100.Jpeg’ ) {
    echo “[img src="".$compl.""}[/img][br/}"; // image ausgeben
    }
    }
    }
    }
    closedir($handle);

    }

    }
    }

    it would be very nice if anybody could help.

    greetz,
    serio

    p.s: sorry for my nasty english, i hope you understood me…

Viewing 5 replies - 1 through 5 (of 5 total)
  • Avatar of alex
    alex
    Participant

    @serio1

    does anybody have an idea?
    tried it for several hours but dont get a solution :/

    how can i rename the image thats uploaded? for example picture.jpg to id_picture.jpg

    Avatar of foxly
    foxly
    Participant

    @foxly

    @alex

    What you’re talking about is called “Keyword Tagging”. We’re implementing this ability, but it isn’t finished yet. But, to summarize:

    Anything you see on Facebook.
    Anything you see on Flickr.
    Anything you see on DeviantArt.
    Anything you see on YouTube.

    You will eventually be able to do with BP Album. Probably within a matter of months.

    Thanks!

    ^F^

    Avatar of alex
    alex
    Participant

    @serio1

    thanks for the info. After a few hours of testing i got a solution for my problem.
    Another problem is the Thumbnail-Generation. If i upload a Panorama Image, for example 3000x150px, the script crops me a thumbnail with ~100*62px but i want to have 100×100

    Avatar of foxly
    foxly
    Participant

    @foxly

    @serio1

    Version 0.1.9 lets you create thousands of different sizes of thumbnails cropped like Flickr, Scaled like Facebook, and autoscaled to any aspect ratio.

    ^F^

    Avatar of Manish Jain
    Manish Jain
    Participant

    @manish-jain

    @alex

    Hi ,

    I am trying to do exactly the same thing as yours but am not good at PHP or coding in fact. Can you help me out. I have installed the BP-Album but I dont have any idea as to how I should go about setting predefined categories and then getting the users to upload using those predefined categories and then display displaying the pages as catalogues of the specific categories. Can you help me out

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.