require_once('/home/freesoftwarec/public_html/global.incl.php'); global $dbi; require_once('/home/freesoftwarec/public_html/session_functions.php'); require_once('/home/freesoftwarec/public_html/member_functions.php'); $action = (isset($_GET["action"]) ? $_GET["action"] : ''); ////////////////////////////////////////// // Display form input and process form // ////////////////////////////////////////// initiate_session(); //var_dump($_COOKIE); <--------------------------------------------------------- $meta_insert = 'Free Software Applications from experienced programmers '; //closes
membership){$user->membership="Basic membership";$user->renewal_date="N/A";} //check to see if the user is a developer //if so, give options to enter the developer portal if ($user->developer && $user->DeveloperID>0){ //add link to developer portal $developer = new Developer($dbi, $user->DeveloperID); //if they are a developer or if they are test user 2 if ($developer->Active==1 || $user->user_id == 2){ $load_new_modal = ' '; $load_new_html = '
Submit A New Package
'; } } else { $load_new_modal=""; $load_new_html=""; } $content = "
$load_new_modal

[Software Packages Available]

$load_new_html
$content"; //if there is a specific package selected, display it //in the future, this should probably carry more information such as tutorials and rating/review details if (isset($action) && is_numeric($action)){ $package = new Pkg($dbi,$action); $tmp_rating = (isset($package->PkgRating) ? $package->PkgRating : 5); $cumulative_ratings = display_rating($tmp_rating); $cumulative_reviews = display_reviews(); //get logo and screen shots $screen_shots = ""; //create a time key by adding two random digits to the front and back of unix time so images can't be hotlinked $time_key = "4".$unix_time."3"; foreach ($package->PkgScreenShots as $this_shot){ $screen_shots .= ""; } $support_divs = ""; //the divs that go above the javascript $support_code = ""; //the object variables that go inside the script $iter = 0; //we have to number the variables and the divid's so they are different if more than 1 pdf foreach ($package->PkgSupportDocs as $this_supportdoc){ if (strlen($this_supportdoc)>1){ $support_divs .= '
'; $support_code .= 'var adobeDCView'.$iter.' = new AdobeDC.View({clientId: "5b500982b03f4e0188071abca4501cd4", divId: "adobe-dc-view'.$iter.'"}); adobeDCView'.$iter.'.previewFile({ content:{location: {url: "https://www.thefreesoftwarecenter.com/software/documentation/'.$this_supportdoc.'"}}, metaData:{fileName: "'.$this_supportdoc.'"} }, {embedMode: "IN_LINE"},{showDownloadPDF: false, showPageControls: false, showPrintPDF: false});'; /*$support_docs .= '

'; //#toolbar=0&navpanes=0&scrollbar=0"*/ $iter++; } } if ($iter > 0){ $support_docs = $support_divs.' '; } $top_div = '
'; /*background-repeat: no-repeat; background-size: 100% 100%; background-color:rgba(0, 0, 0, 0.5);*/ /* "
*/ $cumulative_downloads = number_format($package->PkgDownloads, 0, ".", ","); //build download link for downloads.php, encrypt link, add time stamp $encryption = openssl_encrypt($package->PackageID, $ciphering, $encryption_key, $options, $encryption_iv); $time_key = "4".$unix_time."3"; $removefrom = array(":", " ", "'", "(", ")", ".", "[", "]", ",", "=", "+"); $download_name = str_replace($removefrom, "_",$package->PackageName); $download_link = "/software/download.php?action=$encryption&v=$time_key&package=$download_name"; //format file size $bytes = formatBytes($package->PkgFileSize, 2); //get support options into a readable text block $support_options = "::".$package->PkgSupportOptions; $support_array = array(); if (strpos($support_options, "Online")>0){$support_array[] = "Online Documents";} if (strpos($support_options, "Email")>0){$support_array[] = "Email Support";} if (strpos($support_options, "Paid")>0){$support_array[] = "Paid Support";} $support = implode(", ", $support_array); //convert OS to readable if ($package->PkgOS=="win7"){$os_display = "Windows 7 or Later";} else if ($package->PkgOS=="win7"){$os_display = "Windows 8 or Later";} else {$os_display = "Windows 10 or Later";} $content .= $top_div.'

'.$package->PackageName.'

'.$package->PkgTagLine.'

Software Package Details:

