WordPress.org

Ready to get started?Download WordPress

Forums

SFBrowser
Network Blog Insertion (9 posts)

  1. archetypemkt
    Member
    Posted 2 years ago #

    I am having problems with the insertion the image which appears fine but the code is:

    <img src="http://www.domain.com/wp-content/blogs.dir/7/files/../../../wp-content/blogs.dir/7/files/images/buttons/amlogo_190x60.png" alt="amlogo_190x60" />

    The settings under SFBrowser are: /wp-content/blogs.dir/7/files/

    which is the appropriate directory to show the specific networked blog's image files.

    Any thoughts would be great.

    http://wordpress.org/extend/plugins/sfbrowser/

  2. Sjeiti
    Member
    Plugin Author

    Posted 2 years ago #

    I can't tell offhand...

    It could be the dot in the folder (I never really tested with that).

    But can you turn on debug-mode in the SFBrowser options, save, and inmediately view the source. Then in the third script tag after the comment '<!-- wp-SFBrowser init -debug mode- -->' there is a jQuery document.ready function. What are the values for: siteUri, filePrefixUri, relativePath and imageFolder ???

  3. archetypemkt
    Member
    Posted 2 years ago #

    Hi Thanks for the reply. Here is what I see in debug mode.

    <!-- SFBrowser init -debug mode- -->
    		<link rel="stylesheet" type="text/css" media="screen" href="../wp-content/plugins/sfbrowser/css/sfbrowser.css" />
    		<script type="text/javascript" src="../wp-content/plugins/sfbrowser/SWFObject.js"></script>
    		<script type="text/javascript" src="../wp-content/plugins/sfbrowser/jquery.tinysort.min.js"></script>
    		<script type="text/javascript" src="../wp-content/plugins/sfbrowser/jquery.sfbrowser.js?324"></script>
    		<script type="text/javascript" src="../wp-content/plugins/sfbrowser/lang/en_US.js"></script>
    		<script type="text/javascript">
    			jQuery.sfbrowser.defaults.connector = "php";
    			jQuery.sfbrowser.defaults.sfbpath = "../wp-content/plugins/sfbrowser/";
    			jQuery.sfbrowser.defaults.base = "../../..//wp-content/blogs.dir/7/files//";
    			jQuery.sfbrowser.defaults.previewbytes = 600;
    			jQuery.sfbrowser.defaults.deny = ("php,php3,phtml").split(",");
    			jQuery.sfbrowser.defaults.browser = "<div id=\"sfbrowser\"><div id=\"fbbg\"></div><div id=\"fbwin\"><div id=\"winbrowser\"><div class=\"sfbheader\"><h3>SFBrowser</h3><div id=\"loadbar\"><div></div><span>Loading</span></div><ul id=\"sfbtopmenu\"><li><a class=\"textbutton newfolder\" title=\"New folder\"><span>New folder</span></a></li><li><form id=\"fileio\" name=\"form\" action=\"\" method=\"post\" enctype=\"multipart/form-data\"><input id=\"fileToUpload\" type=\"file\" size=\"1\" name=\"fileToUpload\" class=\"input\" /></form><a class=\"textbutton upload\" title=\"Upload\"><span>Upload</span></a></li><li><a class=\"sfbbutton maximizefb\" title=\"Maximize\">&nbsp;<span>Maximize</span></a></li><li><a class=\"sfbbutton cancelfb\" title=\"Cancel\">&nbsp;<span>Cancel</span></a></li></ul></div><div class=\"fbcontent\"><div id=\"fbtable\"><table id=\"filesDetails\" cellpadding=\"0\" cellspacing=\"0\"><thead><tr><th class=\"file\">Name</th><th class=\"type\">Type</th><th class=\"size\">Size</th><th class=\"date\">Date</th><th class=\"dim\">Dimensions</th><th class=\"buttons\"></th></tr></thead><tbody><tr><td class=\"loading\" colspan=\"6\"></td></tr></tbody></table></div><div id=\"fbpreview\"></div><div class=\"sfbbutton choose\">Choose</div><div class=\"sfbbutton cancelfb\">Cancel</div></div></div><div id=\"sfbfooter\"></div><div id=\"resizer\">&nbsp;</div></div><ul id=\"sfbcontext\"></ul></div>";
    			jQuery.sfbrowser.defaults.debug = true;
    			jQuery.sfbrowser.defaults.maxsize = 314572800;
    			jQuery.sfbrowser.defaults.plugins = ['imageresize','filetree','createascii','wp_db'];
    		</script>
    		<!-- SFBrowser plugins -->
  4. Sjeiti
    Member
    Plugin Author

    Posted 2 years ago #

    That's not precisely the part I meant but I think the problem is the base path.

    What if you change your upload directory to something like 'wp-content/uploads'. Does it work then?

  5. archetypemkt
    Member
    Posted 2 years ago #

    If I change it to 'wp-content/uploads' it goes into the main blog (blod id #1) files locations.

    I've tried several variations and even leaving it blank to go to the root but I don't seem to be able to get the insert image code to work right.

  6. Sjeiti
    Member
    Plugin Author

    Posted 2 years ago #

    Ok... so you get the same faulty image src's when using 'wp-content/uploads'?

  7. archetypemkt
    Member
    Posted 2 years ago #

    I get the same type of thing:

    <img src="http://www.yourdomain.com/wp-content/uploads/../../../wp-content/uploads/images/buttons/image.png" alt="image" />

    It seems that if I can get rid of the "../../../wp-content/xx/xx" it would be fine. Just not sure sure how do that.

  8. skapator
    Member
    Posted 2 years ago #

    Same problem here.
    First of all thanks a lot for this plugin, i was looking for something like this for a long time.
    Back to the problem.
    Removing the slashes from the upload directory worked.
    But no matter what, the %file (from the Insertion rules) outputs the path with a preffix of "../"
    when NOT using relative paths.
    Example:
    <img src="../http://localhost/wp_playground/sfb_uploads/images/New folder/DSC_0861.jpg" alt="DSC_0861" />

    I am not a javascript developer but I looked in the files of the plugin and found a way around it, but not found a proper fix. Seems like a hack.

    So in the file jquery.sfbrowser.js, around line 315, it says:
    sReturnPath = (aFxSfbpath.join("/")+"//"+aFxBase.join("/")).replace(/(\/+)/,"/").replace(/(^\/+)/,"");

    so deleted "aFxSfbpath.join("/")+" from that line.
    That seems to remove the "../" from the %file output.
    Then I added my site's URL at the Insertion rules.
    It looks like this:
    <img src="http://mysite.com/wp_playground/%file" alt="%name" />

    Seems to work. But I would really love your thoughts on what I did.
    And if there is a proper way to fix it.

  9. archetypemkt
    Member
    Posted 2 years ago #

    Thanks so much. That took care of it for me.

    But on my SFBrowser settings because I am using networked sites.

    Use relative paths (unchecked - but either way works)

    Upload directorywp-content/blogs.dir/XX/files (xx is blog id)

    and changed the rule to: <img src="%file" alt="%name" />

    and that seems to give me a cleaner url link

    <img src="http://www.mydomain.com/wp-content/blogs.dir/XX/files/images/newimage.png" alt="New Image" />

    Thanks again for the post.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags