Added a new macro, ^rownum;, which gives the row number of the query for
line numbering and ranking applications.
This commit is contained in:
parent
c256dc234f
commit
92cc42ea15
1 changed files with 4 additions and 2 deletions
|
|
@ -208,7 +208,7 @@ sub www_editSave {
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub www_view {
|
sub www_view {
|
||||||
my (@row, $i, $p, $ouch, %data, $output, $sth, $dbh, @result,
|
my (@row, $i, $rownum, $p, $ouch, %data, $output, $sth, $dbh, @result,
|
||||||
@template, $temp, $col, $errorMessage, $url);
|
@template, $temp, $col, $errorMessage, $url);
|
||||||
tie %data, 'Tie::CPHash';
|
tie %data, 'Tie::CPHash';
|
||||||
%data = getProperties($namespace,$_[0]);
|
%data = getProperties($namespace,$_[0]);
|
||||||
|
|
@ -258,7 +258,9 @@ sub www_view {
|
||||||
$output .= $template[0];
|
$output .= $template[0];
|
||||||
while (@result = $sth->array) {
|
while (@result = $sth->array) {
|
||||||
$temp = $template[1];
|
$temp = $template[1];
|
||||||
$temp =~ s/\^(\d*)\;/$result[$1]/g;
|
$temp =~ s/\^(\d*)\;/$result[$1]/g; # Shouldn't this be \d+ ?
|
||||||
|
$rownum = $i + 1 ;
|
||||||
|
$temp =~ s/\^rownum\;/$rownum/g;
|
||||||
if ($data{convertCarriageReturns}) {
|
if ($data{convertCarriageReturns}) {
|
||||||
$temp =~ s/\n/\<br\>/g;
|
$temp =~ s/\n/\<br\>/g;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue