403Webshell
Server IP : 208.122.213.31  /  Your IP : 216.73.216.185
Web Server : Apache
System : Linux msd6191.mjhst.com 4.18.0-553.137.1.el8_10.x86_64 #1 SMP Wed Jun 24 11:40:24 UTC 2026 x86_64
User : WHMCS_MIA_382 ( 1001)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/httpd/html/store.tiacyrusxxx.com/public_html/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/httpd/html/store.tiacyrusxxx.com/public_html/site.func.php
<?php
function contentCount($model_id,$content_type) {
	$get = @mysql_query("SELECT content_id FROM cms_content WHERE status = '1' AND model_id = '".$model_id."' AND content_type = '".$content_type."' AND releasedate <= NOW()");
	return @mysql_num_rows($get);
}

function modelGrab($limit, $statusCategory, $sortType) {
	if($statusCategory == "private") {
		$sqlAdd = " AND privateStatus = '1'";
	} elseif ($statusCategory == "custom") {
		$sqlAdd = " AND customVideoStatus = '1'";
	}
	if($sortType == "date") {
		$sort = " releasedate DESC";
	} else {
		$sort = " RAND() ";
	}
	$get = @mysql_query("SELECT * FROM cms_models WHERE modelStatus = '1' AND releasedate <= NOW() ".$sqlAdd." ORDER BY ".$sort." LIMIT ".$limit."");
	if(@mysql_num_rows($get) > 0) {
		while ($row = mysql_fetch_object($get)) {
			modelOutput($row);
		}
	}
}

function contentGrabNew($content_type, $limit) {
	$get = @mysql_query("SELECT * FROM cms_content WHERE status = '1' AND content_type = '".$content_type."' AND releasedate <= NOW() ORDER BY releasedate DESC LIMIT ".$limit."");
	if(@mysql_num_rows($get) > 0) {
		while ($row = mysql_fetch_object($get)) {
			contentOutput($row->content_id, $row->content_type, $row->directory, $row->title, $row->model_id, $row->num_photos, 0);
		}
	}
}

function contentGrabModel($model_id, $content_type, $limit) {
	$get = @mysql_query("SELECT * FROM cms_content WHERE status = '1' AND model_id = '".$model_id."' AND content_type = '".$content_type."' AND releasedate <= NOW() ORDER BY releasedate DESC");
	if(@mysql_num_rows($get) > 0) {
		while ($row = mysql_fetch_object($get)) {
			contentOutput($row->content_id, $row->content_type, $row->directory, $row->title, $row->model_id, $row->num_photos, $row->price);
		}
	}
}

function contentGrabOwned($memberID,$content_type, $limit) {
	if($content_type == 3) {
		$get = @mysql_query("SELECT * FROM cms_content WHERE customID IN (SELECT relatedID FROM cms_billing_purchases WHERE memberID = '".$memberID."') AND content_type = '".$content_type."' ORDER BY releasedate DESC");
	} elseif($content_type == 4) {
		$get = @mysql_query("SELECT * FROM cms_content WHERE customID IN (SELECT relatedID FROM cms_billing_purchases WHERE memberID = '".$memberID."') AND content_type = '".$content_type."' ORDER BY releasedate DESC");
	} else {
		$get = @mysql_query("SELECT * FROM cms_content WHERE content_id IN (SELECT itemID FROM cms_billing_purchases WHERE itemType = '".$content_type."' AND memberID = '".$memberID."') AND content_type = '".$content_type."' ORDER BY releasedate DESC");
	}
	if(@mysql_num_rows($get) > 0) {
		while ($row = mysql_fetch_object($get)) {
			contentOutput($row->content_id, $row->content_type, $row->directory, $row->title, $row->model_id, $row->num_photos, 0);
		}
	}
}

function contentOutput($content_id, $content_type, $content_directory, $content_title, $content_model_id, $content_length, $content_price) {
	global $member_id;
	
	$getModel = @mysql_query("SELECT name FROM cms_models WHERE model_id = '".$content_model_id."'");
	$modelName = @mysql_result($getModel,0,'name');
	
	if($content_type == 1) {
		$url = "content.photoset.php?id=".$content_id;	
	} elseif($content_type == 2) {
		$url = "content.video.php?id=".$content_id;	
	} elseif($content_type == 3) {
		$url = "content.video.php?id=".$content_id;	
	} elseif($content_type == 4) {
		$url = "content.photoset.php?id=".$content_id;	
	}  
	
	$image = "content/models/".$content_directory."/tn.jpg";
	
	if($content_price == 0) {
		$content_price = '';
	} else {
		$content_price = '$'.$content_price;	
	}
	
	$purchased_sql = @mysql_query("SELECT * FROM cms_billing_purchases WHERE memberID = '" . $member_id . "' AND  relatedID = '0' AND itemID = '".$content_id."'");
	if (@mysql_num_rows($purchased_sql) == 1) {
		$content_price = '<a href="'.$url.'">VIEW</a>';
	} 

	
	
	
	if($content_type == 1) {
	?>
    <li class="top-level">
        <div class="photoOut-frame">
            <a href="<?php echo $url; ?>"><img src="<?php echo $image; ?>" alt="<?php echo $content_title; ?>" /></a>
            <h5><?php echo $content_title; ?><span><?php echo $content_price; ?></span>
            <br />
            <small><strong>Seller:</strong> <a href="<?php echo modelOutputName($modelName); ?>"><?php echo $modelName; ?></a><br />
            <strong>Photos:</strong> <?php echo $content_length; ?></small>
            
            </h5>
        </div>
    </li>
	<?
	} else {
	?>
    <li class="top-level">
        <div class="videoOut-frame">
            <a href="<?php echo $url; ?>"><img src="<?php echo $image; ?>" alt="<?php echo $content_title; ?>" /></a>
            <h5><?php echo $content_title; ?><span><?php echo $content_price; ?></span>
                        <br />
            <small><strong>Seller:</strong> <a href="<?php echo modelOutputName($modelName); ?>"><?php echo $modelName; ?></a></small></h5>
        </div>
    </li>
	<?
	}
}

