Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Other Programming › Web Languages › Txt Based CMS(Flat-File) + Smiley system

Txt Based CMS(Flat-File) + Smiley system

Posts 1–4 of 4 · Page 1 of 1
SU
Sub
Txt Based CMS(Flat-File) + Smiley system
Easy as pie.

first make this .txt file called updates.txt
Code:
downloadx.org update #2
nextupdate :)
Code:
<?

function replace($content) {
$content = ereg_replace("\n","<br>", $content); 
$content = ereg_replace(":)","<img src=smile.png>", $content); 
return $content;
}
$rawr = file_get_contents("updates.txt");

echo replace($rawr);

?>
now just do this
Code:
js/cssetchere
htmlhtmlhtml
htmlhtmlhtml
<? include("news.php"); ?>
htmlhtmlhtml
htmlhtmlhtml
owned

posted on rune-server.dot.org by me
#1 · 16y ago
yearupie
yearupie
This is crap!

Try a better example (this may in a class or function):

class.ubb.php
Code:
<?php
class Ubb {
	
	public $text;
	public $smilies = array( 
	':)'    =>     "smile.gif", 
	':('    =>     "sad.gif", 
	':D'    =>     "biggrin.gif", 
	':d'    =>     "biggrin.gif",                 
	':p'    =>     "tongue.gif", 
	':P'    =>     "tongue.gif", 
	':-)'    =>     "unsure.gif", 
	'(A)'    =>     "angel.gif", 
	'(a)'    =>     "angel.gif", 
	':s'    =>     "blink.gif", 
	':S'    =>     "blink.gif", 
	':$'    =>     "blush.gif", 
	'(h)'    =>     "cool.gif", 
	'(H)'    =>     "cool.gif", 
	':\'('    =>     "cry.gif", 
	'--'    =>     "dry.gif", 
	'-_-'    =>     "dry.gif", 
	'^^'    =>     "happy.gif", 
	'^_^'    =>     "happy.gif", 
	':|'    =>     "huh.gif", 
	';d'    =>     "laugh.gif", 
	';D'    =>     "laugh.gif", 
	':@'    =>     "mad.gif", 
	':o'    =>     "ohmy.gif", 
	':O'    =>     "ohmy.gif", 
	':0'    =>     "ohmy.gif", 
	'8S'    =>     "woot.gif", 
	'8s'    =>     "woot.gif", 
	'8)'    =>     "wacko.gif", 
	';)'    =>     "wink.gif", 
	);
	
	public function __construct($text) {
		
		$this->text = $text;
	}
	
	public function addCodes() {
	
		$text = $this->text;
		
		# Change characters in html
		$text = htmlspecialchars($text);
		
		# Add enters
		$text = nl2br($text); 
		
		# Run all possibilities
		foreach($this->smilies AS $find => $replace) 
    {
	    # Creates an image for each smiley
    	$text = str_replace(htmlentities($find), '<img src="http://www.mpgh.net/forum/images/smileys/'.$replace.'" alt="smileys" />', $text);   
  	}
  	# Add your own image
  	$text = preg_replace('#\[img\](http(s)?://)([a-zA-Z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]+)\[/img\]#', '<img src="\\1\\3" alt="" />', $text);
  	
  	# Makes colored characters
  	$text = preg_replace('#\[color=(\#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]#si', '<font color="\\1">\\2</font>', $text);
  	
  	return $text;
	}
}
?>
How to use?

Set at the top of your document
Code:
<?php
require_once('class.ubb.php');

$file = file_get_contents("updates.txt");
$text = new Ubb($file);
?>
And this where you want the text:
Code:
<?php
$text-> addCodes();
?>
#2 · 16y ago
SU
Sub
Quote Originally Posted by yearupie View Post
This is crap!

Try a better example (this may in a class or function):

class.ubb.php
Code:
<?php
class Ubb {
	
	public $text;
	public $smilies = array( 
	':)'    =>     "smile.gif", 
	':('    =>     "sad.gif", 
	':D'    =>     "biggrin.gif", 
	':d'    =>     "biggrin.gif",                 
	':p'    =>     "tongue.gif", 
	':P'    =>     "tongue.gif", 
	':-)'    =>     "unsure.gif", 
	'(A)'    =>     "angel.gif", 
	'(a)'    =>     "angel.gif", 
	':s'    =>     "blink.gif", 
	':S'    =>     "blink.gif", 
	':$'    =>     "blush.gif", 
	'(h)'    =>     "cool.gif", 
	'(H)'    =>     "cool.gif", 
	':\'('    =>     "cry.gif", 
	'--'    =>     "dry.gif", 
	'-_-'    =>     "dry.gif", 
	'^^'    =>     "happy.gif", 
	'^_^'    =>     "happy.gif", 
	':|'    =>     "huh.gif", 
	';d'    =>     "laugh.gif", 
	';D'    =>     "laugh.gif", 
	':@'    =>     "mad.gif", 
	':o'    =>     "ohmy.gif", 
	':O'    =>     "ohmy.gif", 
	':0'    =>     "ohmy.gif", 
	'8S'    =>     "woot.gif", 
	'8s'    =>     "woot.gif", 
	'8)'    =>     "wacko.gif", 
	';)'    =>     "wink.gif", 
	);
	
	public function __construct($text) {
		
		$this->text = $text;
	}
	
	public function addCodes() {
	
		$text = $this->text;
		
		# Change characters in html
		$text = htmlspecialchars($text);
		
		# Add enters
		$text = nl2br($text); 
		
		# Run all possibilities
		foreach($this->smilies AS $find => $replace) 
    {
	    # Creates an image for each smiley
    	$text = str_replace(htmlentities($find), '<img src="http://www.mpgh.net/forum/images/smileys/'.$replace.'" alt="smileys" />', $text);   
  	}
  	# Add your own image
  	$text = preg_replace('#\[img\](http(s)?://)([a-zA-Z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]+)\[/img\]#', '<img src="\\1\\3" alt="" />', $text);
  	
  	# Makes colored characters
  	$text = preg_replace('#\[color=(\#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]#si', '<font color="\\1">\\2</font>', $text);
  	
  	return $text;
	}
}
?>
How to use?

Set at the top of your document
Code:
<?php
require_once('class.ubb.php');

$file = file_get_contents("updates.txt");
$text = new Ubb($file);
?>
And this where you want the text:
Code:
<?php
$text-> addCodes();
?>
Ill be posting my cms later, it uses a similar bbc system
#3 · 16y ago
Spookerzz
Spookerzz
Bit of a bump there.
#4 · 16y ago
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

  • Find File In System [solved]By alvaritos in Visual Basic Programming
    3Last post 15y ago
  • .DLL Opening As .TXT FileBy callenbs in Combat Arms Help
    11Last post 17y ago
  • <<<<((need player.txt file!!))>>>By horogon in Combat Arms Mods & Rez Modding
    5Last post 16y ago
  • Advanced .Bat / .Txt File Creator !!!By nökeinbock in Visual Basic Programming
    2Last post 16y ago
  • "Cannot get a file [version.txt] !"By MarcAu in WarRock - International Hacks
    14Last post 19y ago

Tags for this Thread

None