feat: Add comprehensive documentation suite and reorganize project structure

- Created complete documentation in docs/ directory
- Added PROJECT_OVERVIEW.md with feature highlights and getting started guide
- Added ARCHITECTURE.md with system design and technical details
- Added SECURITY.md with comprehensive security implementation guide
- Added DEVELOPMENT.md with development workflows and best practices
- Added DEPLOYMENT.md with production deployment instructions
- Added API.md with complete REST API documentation
- Added CONTRIBUTING.md with contribution guidelines
- Added CHANGELOG.md with version history and migration notes
- Reorganized all documentation files into docs/ directory for better organization
- Updated README.md with proper documentation links and quick navigation
- Enhanced project structure with professional documentation standards
This commit is contained in:
SamiAhmed7777
2025-10-21 00:39:45 -07:00
commit 0b7e2d0a5b
6080 changed files with 1332936 additions and 0 deletions

View File

@@ -0,0 +1,99 @@
<?php
/*******************************************************************************************************************
| Software Name : EasyStream
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
| Software Author : (c) Sami Ahmed
|*******************************************************************************************************************
|
|*******************************************************************************************************************
| This source file is subject to the EasyStream Proprietary License Agreement.
|
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|*******************************************************************************************************************
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|*******************************************************************************************************************/
define('_ISVALID', true);
$main_dir = realpath(dirname(__FILE__) . '/../../../');
set_include_path($main_dir);
include_once 'f_core/config.core.php';
include_once 'f_core/f_classes/class_recaptcha/autoload.php';
include_once 'f_core/f_classes/class_thumb/ThumbLib.inc.php';
include_once $class_language->setLanguageFile('frontend', 'language.global');
include_once $class_language->setLanguageFile('frontend', 'language.account');
include_once $class_language->setLanguageFile('frontend', 'language.email.notif');
include_once $class_language->setLanguageFile('frontend', 'language.notifications');
include_once $class_language->setLanguageFile('frontend', 'language.signup');
$error_message = null;
$notice_message = null;
$cfg = $class_database->getConfigurations('paid_memberships,backend_email,backend_username,signup_domain_restriction,list_email_domains,signup_min_password,signup_max_password,email_change_captcha,keep_entries_open,user_image_max_size,user_image_allowed_extensions,user_image_width,user_image_height,activity_logging,file_favorites,file_rating,file_comments,channel_comments,file_respnses,approve_friends,file_counts,numeric_delimiter,channel_views,recaptcha_site_key,recaptcha_secret_key,affiliate_module,affiliate_tracking_id,affiliate_view_id,affiliate_maps_api_key,affiliate_token_script,affiliate_payout_figure,affiliate_payout_currency,affiliate_payout_units,affiliate_payout_share,affiliate_requirements_type,affiliate_requirements_min');
$logged_in = VLogin::checkFrontend(VHref::getKey('account'));
$membership_check = ($cfg["paid_memberships"] == 1 and $_SESSION["USER_ID"] > 0) ? VLogin::checkSubscription() : null;
$notice_message = ($_POST and $_GET["do"] == '') ? VUseraccount::doChanges() : null;
$user_key = $class_filter->clr_str($_SESSION["USER_KEY"]);
$files = new VFiles;
$smarty->assign('page_display', 'tpl_account');
switch ($_GET["s"]) {
case "account-menu-entry1":
case "account-menu-entry13":
$tpl_page = 'tpl_overview.tpl';
switch ($_GET["do"]) {
case "loading":$smarty->display('tpl_frontend/tpl_acct/tpl_overview_image.tpl');
break;
case "cancel":VUseraccount::cancelProfileImage();
break;
case "upload":VUseraccount::changeProfileImage($user_key);
break;
case "save":VUseraccount::saveProfileImage($user_key);
break;
case "make-affiliate":echo VAffiliate::affiliateRequest();
break;
case "make-affiliate-email":$html = $_POST ? VAffiliate::affiliateRequestEmail() : null;
break;
}
break;
case "account-menu-entry2":
$tpl_page = 'tpl_profile_setup.tpl';
break;
case "account-menu-entry3":
$tpl_page = '';
break;
case "account-menu-entry4":
$tpl_page = 'tpl_email_opts.tpl';
if ($_POST) {
switch ($_GET["do"]) {
case "emchange":VUseraccount::changeEmail();
break;
}
}
break;
case "account-menu-entry5":$tpl_page = 'tpl_activity.tpl';
break;
case "account-menu-entry6":
$tpl_page = 'tpl_manage_acct.tpl';
if ($_POST) {
switch ($_GET["do"]) {
case "cpass":VUseraccount::changePassword();
break;
case "purge":VUseraccount::purgeAccount();
break;
}
}
break;
}
if (!isset($_GET["s"]) and !isset($_GET["do"])) {
VAffiliate::allowRequest();
$smarty->assign('c_section', VHref::getKey("account"));
}
$section_menus = (intval($_SESSION["USER_ID"]) > 0) ? $smarty->assign('keep_entries_open', $_SESSION[$_SESSION["USER_KEY"] . '_list']) : null;
$display_section = ($_GET["s"] != '' and !isset($_GET["do"])) ? $smarty->display('tpl_frontend/tpl_acct/' . $tpl_page) : null;
$display_page = (!isset($_GET["s"]) and !isset($_GET["do"])) ? $class_smarty->displayPage('frontend', 'tpl_account', $error_message, $notice_message) : null;