function modelOutputName($modelName) {
	$output = str_replace(" ","-",strtolower($modelName));
	return $output;
}

function modelOutput($row) {
	//$url = "model.php?id=" . $row->model_id;
	$url = modelOutputName($row->name);
	?>
		<li class="top-level">
			<div class="modelOut-frame">
				<a href="<?php echo $url; ?>"><img src="content/models/<?php echo $row->model_id; ?>_mIcon.jpg" alt="<?php echo $row->name; ?>" /></a>
                <?php /* <h5><?php echo $model_name; ?></h5> */ ?>
                                <h5><?php echo $row->name; ?><span>
                <span class="glyphicon glyphicon-camera" aria-hidden="true"></span><?php echo contentCount($row->model_id,1); ?>&nbsp;<br />
                <span class="glyphicon glyphicon-film" aria-hidden="true"></span><?php echo contentCount($row->model_id,2); ?>&nbsp;<br /></span>
                <?php 
				
				$modelServices = '';
				if($row->customVideoStatus == 1) {
					$modelServices .= 'Custom Videos';
				}
				
				if($row->customPhotosetStatus == 1) {
					//$modelServices .= 'Custom Photos';
				}
				if($row->privateStatus == 1) {
					if($modelServices == '') {
						$modelServices .= 'Chat Dates';
					} else {
						$modelServices .= ', Chat Dates';	
					}
				}
					
				
				if($modelServices != '') {	
					echo '<br /><small><strong>Personal Services Available</strong></small>';
                }
				?>
                </h5>
                
			</div>
		</li>
	<?php
}
/* =============================================================================================== */
/*
$getPendingCustom = purchasedItems($userDetails->xfcadmin, $userDetails -> model_id, "pending", 3, 1, 999, 0);
$getPendingPrivate = purchasedItems($userDetails->xfcadmin, $userDetails -> model_id, "pending", 6, 1, 999, 0);
//$getPendingSpecial = purchasedItems($userDetails->xfcadmin,$userDetails->model_id,"payable",4,1,999,0);
*/
//function purchasedItems($xfcadmin, $memberID, $status, $itemType, $pageNumber, $numResults,$countOnly) {
	
function getMessages($xfcadmin, $memberID, $itemType, $relatedID) {
		$get = @mysql_query("SELECT * FROM cms_billing_messages WHERE itemType = '".$itemType."' AND relatedID = '".$relatedID."' AND (to_memberID = '".$memberID."' OR from_memberID = '".$memberID."')");

}

function getMessagesUnreadCount($xfcadmin, $memberID, $itemType, $relatedID) {
	$get = @mysql_query("SELECT COUNT(messageID) as count FROM cms_billing_messages WHERE itemType = '".$itemType."' AND relatedID = '".$relatedID."' AND to_memberID = '".$memberID."' AND to_memberID_read = '0'");
	return (@mysql_result($get,0,'count'));
}


/* =============================================================================================== */

//paginateStuff("adm.accounting.php","v=".$pageView,$pageNumber,$getCount,$pageDisplay,"all");
	   /*
    <ul class="nav nav-tabs" id="episode_filters">
      <li class="active episode_sort_tab"><a href="#latest" data-sort="latest">Latest</a></li>
      <li class=" episode_sort_tab"><a href="#top_rated" data-sort="top_rated">Top Rated</a></li>
    </ul>
    <div class="pagination pagination-large pagination-centered">
      <ul class="pagination">
        <li class="previous_page disabled"><span>&#8592; Previous</span></li>
        <li class="active"><span>1</span></li>
        <li><a href="/page.js?page=2&amp;sort=latest" data-page="2" data-remote="true" rel="next">2</a></li>
        <li><a href="/page.js?page=3&amp;sort=latest" data-page="3" data-remote="true">3</a></li>
        <li class="disabled"><a>&hellip;</a></li>
        <li><a href="/page.js?page=9&amp;sort=latest" data-page="9" data-remote="true">9</a></li>
        <li><a href="/page.js?page=10&amp;sort=latest" data-page="10" data-remote="true">10</a></li>
        <li><a href="/page.js?page=2&amp;sort=latest" class="next_page" data-page="2" data-remote="true" rel="next">Next &#8594;</a></li>
      </ul>
    </div>
	*/ 
function paginateStuff($url,$urladd,$pageNumber,$count,$pageDisplay,$outputType) {
	$totalPages = ceil($count / $pageDisplay);

	$output = '<div class="paginateStuff">';

	if ($pageNumber > 1) {
		$output .= '<a href="'.$url.'?p='.($pageNumber-1).'&'.$urladd.'" class="pagination"><span>&laquo; prev</span></a>';
	}

	for ($i = 1; $i <= $totalPages; $i++) {
		if ($i == $pageNumber) {
			$output .= '<a href="#" class="currpagination"><span>' . $i . '</span></a>';
		} else {
			$output .= '<a href="' . $url . '?p=' . $i.'&'.$urladd.'"class="pagination"><span>' . $i . '</span></a>';
		}
	}

	if ($pageNumber < $totalPages) {
		$output .= '<a href="' . $url . '?p=' . ($pageNumber + 1).'&'.$urladd.'"class="pagination"><span>next &raquo;</span></a>';
	}

	$output .= '</div>';
	return $output;

}



/* =============================================================================================== */

function getInvoices($xfcadmin, $modelID, $status, $invoiceID, $pageNumber, $numResults,$countOnly) {

	if ($pageNumber == 1) {
		$startResults = 0;
	} else {
		$startResults = ($pageNumber - 1) * $numResults;
	}
	
	$add_sql = "";
	
	// STATUS LIMIT
	if($status == "pending") {
		$add_sql = " AND invoiceStatus = '0'";
	} elseif($status == "paid") {
		$add_sql = " AND invoiceStatus = '1'";
	} elseif($status == "all") {
		$add_sql = " AND invoiceStatus IN ('0','1')";	
	}
		
	// ACCESS LEVEL
	if ($xfcadmin == 0) {
		die("not an admin");
	} elseif ($xfcadmin == 1) {
		// THIS IS A MODEL, DISPLAY WHAT THEY HAVE SOLD.
		$query = "SELECT * FROM cms_billing_purchases_invoices WHERE modelID = '" . $modelID . "' ".$add_sql."  ORDER BY modelID, invoiceDate DESC";
	} elseif ($xfcadmin == 9) {
		// THIS IS TAMMY, DISPLAY ALL.
		$query = "SELECT * FROM cms_billing_purchases_invoices WHERE invoiceID > 0 ".$add_sql." ORDER BY modelID, invoiceDate DESC";
	}
	
	$quickCount_sql = @mysql_query($query);
	if($countOnly == 1) {
		return @mysql_num_rows($quickCount_sql);
	}
	
	$query .= " LIMIT " . $startResults . "," . $numResults;
	
	
	
	if($invoiceID > 0) {
		$query = "SELECT * FROM cms_billing_purchases_invoices WHERE invoiceID = '".$invoiceID."'";
		$startResults = 0;
		$numResults = 999;	
	}
	
	//echo $query;
	
	$get_sql = @mysql_query($query);
	if (@mysql_num_rows($get_sql) > 0) {
		$invoiceDetails = array();
		while ($row = mysql_fetch_object($get_sql)) {
			$row->invoiceDate = date("m-d-Y",strtotime($row->invoiceDate));
			if($row->invoiceStatus == 0) {
				$row->invoiceStatusTXT = "PENDING";
			} elseif($row->invoiceStatus == 1) {
				$row->invoiceStatusTXT = "PAID";
			}
			$getModel = @mysql_query("SELECT name FROM cms_models WHERE model_id = '".$row->modelID."'");
			$row->modelName = @mysql_result($getModel,0,'name');
			$invoiceDetails[] = $row;
		}
		return $invoiceDetails;
	} else {
		return 0;
	}
}



function purchasedItems($xfcadmin, $memberID, $invoiceID, $endDate, $status, $itemType, $pageNumber, $numResults, $countOnly, $startDate="'1970-01-01'") {

	if ($pageNumber == 1) {
		$startResults = 0;
	} else {
		$startResults = ($pageNumber - 1) * $numResults;
	}
    
    //Add single quotes if they are missing from string to make sure they are single quoted in query 
    if(substr($startDate,0,1) != "'") $startDate = "'" . $startDate;
    if(substr($startDate,-1,1) != "'") $startDate = $startDate . "'";
    
    if(substr($endDate,0,1) != "'") $endDate = "'" . $endDate;
    if(substr($endDate,-1,1) != "'") $endDate = $endDate . "'";
	
   
    $add_sql = " AND (DATE(purchaseDate) >= ". $startDate ." AND DATE(purchaseDate) <= " . $endDate . ") ";
	
    
	// STATUS LIMIT
	if($status == "pending") {
		$add_sql .= " AND status = 0 ";
	} elseif($status == "payable") {
		$add_sql .= " AND status = 1 ";
	} elseif($status == "paid") {
		$add_sql .= " AND status = 2 ";
	} elseif($status == "completed") {
		$add_sql .= " AND status IN (1,2) ";	
	}
	
	// TYPE LIMIT
	if($itemType > 0){
		$add_sql .= " AND itemType = ".$itemType." ";
	} 
	
	if($invoiceID < 0) {
		$add_sql .= " AND invoiceID = 0 ";	
	}
    
	
	// ACCESS LEVEL
	if ($xfcadmin == 0) {
		// THIS IS A REGULAR USER, RETURN THEIR PURCHASED ITEMS.
		$query = "SELECT * FROM cms_billing_purchases WHERE memberID = " . $memberID . " ".$add_sql." ORDER BY purchaseDate DESC";
	} elseif ($xfcadmin == 1) {
		// THIS IS A MODEL, DISPLAY WHAT THEY HAVE SOLD.
		$query = "SELECT * FROM cms_billing_purchases WHERE itemID = " . $memberID . " ".$add_sql."";//AND itemType > 2  ".$add_sql."";
		$query .= " UNION ALL ";
		$query .= "SELECT * FROM cms_billing_purchases WHERE itemID IN (SELECT content_id FROM cms_content WHERE model_id = " . $memberID . ") ".$add_sql.""; //AND itemType < 2  ".$add_sql."";
		$query .= "ORDER BY purchaseDate DESC";
	} elseif ($xfcadmin == 9) {
		// THIS IS TAMMY, DISPLAY ALL.
		$query = "SELECT * FROM cms_billing_purchases WHERE itemID > 0 ".$add_sql." ORDER BY purchaseDate DESC";
	}
	
	if($invoiceID > 0) {
		$query = "SELECT * FROM cms_billing_purchases WHERE invoiceID = ".$invoiceID."";
		$startResults = 0;
		$numResults = 999;	
	}
	/*
	if($xfcadmin == 9) {
	echo $query;
	}
	*/
    
	$quickCount_sql = mysql_query($query) or die(mysql_error());
	if($countOnly == 1) {
		return mysql_num_rows($quickCount_sql);
	}
		
	$query .= " LIMIT " . $startResults . "," . $numResults;
	
	

	
	$purchasedArr = array();
	$get_sql = mysql_query($query) or die(mysql_error());
	if (mysql_num_rows($get_sql) > 0) {

		while ($row = mysql_fetch_object($get_sql)) {
						
			if ($row->itemType > 2) {
				$itemDetails = cartModel($row->itemID, $row->itemType);
				if ($row->itemType == 3) {
					//CUSTOM VIDEO
					$customDetails = cartCustomDetails($row->memberID, $row->relatedID);
					$itemDetails->title = $itemDetails->title . "<br />";
					$itemDetails->title .= "Category: " . $customDetails->categoryName . "<br />";
					$itemDetails->title .= "Duration: " . $customDetails->baseName . "<br />";
					$itemDetails->title .= "Delivery: " . $customDetails->deliveryName;
				} elseif ($row->itemType == 4) {
					//CUSTOM PHOTOSET
					$customDetails = cartCustomDetails($row->memberID, $row->relatedID);
					$itemDetails->title = $itemDetails->title . "<br />";
					$itemDetails->title .= "Category: " . $customDetails->categoryName . "<br />";
					$itemDetails->title .= "Duration: " . $customDetails->baseName . "<br />";
					$itemDetails->title .= "Delivery: " . $customDetails->deliveryName;
				} elseif ($row->itemType == 6) {
					//PRIVATE CHAT
					$privateDetails = cartPrivateDetails($row->memberID, $row->relatedID);
					$itemDetails->title = $itemDetails->title . "<br />";
					$itemDetails->title .= "Duration: " . $privateDetails->duration . "<br />";
					$itemDetails->title .= "Preferred date and time: " . $privateDetails->preferredtime;
				}
			} else {
				$itemDetails = cartContent($row->itemID);
			}
			
			$itemDetails->transactionID = $row->transactionID;
			$itemDetails->purchaseDate = date('m-d-Y', strtotime($row->purchaseDate));
			$itemDetails->purchaseID = $row->purchaseID;
			$itemDetails->relatedID = $row->relatedID;
			$itemDetails->itemPrice = $row->itemPrice;
			$itemDetails->itemType = $row->itemType;
			
			if ($row->itemType > 2) {
				$url = "model.php?id=" . $row->itemID;
			} else {
				if($row->itemType == 1){
					$url = "photoset.php?id=" . $row->itemID;
					$itemDetails->title = "Photoset: ".$itemDetails->title;
				} else {
					$url = "video.php?id=" . $row->itemID;
					$itemDetails->title = "Video: ".$itemDetails->title;
				}
			}
			
			$itemDetails->url = $url;
			
			if($row->status == 0) {
				$itemDetails->status = "PENDING";
			} elseif($row->status == 1) {
				if($xfcadmin == 0) {
					$itemDetails->status = "COMPLETE";
				} else {
					$itemDetails->status = "UNPAID";
				}
			} elseif($row->status == 2) {
				if($xfcadmin == 0) {
					$itemDetails->status = "COMPLETE";
				} else {
					$itemDetails->status = "PAID";
				}
			}
			
			$itemDetails->owners = "modelname";
			//check owners, if multiple owners work out their pay...
			
			$purchasedArr[] = $itemDetails;
		}
		return $purchasedArr;
	} else {
		return 0;
	}
}

