Forum Replies Created

Viewing 15 replies - 1 through 15 (of 23 total)
  • Shea, sorry for the delay in getting back to you. I got this all sorted out and I found that it had nothing to do with your plugin. I ended up migrating my site to a host with a much more robust support of PHP. I am currently running several valid PHP snippets with your plugin.

    Thanks for your work and response!

    David McCaran

    I tried your code and still get nothing. I checked the source of my page and this meta tag is not on any webpage. I am running PHP 5.3 on a Fatcow Shared Hosting platform. I was able to get a Code Snippet to work on the back end:

    // replace WordPress Howdy in WordPress 3.3
    function replace_howdy( $wp_admin_bar ) {
        $my_account=$wp_admin_bar->get_node('my-account');
        $newtitle = str_replace( 'Howdy,', 'Welcome to OYC,', $my_account->title );
        $wp_admin_bar->add_node( array(
            'id' => 'my-account',
            'title' => $newtitle,
        ) );
    }
    add_filter( 'admin_bar_menu', 'replace_howdy',25 );

    as well as this snippet that allows shortcodes in widgets:

    add_filter('widget_text', 'do_shortcode');

    Are there certain codes that are not supported or should it be all valid PHP scripts?

    Marked as Resolved

    I cant be certain, but it seems this was related to a jetpack update?

    I updated the jetpack plugin, but the “connection” to my site was lost. I had to re-connect jetpack and then the 500 errors went away? I will keep an eye on this but for now I am getting no more Server Errors in the log related to themes or plugins.

    OK, I believe I fixed the 500 Errors (I think they were jetpack related). I am now trying to run this snippet with the javascript option rather than the html extraction:

    if (!function_exists('wfu_before_file_upload_handler')) {
        function wfu_before_file_upload_handler($file_path, $file_unique_id) {
          $_SESSION['wfu_tempfiles'][$file_unique_id] = $file_path;
          return $file_path;
    	  $message="TEST MESSAGE nymets1104";
    	  wfu_debug_log($message);
      }
      add_filter('wfu_before_file_upload', 'wfu_before_file_upload_handler', 10, 2);
    }
    if (!function_exists('wfu_after_file_upload_handler')) {
      function wfu_after_file_upload_handler($changable_data, $additional_data) {
        if ($additional_data['upload_result'] == 'success' && isset($_SESSION['wfu_tempfiles'][$file_unique_id]) && $_SESSION['wfu_tempfiles'][$file_unique_id] != '') {
    	  $file_contents = file_get_contents($_SESSION['wfu_tempfiles'][$file_unique_id]);
          // perform here html extraction
    	 // header("Refresh:0");
    
    	  // you can set javascript code to run in client browser using $changable_data['js_script']="document.write(5 + 6);"
    	   $changable_data['js_script']='alert("I am an alert box!");'
    	}
    	return $changable_data;
      }
      add_filter('wfu_after_file_upload', 'wfu_after_file_upload_handler', 10, 2);
    }

    As before, I am succesfully uploading the file, but nothing happens after that on the front end. Perhaps I am calling the script at the wrong time in the snippet??

    Not yet,

    I essentially only need to extract the file name or the path to the file. Would this information be stored in the $file_contents?

    Would this require a refresh of the page as well I am thinking in order to display the uploaded image/video on the page?

    Are you able to access your site via ftp or your hosts cpanel? If so, just rename the bp plugin folder temporarily and reload your site.

    I checked another page that has a different plugin on it and I am getting a similar 500 error so I dont think its anything specific to this plugin.

    The odd thing is that despite the errors, I still get the generated email when the file finishes uploading and on the front end, nothing seems amiss.

    I got a test snippet to work so I think I am good there. I did notice this in the console log when I loaded the page using the File Upload Plugin:

    IMAGE OF ERROR LOG

    Also, the files successfully upload and the Plugin shows the “File name” successfully uploaded message when it finishes the upload.

    OK it seems no snippets will run for me so let me address that and then get back with you.

    Here is what I tried:

    if (!function_exists('wfu_before_file_upload_handler')) {
        function wfu_before_file_upload_handler($file_path, $file_unique_id) {
          $_SESSION['wfu_tempfiles'][$file_unique_id] = $file_path;
          return $file_path;
      }
      add_filter('wfu_before_file_upload', 'wfu_before_file_upload_handler', 10, 2);
    }
    if (!function_exists('wfu_after_file_upload_handler')) {
      function wfu_after_file_upload_handler($changable_data, $additional_data) {
        if ($additional_data['upload_result'] == 'success' && isset($_SESSION['wfu_tempfiles'][$file_unique_id]) && $_SESSION['wfu_tempfiles'][$file_unique_id] != '') {
    	  $file_contents = file_get_contents($_SESSION['wfu_tempfiles'][$file_unique_id]);
          // perform here html extraction
    	  $message="TEST MESSAGE nymets1104";
    	  wfu_debug_log($message);
    
    	  // you can set javascript code to run in client browser using $changable_data['js_script']
    	}
    	return $changable_data;
      }
      add_filter('wfu_after_file_upload', 'wfu_after_file_upload_handler', 10, 2);
    }

    Not seeing a debug file anywhere in wp-content though

    So I am certainly screwing something up here but here is what I am trying to do:

    Allow User to upload file (small MP4 in my case)
    After succesful upload, video is then displayed on the same page that has the file upload link.

    I have added your code into Code Snippets plugin, but it never seems to trigger?

    I even tried calling a simple Echo statement and nothing happens.

    Am I going about this the wrong way or did I miss something?

    Nickolas, does this require the paid version of the plugin or will it work in free one also?

    So with a small CSS tweak, this theme fully support sub-menus.

    fostanda, thanks for your response and guidance.
    I was able to get it to its current form with the style rule:

    #menu-item-56:hover ul {
    display: block;
    position:absolute;
    left:239px;
    top:-1px;
    }

    It is now functioning just as I had hoped, Thank You. I really enjoy just how customizable your theme is.

    -David

Viewing 15 replies - 1 through 15 (of 23 total)