本文整理汇总了PHP中rec函数的典型用法代码示例。如果您正苦于以下问题:PHP rec函数的具体用法?PHP rec怎么用?PHP rec使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rec函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rec
function rec($item, $menuMapper, $obj)
{
$subItems = $menuMapper->getMenuItemsByParent($obj->get('menu')->getId(), $item->getId());
$class = 'mjs-nestedSortable-branch mjs-nestedSortable-expanded';
if (empty($subItems)) {
$class = 'mjs-nestedSortable-leaf';
}
if ($item->getType() == 4) {
$class .= ' mjs-nestedSortable-no-nesting';
}
if ($item->getBoxId() > 0) {
$boxKey = $item->getBoxId();
} else {
$boxKey = $item->getBoxKey();
}
echo '<li id="list_' . $item->getId() . '" class="' . $class . '">';
echo '<div><span class="disclose"><i class="fa fa-minus-circle"></i>
<input type="hidden" name="items[' . $item->getId() . '][id]" class="hidden_id" value="' . $item->getId() . '" />
<input type="hidden" name="items[' . $item->getId() . '][title]" class="hidden_title" value="' . $item->getTitle() . '" />
<input type="hidden" name="items[' . $item->getId() . '][href]" class="hidden_href" value="' . $item->getHref() . '" />
<input type="hidden" name="items[' . $item->getId() . '][type]" class="hidden_type" value="' . $item->getType() . '" />
<input type="hidden" name="items[' . $item->getId() . '][siteid]" class="hidden_siteid" value="' . $item->getSiteId() . '" />
<input type="hidden" name="items[' . $item->getId() . '][boxkey]" class="hidden_boxkey" value="' . $boxKey . '" />
<input type="hidden" name="items[' . $item->getId() . '][modulekey]" class="hidden_modulekey" value="' . $item->getModuleKey() . '" />
<span></span>
</span><span class="title">' . $item->getTitle() . '</span><span class="item_delete"><i class="fa fa-times-circle"></i></span><span class="item_edit"><i class="fa fa-edit"></i></span></div>';
if (!empty($subItems)) {
echo '<ol>';
foreach ($subItems as $subItem) {
rec($subItem, $menuMapper, $obj);
}
echo '</ol>';
}
echo '</li>';
}
示例2: rec
function rec($item, $forumMapper, $obj)
{
$subItems = $forumMapper->getforumItemsByParent('1', $item->getId());
$class = 'mjs-nestedSortable-branch mjs-nestedSortable-expanded';
if (empty($subItems)) {
$class = 'mjs-nestedSortable-leaf';
}
echo '<li id="list_' . $item->getId() . '" class="' . $class . '">';
echo '<div><span class="disclose"><i class="fa fa-minus-circle"></i>
<input type="hidden" name="items[' . $item->getId() . '][id]" class="hidden_id" value="' . $item->getId() . '" />
<input type="hidden" name="items[' . $item->getId() . '][title]" class="hidden_title" value="' . $item->getTitle() . '" />
<input type="hidden" name="items[' . $item->getId() . '][desc]" class="hidden_desc" value="' . $item->getDesc() . '" />
<input type="hidden" name="items[' . $item->getId() . '][type]" class="hidden_type" value="' . $item->getType() . '" />
<input type="hidden" name="items[' . $item->getId() . '][readAccess]" class="hidden_read_access" value="' . $item->getReadAccess() . '" />
<input type="hidden" name="items[' . $item->getId() . '][replayAccess]" class="hidden_replay_access" value="' . $item->getReplayAccess() . '" />
<input type="hidden" name="items[' . $item->getId() . '][createAccess]" class="hidden_create_access" value="' . $item->getCreateAccess() . '" />
<span></span>
</span>
<span class="title">' . $item->getTitle() . '</span>
<span class="item_delete">
<i class="fa fa-times-circle"></i>
</span><span class="item_edit">
<i class="fa fa-edit"></i>
</span>
</div>';
if (!empty($subItems)) {
echo '<ol>';
foreach ($subItems as $subItem) {
rec($subItem, $forumMapper, $obj);
}
echo '</ol>';
}
echo '</li>';
}
示例3: rec
function rec($x, $y)
{
global $a, $N, $M;
if (0 <= $x && $x < $N && 0 <= $y && $y < $M && $a[$y][$x]) {
$a[$y][$x] = 0;
rec($x - 1, $y);
rec($x + 1, $y);
rec($x, $y - 1);
rec($x, $y + 1);
}
}
示例4: rec
function rec($site, $oConfig)
{
$o = "<ul>";
foreach ($site as $ele) {
$o .= "<li>";
$o .= "<a href='?path=" . $oConfig->docroot . $oConfig->baseName . "/" . $ele->path . "' >" . $ele->attributes['name'] . "</a>";
if ($ele->hasChildPage == 1) {
$o .= rec($ele->subs);
}
$o .= "</li>";
}
$o .= "</ul>";
return $o;
}
示例5: rec
function rec($parent_id = 0)
{
$items = Page::where('parent_id', $parent_id)->where('status', 1)->get();
$menu = [];
if ($items) {
foreach ($items as $item) {
$menu[$item->id] = ['title' => $item->title, 'path' => rtrim($item->path, '/'), 'slug' => $item->slug, 'order' => $item->order];
if ($item->hasSubs()) {
$menu[$item->id]['subs'] = rec($item->id);
}
}
}
return $menu;
}
示例6: rec
function rec($id)
{
global $_GET, $type, $_POST;
$q = select("select AnswerID from ut_messages where MessageID='{$id}'");
$row = runsql("select * from ut_messages where MessageID='{$q['0']}'");
if (mysql_num_rows($row)) {
while ($r1 = mysql_fetch_array($row)) {
print "<img src=/images/hr.gif height=10px width=473px style=\"margin-top:5px;margin-bottom:5px\">";
$_GET['id'] = $r1[MessageID];
$f = new cls_form($type, "message");
$f->Draw();
}
rec($q[0]);
}
}
示例7: rec
function rec($item, $downloadsMapper, $obj, $fileMapper)
{
$subItems = $downloadsMapper->getDownloadsItemsByParent('1', $item->getId());
$fileCount = $fileMapper->getCountFileById($item->getId());
if ($item->getType() === 0) {
echo '<div class="page-header">
<h4>' . $obj->getTrans('cat') . ': ' . $item->getTitle() . ' <small>' . $item->getDesc() . '</small>
</h4><hr>';
}
if ($item->getType() != 0) {
$lastFile = $fileMapper->getLastFileByDownloadsId($item->getId());
$image = '';
if ($lastFile->getFileImage() != '') {
$image = $obj->getBaseUrl($lastFile->getFileImage());
} else {
$image = $obj->getBaseUrl('application/modules/media/static/img/nomedia.png');
}
echo '<div class="col-md-12 no-padding lib-item" data-category="view">
<div class="lib-panel">
<div class="row box-shadow">
<div class="col-md-4">
<a href="' . $obj->getUrl(array('controller' => 'index', 'action' => 'show', 'id' => $item->getId())) . '" >
<img class="lib-img-show" src="' . $image . '">
</a>
</div>
<div class="col-md-8">
<div class="lib-row lib-header">
<a href="' . $obj->getUrl(array('controller' => 'index', 'action' => 'show', 'id' => $item->getId())) . '" >
' . $item->getTitle() . '
</a>
<p class="text-left">' . $obj->getTrans('files') . ': ' . count($fileCount) . '</p>
<div class="lib-header-seperator"></div>
</div>
<div class="lib-row lib-desc">
' . $item->getDesc() . '
</div>
</div>
</div>
</div>
</div>';
}
if (!empty($subItems)) {
foreach ($subItems as $subItem) {
rec($subItem, $downloadsMapper, $obj, $fileMapper);
}
}
}
示例8: rec
function rec($item, $downloadsMapper, $obj, $fileMapper)
{
$subItems = $downloadsMapper->getDownloadsItemsByParent('1', $item->getId());
$file = $fileMapper->getCountFileById($item->getId());
$class = 'mjs-nestedSortable-branch mjs-nestedSortable-expanded';
if (empty($subItems)) {
$class = 'mjs-nestedSortable-leaf';
}
echo '<li id="list_' . $item->getId() . '" class="' . $class . '">';
echo '<div><span class="disclose"><i class="fa fa-minus-circle"></i>
<input type="hidden" name="items[' . $item->getId() . '][id]" class="hidden_id" value="' . $item->getId() . '" />
<input type="hidden" name="items[' . $item->getId() . '][title]" class="hidden_title" value="' . $item->getTitle() . '" />
<input type="hidden" name="items[' . $item->getId() . '][desc]" class="hidden_desc" value="' . $item->getDesc() . '" />
<input type="hidden" name="items[' . $item->getId() . '][type]" class="hidden_type" value="' . $item->getType() . '" />
<span></span>
</span>
<span class="title">' . $item->getTitle() . '</span>
<span class="item_delete">
<i class="fa fa-times-circle"></i>
</span><span class="item_edit">
<i class="fa fa-edit"></i>
</span>
<span class="upload" style="float:right; margin-right: 6px;">
<a href="javascript:media(' . $item->getId() . ')">
<i class="fa fa-cloud-upload"></i>
</a>
</span>
<span class="view" style="float:right; margin-right: 6px;">
<a href="' . $obj->getUrl(array('controller' => 'downloads', 'action' => 'treatdownloads', 'id' => $item->getId())) . '">
<i class="fa fa-eye"></i>
</a>
</span>
<span class="count" style="float:right; margin-right: 6px;">' . count($file) . '</span>
</div>';
if (!empty($subItems)) {
echo '<ol>';
foreach ($subItems as $subItem) {
rec($subItem, $downloadsMapper, $obj, $fileMapper);
}
echo '</ol>';
}
echo '</li>';
}
示例9: krsort
}
krsort($ccnt0);
reset($ccnt0);
$v = each($ccnt0);
$cmc = $v[0];
$cities = $v[1];
$mstar /= $fcnt;
$mrev /= $fcnt;
$mmp /= $fcnt;
if ($alt_output) {
print 'User #' . $id . "\n";
print 'Visited: ' . implode(', ', array_unique($dat)) . "\n";
print 'Favoured cities: ' . implode(', ', $cities) . ' (' . $cmc . ')' . "\n";
print $mstar * 5 . ' / ' . ($mrev * 5 + 5) . ' / ' . $mmp * 100 . "\n";
}
$rec = rec(3, $dat, $ccnt0, $mstar, $mrev, $mmp);
if ($alt_output) {
print 'Recommended: ' . implode(', ', $rec) . "\n";
print "\n";
} else {
print $id . ',' . implode(',', array_map(function ($x) {
return substr($x, 1);
}, $rec)) . "\n";
}
}
function rec($num, $exc, $cit, $mstar, $mrev, $mmp)
{
$res = array();
foreach ($cit as $clst) {
$mres = recc($num - count($res), array_merge($exc, $res), $clst, $mstar, $mrev, $mmp);
$res = array_merge($res, $mres);
示例10: rec
function rec($sourceIndex, $node, $list)
{
echo $node . "fc";
$result = new stdClass();
if (count($list) == 0) {
$result->ar = array();
$result->needToCheck = array();
} else {
$otherNode = array_pop($list);
echo $otherNode . "ffcc";
$startNode = $sourceIndex->queryOne("sid:{$node}");
$endNode = $sourceIndex->queryOne("sid:{$otherNode}");
$paths = getAllPathsBetweenTwoNodes($startNode, $endNode);
if (count($paths->paths) == 0) {
$res = rec($sourceIndex, $node, $list);
$result->ar = $res->ar;
$result->needToCheck = array_merge($res->needToCheck, array($otherNode));
} else {
$res = rec($sourceIndex, $otherNode, $list);
$res2 = array();
if (count($res->ar) == 0) {
$res2 = $paths->paths;
} else {
for ($j = 0; $j < count($paths->paths); $j++) {
for ($i = 0; $i < count($res->ar); $i++) {
$res2[] = array_merge($paths->paths[$j], $res->ar[$i]);
}
}
}
$result->ar = $res2;
$result->needToCheck = $res->needToCheck;
}
}
return $result;
}
示例11: rec
echo $hot['group_price'];
?>
</span>市场价 <del>¥<?php
echo $hot['original_price'];
?>
</del> </div> </li>
<?php
}
?>
</ul>
<?php
}
?>
</div>
<div class="cp_ad mb10"><?php
echo rec(14);
?>
</div>
</div>
</div>
</div>
</div>
<script type='text/javascript'>
$(function(){
var time = parseInt("<?php
echo TIMESTAMP;
?>
");
$('.process').each(function(){
var lag = parseInt($(this).attr('endtime')) - time;
if(lag>0){
示例12: rec
function rec($id, $uid, $req, $obj)
{
$CommentMappers = new \Modules\Comment\Mappers\Comment();
$userMapper = new \Modules\User\Mappers\User();
$fk_comments = $CommentMappers->getCommentsByFKId($id);
$user_rep = $userMapper->getUserById($uid);
$config = \Ilch\Registry::get('config');
foreach ($fk_comments as $fk_comment) {
$commentDate = new \Ilch\Date($fk_comment->getDateCreated());
$user = $userMapper->getUserById($fk_comment->getUserId());
if ($req > $config->get('comment_interleaving')) {
$req = $config->get('comment_interleaving');
}
$col = 9 - $req;
$req = $req + 1;
echo '<article class="row" id="' . $fk_comment->getId() . '">';
if ($config->get('comment_avatar') == 1) {
echo '<div class="col-md-2 col-sm-2 col-md-offset-' . $req . ' col-sm-offset-' . $req . ' hidden-xs">';
echo '<figure class="thumbnail" title="' . $user->getName() . '">';
echo '<a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $user->getId())) . '"><img class="img-responsive" src="' . $obj->getBaseUrl($user->getAvatar()) . '" alt="' . $user->getName() . '"></a>';
echo '</figure>';
echo '</div>';
echo '<div class="col-md-' . $col . ' col-sm-' . $col . '">';
} else {
$col = $col + 2;
echo '<div class="col-md-' . $col . ' col-sm-' . $col . ' col-md-offset-' . $req . ' col-sm-offset-' . $req . '">';
}
echo '<div class="panel panel-default">';
echo '<div class="panel-bodylist">';
echo '<div class="panel-heading right"><i class="fa fa-reply"></i> ' . $user_rep->getName() . '</div>';
echo '<header class="text-left">';
echo '<div class="comment-user">';
echo '<i class="fa fa-user" title="' . $obj->getTrans('commentUser') . '"></i> <a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $fk_comment->getUserId())) . '">' . $user->getName() . '</a>';
echo '</div>';
if ($config->get('comment_date') == 1) {
echo '<time class="comment-date"><i class="fa fa-clock-o" title="' . $obj->getTrans('dateTime') . '"></i> ' . $commentDate->format("d.m.Y - H:i", true) . '</time>';
}
echo '</header>';
echo '<div class="comment-post"><p>' . nl2br($fk_comment->getText()) . '</p></div>';
if ($config->get('comment_reply') == 1) {
echo '<p class="text-right"><a href="' . $obj->getUrl(array('module' => 'comment', 'controller' => 'index', 'action' => 'index', 'id' => $fk_comment->getId(), 'id_a' => $obj->getRequest()->getParam('id'))) . '" class="btn btn-default btn-sm"><i class="fa fa-reply"></i> ' . $obj->getTrans('reply') . '</a></p>';
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '</article>';
$fkk_comments = $CommentMappers->getCommentsByFKId($fk_comment->getId());
if (count($fkk_comments) > 0) {
$req++;
}
$i = 1;
foreach ($fkk_comments as $fkk_comment) {
if ($i == 1) {
rec($fk_comment->getId(), $fk_comment->getUserId(), $req, $obj);
$i++;
}
}
if (count($fkk_comments) > 0) {
$req--;
}
}
}
示例13: rec
function rec($id, $uid, $req, $obj)
{
$CommentMappers = new \Modules\Comment\Mappers\Comment();
$userMapper = new \Modules\User\Mappers\User();
$fk_comments = $CommentMappers->getCommentsByFKId($id);
$user_rep = $userMapper->getUserById($uid);
$config = \Ilch\Registry::get('config');
$nowDate = new \Ilch\Date();
foreach ($fk_comments as $fk_comment) {
$commentDate = new \Ilch\Date($fk_comment->getDateCreated());
$user = $userMapper->getUserById($fk_comment->getUserId());
if ($req > $config->get('comment_interleaving')) {
$req = $config->get('comment_interleaving');
}
$col = 10 - $req;
echo ' <article class="row" id="comment_' . $fk_comment->getId() . '">';
if ($config->get('comment_avatar') == 1) {
echo ' <div class="col-md-2 col-sm-2 col-md-offset-' . $req . ' col-sm-offset-' . $req . ' hidden-xs">';
echo ' <figure class="thumbnail" title="' . $user->getName() . '">';
echo ' <a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $user->getId())) . '"><img class="img-responsive" src="' . $obj->getBaseUrl($user->getAvatar()) . '" alt="' . $user->getName() . '"></a>';
echo ' </figure>';
echo ' </div>';
echo ' <div class="col-md-' . $col . ' col-sm-' . $col . '">';
} else {
$col = $col + 2;
echo ' <div class="col-md-' . $col . ' col-sm-' . $col . ' col-md-offset-' . $req . ' col-sm-offset-' . $req . '">';
}
echo ' <div class="panel panel-default">';
echo ' <div class="panel-bodylist">';
echo ' <div class="panel-heading right"><i class="fa fa-reply"></i> ' . $user_rep->getName() . '</div>';
echo ' <header class="text-left">';
echo ' <div class="comment-user">';
echo ' <i class="fa fa-user" title="' . $obj->getTrans('commentUser') . '"></i> <a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $fk_comment->getUserId())) . '">' . $user->getName() . '</a>';
echo ' </div>';
if ($config->get('comment_date') == 1) {
echo '<time class="comment-date"><i class="fa fa-clock-o" title="' . $obj->getTrans('commentDateTime') . '"></i> ' . $commentDate->format("d.m.Y - H:i", true) . '</time>';
}
echo ' </header>';
echo ' <div class="comment-post"><p>' . nl2br($fk_comment->getText()) . '</p></div>';
if ($obj->getUser() and $config->get('comment_reply') == 1) {
echo '<p class="text-right"><a href="javascript:slideReply(\'reply_' . $fk_comment->getId() . '\');" class="btn btn-default btn-sm"><i class="fa fa-reply"></i> ' . $obj->getTrans('reply') . '</a></p>';
}
echo ' </div>';
echo ' </div>';
echo ' </div>';
echo ' </article>';
if ($obj->getUser()) {
echo ' <div class="replyHidden" id="reply_' . $fk_comment->getId() . '">';
echo ' <form action="" class="form-horizontal" method="POST">';
echo $obj->getTokenField();
echo ' <section class="comment-list">';
echo ' <article class="row">';
$col = $col - 1;
$req = $req + 1;
if ($config->get('comment_avatar') == 1) {
echo ' <div class="col-md-2 col-sm-2 col-md-offset-' . $req . ' col-sm-offset-' . $req . ' hidden-xs">';
echo ' <figure class="thumbnail" title="' . $obj->getUser()->getName() . '">';
echo ' <a href="' . $obj->getUrl('user/profil/index/user/' . $obj->getUser()->getId()) . '"><img class="img-responsive" src="' . $obj->getUrl() . '/' . $obj->getUser()->getAvatar() . '" alt="' . $obj->getUser()->getName() . '"></a>';
echo ' </figure>';
echo ' </div>';
}
echo ' <div class="col-md-' . $col . ' col-sm-' . $col . '">';
echo ' <div class="panel panel-default">';
echo ' <div class="panel-body">';
echo ' <div class="panel-heading right"><i class="fa fa-reply"></i> ' . $user->getName() . '</div>';
echo ' <header class="text-left">';
echo ' <div class="comment-user">';
echo ' <i class="fa fa-user" title="' . $obj->getTrans('commentUser') . '"></i> <a href="' . $obj->getUrl(array('module' => 'user', 'controller' => 'profil', 'action' => 'index', 'user' => $obj->getUser()->getId())) . '">' . $obj->getUser()->getName() . '</a>';
echo ' </div>';
if ($config->get('comment_date') == 1) {
echo '<time class="comment-date"><i class="fa fa-clock-o" title="' . $obj->getTrans('commentDateTime') . '"></i> ' . $nowDate->format("d.m.Y - H:i", true) . '</time>';
}
echo ' </header>';
echo ' <div class="comment-post">';
echo ' <p>';
echo ' <textarea class="form-control"
accesskey=""
name="article_comment_text"
style="resize: vertical"
required></textarea>';
echo ' </p>';
echo ' </div>';
echo ' <input type="hidden" name="fkId" value="' . $fk_comment->getId() . '" />';
echo ' <p class="text-right submit">';
echo $obj->getSaveBar('submit', 'Comment');
echo ' </p>';
echo ' </div>';
echo ' </div>';
echo ' </div>';
echo ' </article>';
echo ' </section>';
echo ' </form>';
echo ' </div>';
}
$fkk_comments = $CommentMappers->getCommentsByFKId($fk_comment->getId());
$req = $req - 1;
if (count($fkk_comments) > 0) {
$req++;
}
$i = 1;
//.........这里部分代码省略.........
示例14: rec
echo $hot['group_price'];
?>
</span> <del class="o-price">¥<?php
echo $hot['original_price'];
?>
</del> </a> </li>
<?php
}
?>
</ul>
<?php
}
?>
</div>
<div class="cp_ad mb10"><?php
echo rec(15);
?>
</div>
</div>
</div>
</div>
<script type='text/javascript'>
$(function(){
var time = parseInt("<?php
echo TIMESTAMP;
?>
");
var lag = parseInt($('.process').attr('endtime')) - time;
if(lag>0){
var second = Math.floor(lag % 60);
var minite = Math.floor((lag / 60) % 60);
示例15: rec
?>
"><?php
echo $lang['nc_coupon_detail_havealook'];
?>
</a> </div>
</dd>
</dl>
<?php
}
?>
<?php
}
?>
</div>
<div class="cp_ad mb10"><?php
echo rec(11);
?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id='short_message' style="display: none;"> </div>
<script type="text/javascript">
var RESOURCE_SITE_URL = '<?php
echo RESOURCE_SITE_URL;
?>
';
</script>