/* =============================================================================================== */

function cartCount($memberID) {
	$cart_sql = mysql_query("SELECT itemID FROM cms_billing_cart WHERE memberID = '" . $memberID . "'") or die(mysql_error());
	return mysql_num_rows($cart_sql);
}

function cartTotal($memberID) {
	$cart_sql = mysql_query("SELECT SUM(itemPrice) as cartTotal FROM cms_billing_cart WHERE memberID = '" . $memberID . "'") or die(mysql_error());
	if (mysql_num_rows($cart_sql) > 0) {
		$cartDetail = mysql_fetch_object($cart_sql);
		return number_format((float)$cartDetail -> cartTotal, 2, '.', '');
	} else {
		return 0;
	}
}

function cartItems($memberID, $itemID) {

	if ($itemID == 0) {
		$addsql = "";
	} else {
		$addsql = " AND itemID = '" . $itemID . "' ";
	}
	$cartDetails_sql = mysql_query("SELECT * FROM cms_billing_cart WHERE memberID = '" . $memberID . "'" . $addsql) or die(mysql_error());
	if (mysql_num_rows($cartDetails_sql) > 0) {
		$cartDetails = array();
		while ($cartDetail = mysql_fetch_object($cartDetails_sql)) {
			$cartDetails[] = $cartDetail;
		}
		return $cartDetails;
	} else {
		return 0;
	}

}

function cartContent($itemID) {
	$itemID = mysql_real_escape_string($itemID);
	$query = "SELECT * from cms_content WHERE content_id = '" . $itemID . "'";
	$item_sql = mysql_query($query) or die(mysql_error());
	if (mysql_num_rows($item_sql) == 1) {
		if ($item = mysql_fetch_object($item_sql)) {
			return $item;
		} else {
			return FALSE;
		}
	}
}

function cartModel($modelID, $itemType) {
	$modelID = @mysql_real_escape_string($modelID);
	$itemType = @mysql_real_escape_string($itemType);
	/*
	if ($itemType == 1) {
		$titleAdd = "Instant Video Download from: ";
	} elseif ($itemType == 2) {
		$titleAdd = "Instant Photo Download from: ";
	} elseif ($itemType == 3) {
		$titleAdd = "Custom Video from: ";
	} elseif ($itemType == 4) {
		$titleAdd = "Custom Photoset from: ";
	} elseif ($itemType == 5) {
		$titleAdd = "A tip for: ";
	} elseif ($itemType == 6) {
		$titleAdd = "Skype Private Chat with: ";
	} else {
		$titleAdd = "";
	}
	*/
	$query = "SELECT *, name AS title, model_id AS content_id FROM `cms_models` WHERE `model_id` = '" . $modelID . "'";
	$model_sql = mysql_query($query) or die(mysql_error());
	if (mysql_num_rows($model_sql) == 1) {
		if ($model = mysql_fetch_object($model_sql)) {
			//$model -> title = $titleAdd . '<a href="' . modelOutputName($model->title) . '">' . $model->title . '</a>';
			return $model;
		} else {
			return FALSE;
		}
	}
}

