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


PHP XoopsTree::getPathFromId方法代码示例

本文整理汇总了PHP中XoopsTree::getPathFromId方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsTree::getPathFromId方法的具体用法?PHP XoopsTree::getPathFromId怎么用?PHP XoopsTree::getPathFromId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XoopsTree的用法示例。


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

示例1: sprintf

$xoopsTpl->assign('lang_lastupdate', _MD_LASTUPDATEC);
$xoopsTpl->assign('lang_hits', _MD_HITSC);
$xoopsTpl->assign('lang_rating', _MD_RATINGC);
$xoopsTpl->assign('lang_ratethissite', _MD_RATETHISSITE);
$xoopsTpl->assign('lang_reportbroken', _MD_REPORTBROKEN);
$xoopsTpl->assign('lang_tellafriend', _MD_TELLAFRIEND);
$xoopsTpl->assign('lang_modify', _MD_MODIFY);
$xoopsTpl->assign('lang_latestlistings', _MD_LATESTLIST);
$xoopsTpl->assign('lang_category', _MD_CATEGORYC);
$xoopsTpl->assign('lang_visit', _MD_VISIT);
$xoopsTpl->assign('lang_comments', _COMMENTS);
$result = $xoopsDB->query("SELECT l.lid, l.cid, l.title, l.url, l.logourl, l.status, l.date, l.hits, l.rating, l.votes, l.comments, t.description FROM " . $xoopsDB->prefix("mylinks_links") . " l, " . $xoopsDB->prefix("mylinks_text") . " t where l.status>0 and l.lid=t.lid ORDER BY date DESC", $xoopsModuleConfig['newlinks'], 0);
while (list($lid, $cid, $ltitle, $url, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description) = $xoopsDB->fetchRow($result)) {
    if ($isadmin) {
        $adminlink = '<a href="' . XOOPS_URL . '/modules/mylinks/admin/?op=modLink&amp;lid=' . $lid . '"><img src="' . XOOPS_URL . '/modules/mylinks/images/editicon.gif" border="0" alt="' . _MD_EDITTHISLINK . '" /></a>';
    } else {
        $adminlink = '';
    }
    if ($votes == 1) {
        $votestring = _MD_ONEVOTE;
    } else {
        $votestring = sprintf(_MD_NUMVOTES, $votes);
    }
    $path = $mytree->getPathFromId($cid, "title");
    $path = substr($path, 1);
    $path = str_replace("/", " <img src='" . XOOPS_URL . "/modules/mylinks/images/arrow.gif' board='0' alt=''> ", $path);
    $new = newlinkgraphic($time, $status);
    $pop = popgraphic($hits);
    $xoopsTpl->append('links', array('id' => $lid, 'cid' => $cid, 'rating' => number_format($rating, 2), 'title' => $myts->makeTboxData4Show($ltitle) . $new . $pop, 'category' => $path, 'logourl' => $myts->makeTboxData4Show($logourl), 'updated' => formatTimestamp($time, "m"), 'description' => $myts->makeTareaData4Show($description, 0), 'adminlink' => $adminlink, 'hits' => $hits, 'votes' => $votestring, 'comments' => $comments, 'mail_subject' => rawurlencode(sprintf(_MD_INTRESTLINK, $xoopsConfig['sitename'])), 'mail_body' => rawurlencode(sprintf(_MD_INTLINKFOUND, $xoopsConfig['sitename']) . ':  ' . XOOPS_URL . '/modules/mylinks/singlelink.php?cid=' . $cid . '&amp;lid=' . $lid)));
}
include XOOPS_ROOT_PATH . '/footer.php';
开发者ID:amjadtbssm,项目名称:website,代码行数:31,代码来源:index.php

示例2: array

