Coded something up in Couch in an interesting way? Have a snippet or shortcode to share? Post it here for the community to benefit.
3 posts Page 1 of 1
This is a derivative of the original solution viewtopic.php?p=21634#p21634
It does not expose where is admin folder for downloads with cloak_url.
before:
website.com/couch/download.php?auth=ZvFZ4e7...
after:
website.com/download.php?auth=ZvFZ4e7...


1) Move download.php from folder /couch to your website's root and paste name of your couch admin folder in this download.php on line 40:
before:
if ( !defined('K_COUCH_DIR') ) define( 'K_COUCH_DIR', str_replace( '\\', '/', dirname(realpath(__FILE__) ).'/') );
after:
if ( !defined('K_COUCH_DIR') ) define( 'K_COUCH_DIR', str_replace( '\\', '/', dirname(realpath(__FILE__) ).'/couch/') );


Imp: There must be a trailing slash after admin folder: /couch/, else it will try to find a file called coucheader.php instead of /couch/header.php

2) Open /couch/tags.php in editor and make the change on Line 4884 by changing K_ADMIN_URL to K_SITE_URL. Old line can be commented out and new one pasted:
// Create the cloaked link
// $link = K_ADMIN_URL . 'download.php?auth=' . urlencode( $data . '|' . $hash );
$link = K_SITE_URL . 'download.php?auth=' . urlencode( $data . '|' . $hash );


This should do it.
Thanks for this.
for couch 2.0 this line: $link = K_ADMIN_URL . 'download.php?auth=' . urlencode( $data . '|' . $hash ); found in tags.php has been moved to line 5973 just in case you dont find it on line 4884.

I ran into minor problems however. When I hovered over the download link, the path had changed as intended. But when i clicked it, it threw the following errors:

Warning: require_once(C:/Program Files (x86)/Ampps/www/singles/adminheader.php): failed to open stream: No such file or directory in C:\Program Files (x86)\Ampps\www\singles\download.php on line 41

Fatal error: require_once(): Failed opening required 'C:/Program Files (x86)/Ampps/www/singles/adminheader.php' (include_path='.;C:\php\pear') in C:\Program Files (x86)\Ampps\www\singles\download.php on line 41


I cant figure out what I did wrong as I followed your simple instruction to the letter. Please help!!!
No worries, I'll see into it. Please try to move this installation online. It will be much easier to troubleshoot it. Sent PM.

Solution: A trailing slash was missing. Make sure to specify directory of admin folder with slash.
3 posts Page 1 of 1

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 2 guests

cron