当前位置: 首页>>代码示例>>PHP>>正文


PHP ubb函数代码示例

本文整理汇总了PHP中ubb函数的典型用法代码示例。如果您正苦于以下问题:PHP ubb函数的具体用法?PHP ubb怎么用?PHP ubb使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ubb函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ajax_themeinfoOp

 /**
  * GET 话题详细信息
  */
 public function ajax_themeinfoOp()
 {
     $model = Model();
     $m_theme = $model->table('circle_theme');
     $theme = $m_theme->where(array("theme_id" => $this->t_id))->select();
     $this->c_id = $theme['circle_id'];
     // 话题信息
     $this->themeInfo();
     $data = $this->theme_info;
     $model = Model();
     // 访问数增加
     $model->table('circle_theme')->update(array('theme_id' => $this->t_id, 'theme_browsecount' => array('exp', 'theme_browsecount+1')));
     $data['theme_content'] = ubb($data['theme_content']);
     if ($data['theme_edittime'] != '') {
         $data['theme_edittime'] = @date('Y-m-d H:i', $data['theme_edittime']);
     }
     $data['member_avatar'] = getMemberAvatarForID($data['member_id']);
     // 是否赞过话题
     $data['theme_nolike'] = 1;
     if (!empty($this->member_info['member_id'])) {
         // 是否赞过话题
         $like_info = $model->table('circle_like')->where(array('theme_id' => $this->t_id, 'member_id' => $this->member_info['member_id']))->find();
         if (empty($like_info)) {
             $data['theme_nolike'] = 1;
         } else {
             $data['theme_nolike'] = 0;
         }
     }
     if (strtoupper(CHARSET) == 'GBK') {
         $data = Language::getUTF8($data);
     }
     output_data(array('theme_info' => $data));
     die;
 }
开发者ID:ff00x0,项目名称:shopnc-api,代码行数:37,代码来源:circle_theme.php

示例2: insert

 function insert()
 {
     $userId = Session::get(C('USER_AUTH_KEY'));
     $recordId = intval($_POST['recordId']);
     if ($_POST['module'] == "Blog") {
         $dao = D('Blog');
         if ($blog = $dao->getById($recordId)) {
             $toUserId = $blog->userId;
             $blogTitle = $blog->title;
         } else {
             $this->error("文章不存在,无法回复!", false);
         }
     } else {
         if ($_POST['module'] == "Photo") {
             $dao = D('Photo');
             if ($photo = $dao->getById($recordId)) {
                 $toUserId = $photo->userId;
                 $photoPath = $photo->imagePath;
             } else {
                 $this->error("图片不存在,无法回复!", false);
             }
         }
     }
     $dao = D("Comment");
     $vo = $dao->create();
     $vo->cTime = time();
     $vo->userId = $userId;
     if ($result = $dao->add($vo)) {
         if ($vo->replyType == 0) {
             $map = new HashMap();
             $map->put('replyId', $result);
             $replyId = $dao->save($map, "id='{$result}'");
         }
         $content = ubb($vo->content);
         if ($_POST['module'] == 'Blog') {
             /* add_user_feed */
             $feedTitle = "评论了日志:<a href=\"/blog/{$recordId}\">{$blogTitle}</a>";
             $feedInfo = '<div class="share-comment"><p>' . $content . '</p></div>';
             $this->addUserFeed($userId, 'add', 'comment', $recordId, $feedTitle, $feedInfo);
             /* /add_user_feed */
             $this->addUserAlert($toUserId, "reply" . $_POST['module'], $_POST['recordId']);
         } elseif ($_POST['module'] == 'Photo') {
             /* add_user_feed */
             $feedTitle = "评论了照片:";
             $feedInfo = "<p class=\"image\"><a href=\"/photo/{$recordId}\"><img src=\"" . WEB_PUBLIC_URL . "/Thumb/?w=100&h=100&url={$photoPath}\" alt=\"照片\" /></a></p>" . '<div class="share-comment"><p>' . $content . '</p></div>';
             $this->addUserFeed($userId, 'add', 'comment', $recordId, $feedTitle, $feedInfo);
             /* /add_user_feed */
             $this->addUserAlert($toUserId, "reply" . $_POST['module'], $_POST['recordId']);
         }
         //$this->success('回复成功!');
         if ($_POST['module'] == 'Board') {
             header("Location:" . __APP__ . "/Board");
         } else {
             echo $result;
         }
     } else {
         //$this->error('回复失败!');
         echo false;
     }
 }