View File

@@ -0,0 +1,8 @@
<?php
define("_ISVALID", true);
include_once "f_core/config.core.php";
// Affiliate system - basic implementation
echo "<h1>Affiliate Program</h1>";
echo "<p>Affiliate program functionality coming soon...</p>";
echo "<a href=\"/account\">← Back to Account</a>";
?>

View File

@@ -0,0 +1,83 @@
<?php
/*******************************************************************************************************************
| Software Name : EasyStream
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
| Software Author : (c) Sami Ahmed
|*******************************************************************************************************************
|
|*******************************************************************************************************************
| This source file is subject to the EasyStream Proprietary License Agreement.
|
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|*******************************************************************************************************************
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|*******************************************************************************************************************/
define('_ISVALID', true);
include_once 'f_core/config.core.php';
include_once $class_language->setLanguageFile('frontend', 'language.global');
include_once $class_language->setLanguageFile('frontend', 'language.account');
include_once $class_language->setLanguageFile('frontend', 'language.notifications');
include_once $class_language->setLanguageFile('frontend', 'language.view');
include_once $class_language->setLanguageFile('frontend', 'language.files.menu');
include_once $class_language->setLanguageFile('frontend', 'language.browse');
include_once $class_language->setLanguageFile('frontend', 'language.channel');
include_once $class_language->setLanguageFile('frontend', 'language.manage.channel');
include_once $class_language->setLanguageFile('frontend', 'language.files');
include_once $class_language->setLanguageFile('frontend', 'language.signup');
include_once $class_language->setLanguageFile('frontend', 'language.userpage');
$error_message = null;
$notice_message = null;
$cfg = $class_database->getConfigurations('image_player,video_player,audio_player,document_player,paid_memberships,file_favorites,file_playlists,file_watchlist,file_responses,user_subscriptions,public_channels,channel_bulletins,event_map,user_friends,user_blocking,approve_friends,activity_logging,channel_comments,ucc_limit,comment_min_length,comment_max_length,channel_backgrounds,channel_bg_allowed_extensions,channel_bg_max_size,file_favorites,file_rating,file_comments,file_views,channel_views,guest_view_channel,file_promo,comment_emoji');
$guest_chk = $_SESSION["USER_ID"] == '' ? VHref::guestPermissions('guest_view_channel', VHref::getKey("channels")) : null;
$membership_check = ($cfg["paid_memberships"] == 1 and $_SESSION["USER_ID"] > 0) ? VLogin::checkSubscription() : null;
$channel = new VChannel;
if (isset($_GET["a"])) {
switch ($_GET["a"]) {
case "postbulletin":
echo $ht = VChannel::postBulletin();
break;
case "hideuseractivity":
echo $ht = VChannel::hideActivity();
break;
case "cb-addfr": //add friends
case "cb-remfr": //remove friend
case "cb-block": //block friend
case "cb-unblock": //unblock friend
$notifier = new VNotify;
echo $do = $_POST ? VChannel::userActions($_GET["a"]) : null;
break;
}
}
if (isset($_GET["do"])) {
$vview = new VView;
switch ($_GET["do"]) {
case "sub-option":
echo $do_load = VView::subHtml('', 'channel');
break;
case "unsub-option":
echo $do_load = VView::subHtml(1, 'channel');
break;
case "sub-continue":
echo $do_load = VView::subContinue('channel');
break;
case "user-unsubscribe":
echo $do_load = VSubscriber::unsub_request((int) $_POST["uf_vuid"]);
break;
}
}
if (!isset($_GET["s"]) and !isset($_GET["do"]) and !isset($_GET["a"]) and $error_message == '' and isset($_SESSION["q"])) {$_SESSION["q"] = null;}
$update_views = (!isset($_GET["s"]) and !isset($_GET["do"]) and !isset($_GET["a"]) and $error_message == '') ? VChannel::updateViews() : null;
$display_page = (!isset($_GET["a"]) and !isset($_GET["do"])) ? $class_smarty->displayPage('frontend', 'tpl_channel', $error_message, $notice_message) : null;

View File