$xoopsTpl->assign('lang_category', _ALBM_CATEGORY);
$xoopsTpl->assign('lang_hits', _ALBM_HITS);
$xoopsTpl->assign('lang_rating', _ALBM_RATING);
$xoopsTpl->assign('lang_vote', _ALBM_VOTE);
$crs = $xoopsDB->query("SELECT cid,title FROM {$table_cat} WHERE pid=0 ORDER BY title");
$rankings = array();
$i = 0;
while (list($cid, $cat_title) = $xoopsDB->fetchRow($crs)) {
    $rankings[$i] = array('title' => sprintf(_ALBM_TOP10, $myts->htmlSpecialChars($cat_title)), 'count' => $i);
    // get all child cat ids for a given cat id
    $children = $cattree->getAllChildId($cid);
    $whr_cid = 'cid IN (';
    foreach ($children as $child) {
        $whr_cid .= "{$child},";
    }
    $whr_cid .= "{$cid})";
    $sql = "SELECT lid, cid, title, submitter, hits, rating, votes FROM {$table_photos} WHERE status>0 AND ({$whr_cid}) ORDER BY {$odr}";
    $prs = $xoopsDB->query($sql, 10, 0);
    $rank = 1;
    while (list($lid, $cid, $title, $submitter, $hits, $rating, $votes) = $xoopsDB->fetchRow($prs)) {
        $catpath = $cattree->getPathFromId($cid, "title");
        $catpath = substr($catpath, 1);
        $catpath = str_replace("/", " <span class='fg2'>&raquo;&raquo;</span> ", $catpath);
        $title = $myts->makeTboxData4Show($title);
        $rankings[$i]['photo'][] = array('lid' => $lid, 'cid' => $cid, 'rank' => $rank, 'title' => $title, 'submitter' => $submitter, 'submitter_name' => myalbum_get_name_from_uid($submitter), 'category' => $catpath, 'hits' => $hits, 'rating' => number_format($rating, 2), 'votes' => $votes);
        $rank++;
    }
    $i++;
}
$xoopsTpl->assign_by_ref('rankings', $rankings);
include XOOPS_ROOT_PATH . "/footer.php";
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:31,代码来源:topten.php

示例3: array

$xoopsTpl->assign('lang_category', _MD_CATEGORY);
$xoopsTpl->assign('lang_hits', _MD_HITS);
$xoopsTpl->assign('lang_rating', _MD_RATING);
$xoopsTpl->assign('lang_vote', _MD_VOTE);
$arr = array();
$result = $xoopsDB->query("select cid, title from " . $xoopsDB->prefix("mylinks_cat") . " where pid=0");
$e = 0;
$rankings = array();
while (list($cid, $ctitle) = $xoopsDB->fetchRow($result)) {
    $rankings[$e]['title'] = sprintf(_MD_TOP10, $myts->htmlSpecialChars($ctitle));
    $query = "select lid, cid, title, hits, rating, votes from " . $xoopsDB->prefix("mylinks_links") . " where status>0 and (cid={$cid}";
    // get all child cat ids for a given cat id
    $arr = $mytree->getAllChildId($cid);
    $size = count($arr);
    for ($i = 0; $i < $size; $i++) {
        $query .= " or cid=" . $arr[$i] . "";
    }
    $query .= ") order by " . $sortDB . " DESC";
    $result2 = $xoopsDB->query($query, 10, 0);
    $rank = 1;
    while (list($lid, $lcid, $ltitle, $hits, $rating, $votes) = $xoopsDB->fetchRow($result2)) {
        $catpath = $mytree->getPathFromId($lcid, "title");
        $catpath = substr($catpath, 1);
        $catpath = str_replace("/", " <span class='fg2'>&raquo;</span> ", $catpath);
        $rankings[$e]['links'][] = array('id' => $lid, 'cid' => $cid, 'rank' => $rank, 'title' => $myts->htmlSpecialChars($ltitle), 'category' => $catpath, 'hits' => $hits, 'rating' => number_format($rating, 2), 'votes' => $votes);
        $rank++;
    }
    $e++;
}
$xoopsTpl->assign('rankings', $rankings);
include XOOPS_ROOT_PATH . '/footer.php';
开发者ID:koki-h,项目名称:xoops_utf8,代码行数:31,代码来源:topten.php

示例4: substr

		$query .= " or categoryid=".$arr[$i]."";
	}
	$query .= ") order by ".$sortDB." DESC";

// go back lines 20 -> 10
// display lines 10 -> 20
	$result2 = $xoopsDB->query($query,10,0);
//	$result2 = $xoopsDB->query($query,20,0);

	$rank = 1;
	
	while(list($darticleid, $dcategoryid, $dtitle, $counter, $rating, $votes, $dgroupid)=$xoopsDB->fetchRow($result2)){
	
	if(checkAccess($dgroupid)) {
	
		$catpath = $mytree->getPathFromId($dcategoryid, "title");
		$catpath= substr($catpath, 1);
		$catpath = str_replace("/"," <span class='fg2'>&raquo;&raquo;</span> ",$catpath);
		$dtitle = $myts->makeTboxData4Show($dtitle);
		$rankings[$e]['file'][] = array('id' => $darticleid, 'cid' => $dcategoryid, 'rank' => $rank, 'title' => $dtitle, 'category' => $catpath, 'hits' => $counter, 'rating' => number_format($rating, 2), 'votes' => $votes);
		$rank++;
		}
	}
	$e++;
	}		
}
$xoopsTpl->assign('rankings', $rankings);
include XOOPS_ROOT_PATH.'/footer.php';

include "footer.php";
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:30,代码来源:topten.php


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