• Resolved ifrichard

    (@ifrichard)


    The Start
    I wanted to have a page where members could upload their photos and see only the photos they uploaded.
    So, I created a shortcode inserted into my child themes functions.php file
    Parts between ** removed for security

    function current_user_gallery_sc() {
            if ( is_user_logged_in() ) {
                    global $wpdb;
    		global $current_user;
    		get_currentuserinfo();
                    $ifuser = $current_user->user_login;
                    $albumid = $wpdb->get_var("SELECT id FROM *NAME OF DB* WHERE owner = \"$ifuser\"");
                    echo wppa_albums($albumid);
    
    //For debugging, making sure variables are getting correct values
    echo $albumid;
    echo $ifuser;
            }
    }
    add_shortcode('current_user_gallery', 'current_user_gallery_sc');

    it worked!

    I broke it
    The auto generated name setting in the plugin was set to ID and I wanted it set to Display Name. So I changed it in the settings and then. I made the mistake of deleting the DB entries for the albums
    It hasn’t worked since.

    What I have done to try and fix it
    I de-activated the plugin then deleted the plugin and then made sure all DB entries where gone as well as any remaining files in the the directories.
    Then re-installed the plugin. Didn’t work.

    Did the ultimate fix, I thought
    I wiped my entire wordpress installation deleted the whole DB everything.
    Started from scratch.

    The wppa plugin has a debug feature and this is what it shows

    [WPPA+ dbg msg: Entering wppa_albums]
    [WPPA+ dbg msg: Lang=en, Locale=en_US, Ajax=]
    [WPPA+ dbg msg: $wppa_session = a:6:{s:4:"page";i:13;s:4:"ajax";s:1:"0";s:2:"id";s:2:"10";s:11:"search_root";s:1:"2";s:7:"rootbox";s:1:"0";s:16:"use_searchstring";s:0:"";}]
    [WPPA+ dbg msg: Usr_upl entered]
    [WPPA+ dbg msg: Potential search root = 2]
    [WPPA+ dbg msg: Plugin load time :0.065s.]
    [WPPA+ dbg msg: Init runtime time :0.001s.]
    [WPPA+ dbg msg: Num queries before wppa :47]
    [WPPA+ dbg msg: alb=2, albenum=]
    [WPPA+ dbg msg: alb=2, albenum=, l_a=, l_a_p=0]
    [WPPA+ dbg msg: pid=6, type=page, alb=2, sep=, slide=, t_c=0, ph=0]
    [WPPA+ dbg msg: get_albums entered: 1 Start_album=2, Cover=0]
    [WPPA+ dbg msg: get_thumbs entered: 1 Start_album=2, Cover=0]
    [WPPA+ dbg msg: Get thumbs took 0.00046896934509277 seconds, found: 1 items.]
    [WPPA+ dbg msg: Time elapsed occ 1:0.008s. Tot:0.008s.]
    [WPPA+ dbg msg: Number of queries occ 1:8]
    [WPPA+ dbg msg: Cumulative query stats: Q=query, G=cache
    Q-A=>1, Q-PH2=>1, Q-bc1=>1, Q-bc2=>1, Q-bc4=>1, Q-meta2=>1, Q11b=>1, Q201=>1, Q59=>1,
    G-A1=>3,
    Total queries attempted: 12, Cash hits: 3, equals 25.00%, misses: 9. 2nd level cache entries: albums: 1, photos: 1 NQ=55]

    The album id is 2 and has one phot uploaded to it with the id of 1

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter ifrichard

    (@ifrichard)

    Maybe there is another way

    Thread Starter ifrichard

    (@ifrichard)

    Update: tried with just the shortcode that came with the plugin
    [wppa type="album" album="2"][/wppa]
    The debug spit out this

    [WPPA+ dbg msg: Doit is on]
    [WPPA+ dbg msg: Entering wppa_albums]
    [WPPA+ dbg msg: Lang=en, Locale=en_US, Ajax=]
    [WPPA+ dbg msg: $wppa_session = a:6:{s:4:"page";i:13;s:4:"ajax";s:1:"0";s:2:"id";s:2:"10";s:11:"search_root";s:1:"2";s:7:"rootbox";s:1:"0";s:16:"use_searchstring";s:0:"";}]
    [WPPA+ dbg msg: Start content filters]
    
    Notice: Array to string conversion in *PATH TO MY SITE*/wp-content/plugins/wp-photo-album-plus/wppa-functions.php on line 46
    [WPPA+ dbg msg: Pri:8, func: Array, args: 1]
    [WPPA+ dbg msg: Pri:8, func: Array, args: 1]
    [WPPA+ dbg msg: Pri:10, func: wptexturize, args: 1]
    [WPPA+ dbg msg: Pri:10, func: convert_smilies, args: 1]
    [WPPA+ dbg msg: Pri:10, func: convert_chars, args: 1]
    [WPPA+ dbg msg: Pri:10, func: wpautop, args: 1]
    [WPPA+ dbg msg: Pri:10, func: shortcode_unautop, args: 1]
    [WPPA+ dbg msg: Pri:10, func: prepend_attachment, args: 1]
    [WPPA+ dbg msg: Pri:10, func: wppa_lightbox_global, args: 1]
    [WPPA+ dbg msg: Pri:10, func: wppa_add_shortcode_to_post, args: 1]
    [WPPA+ dbg msg: Pri:11, func: capital_P_dangit, args: 1]
    [WPPA+ dbg msg: Pri:11, func: do_shortcode, args: 1]
    [WPPA+ dbg msg: Pri:1001, func: wppa_albums_filter, args: 1]
    [WPPA+ dbg msg: End content filters]
    [WPPA+ dbg msg: Usr_upl entered]
    [WPPA+ dbg msg: Potential search root = 2]
    [WPPA+ dbg msg: alb=2, albenum=]
    [WPPA+ dbg msg: alb=2, albenum=, l_a=, l_a_p=0]
    [WPPA+ dbg msg: pid=6, type=page, alb=2, sep=, slide=, t_c=0, ph=0]
    [WPPA+ dbg msg: get_albums entered: 2 Start_album=2, Cover=0]
    [WPPA+ dbg msg: get_thumbs entered: 2 Start_album=2, Cover=0]
    [WPPA+ dbg msg: Get thumbs took 0.00042414665222168 seconds, found: 1 items.]
    [WPPA+ dbg msg: Time elapsed occ 2:0.005s. Tot:0.014s.]
    [WPPA+ dbg msg: Number of queries occ 2:7]
    [WPPA+ dbg msg: Cumulative query stats: Q=query, G=cache
    Q-A=>1, Q-PH2=>2, Q-bc1=>2, Q-bc2=>2, Q-bc4=>2, Q-meta2=>1, Q11b=>2, Q201=>2, Q59=>2,
    G-A1=>6, G-A2=>1,
    Total queries attempted: 23, Cash hits: 7, equals 30.43%, misses: 16. 2nd level cache entries: albums: 1, photos: 1 NQ=63]

    But still no photos displayed

    Thread Starter ifrichard

    (@ifrichard)

    Reposting. I think I didnt follow the right format for posting i see everyone else has the plugin in brackets

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WPPA and PHP Expert Help’ is closed to new replies.