Opened 6 years ago

Closed 5 years ago

#410 closed change (fixed)

Publishing results of ABP-Sticky study as PDF on adblockplus.org

Reported by: ben Assignee:
Priority: P3 Milestone:
Module: Websites Keywords:
Cc: fhd, trev Blocked By:
Blocking: Platform: Unknown
Ready: yes Confidential: no
Tester: Verified working: no
Review URL(s):

Description

Background

I would like to publish the results of an eyetracking test to adblockplus.org, so that I can link to it in this blogpost: https://adblockplus.org/blog/eyetracking-study-results

What to change

Add attached file to website.

Attachments (1)

Ad effectiveness study - Adblock plus - April 2014.pdf (1.3 MB) - added by ben 6 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 6 years ago by fhd

You can upload the file directly to the blog, form the "File" tab: https://adblockplus.org/textpattern/index.php?event=file

comment:2 Changed 6 years ago by ben

I apparently don't have the rights for that -- the link takes me to a page that says "Restricted Area."

comment:3 Changed 6 years ago by philll

  • Cc fhd added

@fhd: see comment2

comment:4 follow-up: Changed 6 years ago by fhd

Sorry, was on holiday. Should definitely work now, turns out we've put the non-devs in a group that can do pretty much anything but upload files and images. Can you verify that it works and close this, Ben?

comment:5 in reply to: ↑ 4 Changed 6 years ago by ben

  • Resolution set to fixed
  • Status changed from new to closed

Replying to fhd:

Sorry, was on holiday. Should definitely work now, turns out we've put the non-devs in a group that can do pretty much anything but upload files and images. Can you verify that it works and close this, Ben?

comment:6 Changed 6 years ago by philll

While this issue was only about providing the file and thereby might be fixed or not, I still face the links pointing to box.com.

comment:7 Changed 6 years ago by ben

I uploaded the file, but could not link to it in the post. I attempted to create a tag for it, then link to that, but it did not work. So I don't know how to replace the box.com link with the file.

comment:8 Changed 6 years ago by fhd

  • Component changed from Unknown to Infrastructure
  • Priority changed from Unknown to P3
  • Resolution fixed deleted
  • Status changed from closed to reopened

Yeah, there's something off, we'll look into it. Reopening.

comment:9 Changed 6 years ago by trev

The link works now but it offers to download file. We should be better off using https://adblockplus.org/textpattern/files/Ad%20effectiveness%20study%20-%20Adblock%20plus%20-%20April%202014.pdf where the same file is served by the web server rather than Textpattern. We'll need a custom Textpattern plugin to generate that link however.

comment:10 Changed 6 years ago by trev

  • Cc trev added

Linking to this file is now possible via a custom tag, either by file name or ID:

<txp:abp_filedownload filename="Ad effectiveness study - Adblock plus - April 2014.pdf">download</txp:abp_filedownload>
<txp:abp_filedownload id="1">download</txp:abp_filedownload>

Unfortunately, Textpattern plugins are stored in the database. Here is the plugin source code:

function abp_filedownload($attrs, $content = NULL)
{
  extract(lAtts(array(
    'filename' => '',
    'id'       => '',
  ), $attrs));

  $file = NULL;
  if ($id)
  {
    $file = fileDownloadFetchInfo('id = '.intval($id));
  }
  elseif ($filename)
  {
    $file = fileDownloadFetchInfo("filename = '".doSlash($filename)."'");
  }

  if ($file)
  {
    $filename = $file['filename'];
    if (preg_match('/gz$/i', $filename))
      $filename .= a;

    $url = "/textpattern/files/" . rawurlencode($file['filename']);
    if ($content)
      return href(parse($content), $url);
    else
      return $content;
  }
}

fhd, could you review? This is essentially file_download_link() combined with a modified version of filedownloadurl() from the Textpattern source. It would have been better to simply override the filedownloadurl() function but this doesn't seem possible in PHP, at least not without extensions.

comment:11 Changed 5 years ago by saroyanm

  • Component changed from Infrastructure to Websites
  • Platform set to Unknown

comment:12 Changed 5 years ago by fhd

Sorry for the delay, looks good to me.

comment:13 Changed 5 years ago by trev

  • Ready set
  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.