';
echo '
'.archive_menu().' |
';
echo '
';
if(!is_numeric(array_search($input['month'], $config_array['months'])))
$input['month'] = $config_array['months'][11];
if(!is_numeric($input['year']))
$input['year'] = $config_archive['av'][0];
if($input['mcode'] && $input['year']) {
$dirname = $config['user_path'].$input['mcode'].'/'.$input['year'].'/';
$content = '';
$content .= get_magazinesid_based_archives($config_archive, $input['mcode'], $input['year']);
$content .= '';
$content .= ' | ';
echo $content;
/*
if(($input['mcode'] == 'chutti' && $input['year'] < 2008) || ($input['mcode'] == 'av' && $input['year'] == 2007 && $input['month'] == 'dec')){ // ------------------------------- OLD ARCHIVE FILES
echo '';
if($input['mcode'] == 'chutti' || ($input['mcode'] == 'motor' && $input['year'] != '2006')){
if(is_file($dirname.$input['year'].'.php')){
//echo $dirname.$input['year'];
echo ' ';
include_once($dirname.$input['year'].'.php');
echo ' ';
}
else if(is_file($dirname.$input['year'].'.htm')){
include_once($dirname.$input['year'].'.htm');
}
}
else{
echo '';
show_monthwise_old_archive($dirname);
echo ' ';
}
echo ' | ';
}
else{
echo new_archives(); // ---------------- NEW ARCHIVE FILES -------------
}
*/
echo new_archives(); // ---------------- NEW ARCHIVE FILES -------------
echo ' | ';
}
else{
$content12 .= '';
$content12 .= '';
$content12 .= get_magazinesid_based_archives($config_archive,$input['mcode'],'');
$content12 .= '';
$content12 .= ' |
';
$content12 .= new_archives($input['mcode']);
$content12 .= '
';
echo $content12;
}
echo '
';
?>
';
foreach($config_archive as $mag_id => $magazine_years) {
if($input['mcode'] == $mag_id)
$selected = '
';
else
$selected = '';
$content .= ''.$selected.' | ';
}
$content .= '
';
return $content;
}
function new_archives(){
global $sql_db_array, $config_array, $input, $DbCon, $config;
$mag_id = array_search($input['mcode'],$config_array['magazine_code']);
if(is_numeric($mag_id)){
$new_archive_array = get_monthwise_new_archive($mag_id);
$content = '
';
foreach($new_archive_array as $month_number => $issue_array){
$month_in_tamil = ' '.$config_array['months_tamil'][strtolower($month_number)].' | ';
//$top_menu .= $month_in_tamil;
$content .= ''.$month_in_tamil.'
';
$content .= combine_singlemonth_issues($issue_array);
$content .= ' | ';
}
$content .= ' |
';
}
if($input['year'] > 2010){
$content = '
|
'.$content;
}
return $content;
}
function combine_singlemonth_issues($issue_array){
$content = '
';
$i=1;
foreach($issue_array as $single_issue_table){
$content .= ''.$single_issue_table.' | ';
if( $i%4 == 0){
$content .= '
';
}
$i++;
}
$content .= '
';
return $content;
}
function show_monthwise_old_archive($dirname){
global $config_array, $input;
$month_menu = '
';
foreach($config_array['months'] as $key =>$month) {
if(is_dir($dirname.$month.'/')) {
$query_string = 'archives.php?mcode='.$input['mcode'].'&year='.$input['year'].'&month='.$month;
if(is_file($dirname.$month.'/'.$month.'.php')) {
if($month == $input['month']){
$include_path = $dirname.$month.'/'.$month.'.php';
$month_menu_color = '#DDDDDD';
}
$month_menu .= '
'.$config_array['months_tamil'][$month].' | ';
}
else if(is_file($dirname.$month.'/'.$month.'.htm')) {
if($month == $input['month']){
$include_path = $dirname.$month.'/'.$month.'.htm';
$month_menu_color = '#DDDDDD';
}
$month_menu .= '
'.$config_array['months_tamil'][$month].' | ';
}
}
$month_menu_color = '';
}
if($input['year'] == 2010 && ($input['mcode'] != 'pasumai') && ($input['mcode'] != 'aval')){
$query_string = 'archives.php?mcode='.$input['mcode'].'&year='.$input['year'].'&month=dec';
$month_menu .= ''.$config_array['months_tamil']['dec'].' | ';
}
$month_menu .= '
';
echo $month_menu;
if($include_path){
echo '
'.$config_array['months_tamil'][$input['month']].'
';
include_once($include_path);
}
}
function get_monthwise_new_archive($mag_id){
global $sql_db_array, $input, $DbCon, $config;
$result = $DbCon->Select($sql_db_array["T_Issue"], array('Issue_Id', 'Issue_Date'), " where year(Issue_Date)=".$input['year']." and Status=1 and Publish=1 and Magazine_Id=".$mag_id." order by Issue_Date",1);
if(is_array($result) && !empty($result)){
$i = 0;
foreach($result as $rows) {
$wrapper_path = $config['user_url'].$input['mcode'].'/'.convertIssueDateAsPath($rows['Issue_Date'],$rows['Issue_Id']).'/images/medium_wrapper.jpg';
$content = '
';
$new_archives[date('M', strtotime($rows['Issue_Date']))][$i++] = $content;
}
}
else{ $new_archives = 'No Issue Available'; }
return $new_archives;
}
function get_magazinesid_based_archives($config_archive, $mcode, $year='') {
global $input, $config_array;
$content = '
';
return $content;
}
?>