开发者ID:skiman100,项目名称:thinksns,代码行数:60,代码来源:CommentAction.class.php

示例3: parseSmileys

 function parseSmileys($str = '', $image_url = '', $ubb = true)
 {
     global $cfg_smileys;
     if ($image_url == '') {
         return $str;
     }
     $image_url = preg_replace("/(.+?)\\/*\$/", "\\1/", $image_url);
     foreach ($cfg_smileys as $key => $val) {
         $str = str_replace($key, "<img src=\"" . $image_url . $cfg_smileys[$key][0] . "\" width=\"" . $cfg_smileys[$key][1] . "\" height=\"" . $cfg_smileys[$key][2] . "\" alt=\"" . $cfg_smileys[$key][3] . "\"/>", $str);
     }
     return $ubb ? ubb($str) : $str;
 }
开发者ID:stonelf,项目名称:mcgmh,代码行数:12,代码来源:smiley.helper.php

示例4: ajax_themeinfoOp

 /**
  * ajax获取话题详细信息 话题列表页使用
  */
 public function ajax_themeinfoOp()
 {
     // 话题信息
     $this->themeInfo();
     $data = $this->theme_info;
     $model = Model();
     // 话题商品
     $goods_list = $model->table('circle_thg')->where(array('theme_id' => $this->t_id, 'reply_id' => 0))->select();
     $goods_list = tidyThemeGoods($goods_list, 'themegoods_id');
     $data['goods_list'] = $goods_list;
     // 附件
     $affix_list = $model->table('circle_affix')->where(array('affix_type' => 1, 'theme_id' => $this->t_id))->select();
     if (!empty($affix_list)) {
         foreach ($affix_list as $key => $val) {
             $affix_list[$key]['affix_filename'] = themeImageUrl($val['affix_filename']);
             $affix_list[$key]['affix_filethumb'] = themeImageUrl($val['affix_filethumb']);
         }
     }
     $data['affix_list'] = $affix_list;
     // 访问数增加
     $model->table('circle_theme')->update(array('theme_id' => $this->t_id, 'theme_browsecount' => array('exp', 'theme_browsecount+1')));
     $data['theme_content'] = ubb($data['theme_content']);
     if ($data['theme_edittime'] != '') {
         $data['theme_edittime'] = @date('Y-m-d H:i', $data['theme_edittime']);
     }
     // 是否赞过话题
     $data['theme_nolike'] = 1;
     if (isset($_SESSION['member_id'])) {
         // 是否赞过话题
         $like_info = $model->table('circle_like')->where(array('theme_id' => $this->t_id, 'member_id' => $_SESSION['member_id']))->find();
         if (empty($like_info)) {
             $data['theme_nolike'] = 1;
         } else {
             $data['theme_nolike'] = 0;
         }
     }
     if (strtoupper(CHARSET) == 'GBK') {
         $data = Language::getUTF8($data);
     }
     echo json_encode($data);
     exit;
 }
开发者ID:mengtaolin,项目名称:shopping,代码行数:45,代码来源:theme.php

示例5: index

 public function index()
 {
     if (IS_CLI) {
         $data = M('Content')->field("id,content")->select();
         foreach ($data as $value) {
             $value['content'] = ubb($value['content']);
             M('Content')->save($value);
         }
     } else {
         $category = D('Category')->getTree();
         $lists = D('Document')->lists(null);
         $this->assign('category', $category);
         //栏目
         $this->assign('lists', $lists);
         //列表
         $this->assign('page', D('Document')->page);
         //分页
         $this->display();
     }
 }
开发者ID:commiunty,项目名称:Mytest,代码行数:20,代码来源:IndexController.class.php

示例6: get_date

    }
    ?>
 [<?php 
    echo $rs[$i]['ip'];
    ?>
]</th>
      <th width="47">时间:</th>
      <th width="390"><?php 
    echo get_date($rs[$i]['addtime'], 'Y-m-d H:i:s');
    ?>
</th>
      </tr>
    <tr>
      <td>评论:</td>
      <td colspan="4"><?php 
    echo ubb($rs[$i]['contents']);
    ?>
        <?php 
    if ($rs[$i]['reply']) {
        ?>
        <blockquote style="background-color:#F7F7F7;border:#E5E5E5 solid 1px; padding:4px;">
          <?php 
        echo $rs[$i]['reply'];
        ?>
        </blockquote>
      <?php 
    }
    ?>
<blockquote id="reply<?php 
    echo $rs[$i]['id'];
    ?>
开发者ID:jonycookie,项目名称:projectm2,代码行数:31,代码来源:comment.php

示例7: questionOp

 /**
  * GET 问题详情
  */
 public function questionOp()
 {
     // 问题信息
     $question_id = intval($_GET['q_id']);
     if ($question_id > 0) {
         $this->questionInfo($question_id);
         $data = $this->question_info;
         $model = Model();
         // 访问数增加
         $model->table('circle_theme')->update(array('theme_id' => $question_id, 'theme_browsecount' => array('exp', 'theme_browsecount+1')));
         $data['theme_content'] = ubb($data['theme_content']);
         if ($data['theme_edittime'] != '') {
             $data['theme_edittime'] = @date('Y-m-d H:i', $data['theme_edittime']);
         }
         $data['member_avatar'] = getMemberAvatarForID($data['member_id']);
         if (strtoupper(CHARSET) == 'GBK') {
             $data = Language::getUTF8($data);
         }
         output_data(array('questionInfo' => $data));
         die;
     } else {
         output_error("问题id错误");
         die;
     }
 }
开发者ID:Maplecms,项目名称:shopnc-api,代码行数:28,代码来源:question.php

示例8: WHERE

    $db->query("DELETE FROM et_messages WHERE (senduid ='{$my['user_id']}' || sendtouid ='{$my['user_id']}') && message_id='{$_GET['mid']}'");
    echo "success";
    exit;
}
$i = 0;
$start = ($page - 1) * $home_num;
if ($pm == "my") {
    $sql = "SELECT * FROM et_messages WHERE sendtouid='{$my['user_id']}' order by message_id desc limit {$start},{$home_num}";
} elseif ($pm == "send") {
    $sql = "SELECT * FROM et_messages WHERE senduid='{$my['user_id']}' order by message_id desc limit {$start},{$home_num}";
}
$query = $db->query($sql);
while ($data = $db->fetch_array($query)) {
    $i++;
    $sendhead = $data['sendhead'] ? $data['sendhead'] : "{$webaddr}/images/noavatar.jpg";
    $messagebody = ubb($data['messagebody']);
    $isread = $data['isread'] ? 1 : 2;
    $mymsg[] = array("message_id" => $data['message_id'], "senduid" => $data['senduid'], "sendname" => $data['sendname'], "sendnickname" => $data['sendnickname'], "sendhead" => $sendhead, "messagebody" => $messagebody, "sendtouid" => $data['sendtouid'], "sendtoname" => $data['sendtoname'], "sendtonickname" => $data['sendtonickname'], "sendtime" => timeop($data['sendtime']), "isread" => $isread);
}
if ($my['priread'] != 0) {
    $db->query("UPDATE et_users SET priread = 0 WHERE user_id='{$my['user_id']}'");
    $db->query("UPDATE et_messages SET isread = 1 WHERE sendtouid='{$my['user_id']}'");
}
if ($pm == "my") {
    $total = getcount('et_messages', array('sendtouid' => $my[user_id]));
} elseif ($pm == "send") {
    $total = getcount('et_messages', array('senduid' => $my[user_id]));
}
$pg_num = ceil($total / $home_num);
//模板和Foot
$web_name3 = '我的私信';
开发者ID:kbglobal51,项目名称:yii-trackstar-sample,代码行数:31,代码来源:op_privatemsg.inc.php

