• Resolved nikmac

    (@nikmac)


    Hi,

    I have a wordpress plugin setup to embed a specific filetype (.SGF).

    When I upload the file through the plugin, I get this in my post:
    (WordPress is installed in http://www.domain.com/articles/)
    [sgf sgfUrl=”/wp-content/uploads/2010/04/example4.sgf” href=”http://www.allaboutgo.com/articles/wp-content/uploads/2010/04/example4.sgf” class=”aligncenter”][/sgf]

    Notice how “sgfURL=”/…” which tells it to look in the root directory, not in the “/articles/” directory. I have tried changing the settings in “miscellaneous settings” but nothing worked. I think this is a problem with the plugin I am using. I looked at the code and found this:

    # Figure out where we're really getting the SGF data from
    		$sgfurl = $params['sgfurl'];
    		if ($sgfurl) {
    			if (substr($sgfurl, 0, strlen(WP_CONTENT_URL)) == WP_CONTENT_URL) {
    				# absolute URL, but local
    				$sgf_file = WP_CONTENT_DIR . substr($sgfurl, strlen(WP_CONTENT_URL));
    			} elseif (preg_match('!https?://!', $sgfurl)) {
    				# remote
    				$sgf_file = '-';
    				$sgf_data = file_get_contents($sgfurl, 0, null, -1, 65536);
    			} elseif (substr($sgfurl, 0, 1) == '/') {
    				# relative URL, local
    				$sgf_file = ABSPATH . ltrim($sgfurl, '/');
    			} else {
    				# no idea
    				return $fallback;
    			}
    		} else {
    			# using sgf data
    			$sgf_file = '-';
    		}

    I think the problem is in there, but I am really not sure what to change (and I don’t want to accidently break anything).

    Can someone help me? I hope it is as simple as deleting a line from the above PHP code, but I don’t understand PHP well enough to know what that line is.

    I can give more details if requested.

    Thanks.

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

The topic ‘Need help with “Miscellaneous Settings”’ is closed to new replies.