@@ -0,0 +1,105 @@
<?php
/*******************************************************************************************************************
| Software Name : EasyStream
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
| Software Author : (c) Sami Ahmed
|*******************************************************************************************************************
|
|*******************************************************************************************************************
| This source file is subject to the EasyStream Proprietary License Agreement.
|
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|*******************************************************************************************************************
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|*******************************************************************************************************************/
define('_ISVALID', true);
$main_dir = realpath(dirname(__FILE__) . '/../../../');
set_include_path($main_dir);
include_once 'f_core/config.core.php';
include_once $class_language->setLanguageFile('frontend', 'language.global');
include_once $class_language->setLanguageFile('frontend', 'language.home');
include_once $class_language->setLanguageFile('frontend', 'language.files.menu');
include_once $class_language->setLanguageFile('frontend', 'language.account');
include_once $class_language->setLanguageFile('frontend', 'language.userpage');
include_once $class_language->setLanguageFile('frontend', 'language.notifications');
include_once $class_language->setLanguageFile('frontend', 'language.signup');
include_once $class_language->setLanguageFile('frontend', 'language.view');
$error_message = null;
$notice_message = null;
$cfg = $class_database->getConfigurations('paid_memberships,backend_email,backend_username,channel_comments,file_counts,numeric_delimiter,channel_views,user_subscriptions,user_friends,user_blocking,internal_messaging,approve_friends,channel_promo');
$guest_chk = $_SESSION["USER_ID"] == '' ? VHref::guestPermissions('guest_browse_channel', VHref::getKey("channels")) : null;
$membership_check = ($cfg["paid_memberships"] == 1 and $_SESSION["USER_ID"] > 0) ? VLogin::checkSubscription() : null;
$section = VHref::getKey('channels');
$channels = new VChannels;
if (isset($_GET["p"]) and (int) $_GET["p"] >= 0) {
//viewmode changer/loader
$view_mode = (int) $_GET["m"];
switch ($view_mode) {
case "1":
case "2":
echo $html = VChannels::viewMode_loader($view_mode);
break;
}
}
if (isset($_GET["a"])) {
switch ($_GET["a"]) {
case "sub":
$act = VChannels::chSubscribe();
break;
case "unsub":
$act = VChannels::chSubscribe(1);
break;
case "cb-addfr":
case "cb-remfr":
case "cb-block":
case "cb-unblock":
$act = VChannels::contactActions($_GET["a"]);
break;
case "cb-msg":
$act = VChannels::sessionMessageName();
break;
case "vm":
echo $ct = VChannels::viewMode();
break;
}
}
if (isset($_GET["do"])) {
if ($_GET["do"] == 'sub-option' or $_GET["do"] == 'unsub-option' or $_GET["do"] == 'sub-continue' or $_GET["do"] == 'user-sub' or $_GET["do"] == 'user-unsub') {
$vview = new VView;
}
switch ($_GET["do"]) {
case "subscribe":break;
case "user-unsubscribe":
echo $do_load = VSubscriber::unsub_request((int) $_POST["uf_vuid"]);
break;
case "sub-option":
echo $do_load = VView::subHtml(0, 'home');
break;
case "unsub-option":
echo $do_load = VView::subHtml(1, 'home');
break;
case "sub-continue":
echo $do_load = VView::subContinue('channels');
break;
}
}
if (!isset($_GET["sort"]) and !isset($_GET["s"]) and !isset($_GET["a"]) and !isset($_GET["p"]) and !isset($_GET["do"])) {
$smarty->assign('c_section', VHref::getKey("channels"));
$_SESSION["q"] = null;
}
echo $display_page = (!isset($_GET["sort"]) and !isset($_GET["s"]) and !isset($_GET["a"]) and !isset($_GET["p"]) and !isset($_GET["do"])) ? $class_smarty->displayPage('frontend', 'tpl_channels', $error_message, $notice_message) : null;

View File

@@ -0,0 +1,23 @@
<?php
/*******************************************************************************************************************
| Software Name : EasyStream
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
| Software Author : (c) Sami Ahmed
|*******************************************************************************************************************
|
|*******************************************************************************************************************
| This source file is subject to the EasyStream Proprietary License Agreement.
|
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|*******************************************************************************************************************
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|*******************************************************************************************************************/
define('_ISVALID', true);
$main_dir = realpath(dirname(__FILE__) . '/../../../');
set_include_path($main_dir);
include_once 'f_core/config.core.php';
$act = VSubscriber::get_live_viewers();

View File

@@ -0,0 +1,63 @@
<?php
/*******************************************************************************************************************
| Software Name : EasyStream
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
| Software Author : (c) Sami Ahmed
|*******************************************************************************************************************
|
|*******************************************************************************************************************
| This source file is subject to the EasyStream Proprietary License Agreement.
|
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|*******************************************************************************************************************
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|*******************************************************************************************************************/
define('_ISVALID', true);
include_once 'f_core/config.core.php';
include_once $class_language->setLanguageFile('frontend', 'language.global');
include_once $class_language->setLanguageFile('frontend', 'language.account');
include_once $class_language->setLanguageFile('frontend', 'language.notifications');
include_once $class_language->setLanguageFile('frontend', 'language.manage.channel');
$error_message = null;
$notice_message = null;
$cfg = $class_database->getConfigurations('paid_memberships,backend_email,backend_username,channel_backgrounds,channel_comments,file_counts,numeric_delimiter,channel_views,channel_bg_max_size,channel_bg_allowed_extensions,user_subscriptions,user_friends,user_blocking,internal_messaging,approve_friends');
$logged_in = VLogin::checkFrontend(VHref::getKey('manage_channel'));
$membership_check = ($cfg["paid_memberships"] == 1 and $_SESSION["USER_ID"] > 0) ? VLogin::checkSubscription() : null;
$channel = new VChannel;
switch ($_GET["s"]) {
case "channel-menu-entry1": //general setup
echo ($_POST ? VChannel::postChanges('ch_setup') : VChannel::manage_general());
break;
case "channel-menu-entry2": //channel modules
echo ($_POST ? VChannel::postChanges('ch_modules') : VChannel::manage_modules());
break;
case "channel-menu-entry3": //channel art
if (isset($_GET["do"])) {
switch ($_GET["do"]) {
case "edit-crop":$method = 'edit_crop';
break;
case "edit-gcrop":$method = 'edit_crop';
break;
case "delete-crop":$method = 'html_delete_crop';
break;
}
} else {
$method = 'manage_art';
}
echo ($_POST ? VChannel::postChanges('ch_art') : VChannel::$method());
break;
case "channel-menu-entry4":
break;
}
if (!isset($_GET["s"]) and !isset($_GET["do"])) {
$smarty->assign('c_section', VHref::getKey("manage_channel"));
}
echo $display_page = (!isset($_GET["s"])) ? $class_smarty->displayPage('frontend', 'tpl_manage_channel', $error_message, $notice_message) : null;