示例9: while

    $start = ($page - 1) * $index_num;
    $query = $db->query("SELECT * FROM et_content WHERE privacy=0 && replyshow=1 ORDER BY posttime DESC LIMIT {$start},{$index_num}");
    while ($data = $db->fetch_array($query)) {
        $indexnum++;
        $content[] = array('content_id' => $data['content_id'], 'user_id' => $data['user_id'], 'user_name' => $data['user_name'], 'user_nickname' => $data['user_nickname'], 'user_head' => $data['user_head'], 'content_body' => ubb($data['content_body']), 'posttime' => timeop($data['posttime']), 'type' => $data['type'], 'status_id' => $data['status_id'], 'status_uname' => $data['status_uname'], 'status_unickname' => $data['status_unickname'], 'replytimes' => $data['replytimes'], 'zftimes' => $data['zftimes']);
    }
    echo loadindex($content);
    exit;
}
//新信息
if ($act == 'getupdate') {
    $lastid = $_GET['lastid'];
    if ($lastid > 0) {
        $query = $db->query("SELECT * FROM et_content WHERE privacy=0 && replyshow=1 && content_id>'{$lastid}'");
        while ($data = $db->fetch_array($query)) {
            $content[] = array('content_id' => $data['content_id'], 'user_id' => $data['user_id'], 'user_name' => $data['user_name'], 'user_nickname' => $data['user_nickname'], 'user_head' => $data['user_head'], 'content_body' => ubb($data['content_body']), 'posttime' => timeop($data['posttime']), 'type' => $data['type'], 'status_id' => $data['status_id'], 'status_uname' => $data['status_uname'], 'status_unickname' => $data['status_unickname'], 'replytimes' => $data['replytimes'], 'zftimes' => $data['zftimes']);
        }
    }
    echo loadindex($content);
    exit;
}
//上榜
$query = $db->query("SELECT user_name,nickname,user_head FROM et_users WHERE indextop=1 ORDER BY rand() LIMIT 7");
while ($data = $db->fetch_array($query)) {
    $data['user_head'] = $data['user_head'] ? "{$webaddr}/attachments/head/" . $data['user_head'] : "{$webaddr}/images/noavatar.jpg";
    $indextop[] = array('user_name' => $data['user_name'], 'nickname' => $data['nickname'], 'user_head' => $data['user_head']);
}
//在线用户 放入memcache 半小时更新
$query = $db->query("SELECT user_id,user_name,nickname,user_head FROM et_users WHERE last_login>='" . ($addtime - 600) . "' ORDER BY last_login DESC LIMIT 12");
while ($data = $db->fetch_array($query)) {
    $uhead = $data[user_head] ? "{$webaddr}/attachments/head/" . $data[user_head] : "{$webaddr}/images/noavatar.jpg";
开发者ID:kbglobal51,项目名称:yii-trackstar-sample,代码行数:31,代码来源:index.php

示例10: while

    } else {
        echo "ºÜ±§Ç¸£¬É¾³ýÆÀÂÛʧ°ÜÁË£¬";
        exit;
    }
}
$i = 0;
$start = ($page - 1) * $home_num;
$sql = "SELECT r.*,u.user_id,u.user_name,u.user_head FROM et_users AS u,et_sharereply AS r where r.user_id=u.user_id && r.share_id='{$sid}' order by r.shre_id desc limit {$start},{$home_num}";
$query = $db->query($sql);
while ($data = $db->fetch_array($query)) {
    $i = $i + 1;
    $shre_id = $data['shre_id'];
    $reuid = $data['user_id'];
    $reuname = $data['user_name'];
    $reuhead = $data['user_head'] ? "{$webaddr}/attachments/head/" . $data['user_head'] : "{$webaddr}/images/noavatar.jpg";
    $reply_body = ubb($data['reply_body']);
    $reply_time = timeop($data['reply_time']);
    $reply[] = array("shre_id" => $shre_id, "reuid" => $reuid, "reuname" => $reuname, "reuhead" => $reuhead, "reply_body" => $reply_body, "reply_time" => $reply_time);
}
$query = $db->query("select count(*) as count from et_sharereply where share_id='{$sid}'");
$row = $db->fetch_array($query);
$total = $row['count'];
$pg_num = $total / $index_num;
$pg_num = intval($pg_num);
if ($total != $pg_num * $index_num) {
    $pg_num = $pg_num + 1;
}
$np = $page + 1;
$pp = $page - 1;
if ($pg_num > 8) {
    if ($pg_num - $page <= 6) {
开发者ID:BGCX067,项目名称:eztalk-svn-to-git,代码行数:31,代码来源:op_sharereply.inc.php

示例11: artikelInOrde

function artikelInOrde($artikel)
{
    $artikel = stripslashes($artikel);
    $artikel = ubb($artikel);
    $artikel = nl2br($artikel);
    return $artikel;
}
开发者ID:erwincornelis,项目名称:Lepa.slm.be,代码行数:7,代码来源:php_functions.php

示例12: afkorten

				<tr>
					<td valign="top" style="text-align: right;" class="gbHead"><strong>
						<?php 
        echo $rij['naam'];
        // verkorte if constructie
        // indien email en website zijn opgegeven worden ze weergegeven, anders niet
        // stripslashes zorgt voor het verwijderen van overbodige backslashes die voor
        // de escapes zorgden bij het in de tabel steken.
        echo $rij['email'] != '-' ? '<br /><abbr title="' . $rij['email'] . '">' . afkorten($rij['email'], 27) : '</abbr>';
        echo $rij['website'] != '-' ? '<br /><a href="' . $rij['website'] . '" target="_blank"><abbr title="' . $rij['website'] . '">' . afkorten($rij['website'], 27) . '</abbr></a>' : '';
        echo '<br />' . $rij['datum'];
        ?>
</strong>
					</td>
					<td valign="top" style="background-image: url('images/gastenboek.png'); background-position: 336px 0px; background-repeat: no-repeat;" class="gbBody"><?php 
        echo ubb($rij['bericht'], $mapSmileys);
        ?>
</td>
				</tr>
			</table>
		</div>
	<?php 
        $nummer++;
    }
}
// NAVIGATIE
// enkel wanneer het aantal entries groter is dan het max aantal te tonen berichten
// moet de navigatie weergegeven worden
if ($aantalRijen > $max) {
    echo '<div class="gbPaginasOuter"><div class="gbPaginasInner" style="font-size: 12px;">';
    echo '<table border="0" cellspacing="0" cellpadding="0" style="width: 100%;"><tr><td style="width: 80px; text-align: left;" valign="top">';
开发者ID:erwincornelis,项目名称:00_Layouts,代码行数:31,代码来源:gastenboek_lezen.php

示例13: afkorten

		<tr>
			<td valign="top" style="text-align: right;" class="gbHead"><strong>
				<?php 
        echo $rij['naam'];
        // verkorte if constructie
        // indien email en website zijn opgegeven worden ze weergegeven, anders niet
        // stripslashes zorgt voor het verwijderen van overbodige backslashes die voor
        // de escapes zorgden bij het in de tabel steken.
        echo $rij['email'] != '-' ? '<br />' . afkorten(stripslashes($rij['email']), 27) : '';
        echo $rij['website'] != '-' ? '<br /><a href="' . stripslashes($rij['website']) . '" target="_blank">' . afkorten(stripslashes($rij['website']), 27) . '</a>' : '';
        echo '<br />' . $rij['datum'];
        ?>
</strong>
			</td>
			<td valign="top" style="background-image: url('images/gastenboek.png'); background-position: 336px 0px; background-repeat: no-repeat;" class="gbBody"><?php 
        echo ubb(stripslashes($rij['bericht']), $mapSmileys);
        ?>
</td>
		</tr>
	</table>
</div>
		
<div class="gbItem">
	<table border="0" cellpadding="0" cellspacing="0" style="width: 574px;">
		<tr>
			<td>
				<a href="?pagina=gastenboek">Keer terug naar de index</a>
			</td>
			<td style="width: 10px; text-align: center; padding: 5px;">
				<a href="?pagina=gastenboek&amp;action=gastenboek_verwijderen&amp;gastenboekId=<?php 
        echo $rij['id'];
开发者ID:erwincornelis,项目名称:00_Layouts,代码行数:31,代码来源:gastenboek_meer.php

示例14: ubb

			<?php 
    if (isset($_COOKIE['username'])) {
        ?>
			<span>[<a href="#ree" name="reply_re" title="回复<?php 
        echo $i + ($page - 1) * $pagesize;
        ?>
楼的<?php 
        echo $re['username'];
        ?>
">回复</a>]</span></h3>
			<?php 
    }
    ?>
			<div class="detail">
				<?php 
    echo ubb($re['content']);
    ?>
			</div>
		
		</div>
	</div>
	<div id="line">
	</div>
<?php 
    $i++;
}
?>
	<div id="page_text">
		<ul>
			<li><?php 
echo $page;
开发者ID:hachi-zzq,项目名称:guest-cms,代码行数:31,代码来源:article.php

示例15: comment

 public function comment()
 {
     $Comment = D('Comment');
     if ($comment = $Comment->create()) {
         //dump($comment);
         $list = $Comment->add();
         if ($list) {
             // 更新评论数
             $objDao = D("Blog");
             $objDao->setInc('commentCount', "id='" . $comment["recordId"] . "'");
             // 返回客户端数据
             $comment["content"] = nl2br(ubb(trim($comment["content"])));
             $comment["id"] = $list;
             $this->ajaxReturn($comment, "评论成功!", 1);
         } else {
             $this->error("评论失败!");
         }
     } else {
         $this->error($Comment->getError());
     }
 }
开发者ID:zjstage,项目名称:ThinkPHP,代码行数:21,代码来源:PublicAction.class.php


注:本文中的ubb函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。