本文整理汇总了PHP中MyTextSanitizer::xoopsCodeDecode方法的典型用法代码示例。如果您正苦于以下问题:PHP MyTextSanitizer::xoopsCodeDecode方法的具体用法?PHP MyTextSanitizer::xoopsCodeDecode怎么用?PHP MyTextSanitizer::xoopsCodeDecode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyTextSanitizer
的用法示例。
在下文中一共展示了MyTextSanitizer::xoopsCodeDecode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getScraps
function getScraps($nbscraps, $criteria)
{
$myts = new MyTextSanitizer();
$ret = array();
$sql = 'SELECT scrap_id, uid, uname, user_avatar, scrap_from, scrap_text FROM ' . $this->db->prefix('yogurt_scraps') . ', ' . $this->db->prefix('users');
if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
$sql .= ' ' . $criteria->renderWhere();
//attention here this is kind of a hack
$sql .= " AND uid = scrap_from";
if ($criteria->getSort() != '') {
$sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
}
$limit = $criteria->getLimit();
$start = $criteria->getStart();
$result = $this->db->query($sql, $limit, $start);
$vetor = array();
$i = 0;
while ($myrow = $this->db->fetchArray($result)) {
$vetor[$i]['uid'] = $myrow['uid'];
$vetor[$i]['uname'] = $myrow['uname'];
$vetor[$i]['user_avatar'] = $myrow['user_avatar'];
$temptext = $myts->xoopsCodeDecode($myrow['scrap_text'], 1);
$vetor[$i]['text'] = $myts->nl2Br($temptext);
$vetor[$i]['id'] = $myrow['scrap_id'];
$i++;
}
return $vetor;
}
}