本文整理汇总了PHP中Text::bb2html方法的典型用法代码示例。如果您正苦于以下问题:PHP Text::bb2html方法的具体用法?PHP Text::bb2html怎么用?PHP Text::bb2html使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Text
的用法示例。
在下文中一共展示了Text::bb2html方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send
/**
* sends an email using our configs
* @param string/array $to array(array('name'=>'chema','email'=>'chema@'),)
* @param [type] $to_name [description]
* @param [type] $subject [description]
* @param [type] $body [description]
* @param [type] $reply [description]
* @param [type] $replyName [description]
* @param [type] $file [description]
* @return boolean
*/
public static function send($to, $to_name = '', $subject, $body, $reply, $replyName, $file = NULL)
{
require_once Kohana::find_file('vendor', 'php-mailer/phpmailer', 'php');
$body = Text::bb2html($body, TRUE);
//get the template from the html email boilerplate
$body = View::factory('email', array('title' => $subject, 'content' => nl2br($body)))->render();
$mail = new PHPMailer();
$mail->CharSet = Kohana::$charset;
if (core::config('email.smtp_active') == TRUE) {
$mail->IsSMTP();
//SMTP HOST config
if (core::config('email.smtp_host') != "") {
$mail->Host = core::config('email.smtp_host');
// sets custom SMTP server
}
//SMTP PORT config
if (core::config('email.smtp_port') != "") {
$mail->Port = core::config('email.smtp_port');
// set a custom SMTP port
}
//SMTP AUTH config
if (core::config('email.smtp_auth') == TRUE) {
$mail->SMTPAuth = TRUE;
// enable SMTP authentication
$mail->Username = core::config('email.smtp_user');
// SMTP username
$mail->Password = core::config('email.smtp_pass');
// SMTP password
if (core::config('email.smtp_ssl') == TRUE) {
$mail->SMTPSecure = "ssl";
// sets the prefix to the server
}
}
}
$mail->From = core::config('email.notify_email');
$mail->FromName = "no-reply " . core::config('general.site_name');
$mail->Subject = $subject;
$mail->MsgHTML($body);
if ($file !== NULL) {
$mail->AddAttachment($file['tmp_name'], $file['name']);
}
$mail->AddReplyTo($reply, $replyName);
//they answer here
if (is_array($to)) {
foreach ($to as $contact) {
$mail->AddBCC($contact['email'], $contact['name']);
}
} else {
$mail->AddAddress($to, $to_name);
}
$mail->IsHTML(TRUE);
// send as HTML
if (!$mail->Send()) {
//to see if we return a message or a value bolean
Alert::set(Alert::ALERT, "Mailer Error: " . $mail->ErrorInfo);
return FALSE;
} else {
return TRUE;
}
}
示例2: array
?>
" width="30" height="30" style="width:30px;height:30px;" />
</a>
<div class="media-body">
<h4 class="media-heading"><a href="<?php
echo Route::url('product-review', array('seotitle' => $review->product->seotitle, 'category' => $review->product->category->seoname));
?>
"><?php
echo Text::limit_chars(Text::bb2html($review->product->title, TRUE), 30, NULL, TRUE);
?>
</a><span class="label label-warning"><?php
echo $review->rate;
?>
</span></h4>
<h5><?php
echo Text::limit_chars(Text::bb2html($review->description, TRUE), 30, NULL, TRUE);
?>
</h5>
<hr style="margin:8px auto">
</div>
</div>
<?php
}
?>
</ul>
示例3: __
</span>
<?if (empty($item['url_demo'])===FALSE):?>
<a class="btn btn-default btn-xs" target="_blank" href="<?php
echo $item['url_demo'];
?>
">
<i class="glyphicon glyphicon-eye-open"></i>
<?php
echo __('Preview');
?>
</a>
<?endif?>
</p>
<p>
<?php
echo Text::bb2html($item['description']);
?>
</p>
<?if ( $item['price_offer']>0 AND strtotime($item['offer_valid'])>time()):?>
<p>
<a href="<?php
echo $item['url_buy'];
?>
" class="btn btn-block btn-danger oe_button" data-toggle="modal" data-target="#marketModal"><?php
echo __('Limited Offer!');
?>
$<?php
echo $item['price_offer'];
?>
</a>
<a href="<?php
示例4: __
<span class="label label-info"><?php
echo $hits;
?>
<?php
echo __('Hits');
?>
</span>
<?endif?>
</div>
</div>
<br/>
<div>
<?php
echo Text::bb2html($ad->description, TRUE);
?>
<?if (Valid::url($ad->website)):?>
<p><a href="<?php
echo $ad->website;
?>
" rel="nofollow" target="_blank">><?php
echo $ad->website;
?>
</a></p>
<?endif?>
</div>
<?if(core::config('payment.paypal_seller')==1 AND $ad->price != NULL AND $ad->price > 0):?>
<?if(core::config('payment.stock')==0 OR ($ad->stock > 0 AND core::config('payment.stock')==1)):?>
<?if (!Auth::instance()->logged_in()):?>
示例5: __
<?php
echo $content->title;
?>
</button>
<!-- Modal -->
<div class="modal fade" id="alternative_pay_modal" tabindex="-1" role="dialog" aria-labelledby="alternative_pay_modal" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel"><?php
echo $content->title;
?>
</h4>
</div>
<div class="modal-body">
<div class="text-description"><?php
echo Text::bb2html($content->description, TRUE, FALSE);
?>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><?php
echo __('OK');
?>
</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
示例6: array
</div>
</div>
</div>
<div class="col-md-9 span6">
<?if(Auth::instance()->logged_in()):?>
<?if(Auth::instance()->get_user()->id_role==Model_Role::ROLE_ADMIN):?>
<a class="label label-warning pull-right" href="<?php
echo Route::url('oc-panel', array('controller' => 'topic', 'action' => 'update', 'id' => $reply->id_post));
?>
">
<i class="glyphicon icon-white icon-edit glyphicon-edit"></i>
</a>
<?endif?>
<?endif?>
<p><?php
echo Text::bb2html($reply->description, TRUE);
?>
</p>
<a class="btn btn-xs btn-primary" href="#reply_form"><?php
echo __('Reply');
?>
</a>
</div>
<div class="clearfix"></div>
<div class="page-header"></div>
<?endforeach?>
<?php
echo $pagination;
?>
示例7: array
echo $post->user->name;
?>
</a>
<div class="pull-right">
<span class="label label-info"><?php
echo Date::format($post->created, core::config('general.date_format'));
?>
</span>
</div>
</div>
<br/>
<div>
<?php
echo Text::bb2html($post->description, TRUE);
?>
</div>
<div class="pull-right">
<?php
if ($previous->loaded()) {
?>
<a class="btn btn-success" href="<?php
echo Route::url('blog', array('seotitle' => $previous->seotitle));
?>
" title="<?php
echo $previous->title;
?>
">
<i class="glyphicon glyphicon-backward glyphicon"></i> <?php
示例8: defined
<?php
defined('SYSPATH') or die('No direct script access.');
?>
<div class="page-header">
<h1><?php
echo $faq->title;
?>
</h1>
</div>
<div class="text-description">
<?php
echo Text::bb2html($faq->description, TRUE, FALSE);
?>
</div><!-- /well -->
<?php
echo $disqus;
示例9: defined
<?php
defined('SYSPATH') or die('No direct script access.');
?>
<div class="page-header">
<h1><?php
echo $page->title;
?>
</h1>
</div>
<div class="well">
<?php
echo Text::bb2html($page->description, TRUE);
?>
</div><!-- /well -->
示例10: elseif
?>
<?php
$current_plan = FALSE;
if ($subscription !== FALSE and $subscription->plan->id_plan == $plan->id_plan) {
$current_plan = TRUE;
}
?>
<div class="col-md-4">
<div class="well">
<h3><b><?php
echo $plan->name;
?>
</b></h3>
<hr>
<p><?php
echo Text::bb2html($plan->description, TRUE);
?>
</p>
<hr>
<p>
<?php
if ($plan->days == 0 and $plan->price > 0) {
?>
<?php
echo _e('Pay once');
?>
<?php
} elseif ($plan->days == 365) {
?>
<?php
echo _e('Yearly');
示例11: test_bb2html_advanced
/**
* @dataProvider provider_bb2html_advanced
*/
public function test_bb2html_advanced($bbcode, $html)
{
$this->assertEquals(Text::bb2html($bbcode, TRUE), $html);
}
示例12: defined
defined('SYSPATH') or die('No direct script access.');
?>
<div class="pad_10tb">
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="page-header">
<h3><?php
echo $forum->name;
?>
</h3>
<div class="pad_5tb">
<small><?php
echo Text::bb2html($forum->description, TRUE);
?>
</small>
</div>
</div>
<form action="<?php
echo Route::URL('forum-home');
?>
" method="get">
<div class="input-group">
<input type="text" class="form-control" id="task-table-filter" placeholder="<?php
echo __('Search');
?>
" type="search" value="<?php
echo core::get('search');
示例13: confirm_payment
/**
* confirm payment for order
*
* @param string $id_order [unique indentifier of order]
* @param string $txn_id id of the transaction depending on provider
*/
public function confirm_payment($paymethod = 'paypal', $txn_id = NULL, $pay_date = NULL, $amount = NULL, $currency = NULL)
{
// update orders
if ($this->loaded()) {
$product = $this->product;
$user = $this->user;
$this->status = self::STATUS_PAID;
$this->pay_date = $pay_date === NULL ? Date::unix2mysql() : $pay_date;
$this->paymethod = $paymethod;
$this->txn_id = $txn_id;
if ($product->support_days > 0) {
$this->support_date = Date::unix2mysql(Date::mysql2unix($this->pay_date) + $product->support_days * 24 * 60 * 60);
}
if ($amount !== NULL) {
$this->amount = $amount;
}
if ($currency !== NULL) {
$this->currency = $currency;
}
try {
$this->save();
} catch (Exception $e) {
throw HTTP_Exception::factory(500, $e->getMessage());
}
//if saved delete coupon from session and -- number of coupons.
Model_Coupon::sale($this->coupon);
//add affiliate commision
Model_Affiliate::sale($this, $product);
//generate licenses
$licenses = Model_License::generate($user, $this, $product);
$license = '';
//loop all the licenses to an string
if (count($licenses) > 0) {
$license = '\\n\\n==== ' . __('Your Licenses') . ' ====';
foreach ($licenses as $l) {
$license .= '\\n' . $l->license;
}
}
//download link
$download = '';
if ($product->has_file() == TRUE) {
$dwnl_link = $user->ql('oc-panel', array('controller' => 'profile', 'action' => 'download', 'id' => $this->id_order));
$download = '\\n\\n==== ' . __('Download') . ' ====\\n<a href="' . $dwnl_link . '">' . $dwnl_link . '</a>';
}
//theres an expire? 0 = unlimited
$expire = '';
$expire_hours = Core::config('product.download_hours');
$expire_times = Core::config('product.download_times');
if (($expire_hours > 0 or $expire_times > 0) and $product->has_file() == TRUE) {
if ($expire_hours > 0 and $expire_times > 0) {
$expire = sprintf(__('Your download expires in %u hours and can be downloaded %u times.'), $expire_hours, $expire_times);
} elseif ($expire_hours > 0) {
$expire = sprintf(__('Your download expires in %u hours.'), $expire_hours);
} elseif ($expire_times > 0) {
$expire = sprintf(__('Can be downloaded %u times.'), $expire_times);
}
$expire = '\\n' . $expire;
}
//param for sale email
$params = array('[DATE]' => $this->pay_date, '[ORDER.ID]' => $this->id_order, '[USER.NAME]' => $user->name, '[USER.EMAIL]' => $user->email, '[PRODUCT.TITLE]' => $product->title, '[PRODUCT.PRICE]' => i18n::format_currency($this->amount, $this->currency), '[PRODUCT.NOTES]' => Text::bb2html($product->email_purchase_notes, TRUE, FALSE, FALSE), '[DOWNLOAD]' => $download, '[EXPIRE]' => $expire, '[LICENSE]' => $license);
//send email with order details download link and product notes
$user->email('new-sale', $params);
//notify to seller
if (core::config('email.new_sale_notify')) {
Email::send(core::config('email.notify_email'), '', 'New Sale! ' . $product->title, 'New Sale! ' . $product->title, core::config('email.notify_email'), '');
}
return TRUE;
}
return FALSE;
}
示例14: elseif
<?php
for ($i = 0; $i < round($review->rate, 1); $i++) {
?>
<span class="glyphicon glyphicon-star"></span>
<?php
}
?>
</div>
<?php
}
?>
</ul>
</div>
<div class="col-xs-12 col-sm-12 col-md-12 span6">
<p><?php
echo Text::bb2html($review->description, TRUE);
?>
</p>
<!-- <span class="plus"><a href="#" title="Lorem ipsum"><i class="glyphicon glyphicon-plus"></i></a></span> -->
</div>
<span class="clearfix borda"></span>
</div>
</div>
</article>
<hgroup class="mb20 mt20"></hgroup>
<?php
}
?>
<?php
} elseif (count($reviews) == 0) {
示例15: action_16
/**
* This function will upgrade configs
*/
public function action_16()
{
//subscriber field
try {
DB::query(Database::UPDATE, "ALTER TABLE `" . self::$db_prefix . "users` ADD `subscriber` tinyint(1) NOT NULL DEFAULT '1'")->execute();
} catch (exception $e) {
}
//updating contents replacing . for _
try {
DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "content SET seotitle=REPLACE(seotitle,'.','-') WHERE type='email'")->execute();
} catch (exception $e) {
}
try {
DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "content SET seotitle='affiliate-commission' WHERE seotitle='affiliatecommission' AND type='email'")->execute();
} catch (exception $e) {
}
try {
DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "content SET seotitle='new-ticket' WHERE seotitle='newticket' AND type='email'")->execute();
} catch (exception $e) {
}
try {
DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "content SET seotitle='review-product' WHERE seotitle='reviewproduct' AND type='email'")->execute();
} catch (exception $e) {
}
try {
DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "content SET seotitle='assign-agent' WHERE seotitle='assignagent' AND type='email'")->execute();
} catch (exception $e) {
}
try {
DB::query(Database::UPDATE, "UPDATE " . self::$db_prefix . "content SET seotitle='contact-admin' WHERE seotitle='contactadmin' AND type='email'")->execute();
} catch (exception $e) {
}
//end updating emails
//ip_address from float to bigint
try {
DB::query(Database::UPDATE, "ALTER TABLE `" . self::$db_prefix . "users` CHANGE last_ip last_ip BIGINT NULL DEFAULT NULL ")->execute();
} catch (exception $e) {
}
try {
DB::query(Database::UPDATE, "ALTER TABLE `" . self::$db_prefix . "visits` CHANGE ip_address ip_address BIGINT NULL DEFAULT NULL ")->execute();
} catch (exception $e) {
}
try {
DB::query(Database::UPDATE, "ALTER TABLE `" . self::$db_prefix . "posts` CHANGE ip_address ip_address BIGINT NULL DEFAULT NULL ")->execute();
} catch (exception $e) {
}
try {
DB::query(Database::UPDATE, "ALTER TABLE `" . self::$db_prefix . "orders` CHANGE ip_address ip_address BIGINT NULL DEFAULT NULL ")->execute();
} catch (exception $e) {
}
try {
DB::query(Database::UPDATE, "ALTER TABLE `" . self::$db_prefix . "licenses` CHANGE ip_address ip_address BIGINT NULL DEFAULT NULL ")->execute();
} catch (exception $e) {
}
try {
DB::query(Database::UPDATE, "ALTER TABLE `" . self::$db_prefix . "downloads` CHANGE ip_address ip_address BIGINT NULL DEFAULT NULL ")->execute();
} catch (exception $e) {
}
try {
DB::query(Database::UPDATE, "ALTER TABLE `" . self::$db_prefix . "tickets` CHANGE ip_address ip_address BIGINT NULL DEFAULT NULL ")->execute();
} catch (exception $e) {
}
try {
DB::query(Database::UPDATE, "ALTER TABLE `" . self::$db_prefix . "reviews` CHANGE ip_address ip_address BIGINT NULL DEFAULT NULL ")->execute();
} catch (exception $e) {
}
try {
DB::query(Database::UPDATE, "ALTER TABLE `" . self::$db_prefix . "affiliates` CHANGE ip_address ip_address BIGINT NULL DEFAULT NULL ")->execute();
} catch (exception $e) {
}
//crontab table
try {
DB::query(Database::UPDATE, "CREATE TABLE IF NOT EXISTS `" . self::$db_prefix . "crontab` (\n `id_crontab` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `name` varchar(50) NOT NULL,\n `period` varchar(50) NOT NULL,\n `callback` varchar(140) NOT NULL,\n `params` varchar(255) DEFAULT NULL,\n `description` varchar(255) DEFAULT NULL,\n `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,\n `date_started` datetime DEFAULT NULL,\n `date_finished` datetime DEFAULT NULL,\n `date_next` datetime DEFAULT NULL,\n `times_executed` bigint DEFAULT '0',\n `output` varchar(50) DEFAULT NULL,\n `running` tinyint(1) NOT NULL DEFAULT '0',\n `active` tinyint(1) NOT NULL DEFAULT '1',\n PRIMARY KEY (`id_crontab`),\n UNIQUE KEY `" . self::$db_prefix . "crontab_UK_name` (`name`)\n ) ENGINE=MyISAM;")->execute();
} catch (exception $e) {
}
//crontabs
try {
DB::query(Database::UPDATE, "INSERT INTO `" . self::$db_prefix . "crontab` (`name`, `period`, `callback`, `params`, `description`, `active`) VALUES\n ('Sitemap', '* 3 * * *', 'Sitemap::generate', NULL, 'Regenerates the sitemap everyday at 3am',1),\n ('Clean Cache', '* 5 * * *', 'Core::delete_cache', NULL, 'Once day force to flush all the cache.', 1),\n ('Optimize DB', '* 4 1 * *', 'Core::optimize_db', NULL, 'once a month we optimize the DB', 1);")->execute();
} catch (exception $e) {
}
//delete old sitemap config
try {
DB::query(Database::DELETE, "DELETE FROM " . self::$db_prefix . "config WHERE (config_key='expires' OR config_key='on_post') AND group_name='sitemap'")->execute();
} catch (exception $e) {
}
//categories description to HTML
try {
DB::query(Database::UPDATE, "ALTER TABLE `" . self::$db_prefix . "categories` CHANGE `description` `description` TEXT NULL DEFAULT NULL;")->execute();
} catch (exception $e) {
}
$categories = new Model_Category();
$categories = $categories->find_all();
foreach ($categories as $category) {
$category->description = Text::bb2html($category->description, TRUE, FALSE);
try {
$category->save();
} catch (Exception $e) {
//.........这里部分代码省略.........