Results 1 to 7 of 7

Attachments in blogs

This is a discussion on Attachments in blogs within the Troubleshooting forums, part of the vBSEO SEO Plugin category; I just noticed after trying to upload an attachment in a blog entry that i get an invalid URL for ...

  1. #1
    Junior Member
    Real Name
    Jason
    Join Date
    Jan 2008
    Posts
    3
    Liked
    0 times

    Attachments in blogs

    I just noticed after trying to upload an attachment in a blog entry that i get an invalid URL for the attachment.

    I have the exact issue noted at Attachments in blogs - where it looks to have been fixed (i see it is working on this board anyway)

    I have the latest version of vBSEO, vBulletin (Beta 4) and the latest version of vBulletin Blogs.

    Any suggestions?

  2. #2
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    Please try to modify functions_vbseo.php file:
    FIND:
    PHP Code:
    $find_user_ids$find_blog_ids$find_blogcat_ids 
    REPLACE WITH:
    PHP Code:
    $find_user_ids$find_blog_ids$find_blogcat_ids$find_blogatt_ids 
    FIND:
    PHP Code:
    $find_user_ids $find_blog_ids $find_blogcat_ids 
    REPLACE WITH:
    PHP Code:
    $find_user_ids $find_blog_ids $find_blogcat_ids $find_blogatt_ids 
    FIND:
    PHP Code:
    $find_blog_ids $matches[1]; 
    EDIT ADD ABOVE (not "replace with"):
    PHP Code:
                if(preg_match_all('#'.$matchpre2.'blog_attachment\.'.VBSEO_VB_EXT.'\?[^"]*?attachmentid=(\d+)#'$newtext$matches))
                    
    $find_blogatt_ids $matches[1]; 
    FIND:
    PHP Code:
    $g_cache['battach'][$aid] = $att
    ADD BELOW:
    PHP Code:
                if($find_blogatt_ids)
                    
    vbseo_get_blogatt_info($find_blogatt_ids); 
    and functions_vbseo_vb.php file

    FIND:
    PHP Code:
    function vbseo_get_blog_cats($ids
    ADD ABOVE:
    PHP Code:
    function vbseo_get_blogatt_info($ids)
    {
        global 
    $g_cache;

        if (!
    is_array($ids)) $ids = array($ids);
        
    $lookupids = array();
        foreach(
    $ids as $id)
        {
            if (isset(
    $g_cache['battach'][$id])) continue;
            
    $lookupids[$id]++;
        }

        if (empty(
    $lookupids))
            return;

        
    $db vbseo_get_db();
        
    $db->vbseodb_select_db();
        
    $rid $db->vbseodb_query($q="
                select attachmentid, blogid, userid, filename, dateline
                from " 
    vbseo_tbl_prefix('blog') . "blog_attachment
                where
                    attachmentid in (" 
    join(','array_keys($lookupids)) . ")
            "
    );

        if (
    $rid)
        {
            while (
    $bl = @$db->funcs['fetch_assoc']($rid))
            
    $g_cache['battach'][$bl['attachmentid']] = $bl;
            
    $db->vbseodb_free_result($rid);
        }
        return;


    EDIT
    in functions_vbseo_createurl.php file:
    FIND:
    PHP Code:
    $blogid $g_cache['battach'][$attid]['blogid']; 
    add below:
    PHP Code:
            if(!$blogid)
                return 
    ''
    Last edited by Oleg Ignatiuk; 01-30-2008 at 03:35 PM.
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  3. #3
    Junior Member
    Real Name
    Jason
    Join Date
    Jan 2008
    Posts
    3
    Liked
    0 times
    Thanks for your speedy reply Oleg, i made the adjustments you suggested but unfortunately it did not fix the problem.

    The attachment issue remains unchanged, and now a new problem has surfaced.

    Individual blog posts are no longer accessible, after following your edits the URLs are now
    Code:
    %user_name%/-a.html

  4. #4
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    Can you provide ftp/admincp access via support ticket for troubleshooting?
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  5. #5
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    An update: one of the code edits should be "added above" (not "replace with").
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


  6. #6
    Junior Member
    Real Name
    Jason
    Join Date
    Jan 2008
    Posts
    3
    Liked
    0 times
    Thanks for your assistance, all the links appear to be working fine now.

    Just one final tiny thing, when you upload an attachment to a blog post it shows
    Code:
    Array (     [0] => 12 )
    (where 12 is the attachment number) at the top of the window. Is there a quick change i can do to tidy that up?

  7. #7
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,689
    Liked
    157 times
    That should be fixed now.
    Oleg Ignatiuk / Crawlability Inc.
    vBSEO 3.6.0 GOLD Released!
    Unveiling the NEW vBSEO Sitemap Generator 3.0. - available NOW for vBSEO Customers!


Similar Threads

  1. change /forums/blogs to /blogs
    By magmf in forum URL Rewrite Settings
    Replies: 31
    Last Post: 02-08-2008, 11:20 AM
  2. Blog rewrite error 500 with CRR blogs.php => /blogs/
    By class101 in forum Bug Reporting
    Replies: 5
    Last Post: 12-24-2007, 03:17 PM
  3. attachments
    By woodysfj40 in forum Troubleshooting
    Replies: 1
    Last Post: 12-16-2007, 07:11 PM
  4. Attachments in blogs
    By Elmer in forum Bug Reporting
    Replies: 5
    Last Post: 11-28-2007, 08:21 PM
  5. How to get /blogs instead of /forum/blogs
    By Doug Nelson in forum General Discussion
    Replies: 2
    Last Post: 11-20-2007, 01:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •