Здравейте ! Значи сайта ми е Joomla и се опитвам да изкарам 1 проста табличка със 3 колонки съответно : ИД , Потр. Име , Точки , като искам да се нареждат по точки с възходящ ред .. нещо като класация за потребителите..
пробвах да преправя 1компонент за Userlist но не иска да ми ги подрежда по точки
Багодаря предварително
ето го и кода
пробвах да преправя 1компонент за Userlist но не иска да ми ги подрежда по точки
Багодаря предварително
ето го и кода
Код:
<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
class HTML_userlist_content {
function showlist($rows, $total_results, $pageNav, $limitstart, $query_ext, $search='', $settings, $base_url) {
global $mosConfig_sitename, $userlist_version;
if ($search=='') {
$search = _USRL_SEARCH;
}
?>
<script type="text/javascript">
</script>
<table width="100%" cellpadding="4" cellspacing="0" border="0" align="center" class="contentpane" style="width: 100%">
<tr>
<td colspan="2"><span class="contentheading"><?php echo _USRL_USERLIST; ?></span></td>
</tr>
<tr>
<td valign="top" class="contentdescription">
<form name="usrlform" method="post" action="<?php echo sefRelToAbs("$base_url"); ?>" onsubmit="return validate()">
<?php printf(_USRL_REGISTERED_USERS, $mosConfig_sitename, $total_results); ?><br />
<br />
<input type="text" name="search" class="inputbox" style="width:150px" maxlength="100" value="<?php echo $search; ?>" onblur="if(this.value=='') this.value='<?php echo $search; ?>';" onfocus="if(this.value=='<?php echo $search; ?>') this.value='';" />
<input type="image" src="components/com_userlist/images/search_icon.gif" alt="<?php echo _USRL_SEARCH; ?>" align="top" style="border: 0px;" />
</form>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="<?php echo sefRelToAbs("$base_url"); ?>"><?php echo _USRL_LIST_ALL; ?></a></td>
<td align="right" style="text-align:right;"><?php echo _PN_DISPLAY_NR; ?> <?php echo $pageNav->writeLimitBox("$base_url$query_ext"); ?></td>
</tr>
</table>
<hr noshade="noshade" size="1" />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20" align="center" class="sectiontableheader"> </td>
<?php if ($settings->name) { ?>
<td height="20" class="sectiontableheader"><?php echo _USRL_NAME; ?></td>
<?php } ?>
<?php if ($settings->username) { ?>
<td height="20" class="sectiontableheader"><?php echo _USRL_USERNAME; ?> <a href="<?php echo sefRelToAbs("$base_url&orderby=username"); ?>"><img src="components/com_userlist/images/down.gif" width="8" height="5" border="0" alt="<?php echo _USRL_ASC; ?>" /></a> <a href="<?php echo sefRelToAbs("$base_url&orderby=username&direction=DESC"); ?>"><img src="components/com_userlist/images/up.gif" width="8" height="5" border="0" alt="<?php echo _USRL_DESC; ?>" /></a></td>
<?php } ?>
<?php if ($settings->email) { ?>
<td height="20" class="sectiontableheader"> </td>
<?php } ?>
<?php if ($settings->usertype) { ?>
<td height="20" class="sectiontableheader"><?php echo _USRL_USERTYPE; ?> <a href="<?php echo sefRelToAbs("$base_url&orderby=usertype"); ?>"><img src="components/com_userlist/images/down.gif" width="8" height="5" border="0" alt="<?php echo _USRL_ASC; ?>" /></a> <a href="<?php echo sefRelToAbs("$base_url&orderby=usertype&direction=DESC"); ?>"><img src="components/com_userlist/images/up.gif" width="8" height="5" border="0" alt="<?php echo _USRL_DESC; ?>" /></a></td>
<?php } ?>
<?php if ($settings->lastvisitdate) { ?>
<td height="20" class="sectiontableheader"><?php echo _USRL_LAST_LOGIN; ?> <a href="<?php echo sefRelToAbs("$base_url&orderby=lastvisitDate"); ?>"><img src="components/com_userlist/images/down.gif" width="8" height="5" border="0" alt="<?php echo _USRL_ASC; ?>" /></a> <a href="<?php echo sefRelToAbs("$base_url&orderby=lastvisitDate&direction=DESC"); ?>"><img src="components/com_userlist/images/up.gif" width="8" height="5" border="0" alt="<?php echo _USRL_DESC; ?>" /></a></td>
<?php } ?>
</tr>
<?php
$i = 1;
foreach($rows as $row) {
$evenodd = $i % 2;
if ($evenodd == 0) {
$usrl_class = "sectiontableentry1";
} else {
$usrl_class = "sectiontableentry2";
}
$nr=$i+$limitstart;
echo "\t<tr class=\"$usrl_class\">\n";
echo "\t\t<td align=\"center\">$nr</td>\n";
if ($settings->usertype) {
echo "\t\t<td>$row->id</td>\n";
}
if ($settings->name) {
echo "\t\t<td><a href=vote.php?id=$row->id>$row->name</a></td>\n";
}
if ($settings->username) {
echo "\t\t<td><a href=www.lowsense.com>$row->username </a></td>\n";
}
if ($settings->email) {
echo "\t\t<td><a href=\"mailto:$row->email\">$row->email</a></td>\n";
}
if ($settings->joindate) {
echo "\t\t<td>".convertDate($row->registerDate)."</td>\n";
}
if ($settings->lastvisitdate) {
echo "\t\t<td>$row->point</td>\n";
}
echo "\t</tr>\n";
$i++;
}
?>
<tr>
<td width="100%" height="20" class="sectiontableheader" colspan="9" align="center" style="text-align:center;"><?php echo $pageNav->writePagesLinks("$base_url$query_ext"); ?></td>
</tr>
</table>
<hr noshade="noshade" size="1" />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td nowrap="nowrap"> </td>
<td align="right" style="text-align:right;"><?php echo $pageNav->writePagesCounter(); ?></td>
</tr>
</table>
</td>
</tr>
</table>
<?php
}
}
?>