Results 1 to 2 of 2

Thread: News.php Modification: How do I modify this code related to attachments?

  1. #1
    Senior Member
    Join Date
    Jan 2008
    Posts
    158

    Default News.php Modification: How do I modify this code related to attachments?

    Currently, there are three options listed under 'Enable Attachments'

    Turn this option on to display the attachments associated with each news post.

    * - No
    * - Yes, First Attachment Only
    * - Yes, All Attachments
    Is there a slight modification or tweak I could make to the News Module so that when I select "Yes, First Attachment Only", it actually displays the First Three Attachments only??

    I appreciate any feedback/advice anybody can give. I am a totally novice when it comes to reading/interpreting PHP.

  2. #2
    Senior Member
    Join Date
    Jan 2008
    Posts
    158

    Default

    Answer:

    After the following code in news.php:
    SELECT attachmentid, filename, filesize, dateline, postid, IF(thumbnail_filesize > 0, 1, 0) AS hasthumbnail, counter, attachment.thumbnail, attachment.thumbnail_dateline, LENGTH(attachment.thumbnail) AS thumbnailsize, newwindow, visible
    * *FROM " . TABLE_PREFIX . "attachment AS attachment
    * *LEFT JOIN " . TABLE_PREFIX . "attachmenttype AS attachmenttype ON (attachment.extension = attachmenttype.extension)
    * *WHERE postid IN(" . implode(',', $newspids) . ")
    * * AND visible = 1
    * *" . iif($mod_options['portal_news_showattachments'] != 2, 'GROUP BY attachment.postid') . "
    * *ORDER BY attachmentid
    Add

    Limit 0,3

    Save and Enjoy!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. adding related news on link pages
    By Gurilla in forum "How Do I..." Questions
    Replies: 1
    Last Post: 03-22-2010, 11:48 AM
  2. Replies: 1
    Last Post: 07-18-2009, 09:40 AM
  3. News / Announcements Modification !!
    By kartik786 in forum Modifications (version 3.x & 2.x)
    Replies: 18
    Last Post: 05-29-2008, 07:43 PM
  4. Need to modify the code to remove top navigation
    By one_sad_episode in forum "How Do I..." Questions
    Replies: 2
    Last Post: 10-24-2007, 01:58 PM
  5. News Module Modification
    By adnan in forum Modifications (version 3.x & 2.x)
    Replies: 3
    Last Post: 08-14-2007, 02:54 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
  •