Created By: '.$package->DeveloperName.'
submitted '.$package->DateSubmitted.'
Reviews: '.$cumulative_reviews.'  |  Rating: '.$cumulative_ratings.'
Total Downloads: '.$cumulative_downloads.'
Description:
'.$package->PkgDescription.'
OS:  '.$os_display.'
Support Options:  '.$support.'
Download Size:  '.$bytes.'
Screen Shots / Previews:
'.$screen_shots.'
Installation & Support:
'.$support_docs.'
'; } //otherwise, display all in summary format //this should probably display a more summary version of the software //and definitely needs pagination as we get over 8 or 10 softare packages else { $query = "SELECT * FROM `software_packages` where `PkgActive` = 1"; //if the query returns results, analyze it if ($result = $dbi->query($query)){ while ($obj = $result->fetch_object()){ $package = new Pkg($dbi,$obj->PackageID); $tmp_rating = (isset($package->PkgRating) ? $package->PkgRating : 5); $cumulative_ratings = display_rating($tmp_rating); $cumulative_reviews = display_reviews(); // .hero-logo { // background-image: url("photographer.jpg"); /* The image used */ // background-color: #cccccc; /* Used if the image is unavailable */ // height: 500px; /* You must set a specified height */ // background-position: right; /* Center the image */ // background-repeat: no-repeat; /* Do not repeat the image */ // background-size: ; /* Resize the background image to cover the entire container */ // } //get logo and screen shots $screen_shots = ""; //create a time key by adding two random digits to the front and back of unix time so images can't be hotlinked $time_key = "4".$unix_time."3"; foreach ($package->PkgScreenShots as $this_shot){ $screen_shots .= ""; } $support_docs_div = ""; if (isset($package->PkgSupportDocs)){ $support_docs_div = ''; } $top_div = '
'; /*background-repeat: no-repeat; background-size: 100% 100%; background-color:rgba(0, 0, 0, 0.5);*/ /* "
*/ $cumulative_downloads = number_format($package->PkgDownloads, 0, ".", ","); //build download link for downloads.php, encrypt link, add time stamp $encryption = openssl_encrypt($package->PackageID, $ciphering, $encryption_key, $options, $encryption_iv); $time_key = "4".$unix_time."3"; $removefrom = array(":", " ", "'", "(", ")", ".", "[", "]", ",", "=", "+"); $download_name = str_replace($removefrom, "_",$package->PackageName); $download_link = "/software/download.php?action=$encryption&v=$time_key&package=$download_name"; //format file size $bytes = formatBytes($package->PkgFileSize, 2); //get support options into a readable text block $support_options = "::".$package->PkgSupportOptions; $support_array = array(); if (strpos($support_options, "Online")>0){$support_array[] = "Online Documents";} if (strpos($support_options, "Email")>0){$support_array[] = "Email Support";} if (strpos($support_options, "Paid")>0){$support_array[] = "Paid Support";} $support = implode(", ", $support_array); //convert OS to readable if ($package->PkgOS=="win7"){$os_display = "Windows 7 or Later";} else if ($package->PkgOS=="win7"){$os_display = "Windows 8 or Later";} else {$os_display = "Windows 10 or Later";} $content .= $top_div.'

'.$package->PackageName.'

'.$package->PkgTagLine.'

Software Package Details:

Created By: '.$package->DeveloperName.'
submitted '.$package->DateSubmitted.'
Reviews: '.$cumulative_reviews.'  |  Rating: '.$cumulative_ratings.'
Total Downloads: '.$cumulative_downloads.'
Description:
'.$package->PkgDescription.'
OS:  '.$os_display.'
Support Options:  '.$support.'
Download Size:  '.$bytes.'
Screen Shots / Previews:
'.$screen_shots.'
'.$support_docs_div.'
'; } } else { $content .= ''; } } } //otherwise check for pacakges which are viewable by the general public else { $load_new_html = ''; $content = "

[Software Packages Available]

$load_new_html
$content"; //if there is a specific package selected, display it //in the future, this should probably carry more information such as tutorials and rating/review details if (isset($action) && is_numeric($action)){ $package = new Pkg($dbi,$action); //if the package is publicly viewable or downloadable proceed if ($package->PkgAccess > 0){ $tmp_rating = (isset($package->PkgRating) ? $package->PkgRating : 5); $cumulative_ratings = display_rating($tmp_rating); $cumulative_reviews = display_reviews(); //get logo and screen shots $screen_shots = ""; //create a time key by adding two random digits to the front and back of unix time so images can't be hotlinked $time_key = "4".$unix_time."3"; foreach ($package->PkgScreenShots as $this_shot){ $screen_shots .= ""; } $support_divs = ""; //the divs that go above the javascript $support_code = ""; //the object variables that go inside the script $iter = 0; //we have to number the variables and the divid's so they are different if more than 1 pdf //installation and support documents have been removed from public view $top_div = '
'; $cumulative_downloads = number_format($package->PkgDownloads, 0, ".", ","); //build download link for downloads.php, encrypt link, add time stamp $encryption = openssl_encrypt($package->PackageID, $ciphering, $encryption_key, $options, $encryption_iv); $time_key = "4".$unix_time."3"; $removefrom = array(":", " ", "'", "(", ")", ".", "[", "]", ",", "=", "+"); $download_name = str_replace($removefrom, "_",$package->PackageName); $download_link = "/software/download.php?action=$encryption&v=$time_key&package=$download_name"; //if the package is publicly downloadable, allow it if ($package->PkgAccess == 2){ $download_button = 'Download Now!'; } else { $download_button = 'Join the Community to Download!'; } //format file size $bytes = formatBytes($package->PkgFileSize, 2); //get support options into a readable text block $support_options = "::".$package->PkgSupportOptions; $support_array = array(); if (strpos($support_options, "Online")>0){$support_array[] = "Online Documents";} if (strpos($support_options, "Email")>0){$support_array[] = "Email Support";} if (strpos($support_options, "Paid")>0){$support_array[] = "Paid Support";} $support = implode(", ", $support_array); //convert OS to readable if ($package->PkgOS=="win7"){$os_display = "Windows 7 or Later";} else if ($package->PkgOS=="win7"){$os_display = "Windows 8 or Later";} else {$os_display = "Windows 10 or Later";} $content .= $top_div.'

