示例#1
0
$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';
示例#2
0
$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";
示例#3
0
$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';
示例#4
0
		$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";