Файл: application/manual/index.html
Строк: 250
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<head lang="en">
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Text Helper</title>
<!-- Framework CSS -->
<link rel="stylesheet" href="assets/blueprint-css/screen.css" type="text/css" media="screen, projection">
<link rel="stylesheet" href="assets/blueprint-css/print.css" type="text/css" media="print">
<!--[if lt IE 8]><link rel="stylesheet" href="assets/blueprint-css/ie.css" type="text/css" media="screen, projection"><![endif]-->
<link rel="stylesheet" href="assets/blueprint-css/plugins/fancy-type/screen.css" type="text/css" media="screen, projection">
<style type="text/css" media="screen">
p, table, hr, .box { margin-bottom:25px; }
.box p { margin-bottom:10px; }
</style>
<link rel="stylesheet" href="assets/blueprint-css/shCore.css"/>
<link rel="stylesheet" href="assets/blueprint-css/shCoreDefault.css"/>
<script language="javascript" src="scripts/shCore.js"></script>
<script language="javascript" src="scripts/shBrushCss.js"></script>
<script language="javascript" src="scripts/shBrushJScript.js"></script>
<script language="javascript" src="scripts/shBrushPhp.js"></script>
</head>
<body>
<div class="container">
<h3 class="center alt">“Date Helper” Documentation by “The-Di-Lab” v1.0</h3>
<hr>
<h1 class="center">“Text Helper”</h1>
<div class="borderTop">
<div class="span-6 colborder info prepend-1">
<p class="prepend-top">
<strong>
Created: 7 July 2011 <br>
<br>
By: The-Di-Lab<br><br>
Email: <a href="mailto:thedilab@gmail.com">thedilab@gmail.com</a><br><br>
Social: <a href="http://twitter.com/#!/XuDing" title="twitter" target="_blank"><img src="assets/images/24x24.png"/></a>
</strong>
</p>
</div><!-- end div .span-6 -->
<div class="span-12 last">
<p class="prepend-top append-0"><img src="assets/images/avator.jpg" width="80" height="80" style="float:left; ">Thank you for purchasing my script. If you have any questions that are beyond the scope of this help file, please feel free to contact me via my email.
Please also follow my <a href="http://twitter.com/#!/XuDing" title="twitter" target="_blank">twitter</a> account to get future updates of this script.
Thank you very much!
</p>
</div>
</div><!-- end div .borderTop -->
<hr>
<h2 id="toc" class="alt">Table of Contents</h2>
<ol class="alpha toc">
<li><a href="#install">Installation Guide</a></li>
<li><a href="#usage">Usage</a></li>
<li><a href="#php">PHP Code Explanation</a></li>
</ol>
<hr>
<h3 id="install"><strong>A) Installation Guide</strong> <a href="#toc"><img src="assets/images/up.png"/></a></h3>
<ol>
<li>Copy and paste 'text_helper.php' to your directory.</li>
<li>Include 'text_helper.php' on your page and you are ready to go.
<script type="syntaxhighlighter" class="brush: php"><![CDATA[
<?php
include 'text_helper.php';
$textHelper = new TextHelper();
?>
]]></script>
</li>
</ol>
<hr>
<h3 id="usage"><strong>B) Usage</strong> <a href="#toc"><img src="assets/images/up.png"/></a></h3>
<ol>
<li>autoEmail($text): this function adds links to email address in the string. e.g.
<script type="syntaxhighlighter" class="brush: php"><![CDATA[
<?php
include 'text_helper.php';
$textHelper = new TextHelper();
$string = 'my email address is thedilab@gmail.com';
$result = $textHelper->autoEmail($string);
//my email address is <a href="mailto:thedilab@gmail.com">thedilab@gmail.com</a>
?>
]]></script>
</li>
<li>autoUrl($text):this function transforms http links to hyperlinks. e.g.
<script type="syntaxhighlighter" class="brush: php"><![CDATA[
<?php
include 'text_helper.php';
$textHelper = new TextHelper();
$string = 'my website is http://www.google.com';
$result = $textHelper->autoUrl($string);
//my website is <a href="http://www.google.com">http://www.google.com</a>
?>
]]></script>
</li>
<li>truncate($text, $length=100, $end='...'): this function will shorten the string by $length, and append $end after that. e.g.
<script type="syntaxhighlighter" class="brush: php"><![CDATA[
<?php
include 'text_helper.php';
$textHelper = new TextHelper();
$string = 'my email address is';
$result = $textHelper->truncate($string,14);
//my email addre...
]]></script>
</li>
<li>extractBetween($text,$start,$end) : this function extracts string between $start and $end in $text. e.g.
<script type="syntaxhighlighter" class="brush: php"><![CDATA[
<?php
include 'text_helper.php';
$textHelper = new TextHelper();
$string = 'my website is ';
$result = $textHelper->extractBetween($string,'my','is');
//" website "
?>
]]></script>
</li>
<li>toSlug($text) :this function transforms $text to a SEO friendly urlencode string. e.g.
<script type="syntaxhighlighter" class="brush: php"><![CDATA[
<?php
include 'text_helper.php';
$textHelper = new TextHelper();
$string = 'my website is ';
$result = $textHelper->toSlug($string);
//"my-website-is"
?>
]]></script>
</li>
<li>stripTags($text,$tags): this function strips specified tags from the string. e.g.
<script type="syntaxhighlighter" class="brush: php"><![CDATA[
<?php
include 'text_helper.php';
$textHelper = new TextHelper();
$string = '<a>my website is</a>';
$result = $textHelper->stripTags($string,'a');
//"my-website-is"
?>
]]></script>
</li>
<li>stripImages($text) : this function removes img from string. e.g.
<script type="syntaxhighlighter" class="brush: php"><![CDATA[
<?php
include 'text_helper.php';
$textHelper = new TextHelper();
$string = '<img src="www.google.com"/>my website is';
$result = $textHelper->stripImages($string);
//"my-website-is"
?>
]]></script>
</li>
<li>stripScripts($text) : this function strips scripts and stylesheets from string. e.g.
<script type="syntaxhighlighter" class="brush: php"><![CDATA[
<?php
include 'text_helper.php';
$textHelper = new TextHelper();
$string = '<link href="special.css" rel="stylesheet" type="text/css"/>';
$result = $textHelper->testStripScripts($string);
//""
?>
]]></script>
</li>
<li>stripWhitespace($text): this function strips whitespace from the text. e.g.
<script type="syntaxhighlighter" class="brush: php"><![CDATA[
<?php
include 'text_helper.php';
$textHelper = new TextHelper();
$string = 'my website isnnnn';
$result = $textHelper->testStripWhitespace($string);
//"my website is"
?>
]]></script>
</li>
<li>noHtml($text): this function removes all the html open and close tags. e.g.
<script type="syntaxhighlighter" class="brush: php"><![CDATA[
<?php
include 'text_helper.php';
$textHelper = new TextHelper();
$string ='<a href="#">my website is</a>';
$result = $textHelper->noHtml($string);
//"my website is"
?>
]]></script>
</li>
<li>html($text): this function makes string safe for display as HTML. e.g.
<script type="syntaxhighlighter" class="brush: php"><![CDATA[
<?php
include 'text_helper.php';
$textHelper = new TextHelper();
$string ='<a>tmy website is</a>';
$result = $textHelper->html($string);
//"<a>this is a link</a>"
?>
]]></script>
</li>
</ol>
<hr>
<h3 id="php"><strong>C) PHP Code Explanation</strong> <a href="#toc"><img src="assets/images/up.png"/></a></h3>
<p>Code in this class is well commented, you should be able to understand its logic easily by reading the code.
It following OOP coding design.</p>
<p>Once again, thank you so much for purchasing this script. As I said at the beginning, I'd be glad to help you if you have any questions relating to this script. No guarantees, but I'll do my best to assist. And do not forget to follow my
<a href="http://twitter.com/#!/XuDing" title="twitter" target="_blank">twitter</a> to get future updates. </p>
<p class="large alt append-bottom"><strong>The-Di-Lab</strong></p>
<p><a href="#toc">Go To Table of Contents</a></p>
<hr class="space">
</div><!-- end div .container -->
<script>
SyntaxHighlighter.all();
</script>
</body>
</html>