'.$package->PackageName.'

'.$package->PkgTagLine.'

Software Package Details:

Created By: '.$package->DeveloperName.'
submitted '.$package->DateSubmitted.'
Reviews: '.$cumulative_reviews.'  |  Rating: '.$cumulative_ratings.'
Total Downloads: '.$cumulative_downloads.'
Description:
'.$package->PkgDescription.'
OS:  '.$os_display.'
Support Options:  '.$support.'
Download Size:  '.$bytes.'
'.$download_button.'
Screen Shots / Previews:
'.$screen_shots.'
Installation & Support:
Installation and support documents are only available to community members!
'; } else { $content .= $body_login_form; } } //otherwise, display all in summary format //this should probably display a more summary version of the software //and definitely needs pagination as we get over 8 or 10 softare packages else { $query = "SELECT * FROM `software_packages` where `PkgActive` = 1 and `PkgAccess` > 0"; //if the query returns results, analyze it if ($result = $dbi->query($query)){ while ($obj = $result->fetch_object()){ $package = new Pkg($dbi,$obj->PackageID); $tmp_rating = (isset($package->PkgRating) ? $package->PkgRating : 5); $cumulative_ratings = display_rating($tmp_rating); $cumulative_reviews = display_reviews(); // .hero-logo { // background-image: url("photographer.jpg"); /* The image used */ // background-color: #cccccc; /* Used if the image is unavailable */ // height: 500px; /* You must set a specified height */ // background-position: right; /* Center the image */ // background-repeat: no-repeat; /* Do not repeat the image */ // background-size: ; /* Resize the background image to cover the entire container */ // } //get logo and screen shots $screen_shots = ""; //create a time key by adding two random digits to the front and back of unix time so images can't be hotlinked $time_key = "4".$unix_time."3"; foreach ($package->PkgScreenShots as $this_shot){ $screen_shots .= ""; } $support_docs_div = ""; if (isset($package->PkgSupportDocs)){ $support_docs_div = ''; } $top_div = '
'; $cumulative_downloads = number_format($package->PkgDownloads, 0, ".", ","); //build download link for downloads.php, encrypt link, add time stamp $encryption = openssl_encrypt($package->PackageID, $ciphering, $encryption_key, $options, $encryption_iv); $time_key = "4".$unix_time."3"; $removefrom = array(":", " ", "'", "(", ")", ".", "[", "]", ",", "=", "+"); $download_name = str_replace($removefrom, "_",$package->PackageName); $download_link = "/software/download.php?action=$encryption&v=$time_key&package=$download_name"; //if the package is publicly downloadable, allow it if ($package->PkgAccess == 2){ $download_button = 'Download Now!'; } else { $download_button = 'Join the Community to Download!'; } //format file size $bytes = formatBytes($package->PkgFileSize, 2); //get support options into a readable text block $support_options = "::".$package->PkgSupportOptions; $support_array = array(); if (strpos($support_options, "Online")>0){$support_array[] = "Online Documents";} if (strpos($support_options, "Email")>0){$support_array[] = "Email Support";} if (strpos($support_options, "Paid")>0){$support_array[] = "Paid Support";} $support = implode(", ", $support_array); //convert OS to readable if ($package->PkgOS=="win7"){$os_display = "Windows 7 or Later";} else if ($package->PkgOS=="win7"){$os_display = "Windows 8 or Later";} else {$os_display = "Windows 10 or Later";} $content .= $top_div.'

'.$package->PackageName.'

'.$package->PkgTagLine.'

Software Package Details:

Created By: '.$package->DeveloperName.'
submitted '.$package->DateSubmitted.'
Reviews: '.$cumulative_reviews.'  |  Rating: '.$cumulative_ratings.'
Total Downloads: '.$cumulative_downloads.'
Description:
'.$package->PkgDescription.'
OS:  '.$os_display.'
Support Options:  '.$support.'
Download Size:  '.$bytes.'
'.$download_button.'
Screen Shots / Previews:
'.$screen_shots.'
'.$support_docs_div.'
'; } } else { $content .= 'There are currently no software packages available for non-members to download.
Please Join the Community or Login to access our full line of software packages!
'; $content .= $body_login_form; } } } $content .= "
"; //remove an extra div if it got created $content = str_replace('
', "", $content); $_POST = array(); //echo $logged.$user1name.$user_id; $header = get_header(); $footer = get_footer(); //////////////////////////// //SCRIPT TO SHOW PASSWORD // //////////////////////////// $test_footer = <<