I'm trying to change functions-template so that when you view the archive and click on a date it returns ablums instead if images...
What do i need to change here?
`
/**
Retrieves a list of all unique years & months from the images in the gallery
@param string $order set to 'desc' for the list to be in descending order
@return array
*/
function getAllDates($order='asc') {
$alldates = array();
$cleandates = array();
$sql = "SELECT [code]date[/code] FROM ". prefix('albums');
if (!zp_loggedin()) {
$sql .= " WHERE [code]show[/code] = 1";
}
$hidealbums = getNotViewableAlbums();
if (!is_null($hidealbums)) {
if (zp_loggedin()) {
$sql .= ' WHERE ';
} else {
$sql .= ' AND ';
}
foreach ($hidealbums as $id) {
$sql .= '[code]albumid[/code]!='.$id.' AND ';
}
$sql = substr($sql, 0, -5);
}
$result = query_full_array($sql);
foreach($result as $row){
$alldates[] = $row['date'];
}
foreach ($alldates as $adate) {
if (!empty($adate)) {
$cleandates[] = substr($adate, 0, 7) . "-01";
}
}
$datecount = array_count_values($cleandates);
if ($order == 'desc') {
krsort($datecount);
} else {
ksort($datecount);
}
return $datecount;
}
/**
Prints a compendum of dates and links to a search page that will show results of the date
@param string $class optional class
@param string $yearid optional class for "year"
@param string $monthid optional class for "month"
@param string $order set to 'desc' for the list to be in descending order
*/
function printAllDates($class='archive', $yearid='year', $monthid='month', $order='asc') {
global $_zp_current_search;
if (!empty($class)){ $class = "class=\"$class\""; }
if (!empty($yearid)){ $yearid = "class=\"$yearid\""; }
if (!empty($monthid)){ $monthid = "class=\"$monthid\""; }
$datecount = getAllDates($order);
$lastyear = "";
echo "\n\n";
$nr = 0;
while (list($key, $val) = each($datecount)) {
$nr++;
if ($key == '0000-00-01') {
$year = "no date";
$month = "";
} else {
$dt = strftime('%Y-%B', strtotime($key));
$year = substr($dt, 0, 4);
$month = substr($dt, 5);
}
if ($lastyear != $year) {
$lastyear = $year;
if($nr != 1) { echo "\n\n";}
echo "$year\n\n";
}
if (is_object($_zp_current_search)) {
$albumlist = $_zp_current_search->album_list;
} else {
$albumlist = NULL;
}
echo "[*]$month ($val)\n";
}
echo "\n\n\n";
}
`
I changed this...
echo "[*]$month ($val)\n"; }
To this...
echo "[*]$month ($val)\n"; }
And it seems to work.
It changed the URL from http://example.com/page/search/archive/DATE
to
http://example.com/page/search/DATE
Will this cause any issues with anything else?