function cartRemoveItem($memberID, $cartID) {
	$cartID = @mysql_real_escape_string($cartID);
	$delete = @mysql_query("DELETE FROM cms_billing_cart WHERE memberID = '" . $memberID . "' AND cartID = '" . $cartID . "'") or die(mysql_error());
	//return msgSystem('That item has been removed.', 'success');
}

function cartCustomDetails($memberID, $customID) {
	$query = "SELECT * FROM cms_billing_custom WHERE customID = '" . $customID . "' AND memberID = '" . $memberID . "'";
	$custom_sql = @mysql_query($query);
	if (mysql_num_rows($custom_sql) == 1) {
		if ($custom = @mysql_fetch_object($custom_sql)) {
		//$custom->
			// status
			// modelID
			// contentType
			
			// baseOption
			// categoryOption
			// deliveryOption

			// description
			$getBase = @mysql_query("SELECT optionDescription FROM cms_custom_options WHERE optionID = '" . $custom->baseOption . "'");
			$getCategory = @mysql_query("SELECT optionDescription FROM cms_custom_options WHERE optionID = '" . $custom->categoryOption . "'");
			$getDelivery = @mysql_query("SELECT optionDescription FROM cms_custom_options WHERE optionID = '" . $custom->deliveryOption . "'");
			
			if (@mysql_num_rows($getBase) == 1) {
				$custom->baseName = @mysql_result($getCategory, 0, 'optionDescription');
			} else {
				$custom->baseName = "ERROR!";
			}
			
			if (@mysql_num_rows($getCategory) == 1) {
				$custom->categoryName = @mysql_result($getBase, 0, 'optionDescription');
			} else {
				$custom->categoryName = "ERROR!";
			}
			
			if($custom->deliveryOption == 0) {
				$custom->deliveryName = "14 Days (Standard)";
			} else {
				if (@mysql_num_rows($getDelivery) == 1) {
					$custom->deliveryName = @mysql_result($getDelivery, 0, 'optionDescription');
				} else {
					$custom->deliveryName = "ERROR!";
				}
			}

			return $custom;

		}
	}
}
/*
function cartCustomDetails($memberID, $customID) {
	$query = "SELECT * FROM cms_billing_custom WHERE customID = '" . $customID . "' AND memberID = '" . $memberID . "'";
	$custom_sql = @mysql_query($query);
	if (mysql_num_rows($custom_sql) == 1) {
		if ($custom = mysql_fetch_object($custom_sql)) {
			//$custom->
			// modelID
			// customType
			// categoryID
			// cvpoIDduration
			// cvpoIDdelivery
			// status
			// description

			$category_sql = mysql_query("SELECT category FROM cms_categories WHERE id = '" . $custom -> categoryID . "'") or die(mysql_error());
			$duration_sql = mysql_query("SELECT cvpo_name FROM `cms_custom_video_pricing_options` WHERE `type` = 'length' AND id = '" . $custom -> cvpoIDduration . "'") or die(mysql_error());
			$delivery_sql = mysql_query("SELECT cvpo_name FROM `cms_custom_video_pricing_options` WHERE `type` = 'delivery' AND id = '" . $custom -> cvpoIDdelivery . "'") or die(mysql_error());

			if (mysql_num_rows($category_sql) == 1) {
				$custom -> categoryName = mysql_result($category_sql, 0, 'category');
			} else {
				$custom -> categoryName = "ERROR!";
			}

			if (mysql_num_rows($duration_sql) == 1) {
				$custom -> durationName = mysql_result($duration_sql, 0, 'cvpo_name');
			} else {
				$custom -> durationName = "ERROR!";
			}

			if (mysql_num_rows($delivery_sql) == 1) {
				$custom -> deliveryName = mysql_result($delivery_sql, 0, 'cvpo_name');
			} else {
				$custom -> deliveryName = "ERROR!";
			}

			return $custom;

		}
	}
}
function cartCustomPrice($modelID, $categoryID, $cvpoIDduration, $cvpoIDdelivery) {
	$category_sql = mysql_query("SELECT price FROM cms_cvpo_match WHERE model_id = '" . $modelID . "' AND category_id = '" . $categoryID . "'") or die(mysql_error());
	$duration_sql = mysql_query("SELECT price FROM `cms_cvpo_match` WHERE `model_id` = '" . $modelID . "' AND `cvpo_id` = '" . $cvpoIDduration . "'") or die(mysql_error());
	$delivery_sql = mysql_query("SELECT price FROM `cms_cvpo_match` WHERE `model_id` = '" . $modelID . "' AND `cvpo_id` = '" . $cvpoIDdelivery . "'") or die(mysql_error());

	if (mysql_num_rows($category_sql) == 1 && mysql_num_rows($duration_sql) == 1 && mysql_num_rows($delivery_sql) == 1) {
		$customPrice = mysql_result($category_sql, 0, 'price') + mysql_result($duration_sql, 0, 'price') + mysql_result($delivery_sql, 0, 'price');
		return $customPrice;
	} else {
		return 0;
	}
}
*/

function buildCustomSelect($modelID,$currentOption,$contentType,$optionType) {
	$output = '';
	if($optionType == 3) {
		$output .= '<option value="0" data-price="0">14 Days (Standard)</option>';
		$contentType = 0;
	}
	$get = @mysql_query("SELECT * FROM cms_custom_options WHERE optionType = '".$optionType."' AND contentType = '".$contentType."'");
	if (@mysql_num_rows($get) > 0) {
		while ($row = @mysql_fetch_object($get)) {
			$get2 = @mysql_query("SELECT settingPrice FROM cms_custom_options_models WHERE modelID = '".$modelID."' AND optionID = '".$row->optionID."'");
			if (@mysql_num_rows($get2) == 1) {
				$settingPrice = @mysql_result($get2, 0, 'settingPrice');
				if($currentOption == $row->optionID) { $add = ' selected="selected"'; } else { $add = ''; }
				$output .= '<option value="' . $row->optionID . '" data-price="' . $settingPrice . '"'.$add.'>' . $row->optionDescription . '</option>';
			}
		}
	}			
	return $output;
}

function cartCustomPrice($modelID, $baseOption, $catOption, $deliveryOption) {
	$get = @mysql_query("SELECT SUM(settingPrice) as settingPrice FROM cms_custom_options_models WHERE modelID = '" . $modelID . "' AND optionID IN ('" . $baseOption . "','" . $catOption . "','" . $deliveryOption . "')");
	
	if (@mysql_num_rows($get) == 1) {
		$customPrice = mysql_result($get, 0, 'settingPrice');
		return $customPrice;
	} else {
		return 0;
	}
}

function cartPrivateDetails($memberID, $privateID) {
	$query = "SELECT * FROM cms_billing_private WHERE privateID = '" . $privateID . "' AND memberID = '" . $memberID . "'";
	$private_sql = mysql_query($query) or die(mysql_error());
	if (mysql_num_rows($private_sql) == 1) {
		if ($private = mysql_fetch_object($private_sql)) {
			//$private->
			// modelID
			// duration
			// preferredtime
			// status
			// description
			return $private;
		}
	} else {
		return 0;	
	}
}

function cartPrivatePrice($modelID, $duration) {
	$model_call_options_sql = mysql_query("SELECT a15min_video, a30min_video, a45min_video, a60min_video FROM cms_model_call_options WHERE model_id = '" . $modelID . "'");
	if (mysql_num_rows($model_call_options_sql) == 1) {
		if ($duration == 15) {
			$privatePrice = mysql_result($model_call_options_sql, 0, 'a15min_video');
		} elseif ($duration == 30) {
			$privatePrice = mysql_result($model_call_options_sql, 0, 'a30min_video');
		} elseif ($duration == 45) {
			$privatePrice = mysql_result($model_call_options_sql, 0, 'a45min_video');
		} elseif ($duration == 60) {
			$privatePrice = mysql_result($model_call_options_sql, 0, 'a60min_video');
		}
		return $privatePrice;
	} else {
		return 0;
	}
}

function cartUpdate($cartID, $itemPrice) {
	$update = @mysql_query("UPDATE cms_billing_cart SET itemPrice = '".$itemPrice."' WHERE cartID = '".$cartID."'");
}

function cartAdd($memberID, $itemID, $itemType, $relatedID, $itemPrice) {
	if ($memberID == 0) {
		header('Location: acct.php');
		die();
	}
	//$generalError = msgSystem('There was a problem adding that item to your cart, please try again.', 'error');
	if (isset($memberID) && isset($itemID) && isset($itemType) && isset($relatedID) && isset($itemPrice)) {
		$result = mysql_query("SELECT * FROM cms_billing_cart WHERE memberID = '" . $memberID . "' AND itemID = '" . $itemID . "' AND itemType = '" . $itemType . "'") or die(mysql_error());
		if (mysql_num_rows($result) == 0) {
			$insert = mysql_query("INSERT INTO cms_billing_cart SET  memberID = '" . $memberID . "', itemID = '" . $itemID . "', itemType = '" . $itemType . "', itemPrice = '" . $itemPrice . "', relatedID = '" . $relatedID . "'") or die(mysql_error());
			if ($itemType == 3) {
				//$message = "Your custom video request has been added to your cart.";
			} elseif ($itemType == 4) {
				//$message = "A special request has been added to your cart.";
			} elseif ($itemType == 5) {
				//$message = "A tip has been added to your cart.";
			} elseif ($itemType == 6) {
				//$message = "A One on One has been added to your cart.";
			} else {
				//$message = "added to your cart.";
			}
			//return msgSystem($message, 'success');
		} else {
			//return $generalError . '(Code: 200)';
		}
	} else {
		//return $generalError . '(Code: 300)';
	}
	
	header('Location: acct.cart.php');
	die();
}
/* =============================================================================================== */

/* =============================================================================================== */

function secureFile($filename = "") {
/*	$filename = "/" . $filename;
	$secret = "LcO1SzLMElKHj";
	$t_hex = sprintf("%08x", time());
	$mash = md5($secret . $filename . $t_hex);
	$url = "http://content.store.tiacyrusxxx.com:81/dl/" . $mash . "/" . $t_hex . "" . $filename;
	return $url;
 */
 $url = "http://store.tiacyrusxxx.com/content/models/" . $filename;
return $url;
}
/* =============================================================================================== */
function sendAnEmail($emailTo,$emailSubject,$memberID,$emailAddress,$emailMessage) {
	@mysql_query("INSERT INTO cms_emails SET member_id = '".$memberID."', email = '".$emailAddress."', message = '".$emailMessage."'");
	
	
    
    $emailHeaders = "From: TIACYRUSXXX.com <support@tiacyrusxxx.com>\r\n" .
		 'X-Mailer: PHP/' . phpversion() . "\r\n" .
		 "MIME-Version: 1.0\r\n" .
		 "Content-Type: text/html; charset=utf-8\r\n" .
		 "Content-Transfer-Encoding: 8bit\r\n\r\n";
	
	mail($emailTo, $emailSubject, $emailMessage, $emailHeaders);
}

function videoToken($time, $path)
{
    //This is to ensure that time GET variable in video has not been modified   
    $token = md5("@salt!" . $time . $path);
    
    return $token;
    
}
function videoTimeShort()
{
    
    return strtotime("+27 minutes");
    
}
function notificationEmail($memberType,$memberID,$emailTemplate){
	if($memberType == 0) {
		$get_sql = mysql_query("SELECT email, password, confirm, model_email FROM cms_members WHERE member_id = '" . $memberID . "'") or die(mysql_error());
	} else {
		$get_sql = mysql_query("SELECT email, password, confirm, model_email FROM cms_members WHERE model_id = '" . $memberID . "'") or die(mysql_error());
	}
	
	if (mysql_num_rows($get_sql) == 1) {
		$userDetails = mysql_fetch_object($get_sql);
		
		if($emailTemplate == "join")
        {
            $emailHeaders = "From: STORE.TIACYRUSXXX.com <support@tiacyrusxxx.com>\r\n" .
            'Cc: support@tiacyrusxxx.com' . "\r\n".
			 'X-Mailer: PHP/' . phpversion() . "\r\n" .
			 "MIME-Version: 1.0\r\n" .
			 "Content-Type: text/html; charset=utf-8\r\n" .
			 "Content-Transfer-Encoding: 8bit\r\n\r\n";
        }
        else if(isset($userDetails->model_email) && !empty($userDetails->model_email))
        {
            $emailHeaders = "From: TIACYRUSXXX.com <support@tiacyrusxxx.com>\r\n" .
            'Cc: support@tiacyrusxxx.com, ' .$userDetails->model_email .  "\r\n".
			 'X-Mailer: PHP/' . phpversion() . "\r\n" .
			 "MIME-Version: 1.0\r\n" .
			 "Content-Type: text/html; charset=utf-8\r\n" .
			 "Content-Transfer-Encoding: 8bit\r\n\r\n";
        }
        else
        {
             $emailHeaders = "From: TIACYRUSXXX.com <support@tiacyrusxxx.com>\r\n" .
			 'X-Mailer: PHP/' . phpversion() . "\r\n" .
			 "MIME-Version: 1.0\r\n" .
			 "Content-Type: text/html; charset=utf-8\r\n" .
			 "Content-Transfer-Encoding: 8bit\r\n\r\n";
         }
					 
		if($emailTemplate == "join") {
			$emailSubject = " ** TIACYRUSXXX.COM MEMBER CONFIRMATION E-MAIL ** ";
			$emailTo = $userDetails->email;
	
			$emailMessage = "You have requested a membership to store.tiacyrusxxx.com and you have specified this address ($email) as your contact e-mail.<br><br>";
			$emailMessage .= "If you did not make this request at Tiacyrusxxx.com, please ignore this email.<br><br>";
			$emailMessage .= "If you did make this request, you must confirm your e-mail address by visiting the following link:<br><br>";
			$emailMessage .= "<a href=\"http://store.tiacyrusxxx.com/acct.php?email=".$userDetails->email."&code=".$userDetails->confirm."\">http://store.tiacyrusxxx.com/acct.php?email=".$userDetails->email."&code=".$userDetails->confirm."</a><br><br>";
			$emailMessage .= "Thank You,<br>- TiaCyrusXXX";
		}
		
        if($emailTemplate == "resetPasswordForEmail") {
            $emailSubject = " ** TIACYRUSXXX.COM MEMBER PASSWORD RESET LINK ** ";
			$emailTo = $userDetails->email;
	
			$emailMessage = "You have requested a password reset link for your account at Store.Tiacyrusxxx.com and you have specified this address as your contact e-mail.<br><br>";
			$emailMessage .= "If you did not make this request at Store.Tiacyrusxxx.com, please ignore this email.<br><br>";
			$emailMessage .= "If you did make this request, you can reset your password by visiting the following link:<br><br>";
			$emailMessage .= "<a href=\"http://store.tiacyrusxxx.com/forgot.php?email=".$userDetails->email."&reset_code=".md5('LeSalt' . $userDetails->email . $userDetails->password)."\">http://store.tiacyrusxxx.com/forgot.php?email=".$userDetails->email."&reset_code=".md5('LeSalt' . $userDetails->email . $userDetails->password)."</a><br><br>";
			$emailMessage .= "Thank You,<br>- TiaCyrusxxx";
            
        }
		if($emailTemplate == "customOrder") {
			$emailSubject = " ** TIACYRUSXXX.COM CUSTOM VIDEO PURCHASE ** ";
			$emailTo = $userDetails->email;
	
			$emailMessage = "A member of STORE.TIACYRUSXXX.COM has purchased a custom video!<br><br>";
			$emailMessage .= "Please log on to see details: ";
			$emailMessage .= "<a href=\"http://store.tiacyrusxxx.com/login.php\">http://store.tiacyrusxxx.com/</a><br><br>";
			$emailMessage .= "Thank You,<br>- Tiacyrusxxx";
		}
		
		if($emailTemplate == "privateOrder") {
			$emailSubject = " ** TIACYRUSXXX.COM PRIVATE PURCHASE ** ";
			$emailTo = $userDetails->email;
	
			$emailMessage = "A member of TIACYRUSXXX.COM has purchased a private session!<br><br>";
			$emailMessage .= "Please log on to see details: ";
			$emailMessage .= "<a href=\"http://store.tiacyrusxxx.com/login.php\">http://store.tiacyrusxxx.com/</a><br><br>";
			$emailMessage .= "Thank You,<br>- Tiacyrusxxx";
		}	
			
		if($emailTemplate == "newMessage") {
			$emailSubject = " ** TIACYRUSXXX.COM NEW MESSAGE ** ";
			$emailTo = $userDetails->email;
			
			$emailMessage = "You have received a new message on TIACYRUSXXX.COM!<br><br>";
			$emailMessage .= "Please log on to see details: ";
			$emailMessage .= "<a href=\"http://store.tiacyrusxxx.com/login.php\">http://store.tiacyrusxxx.com/</a><br><br>";
			$emailMessage .= "Thank You,<br>- Tiacyrusxxx";
		}

		mail($emailTo, $emailSubject, $emailMessage, $emailHeaders);
	}
}

function navigateAndCreatePath($path)
{
    //This functions gets a path and creates folders in the path which do not exist
    rtrim($path, "/"); //trim trailing slash
    
    $chunks = explode("/", $path);
    
    $folder_path = "";
    
    foreach($chunks as $key=>$value)
    {
        $folder_path .= trim($value . "/");
        
        if($folder_path == "/") continue;//because this is root
        
        if(!file_exists($folder_path))
        {
            mkdir($folder_path, 0755, true);
        }
    }
}

function ordinal($number) {
    //Returns ordinal form of number e.g 31st, 32nd, 150th etc useful for displaying date
    $ends = array('th','st','nd','rd','th','th','th','th','th','th');
    if ((($number % 100) >= 11) && (($number%100) <= 13))
        return $number. 'th';
    else
        return $number. $ends[$number % 10];
}

function smart_resize_image($imgData, $thumbPath, $width, $height, $newWidth = 100, $newHeight = 0, $percent = 100){
    
    
/*
 * PHP GD
 * resize an image using GD library
 *By Bill
 */

// Get new sizes
$newwidth = $newWidth * ($percent/100);
$newheight = $newHeight * ($percent/100);

// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromstring($imgData);

// Resize
imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

// Save and free memory
imagejpeg($thumb, $thumbPath);
imagedestroy($thumb);

}

if (!function_exists('getimagesizefromstring')) {
      function getimagesizefromstring($string_data)
      {
         $uri = 'data://application/octet-stream;base64,'  . base64_encode($string_data);
         return getimagesize($uri);
      }
}

function modelDropDown(){
    ?>
    <option value="<?php echo $_SERVER['PHP_SELF']; ?>" selected="selected">All</option>
               <?php 
                     $getModels = mysql_query("SELECT * FROM cms_models ORDER BY name ASC") or die(mysql_error());
                     
                     while($result = mysql_fetch_object($getModels))
                     {
                     //echo "<pre>";
                     //print_r($results);
                     //echo "</pre>";
                        echo "<option value='".$_SERVER['PHP_SELF']."?model_id=". $result->model_id ."'";
                        echo $_GET['model_id'] == $result->model_id? "selected='selected'": "";
                        echo ">". $result->name ."</option>";
                     }
                     
                     
               ?>			
                        
                        
			
<?php
}

function echoStore()
{ //Store Item REQUESTS
$contentType = 3;
?>
  <div class="content-box">
  <span class="backtotop"><a href="#thetop"><span class="glyphicon glyphicon-arrow-up"></span>TOP</a></span>
    <h3 id="custom<?php if($contentType == 2) { echo 'Videos'; } else { echo 'Photos'; } ?>"><span class="glyphicon glyphicon-heart" aria-hidden="true"></span> MY <?php if($contentType == 3) { echo 'STORE'; } else { echo 'PHOTOS'; } ?></h3>
<?php if($memberID == 0) { ?><h4 class="pink">YOU NEED TO BE A MEMBER! <a href="acct.php">JOIN NOW</a></h4><?php } ?>
<h5><?php if($contentType == 3) { echo "Welcome to my official online store!! I'm so excited for all the fun things I have to share with you!";/*nl2br($row->customVideoText);*/ } else { echo nl2br($row->customPhotosetText); } ?></h5>
<br />
<ul id="photoOut-li">v  
    <li class="top-level">
        <div class="photoOut-frame">
            <a href="content.photoset.php?id=1015"><img src="store_imgs/t1.jpg" alt="Tip Me" /></a>
            <h5>Tip Me<span>$35.00</span>
            <br />
            <small><strong>Seller:</strong> <a href="georgia-jones">Georgia Jones</a>
            <br />
            <button type="submit" class="btn btn-default" <?php if ($member_id == 0) { echo ' disabled'; } ?>>     Add to Cart     </button>
            </h5>           
        </div>
    </li>
    <li class="top-level">
        <div class="photoOut-frame">
            <a href="content.photoset.php?id=1000"><img src="store_imgs/t2.jpg" alt="Snapchat For Life" /></a>
            <h5>Snapchat For Life<span>$99.00</span>
            <br />
            <small><strong>Seller:</strong> <a href="georgia-jones">Georgia Jones</a><br />
            <button type="submit" class="btn btn-default" <?php if ($member_id == 0) { echo ' disabled'; } ?>>     Add to Cart     </button>
            </h5>
        </div>
    </li>
    <li class="top-level">
        <div class="photoOut-frame">
            <a href="content.photoset.php?id=1000"><img src="store_imgs/t3.jpg" alt="Treat for Lesley" /></a>
            <h5>Treat for Lesley<span>$5.00</span>
            <br />
            <small><strong>Seller:</strong> <a href="georgia-jones">Georgia Jones</a><br />
            <button type="submit" class="btn btn-default" <?php if ($member_id == 0) { echo ' disabled'; } ?>>     Add to Cart     </button>
            </h5>
        </div>
    </li>
    
    <li class="top-level">
        <div class="photoOut-frame">
            <a href="content.photoset.php?id=1000"><img src="store_imgs/t4.jpg" alt="Victoria Secrets Spoil Me" /></a>
            <h5>Victoria Secrets Spoil Me<span>$49.00</span>
            <br />
            <small><strong>Seller:</strong> <a href="georgia-jones">Georgia Jones</a><br />
            <button type="submit" class="btn btn-default" <?php if ($member_id == 0) { echo ' disabled'; } ?>>     Add to Cart     </button>
            </h5>
        </div>
    </li>
    
    <li class="top-level">
        <div class="photoOut-frame">
            <a href="content.photoset.php?id=1000"><img src="store_imgs/t5.jpg" alt="Treat for Bruno" /></a>
            <h5>Treat for Bruno<span>$10.00</span>
            <br />
            <small><strong>Seller:</strong> <a href="georgia-jones">Georgia Jones</a><br />
            <button type="submit" class="btn btn-default" <?php if ($member_id == 0) { echo ' disabled'; } ?>>     Add to Cart     </button>
            </h5>
        </div>
    </li>
    
	</ul>
<div class="clearfix"></div>
    </div>


<?php
}

?>

Youez - 2016 - github.com/yon3zu
LinuXploit