View File

@@ -0,0 +1,74 @@
<?php
/*******************************************************************************************************************
| Software Name : EasyStream
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
| Software Author : (c) Sami Ahmed
|*******************************************************************************************************************
|
|*******************************************************************************************************************
| This source file is subject to the EasyStream Proprietary License Agreement.
|
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|*******************************************************************************************************************
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|*******************************************************************************************************************/
define('_ISVALID', true);
define('_ISADMIN', true);
include_once 'f_core/config.core.php';
include_once $class_language->setLanguageFile('backend', 'language.dashboard');
include_once $class_language->setLanguageFile('backend', 'language.settings.entries');
include_once $class_language->setLanguageFile('backend', 'language.subscriber');
include_once $class_language->setLanguageFile('frontend', 'language.global');
include_once $class_language->setLanguageFile('frontend', 'language.account');
include_once $class_language->setLanguageFile('frontend', 'language.email.notif');
include_once $class_language->setLanguageFile('frontend', 'language.notifications');
include_once $class_language->setLanguageFile('frontend', 'language.signup');
$error_message = null;
$notice_message = null;
$ipn_check = false;
$cfg[] = $class_database->getConfigurations('paypal_test,paypal_test_email,affiliate_module,affiliate_tracking_id,affiliate_view_id,affiliate_maps_api_key,affiliate_token_script,affiliate_payout_figure,affiliate_payout_units,affiliate_payout_currency,affiliate_payout_share,sub_shared_revenue,subscription_payout_currency,channel_views,sub_threshold,partner_requirements_min,partner_requirements_type');
$logged_in = !$ipn_check ? VLogin::checkFrontend(VHref::getKey("subscribers")) : null;
$analytics = false;
if (isset($_GET["do"])) {
switch ($_GET["do"]) {
case "save-subscriber":
echo $ht = VAffiliate::affiliateProfile(1);
break;
case "showstats":
echo $ht = VSubscriber::userStats();
break;
case "make-partner":
case "clear-partner":
echo $ht = VAffiliate::affiliateRequest();
break;
case "make-partner-email":
case "clear-partner-email":
$ht = $_POST ? VAffiliate::affiliateRequestEmail() : null;
break;
}
}
if (!isset($_GET["s"]) and !isset($_GET["do"])) {
VAffiliate::allowRequest('partner');
$smarty->assign('c_section', VHref::getKey("subscribers"));
}
if (!isset($_GET["do"])) {
$smarty->assign('file_type', 'sub');
if (isset($_GET["rg"]) and isset($_SESSION["USER_PARTNER"]) and (int) $_SESSION["USER_PARTNER"] == 1) {
$smarty->assign('html_payouts', VSubscriber::html_payouts(1));
} else if (isset($_GET["rp"]) and isset($_SESSION["USER_PARTNER"]) and (int) $_SESSION["USER_PARTNER"] == 1) {
$smarty->assign('html_payouts', VSubscriber::html_payouts());
} else if ((isset($_GET["rg"]) and (!isset($_SESSION["USER_PARTNER"]) or (int) $_SESSION["USER_PARTNER"] == 0)) or (isset($_GET["rp"]) and (!isset($_SESSION["USER_PARTNER"]) or (int) $_SESSION["USER_PARTNER"] == 0))) {
header("Location: " . $cfg["main_url"] . '/' . VHref::getKey("subscribers"));
exit;
}
$class_smarty->displayPage('frontend', 'tpl_subscribers', $error_message, $notice_message);
}

View File

@@ -0,0 +1,26 @@
<?php
/*******************************************************************************************************************
| Software Name : EasyStream
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
| Software Author : (c) Sami Ahmed
|*******************************************************************************************************************
|
|*******************************************************************************************************************
| This source file is subject to the EasyStream Proprietary License Agreement.
|
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|*******************************************************************************************************************
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|*******************************************************************************************************************/
define('_ISVALID', true);
$main_dir = realpath(dirname(__FILE__) . '/../../../');
set_include_path($main_dir);
include_once 'f_core/config.core.php';
$error_message = null;
$notice_message = null;
$do_sync = VSubscriber::sync_df();

View File

@@ -0,0 +1,26 @@
<?php
/*******************************************************************************************************************
| Software Name : EasyStream
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
| Software Author : (c) Sami Ahmed
|*******************************************************************************************************************
|
|*******************************************************************************************************************
| This source file is subject to the EasyStream Proprietary License Agreement.
|
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|*******************************************************************************************************************
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|*******************************************************************************************************************/
define('_ISVALID', true);
$main_dir = realpath(dirname(__FILE__) . '/../../../');
set_include_path($main_dir);
include_once 'f_core/config.core.php';
$error_message = null;
$notice_message = null;
$do_sync = VSubscriber::sync_subs();

View File

