Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

Commit

Permalink
Updated for installation in subfolder and optional use of index.php i…
Browse files Browse the repository at this point in the history
…n url.
  • Loading branch information
mstuyts authored May 19, 2017
1 parent 0a22585 commit 7af6828
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@
$maincontent.="\n\t\t<author_name><![CDATA[".@$plugin['author']."]]></author_name>";
$maincontent.="\n\t\t<download_url>http";
if($_SERVER['SERVER_PORT'] == 443){$maincontent.="s";}
$maincontent.="://$_SERVER[HTTP_HOST]/downloads/".@$plugin['filename']."</download_url>";
$folder=strtok($_SERVER["REQUEST_URI"],'?');
if(substr($folder, -9,9)=="index.php"){
$folder=substr($folder, 0,-9);
}
$maincontent.="://".$_SERVER['HTTP_HOST'].$folder."downloads/".@$plugin['filename']."</download_url>";
$maincontent.="\n\t\t<uploaded_by><![CDATA[".@$plugin['author']."]]></uploaded_by>";
$maincontent.="\n\t\t<create_date><![CDATA[".@$plugin['create_date']."]]></create_date>";
$maincontent.="\n\t\t<update_date><![CDATA[".@$plugin['update_date']."]]></update_date>";
Expand Down

0 comments on commit 7af6828

Please sign in to comment.