About this topic

  • Posted by StiveG 1 year ago. There are 6 posts. The latest reply is from StiveG.
  • This topic is not resolved
  1. Hi,

    I really love this script and found answers for almost all questions I had in this forum.

    But... I still have one question that I can't find an answer for...

    When I use the upload link in a photo galery, the [category_name] field in my form return nothing. I think the [category_name] returns only wp categories (based on post categories, not on photo catagories).

    So my question is : Is it possible to have [category_name] based on photo gallery category?

    Sorry for my english, i'm french...

    Thank you,

    Steve

    P.S. I can see in the form source the gallery category ID (<input type="hidden" name="gallery_id" id="c1bwbps_galleryid" value="2" />
    )

    Unfortunately, I don't know how to retrive this value and then retrive the name with SQL...

  2. Ok... Now, i'm trying a workaround but it doesn't work neither...

    I want an upload link above my galeries when I use URL such as http://localhost/galeries-photos/?psmash-gallery=17

    If I put [photosmash create_post='photo_up_form' post_tags=true no_gallery=true form='Envoie_Photos'] in my page (galeries-photos) the upload links is there, everything works (the new post is created with extend etc.) BUT the gallery_id is missing. So my uploaded image go to (galeries-photos) but I want it to go to the current gallery showing in the galeries-photos page (gallery=17)

    If I use the built-in upload link, the image goes into the right gallery_id (gallery=17) BUT the new post is not create with extend.

    I hope you understand... Quite difficult to explain...

    Basicaly, what i'm tring to do is to have a links above my galeries with URLs like http://localhost/galeries-photos/?psmash-gallery=17 which 1- allow user to choose a category for the post ([post_cat] in the form), 2- Put the image in the gallery 17 and not in the galeries-photos gallery, 3- Create the new post using Extend.

    Is this possible?

    Thanks for your time,

    Steve

  3. Ok, now I understand why the gallery_id is not the same!!

    $galparms['gallery_id'] = (int)$_REQUEST['psmash-gallery']; (bwb-photosmash.php line 1008)

    If I put '[photosmash create_post='photo_up_form' post_tags=true no_gallery=true form='Envoie_Photos']' in the post "galeries-photos" then it will take the gallery_id of "galeries-photos" instead of the one showing in the adress bar (psmash-gallery=17). Because the founction is call from "galeries-photos" post directly...

    But if I use the built-in function, it will use the psmash-gallery=17 because it is load on this URL not in the "galeries-photos" post...

    Tell me i'm right, i'm so proud of my discovery...

    The problem is.. The built-in function does not create post on upload...

    ok...

    What a geek I am.. lol Coffee! again!

  4. Ok, I found a solution to create post on upload from a gallery page (ex : http://localhost/galeries-photos/?psmash-gallery=17)

    I added the array create_post (with the form I wanna use for the new post) in the autoAddGallery function (line 698) in bwb-photosmash.php

    $content .= do_shortcode("[photosmash create_post='photo_up_form' gallery_viewer=true image_layout='image_view_layout']");

    So now it's working. New post created on upload and the image goes in the current gallery (in this exemple, 17)

    I don't know if it's the right way to do it and if it's safe but it's working.

    I only have upload links in my photos galleries so I think that should do it.

    USE AT YOU OWN RISK!! That might modify the way photosmash handles upload elsewhere on your site

    Of course, you need Photosmash-Extend for this to work and you will have to modify this file everytimes you update the plugin.

  5. Hi Stive,

    Looks like you've been diving in head first!

    I'm not 100% sure I understand what you were trying to accomplish. Can you walk me through what you want one more time? I'll be glad to take a look at it and let you know if I can come up with a better way to do it than you did. It would definitely be best if we can do it without modifying the code (as you warned above ;-) ).

    Cheers,
    Byron

  6. Ok..

    All my galleries can be found in URLs like this : http://localhost/galeries-photos/?psmash-gallery=x,http://localhost/galeries-photos/?psmash-gallery=y,http://localhost/galeries-photos/?psmash-gallery=z

    http://localhost/galeries-photos/ is the Gallery Viewer Page.

    So, the only way for me to manualy insert the upload code in those urls was to put in in the galerie-photos post. BUT, doing so, all the uploaded photos went to a gallery named "galerie-photos", not in (exemple:) the cars gallery showing on the http://localhost/galeries-photos/?psmash-gallery=12.

    Ex : http://localhost/galeries-photos/?psmash-gallery=12 was a gallery named "cars"
    To have the upload link on that page, I had to put the code in the "galerie-photos" post (since there is no "cars" post). Doing so, the upload link put the uploaded photos in a gallery named "galerie-photos", not "cars".

    The upload link who is automatically insert in every gallery (built-in) did put the uploaded photos in the right gallery (ex: "cars") BUT did not created new post on upload.

    So, I figured the only way to have the photos uploaded in a url like http://localhost/galeries-photos/?psmash-gallery=12 to be put in his own gallery AND have a post created on upload was to add "create_post='nameoftheform'" in the autoAddGallery function.

    Maybe there is an other way to do it without modifying the code but can't find it...

    Hope you understand... Kind hard to explain... harder when you are not english ;)

RSS feed for this topic