@@ -0,0 +1,26 @@
<?php
/*******************************************************************************************************************
| Software Name : EasyStream
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
| Software Author : (c) Sami Ahmed
|*******************************************************************************************************************
|
|*******************************************************************************************************************
| This source file is subject to the EasyStream Proprietary License Agreement.
|
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|*******************************************************************************************************************
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|*******************************************************************************************************************/
define('_ISVALID', true);
$main_dir = realpath(dirname(__FILE__) . '/../../../');
set_include_path($main_dir);
include_once 'f_core/config.core.php';
$error_message = null;
$notice_message = null;
$do_sync = VSubscriber::sync_vods();

View File

@@ -0,0 +1,148 @@
<?php
/*******************************************************************************************************************
| Software Name : EasyStream
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
| Software Author : (c) Sami Ahmed
|*******************************************************************************************************************
|
|*******************************************************************************************************************
| This source file is subject to the EasyStream Proprietary License Agreement.
|
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|*******************************************************************************************************************
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|*******************************************************************************************************************/
define('_ISVALID', true);
if (isset($_SERVER["HTTP_ORIGIN"]) === true) {
$origin = $_SERVER["HTTP_ORIGIN"];
$allowed_origins = array(
"http://192.168.100.77",
"http://192.168.100.77:3000",
);
if (in_array($origin, $allowed_origins, true) === true) {
header('Access-Control-Allow-Origin: ' . $origin);
header('Access-Control-Allow-Methods: GET,POST');
header('Access-Control-Allow-Headers: VS-Custom-Header');
}
if ($_SERVER["REQUEST_METHOD"] === "OPTIONS") {
exit; // OPTIONS request wants only the policy, we can stop here
}
$main_dir = realpath(dirname(__FILE__) . '/../../../');
set_include_path($main_dir);
include_once 'f_core/config.core.php';
include_once $class_language->setLanguageFile('backend', 'language.members.entries');
include_once $class_language->setLanguageFile('frontend', 'language.email.notif');
$cfg = $class_database->getConfigurations('paypal_log_file,paypal_logging,paypal_test,paypal_email,paypal_test_email,backend_notification_payment,backend_email,backend_username');
$error_message = null;
$notice_message = null;
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$out = array("valid" => 0);
$cc = $class_filter->clr_str($_POST["a"]);
$ff = $class_filter->clr_str($_POST["b"]);
$estr = $class_filter->clr_str($_POST["c"]);
$amount = $class_filter->clr_str($_POST["d"]);
$rs = $db->execute(sprintf("SELECT `db_id`, `channel_owner`, `channel_id`, `usr_id`, `usr_key`, `chat_user` FROM `db_livechat` WHERE `chat_id`='%s' AND `stream_id`='%s' LIMIT 1;", $cc, $ff));
if ($rs->fields["db_id"]) {
$ch_owner = $rs->fields["channel_owner"];
$ch_user = $rs->fields["chat_user"];
$ch_id = $rs->fields["channel_id"];
$usr_id = $rs->fields["usr_id"];
$usr_key = $rs->fields["usr_key"];
$p = $db->execute(sprintf("SELECT `usr_key`, `usr_photo`, `usr_profileinc`, `usr_tokencount` FROM `db_accountuser` WHERE `usr_id`='%s' LIMIT 1;", $usr_id));
if ($p->fields['usr_key']) {
$tokens = $p->fields['usr_tokencount'];
$pimg = VUseraccount::getProfileImage_inc($p->fields['usr_key'], $p->fields['usr_photo'], $p->fields['usr_profileinc']);
} else {
echo json_encode($out); return;
}
$cstr = md5($ff . $cc . $ch_user . $amount . $cfg["live_chat_salt"]);
if ($estr == $cstr and $amount <= $tokens) {
$db->execute(sprintf("UPDATE `db_accountuser` SET `usr_tokencount`=`usr_tokencount`-%s WHERE `usr_id`='%s' LIMIT 1;", $amount, $usr_id));
if ($db->Affected_Rows() > 0) {
$ins = array(
"tk_from" => $usr_id,
"tk_to" => $ch_id,
"tk_from_user" => $ch_user,
"tk_to_user" => $ch_owner,
"tk_amount" => $amount,
"tk_date" => date("Y-m-d H:i:s"),
);
$class_database->doInsert('db_tokendonations', $ins);
if ($db->Affected_Rows() > 0) {
/* mail notifications */
$notifier = new VNotify;
$website_logo = $smarty->fetch($cfg["templates_dir"] . '/tpl_frontend/tpl_header/tpl_headerlogo.tpl');
$user_data = VUserinfo::getUserInfo($ch_id);
/* user notification */
$_replace = array(
'##TITLE##' => $language["payment.notification.donate.subj"],
'##LOGO##' => $website_logo,
'##H2##' => $language["recovery.forgot.password.h2"] . $user_data["uname"] . ',',
'##NR##' => '<b>' . $amount . '</b>',
'##USER##' => '<a href="' . VHref::channelURL(["username" => $ch_user]) . '" target="_blank">' . $ch_user . '</a>',
'##YEAR##' => date('Y'),
);
$notifier->dst_mail = VUserinfo::getUserEmail($ch_id);
$notifier->dst_name = $user_data["uname"];
$notifier->Mail('frontend', 'token_donation_fe', $_replace);
$_output[] = $user_data["uname"] . ' -> token_donation_fe -> ' . $notifier->dst_mail . ' -> ' . date("Y-m-d H:i:s");
/* admin notification */
if ($cfg["backend_notification_payment"] == 1) {
include 'f_core/config.backend.php';
$main_url = $cfg["main_url"] . '/' . $backend_access_url;
$notifier->msg_subj = $language["payment.notification.donate.subj"];
$notifier->dst_mail = $cfg["backend_email"];
$notifier->dst_name = $cfg["backend_username"];
$user_data2 = VUserinfo::getUserInfo($ch_id);
$_replace = array(
'##TITLE##' => $notifier->msg_subj,
'##LOGO##' => $website_logo,
'##SUBJ##' => str_replace(array('##USER1##', '##USER2##', '##NR##'), array($ch_user, $user_data2["uname"], $amount), $language["payment.notification.donate.subj.be"]),
'##H2##' => $language["recovery.forgot.password.h2"] . $cfg["backend_username"] . ',',
'##USER1##' => '<a href="' . $main_url . '/' . VHref::getKey('be_members') . '?u=' . $usr_key . '" target="_blank">' . $ch_user . '</a>',
'##USER2##' => '<a href="' . $main_url . '/' . VHref::getKey('be_members') . '?u=' . $user_data2["key"] . '" target="_blank">' . $user_data2["uname"] . '</a>',
'##NR##' => '<b>' . $amount . '</b>',
'##YEAR##' => date('Y'),
);
$notifier->Mail('backend', 'token_donation_be', $_replace);
$_output[] = $cfg["backend_username"] . ' -> token_donation_be -> ' . $notifier->dst_mail . ' -> ' . date("Y-m-d H:i:s");
}
$log_mail = '.mailer.log';
VServer::logToFile($log_mail, implode("\n", $_output));
$out["pimg"] = $pimg; $out["valid"] = 1;
echo json_encode($out);
return;
}
}
}
}
echo json_encode($out);
return;
}
}

