Results 1 to 7 of 7

Thread: News Attachments

  1. #1
    Join Date
    Jan 2004
    Location
    Raleigh, NC
    Posts
    1,614

    Default News Attachments

    With vB 3.5, you can define per File Extension/Type if that type should be opened in a new window or not. I have all mine set to open in a new window, but when clicking an attachment displayed on the CMPS News module, it opens in the current window.
    My Blog
    GPS Discussion Forum

    *** Please do not contact me privately for help. Thanks. ***

  2. #2
    Join Date
    Jan 2004
    Location
    Georgia, USA
    Posts
    34,466

    Default Re: News Attachments

    If you'll look in your modules/news.php file for this code:
    PHP Code:
    $getnattach $db->query_read("SELECT attachmentid, filename, filesize, visible, postid, IF(thumbnail_filesize > 0, 1, 0) AS hasthumbnail, counter, thumbnail, LENGTH(thumbnail) AS thumbnailsize FROM " TABLE_PREFIX "attachment WHERE postid IN(" implode(','$newspids) . ") ORDER BY attachmentid"); 
    Replace with this:
    PHP Code:
    $getnattach $db->query_read("
                        SELECT attachmentid, filename, filesize, visible, postid, IF(thumbnail_filesize > 0, 1, 0) AS hasthumbnail, counter, attachment.thumbnail, LENGTH(attachment.thumbnail) AS thumbnailsize, newwindow
                        FROM " 
    TABLE_PREFIX "attachment AS attachment
                        LEFT JOIN " 
    TABLE_PREFIX "attachmenttype AS attachmenttype USING (extension)
                        WHERE postid IN(" 
    implode(','$newspids) . ") 
                        ORDER BY attachmentid
                "
    ); 
    Then find:
    PHP Code:
    eval('$news[\'attachment\'] .= "' fetch_template('postbit_attachmentthumbnail') . '";'); 
    Add this right above:
    PHP Code:
    $show['newwindow'] = $attachment['newwindow']; 
    And that should take care of the problem.

  3. #3
    Join Date
    Jan 2004
    Location
    Raleigh, NC
    Posts
    1,614

    Default Re: News Attachments

    Yep, that did it. Thanks!
    My Blog
    GPS Discussion Forum

    *** Please do not contact me privately for help. Thanks. ***

  4. #4
    Join Date
    Dec 2004
    Posts
    71

    Default Re: News Attachments

    is it also possible to replace the link behind the attachment in total?

  5. #5

    Default Re: News Attachments

    Exactly what I was looking for...

  6. #6

    Default Re: News Attachments

    Can you customize how the new window will look... the size... add background color etc... a close button...

  7. #7
    Join Date
    Jan 2004
    Location
    Raleigh, NC
    Posts
    1,614

    Default Re: News Attachments

    No. It just adds a target="_blank" to the link. It's a vBulletin feature, not a CMPS feature.
    My Blog
    GPS Discussion Forum

    *** Please do not contact me privately for help. Thanks. ***

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. News Attachments: Only 1 thumbnail
    By Frankenberrie in forum Troubleshooting / "How do I..." Questions
    Replies: 4
    Last Post: 05-08-2006, 09:36 PM
  2. Problem with user location when attachments are shown on news post.
    By himerus in forum Troubleshooting / "How do I..." Questions
    Replies: 3
    Last Post: 06-30-2004, 01:13 PM
  3. Multiple Attachments on News
    By Shon in forum Add-On Modules & Modifications
    Replies: 4
    Last Post: 06-17-2004, 02:03 PM

Posting Permissions

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