本文整理汇总了PHP中CTag::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP CTag::getInstance方法的具体用法?PHP CTag::getInstance怎么用?PHP CTag::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTag
的用法示例。
在下文中一共展示了CTag::getInstance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<?php
if ($options[0] == '') {
$t =& CTag::getInstance();
$tagsArr = $t->tags($user_id, 'TAG');
$min = $tagsArr[0]['MIN'];
$max = $tagsArr[0]['MAX'];
$step = ($max - $min) / 5;
if ($variance == 0) {
$variance = 1;
}
echo '<div class="bold"></div>
<div style="padding:5px; text-align:justify;">';
foreach ($tagsArr as $k => $v) {
if ($v['TAG'] != '') {
$fontSize = tagsize(intval($v['WEIGHT']), $step);
echo ' <a href="/users/' . $username . '/tags/' . $v['TAG'] . '/" style="line-height:30px; font-size:' . $fontSize . 'px;" title="' . $v['TAG_COUNT'] . ' items tagged with ' . $v['TAG'] . '" class="plain">' . $v['TAG'] . '</a></span> ';
}
}
echo '</div>';
} else {
$fb =& CFotobox::getInstance();
$fl =& CFlix::getInstance();
$tagsArr = (array) explode(',', $options[0]);
$arrFotos = $fb->fotosSearch(array('USER_ID' => $user_id, 'TAGS' => $tagsArr, 'PERMISSION' => PERM_PHOTO_PUBLIC, 'ORDER' => 'P_TAKEN_BY_DAY', 'LIMIT' => 8));
$arrFlix = $fl->search(array('USER_ID' => $user_id, 'TYPE' => 'slideshow', 'TAGS' => $tagsArr, 'PERMISSION' => PERM_SLIDESHOW_PUBLIC, 'ORDER' => 'P_TAKEN', 'LIMIT' => 3));
//$arrFotos = $fb->fotosByTags($tagsArr, $user_id, 3, 'P_MOD_YMD', 0, 10);
//$arrFlix = $fl->flixByTags($tagsArr, $user_id, 3, 'user', false, 0, 4);
echo '<div style="padding-left:10px; padding-bottom:8px;">Photos tagged with: ' . $options[0] . '<span style="font-weight:normal;"> (<a href="/users/' . $username . '/photos/tags-' . $options[0] . '/">all photos tagged with ' . $options[0] . '</a>)</span></div>
<div>';
if (count($arrFotos) > 0) {
示例2: dirname
<?php
include_once dirname($_SERVER['SCRIPT_FILENAME']) . '/_reporter.php';
chdir(dirname(__FILE__));
ob_start();
include_once str_replace('/scripts', '', dirname(__FILE__)) . '/init_constants.php';
include_once PATH_DOCROOT . '/init_database.php';
include_once PATH_CLASS . '/CUser.php';
include_once PATH_CLASS . '/CFotobox.php';
include_once PATH_CLASS . '/CTag.php';
$u = CUser::getInstance();
$fb = CFotobox::getInstance();
$t = CTag::getInstance();
$users = $u->search(array());
$GLOBALS['dbh']->execute('TRUNCATE user_tag_sibling');
foreach ($users as $user) {
$tags = array();
$photos = $fb->fotosSearch(array());
foreach ($photos as $photo) {
$pTags = (array) explode(',', $photo['P_TAGS']);
foreach ($pTags as $pTag) {
if ($pTag == '') {
continue;
}
if (isset($tags[$pTag])) {
$tags[$pTag] = array_unique(array_merge($tags[$pTag], $pTags));
} else {
$tags[$pTag] = $pTags;
}
}
}
示例3: foreach
{
if(document.getElementById("tagwords").value.length > 0)
{
location.href="/users/' . $username . '/fotos/tags-"+document.getElementById("tagwords").value + "/";
}
return false;
}
new Autocompleter.Local("tagwords", "auto_complete_tagwords", userTags, {tokens: ","});
</script>
</div>
<div style="padding-top:5px; padding-bottom:5px;">
<div style="padding-left:10px;"><a href="/users/' . $username . '/tags/">' . $displayName . '\'s tags</a></div>
</div>
</div>';
$objTags =& CTag::getInstance();
$arr_tags = $objTags->quickSets($user_id, 0);
foreach ($arr_tags as $v) {
$arr_children = $objTags->quickSets($user_id, $v['S_ID']);
$has_children = count($arr_children) == 0 ? false : true;
$arrow_html = $has_children === false ? '<img src="images/spacer.gif" width="15" height="15" border="0" />' : '<a href="javascript:_toggle_nav(' . $v['L_ID'] . '); _toggle_arrow(\'_arrow_' . $v['L_ID'] . '\');" title="click to show/hide sub labels"><img src="images/navigation/sub_arrow_closed.gif" width="15" height="15" id="_arrow_' . $v['L_ID'] . '" border="0" /></a>';
echo '<div class="quickSetParentRow">
<div>';
if ($has_children === false) {
echo '<div style="float:left; padding-left:2px; padding-right:3px;"><img src="images/spacer.gif" width="15" height="15" border="0" /></div>';
} else {
echo '<div style="float:left; padding-left:2px; padding-right:3px;"><a href="javascript:_toggle(\'quickSetChild_' . $v['S_ID'] . '\'); _toggle_arrow(\'_arrow_' . $v['S_ID'] . '\');"><img src="images/navigation/sub_arrow_close.gif" id="_arrow_' . $v['S_ID'] . '" width="15" height="15" border="0" /></a></div>';
}
if ($v['S_TAGS'] != '') {
echo '<div style="float:left;"><a href="/users/' . $username . '/fotos/tags-' . $v['S_TAGS'] . '/" class="f_9 f_black bold" style="text-decoration:none;">' . $v['S_NAME'] . '</a></div>';
} else {