View File

@@ -0,0 +1,131 @@
<?php
/*******************************************************************************************************************
| Software Name : EasyStream
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
| Software Author : (c) Sami Ahmed
|*******************************************************************************************************************
|
|*******************************************************************************************************************
| This source file is subject to the EasyStream Proprietary License Agreement.
|
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|*******************************************************************************************************************
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|*******************************************************************************************************************/
define('_ISVALID', true);
if (isset($_SERVER["HTTP_ORIGIN"]) === true) {
$origin = $_SERVER["HTTP_ORIGIN"];
$allowed_origins = array(
"http://192.168.100.77",
"http://192.168.100.77:3000",
);
if (in_array($origin, $allowed_origins, true) === true) {
header('Access-Control-Allow-Origin: ' . $origin);
header('Access-Control-Allow-Methods: GET,POST');
header('Access-Control-Allow-Headers: VS-Custom-Header');
}
if ($_SERVER["REQUEST_METHOD"] === "OPTIONS") {
exit; // OPTIONS request wants only the policy, we can stop here
}
$main_dir = realpath(dirname(__FILE__) . '/../../../');
set_include_path($main_dir);
include_once 'f_core/config.core.php';
include_once $class_language->setLanguageFile('backend', 'language.members.entries');
$error_message = null;
$notice_message = null;
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$rs = array();
$us = array();
$ls = array();
$cn = explode(',', $language["supported_currency_names"]);
$cu = explode(',', $language["supported_currency_codes"]);
$cid = $class_filter->clr_str($_POST["a"]);
$file_key = $class_filter->clr_str($_POST["b"]);
$get_token_nr = isset($_POST["c"]);
$ch = $db->execute(sprintf("SELECT A.`db_id`, A.`usr_id`, A.`usr_key`, B.`usr_tokencount` FROM `db_livechat` A, `db_accountuser` B WHERE A.`chat_id`='%s' AND A.`stream_id`='%s' AND A.`usr_id`=B.`usr_id` LIMIT 1;", $cid, $file_key));
if (!$ch->fields["db_id"] or ($ch->fields["db_id"] and $ch->fields["usr_id"] == 0)) {
$ls["l"] = "auth";
echo json_encode($ls);
return;
}
$usr_id = $ch->fields["usr_id"];
$us[0] = (int) $ch->fields["usr_tokencount"];
if ($get_token_nr) {
echo json_encode($us);
return;
}
$pp = $class_database->getConfigurations('paypal_log_file,paypal_logging,paypal_test,paypal_email,paypal_test_email');
$paypal_url = $pp["paypal_test"] == 0 ? 'https://www.paypal.com/cgi-bin/webscr' : 'https://www.sandbox.paypal.com/cgi-bin/webscr';
$paypal_mail = $pp["paypal_test"] == 0 ? $pp["paypal_email"] : $pp["paypal_test_email"];
$paypal_return = rawurlencode($cfg["main_url"] . '/' . VHref::getKey('watch') . '?l=' . $file_key . '&fst=1');
$paypal_cancel = rawurlencode($cfg["main_url"] . '/' . VHref::getKey('watch') . '?l=' . $file_key);
$paypal_ipn = rawurlencode($cfg["main_url"] . '/' . VHref::getKey('tokenpayment') . '?do=ipn');
$paypal_param = array(
"cmd" => "_xclick",
"rm" => 2,
"business" => $paypal_mail,
"return" => $paypal_return,
"cancel_return" => $paypal_cancel,
"notify_url" => $paypal_ipn,
"item_name" => "##ITEM_NAME##",
"item_number" => "##PP_ITEM##",
"currency_code" => "##PP_CURRENCY##",
"amount" => "##PP_AMOUNT##",
"custom" => "",
);
$params = array();
foreach ($paypal_param as $pk => $pv) {
$params[] = sprintf("%s=%s", $pk, $pv);
}
$paypal_link = sprintf("%s?%s", $paypal_url, implode("&", $params));
$tks = $db->execute(sprintf("SELECT `tk_id`, `tk_name`, `tk_slug`, `tk_price`, `tk_currency`, `tk_amount` FROM `db_livetoken` WHERE `tk_active`='1';"));
if ($tks->fields["tk_id"]) {
$i = 0;
while (!$tks->EOF) {
$rs[$i][0] = $tks->fields["tk_id"];
$rs[$i][1] = $tks->fields["tk_name"];
$rs[$i][2] = $tks->fields["tk_price"];
$rs[$i][3] = $tks->fields["tk_currency"];
$rs[$i][4] = $tks->fields["tk_amount"];
$paypal_string = $usr_id . '|' . $rs[$i][0] . '|' . $rs[$i][4];
$paypal_item = rawurlencode($paypal_string . '|' . md5($paypal_string . $cfg["global_salt_key"]));
$paypal_name = rawurlencode($cfg["website_shortname"] . ' - ' . $rs[$i][1]);
$paypal_search = array("##ITEM_NAME##", "##PP_ITEM##", "##PP_CURRENCY##", "##PP_AMOUNT##");
$paypal_replace = array($paypal_name, $paypal_item, $rs[$i][3], $rs[$i][2]);
$rs[$i][5] = str_replace($paypal_search, $paypal_replace, $paypal_link);
$ak = array_search($rs[$i][3], $cn);
$rs[$i][3] = $cu[$ak];
$i += 1;
$tks->MoveNext();
}
}
$ls["u"] = $us;
$ls["l"] = $rs;
echo json_encode($ls);
}
}

View File

@@ -0,0 +1,109 @@
<?php
/*******************************************************************************************************************
| Software Name : EasyStream
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
| Software Author : (c) Sami Ahmed
|*******************************************************************************************************************
|
|*******************************************************************************************************************
| This source file is subject to the EasyStream Proprietary License Agreement.
|
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|*******************************************************************************************************************
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|*******************************************************************************************************************/
define('_ISVALID', true);
$main_dir = realpath(dirname(__FILE__) . '/../../../');
set_include_path($main_dir);
include_once 'f_core/config.core.php';
include_once $class_language->setLanguageFile('backend', 'language.members.entries');
include_once $class_language->setLanguageFile('frontend', 'language.email.notif');
$cfg = $class_database->getConfigurations('paypal_log_file,paypal_logging,paypal_test,paypal_email,paypal_test_email,backend_notification_payment,backend_email,backend_username');
$error_message = null;
$notice_message = null;
if ($_POST and isset($_GET["do"]) and $_GET["do"] == "ipn") {
$p = new VPaypalToken;
$p->paypal_url = $cfg["paypal_test"] == 1 ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr';
if ($p->validate_ipn()) {
$ipn_info = explode('|', urldecode($p->ipn_data["item_number"]));
$usr_id = (int) $ipn_info[0];
$item_id = (int) $ipn_info[1];
$item_amt = (int) $ipn_info[2];
$item_price = $class_filter->clr_str($p->ipn_data["mc_gross"]);
$txn_id = $class_filter->clr_str($p->ipn_data["txn_id"]);
$hash = $ipn_info[3];
$pps = $usr_id . '|' . $item_id . '|' . $item_amt;
if ($hash == md5($pps . $cfg["global_salt_key"])) {
$db->execute(sprintf("UPDATE `db_accountuser` SET `usr_tokencount`=`usr_tokencount`+%s WHERE `usr_id`='%s' LIMIT 1;", $item_amt, $usr_id));
if ($db->Affected_Rows() > 0) {
$receipt = null;
foreach ($p->ipn_data as $key => $value) {$receipt .= $key . ': ' . $value . '<br>';}
$ins_array = array(
'usr_id' => $usr_id,
'tk_id' => $item_id,
'tk_amount' => $item_amt,
'tk_price' => $item_price,
'tk_date' => date("Y-m-d H:i:s"),
'txn_id' => $txn_id,
'txn_receipt' => str_replace('<br>', "\n", $receipt),
);
$class_database->doInsert('db_tokenpayments', $ins_array);
/* mail notifications */
$notifier = new VNotify;
$website_logo = $smarty->fetch($cfg["templates_dir"] . '/tpl_frontend/tpl_header/tpl_headerlogo.tpl');
$user_data = VUserinfo::getUserInfo($usr_id);
/* user notification */
$_replace = array(
'##TITLE##' => $language["payment.notification.token.subj"],
'##LOGO##' => $website_logo,
'##H2##' => $language["recovery.forgot.password.h2"] . $user_data["uname"] . ',',
'##NR##' => $item_amt,
'##YEAR##' => date('Y'),
);
$notifier->dst_mail = VUserinfo::getUserEmail($usr_id);
$notifier->dst_name = $user_data["uname"];
$notifier->Mail('frontend', 'token_notification_fe', $_replace);
$_output[] = $user_data["uname"] . ' -> token_notification_fe -> ' . $notifier->dst_mail . ' -> ' . date("Y-m-d H:i:s");
/* admin notification */
if ($cfg["backend_notification_payment"] == 1) {
include 'f_core/config.backend.php';
$main_url = $cfg["main_url"] . '/' . $backend_access_url;
$notifier->msg_subj = $language["payment.notification.token.subj.be"] . urldecode($p->ipn_data["payer_email"]);
$notifier->dst_mail = $cfg["backend_email"];
$notifier->dst_name = $cfg["backend_username"];
$_replace = array(
'##TITLE##' => $notifier->msg_subj,
'##LOGO##' => $website_logo,
'##H2##' => $language["recovery.forgot.password.h2"] . $cfg["backend_username"] . ',',
'##USER##' => '<a href="' . $main_url . '/' . VHref::getKey('be_members') . '?u=' . $user_data["key"] . '" target="_blank">' . $user_data["uname"] . '</a>',
'##NR##' => $item_amt,
'##PAID##' => $p->ipn_data["mc_gross"] . $p->ipn_data["mc_currency"],
'##PAID_RECEIPT##' => urldecode($receipt),
'##YEAR##' => date('Y'),
);
$notifier->Mail('backend', 'token_notification_be', $_replace);
$_output[] = $cfg["backend_username"] . ' -> token_notification_be -> ' . $notifier->dst_mail . ' -> ' . date("Y-m-d H:i:s");
}
$log_mail = '.mailer.log';
VServer::logToFile($log_mail, implode("\n", $_output));
}
}
}
}

View File

@@ -0,0 +1,71 @@
<?php
/*******************************************************************************************************************
| Software Name : EasyStream
| Software Description : High End YouTube Clone Script with Videos, Shorts, Streams, Images, Audio, Documents, Blogs
| Software Author : (c) Sami Ahmed
|*******************************************************************************************************************
|
|*******************************************************************************************************************
| This source file is subject to the EasyStream Proprietary License Agreement.
|
| By using this software, you acknowledge having read this Agreement and agree to be bound thereby.
|*******************************************************************************************************************
| Copyright (c) 2025 Sami Ahmed. All rights reserved.
|*******************************************************************************************************************/
define('_ISVALID', true);
define('_ISADMIN', true);
include_once 'f_core/config.core.php';
include_once $class_language->setLanguageFile('backend', 'language.dashboard');
include_once $class_language->setLanguageFile('backend', 'language.settings.entries');
include_once $class_language->setLanguageFile('backend', 'language.subscriber');
include_once $class_language->setLanguageFile('frontend', 'language.global');
include_once $class_language->setLanguageFile('frontend', 'language.account');
include_once $class_language->setLanguageFile('frontend', 'language.email.notif');
include_once $class_language->setLanguageFile('frontend', 'language.notifications');
include_once $class_language->setLanguageFile('frontend', 'language.signup');
$error_message = null;
$notice_message = null;
$ipn_check = false;
$cfg[] = $class_database->getConfigurations('paypal_test,paypal_test_email,affiliate_module,affiliate_tracking_id,affiliate_view_id,affiliate_maps_api_key,affiliate_token_script,affiliate_payout_figure,affiliate_payout_units,affiliate_payout_currency,affiliate_payout_share,sub_shared_revenue,subscription_payout_currency,channel_views,sub_threshold,partner_requirements_min,partner_requirements_type,token_threshold');
$logged_in = !$ipn_check ? VLogin::checkFrontend(VHref::getKey("tokens")) : null;
$analytics = false;
if (isset($_GET["do"])) {
switch ($_GET["do"]) {
case "save-subscriber":
break;
case "showstats":
echo $ht = VToken::userStats();
break;
case "make-partner":
case "clear-partner":
break;
case "make-partner-email":
case "clear-partner-email":
break;
}
}
if (!isset($_GET["s"]) and !isset($_GET["do"])) {
VAffiliate::allowRequest('partner');
$smarty->assign('c_section', VHref::getKey("subscribers"));
}
if (!isset($_GET["do"])) {
$smarty->assign('file_type', 'sub');
if (isset($_GET["rg"]) and isset($_SESSION["USER_PARTNER"]) and (int) $_SESSION["USER_PARTNER"] == 1) {
$smarty->assign('html_payouts', VToken::html_payouts(1));
} else if (isset($_GET["rp"]) and isset($_SESSION["USER_PARTNER"]) and (int) $_SESSION["USER_PARTNER"] == 1) {
$smarty->assign('html_payouts', VToken::html_payouts());
} else if ((isset($_GET["rg"]) and (!isset($_SESSION["USER_PARTNER"]) or (int) $_SESSION["USER_PARTNER"] == 0)) or (isset($_GET["rp"]) and (!isset($_SESSION["USER_PARTNER"]) or (int) $_SESSION["USER_PARTNER"] == 0))) {
header("Location: " . $cfg["main_url"] . '/' . VHref::getKey("tokens"));
exit;
}
$class_smarty->displayPage('frontend', 'tpl_tokens', $error_message, $notice_message);
}