Browse Source

Add last modified time

Add last modified time variable (eg. $p->lastMod). Add fallback just in case the tags count not the same.
pull/659/head
danpros 2 years ago
parent
commit
f4cf4e4435
3 changed files with 163 additions and 152 deletions
  1. +2
    -2
      system/admin/admin.php
  2. +135
    -131
      system/admin/views/edit-content.html.php
  3. +26
    -19
      system/includes/functions.php

+ 2
- 2
system/admin/admin.php View File

@ -818,9 +818,9 @@ function migrate($title, $time, $tags, $content, $url, $user, $source)
$post_tagmd = rtrim($post_tagmd, ','); $post_tagmd = rtrim($post_tagmd, ',');
$post_url = strtolower(preg_replace(array('/[^a-zA-Z0-9 \-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($url))); $post_url = strtolower(preg_replace(array('/[^a-zA-Z0-9 \-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($url)));
if (!empty($source)) { if (!empty($source)) {
$post_content = '<!--t ' . $post_title . ' t-->' . "\n" . '<!--tag' . $post_tagmd . 'tag-->' . "\n\n" . $content . "\n\n" . 'Source: <a target="_blank" href="' . $source . '">' . $title . '</a>';
$post_content = '<!--t ' . $post_title . ' t-->' . "\n" . '<!--tag ' . $post_tagmd . ' tag-->' . "\n\n" . $content . "\n\n" . 'Source: <a target="_blank" href="' . $source . '">' . $title . '</a>';
} else { } else {
$post_content = '<!--t ' . $post_title . ' t-->' . "\n" . '<!--tag' . $post_tagmd . 'tag-->' . "\n\n" . $content;
$post_content = '<!--t ' . $post_title . ' t-->' . "\n" . '<!--tag ' . $post_tagmd . ' tag-->' . "\n\n" . $content;
} }
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) {


+ 135
- 131
system/admin/views/edit-content.html.php View File

@ -43,7 +43,7 @@ $cat = explode('/', $replaced);
if ($cat[count($cat) - 2] === 'scheduled') { if ($cat[count($cat) - 2] === 'scheduled') {
$category = $cat[count($cat) - 4]; $category = $cat[count($cat) - 4];
} else { } else {
$category = $cat[count($cat) - 3];
$category = $cat[count($cat) - 3];
} }
$dt = str_replace($replaced, '', $oldurl[0]); $dt = str_replace($replaced, '', $oldurl[0]);
@ -65,7 +65,11 @@ $tagslang = "content/data/tags.lang";
if (file_exists($tagslang)) { if (file_exists($tagslang)) {
$ptags = unserialize(file_get_contents($tagslang)); $ptags = unserialize(file_get_contents($tagslang));
$tkey = array_keys($tags); $tkey = array_keys($tags);
$newlang = array_intersect_key($ptags, array_flip($tkey));
if (!empty($ptags)) {
$newlang = array_intersect_key($ptags, array_flip($tkey));
} else {
$newlang = array_combine($tkey, $tkey);
}
$tmp = serialize($newlang); $tmp = serialize($newlang);
file_put_contents($tagslang, print_r($tmp, true)); file_put_contents($tagslang, print_r($tmp, true));
} }
@ -132,143 +136,143 @@ $( function() {
<?php } ?> <?php } ?>
<div class="row"> <div class="row">
<div class="wmd-panel" style="width:100%;">
<form method="POST">
<div class="row">
<div class="col-sm-6">
<label for="pTitle"><?php echo i18n('Title');?> <span class="required">*</span></label>
<input autofocus type="text" id="pTitle" name="title" class="form-control text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error';} } ?>" value="<?php echo $oldtitle ?>"/>
<br>
<label for="pCategory"><?php echo i18n('Category');?> <span class="required">*</span></label>
<select id="pCategory" class="form-control" name="category">
<option value="uncategorized"><?php echo i18n("Uncategorized");?></option>
<?php foreach ($desc as $d):?>
<option value="<?php echo $d->md;?>" <?php if($category === $d->md) { echo 'selected="selected"';} ?>><?php echo $d->title;?></option>
<?php endforeach;?>
</select>
<br>
<label for="pTag"><?php echo i18n('Tags');?> <span class="required">*</span></label>
<input type="text" id="pTag" name="tag" class="form-control text <?php if (isset($postTag)) { if (empty($postTag)) { echo 'error'; } } ?>" value="<?php echo $oldtag ?>" placeholder="<?php echo i18n('Comma_separated_values');?>"/>
<br>
<div class="wmd-panel" style="width:100%;">
<form method="POST">
<div class="row">
<div class="col-sm-6">
<label for="pTitle"><?php echo i18n('Title');?> <span class="required">*</span></label>
<input autofocus type="text" id="pTitle" name="title" class="form-control text <?php if (isset($postTitle)) { if (empty($postTitle)) { echo 'error';} } ?>" value="<?php echo $oldtitle ?>"/>
<br>
<label for="pCategory"><?php echo i18n('Category');?> <span class="required">*</span></label>
<select id="pCategory" class="form-control" name="category">
<option value="uncategorized"><?php echo i18n("Uncategorized");?></option>
<?php foreach ($desc as $d):?>
<option value="<?php echo $d->md;?>" <?php if($category === $d->md) { echo 'selected="selected"';} ?>><?php echo $d->title;?></option>
<?php endforeach;?>
</select>
<br>
<label for="pTag"><?php echo i18n('Tags');?> <span class="required">*</span></label>
<input type="text" id="pTag" name="tag" class="form-control text <?php if (isset($postTag)) { if (empty($postTag)) { echo 'error'; } } ?>" value="<?php echo $oldtag ?>" placeholder="<?php echo i18n('Comma_separated_values');?>"/>
<br>
<label for="pMeta"><?php echo i18n('Meta_description');?> (<?php echo i18n('optional');?>)</label>
<textarea id="pMeta" class="form-control" name="description" rows="3" cols="20" placeholder="<?php echo i18n('If_leave_empty_we_will_excerpt_it_from_the_content_below');?>"><?php if (isset($p->description)) { echo $p->description; } else { echo $olddescription;} ?></textarea>
<br>
</div>
<div class="col-sm-6">
<div class="form-row">
<div class="col">
<label for="pDate"><?php echo i18n('Date');?></label>
<input type="date" id="pDate" name="date" class="form-control text" value="<?php echo date('Y-m-d', $postdate); ?>">
</div>
<div class="col">
<label for="pTime"><?php echo i18n('Time');?></label>
<input step="1" type="time" id="pTime" name="time" class="form-control text" value="<?php echo $time->format('H:i:s'); ?>">
</div>
<small style="margin-top:10px;"><em><?php echo i18n('Scheduled_tips');?></em></small>
</div>
<br>
<label for="pURL"><?php echo i18n('Slug');?> (<?php echo i18n('optional');?>)</label>
<input type="text" id="pURL" name="url" class="form-control text" value="<?php echo $oldmd ?>" placeholder="<?php echo i18n('If_the_url_leave_empty_we_will_use_the_post_title');?>"//>
<br>
<label for="pMeta"><?php echo i18n('Meta_description');?> (<?php echo i18n('optional');?>)</label>
<textarea id="pMeta" class="form-control" name="description" rows="3" cols="20" placeholder="<?php echo i18n('If_leave_empty_we_will_excerpt_it_from_the_content_below');?>"><?php if (isset($p->description)) { echo $p->description; } else { echo $olddescription;} ?></textarea>
<br>
</div>
<div class="col-sm-6">
<div class="form-row">
<div class="col">
<label for="pDate"><?php echo i18n('Date');?></label>
<input type="date" id="pDate" name="date" class="form-control text" value="<?php echo date('Y-m-d', $postdate); ?>">
</div>
<div class="col">
<label for="pTime"><?php echo i18n('Time');?></label>
<input step="1" type="time" id="pTime" name="time" class="form-control text" value="<?php echo $time->format('H:i:s'); ?>">
</div>
<small style="margin-top:10px;"><em><?php echo i18n('Scheduled_tips');?></em></small>
</div>
<br>
<label for="pURL"><?php echo i18n('Slug');?> (<?php echo i18n('optional');?>)</label>
<input type="text" id="pURL" name="url" class="form-control text" value="<?php echo $oldmd ?>" placeholder="<?php echo i18n('If_the_url_leave_empty_we_will_use_the_post_title');?>"//>
<br>
<?php if ($type == 'is_audio'):?>
<label for="pAudio"><?php echo i18n('Featured_Audio');?> <span class="required">*</span> (e.g Soundcloud)</label>
<textarea rows="2" cols="20" class="form-control text <?php if (isset($postAudio)) { if (empty($postAudio)) { echo 'error';} } ?>" id="pAudio" name="audio"><?php echo $oldaudio; ?></textarea>
<input type="hidden" name="is_audio" value="is_audio">
<br>
<?php endif;?>
<?php if ($type == 'is_audio'):?>
<label for="pAudio"><?php echo i18n('Featured_Audio');?> <span class="required">*</span> (e.g Soundcloud)</label>
<textarea rows="2" cols="20" class="form-control text <?php if (isset($postAudio)) { if (empty($postAudio)) { echo 'error';} } ?>" id="pAudio" name="audio"><?php echo $oldaudio; ?></textarea>
<input type="hidden" name="is_audio" value="is_audio">
<br>
<?php endif;?>
<?php if ($type == 'is_video'):?>
<label for="pVideo"><?php echo i18n('Featured_Video');?> <span class="required">*</span> (e.g Youtube)</label>
<textarea rows="2" cols="20" class="form-control text <?php if (isset($postVideo)) { if (empty($postVideo)) { echo 'error';} } ?>" id="pVideo" name="video"><?php echo $oldvideo ?></textarea>
<input type="hidden" name="is_video" value="is_video">
<br>
<?php endif;?>
<?php if ($type == 'is_video'):?>
<label for="pVideo"><?php echo i18n('Featured_Video');?> <span class="required">*</span> (e.g Youtube)</label>
<textarea rows="2" cols="20" class="form-control text <?php if (isset($postVideo)) { if (empty($postVideo)) { echo 'error';} } ?>" id="pVideo" name="video"><?php echo $oldvideo ?></textarea>
<input type="hidden" name="is_video" value="is_video">
<br>
<?php endif;?>
<?php if ($type == 'is_image'):?>
<label for="pImage"><?php echo i18n('Featured_Image');?> <span class="required">*</span></label>
<textarea rows="2" cols="20" class="form-control text <?php if (isset($postImage)) { if (empty($postImage)) { echo 'error';} } ?>" id="pImage" name="image"><?php echo $oldimage; ?></textarea>
<input type="hidden" name="is_image" value="is_image">
<br>
<?php endif;?>
<?php if ($type == 'is_image'):?>
<label for="pImage"><?php echo i18n('Featured_Image');?> <span class="required">*</span></label>
<textarea rows="2" cols="20" class="form-control text <?php if (isset($postImage)) { if (empty($postImage)) { echo 'error';} } ?>" id="pImage" name="image"><?php echo $oldimage; ?></textarea>
<input type="hidden" name="is_image" value="is_image">
<br>
<?php endif;?>
<?php if ($type == 'is_quote'):?>
<label for="pQuote"><?php echo i18n('Featured_Quote');?> <span class="required">*</span></label>
<textarea rows="3" cols="20" class="form-control text <?php if (isset($postQuote)) { if (empty($postQuote)) { echo 'error';} } ?>" id="pQuote" name="quote"><?php echo $oldquote ?></textarea>
<input type="hidden" name="is_quote" value="is_quote">
<br>
<?php endif;?>
<?php if ($type == 'is_quote'):?>
<label for="pQuote"><?php echo i18n('Featured_Quote');?> <span class="required">*</span></label>
<textarea rows="3" cols="20" class="form-control text <?php if (isset($postQuote)) { if (empty($postQuote)) { echo 'error';} } ?>" id="pQuote" name="quote"><?php echo $oldquote ?></textarea>
<input type="hidden" name="is_quote" value="is_quote">
<br>
<?php endif;?>
<?php if ($type == 'is_link'):?>
<label for="pLink"><?php echo i18n('Featured_Link');?> <span class="required">*</span></label>
<textarea rows="2" cols="20" class="form-control text <?php if (isset($postLink)) { if (empty($postLink)) { echo 'error';} } ?>" id="pLink" name="link"><?php echo $oldlink ?></textarea>
<input type="hidden" name="is_link" value="is_link">
<br>
<?php endif;?>
<?php if ($type == 'is_link'):?>
<label for="pLink"><?php echo i18n('Featured_Link');?> <span class="required">*</span></label>
<textarea rows="2" cols="20" class="form-control text <?php if (isset($postLink)) { if (empty($postLink)) { echo 'error';} } ?>" id="pLink" name="link"><?php echo $oldlink ?></textarea>
<input type="hidden" name="is_link" value="is_link">
<br>
<?php endif;?>
<?php if ($type == 'is_post'):?>
<input type="hidden" name="is_post" value="is_post">
<?php endif;?>
<input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div>
<label for="wmd-input"><?php echo i18n('Content');?></label>
<div id="wmd-button-bar" class="wmd-button-bar"></div>
<textarea id="wmd-input" class="form-control wmd-input <?php if (isset($postContent)) { if (empty($postContent)) { echo 'error'; } } ?>" name="content" cols="20" rows="15"><?php echo $oldcontent ?></textarea><br>
<?php if ($isdraft[4] == 'draft') { ?>
<input type="submit" name="publishdraft" class="btn btn-primary submit" value="<?php echo i18n('Publish_draft');?>"/> <input type="submit" name="updatedraft" class="btn btn-primary draft" value="<?php echo i18n('Update_draft');?>"/> <a class="btn btn-danger" href="<?php echo $delete ?>"><?php echo i18n('Delete');?></a>
<?php } else { ?>
<input type="submit" name="updatepost" class="btn btn-primary submit" value="<?php echo i18n('Update_post');?>"/> <input type="submit" name="revertpost" class="btn btn-primary revert" value="<?php echo i18n('Revert_to_draft');?>"/> <a class="btn btn-danger" href="<?php echo $delete ?>"><?php echo i18n('Delete');?></a>
<?php }?>
<br><br>
</div>
</div>
<div class="col-sm-6">
<label><?php echo i18n('Preview');?></label>
<br>
<div id="wmd-preview" class="wmd-panel wmd-preview" style="width:100%;overflow:auto;"></div>
</div>
</div>
</form>
</div>
<?php if ($type == 'is_post'):?>
<input type="hidden" name="is_post" value="is_post">
<?php endif;?>
<input type="hidden" name="oldfile" class="text" value="<?php echo $url ?>"/>
<input type="hidden" name="csrf_token" value="<?php echo get_csrf() ?>">
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div>
<label for="wmd-input"><?php echo i18n('Content');?></label>
<div id="wmd-button-bar" class="wmd-button-bar"></div>
<textarea id="wmd-input" class="form-control wmd-input <?php if (isset($postContent)) { if (empty($postContent)) { echo 'error'; } } ?>" name="content" cols="20" rows="15"><?php echo $oldcontent ?></textarea><br>
<?php if ($isdraft[4] == 'draft') { ?>
<input type="submit" name="publishdraft" class="btn btn-primary submit" value="<?php echo i18n('Publish_draft');?>"/> <input type="submit" name="updatedraft" class="btn btn-primary draft" value="<?php echo i18n('Update_draft');?>"/> <a class="btn btn-danger" href="<?php echo $delete ?>"><?php echo i18n('Delete');?></a>
<?php } else { ?>
<input type="submit" name="updatepost" class="btn btn-primary submit" value="<?php echo i18n('Update_post');?>"/> <input type="submit" name="revertpost" class="btn btn-primary revert" value="<?php echo i18n('Revert_to_draft');?>"/> <a class="btn btn-danger" href="<?php echo $delete ?>"><?php echo i18n('Delete');?></a>
<?php }?>
<br><br>
</div>
</div>
<div class="col-sm-6">
<label><?php echo i18n('Preview');?></label>
<br>
<div id="wmd-preview" class="wmd-panel wmd-preview" style="width:100%;overflow:auto;"></div>
</div>
</div>
</form>
</div>
<style>
.wmd-prompt-background {z-index:10!important;}
#wmd-preview img {max-width:100%;}
</style>
<div class="modal fade" id="insertImageDialog" tabindex="-1" role="dialog" aria-labelledby="insertImageDialogTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="insertImageDialogTitle"><?php echo i18n('Insert_Image');?></h5>
<button type="button" class="close" id="insertImageDialogClose" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="insertImageDialogURL">URL</label>
<input type="text" class="form-control" id="insertImageDialogURL" size="48" placeholder="<?php echo i18n('Enter_image_URL');?>" />
</div>
<hr>
<div class="form-group">
<label for="insertImageDialogFile"><?php echo i18n('Upload');?></label>
<input type="file" class="form-control-file" name="file" id="insertImageDialogFile" accept="image/png,image/jpeg,image/gif" />
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="insertImageDialogInsert"><?php echo i18n('Insert_Image');?></button>
<button type="button" class="btn btn-secondary" id="insertImageDialogCancel" data-dismiss="modal"><?php echo i18n('Cancel');?></button>
</div>
</div>
</div>
</div>
<style>
.wmd-prompt-background {z-index:10!important;}
#wmd-preview img {max-width:100%;}
</style>
<div class="modal fade" id="insertImageDialog" tabindex="-1" role="dialog" aria-labelledby="insertImageDialogTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="insertImageDialogTitle"><?php echo i18n('Insert_Image');?></h5>
<button type="button" class="close" id="insertImageDialogClose" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="insertImageDialogURL">URL</label>
<input type="text" class="form-control" id="insertImageDialogURL" size="48" placeholder="<?php echo i18n('Enter_image_URL');?>" />
</div>
<hr>
<div class="form-group">
<label for="insertImageDialogFile"><?php echo i18n('Upload');?></label>
<input type="file" class="form-control-file" name="file" id="insertImageDialogFile" accept="image/png,image/jpeg,image/gif" />
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="insertImageDialogInsert"><?php echo i18n('Insert_Image');?></button>
<button type="button" class="btn btn-secondary" id="insertImageDialogCancel" data-dismiss="modal"><?php echo i18n('Cancel');?></button>
</div>
</div>
</div>
</div>
</div> </div>
<!-- Declare the base path. Important --> <!-- Declare the base path. Important -->
<script type="text/javascript">var base_path = '<?php echo site_url() ?>';</script> <script type="text/javascript">var base_path = '<?php echo site_url() ?>';</script>


+ 26
- 19
system/includes/functions.php View File

@ -283,7 +283,7 @@ function get_posts($posts, $page = 1, $perpage = 0)
// Author string // Author string
$str = explode('/', $replaced); $str = explode('/', $replaced);
$author = $str[1]; $author = $str[1];
if($str[3] == 'uncategorized') { if($str[3] == 'uncategorized') {
$category = default_category(); $category = default_category();
$post->category = '<a href="' . $category->url . '">' . $category->title . '</a>'; $post->category = '<a href="' . $category->url . '">' . $category->title . '</a>';
@ -303,7 +303,7 @@ function get_posts($posts, $page = 1, $perpage = 0)
} }
} }
$type = $str[4]; $type = $str[4];
$post->ct = $str[3]; $post->ct = $str[3];
@ -328,6 +328,7 @@ function get_posts($posts, $page = 1, $perpage = 0)
// The post date // The post date
$post->date = strtotime($timestamp); $post->date = strtotime($timestamp);
$post->lastMod = strtotime(date('Y-m-d H:i:s', filemtime($filepath)));
// The archive per day // The archive per day
$post->archive = site_url() . 'archive/' . date('Y-m', $post->date); $post->archive = site_url() . 'archive/' . date('Y-m', $post->date);
@ -360,7 +361,11 @@ function get_posts($posts, $page = 1, $perpage = 0)
if(!empty($tagt)) { if(!empty($tagt)) {
$tl = explode(',', rtrim($tagt, ',')); $tl = explode(',', rtrim($tagt, ','));
$tCom = array_combine($t, $tl);
if (count($tl) == count($t)) {
$tCom = array_combine($t, $tl);
} else {
$tCom = array_combine($t, $t);
}
foreach ($tCom as $key => $val) { foreach ($tCom as $key => $val) {
if(!empty($val)) { if(!empty($val)) {
$tag[] = array($val, site_url() . 'tag/' . strtolower($key)); $tag[] = array($val, site_url() . 'tag/' . strtolower($key));
@ -875,8 +880,8 @@ function get_author($name)
if ($name === $profile) { if ($name === $profile) {
// Profile URL // Profile URL
$url= pathinfo($v, PATHINFO_BASENAME); $url= pathinfo($v, PATHINFO_BASENAME);
$author->file = $url;
$author->file = $url;
$author->url = site_url() . 'author/' . $profile; $author->url = site_url() . 'author/' . $profile;
@ -934,11 +939,12 @@ function get_static_post($static)
// The static page URL // The static page URL
$url= pathinfo($v, PATHINFO_FILENAME); $url= pathinfo($v, PATHINFO_FILENAME);
$post->url = site_url() . $url; $post->url = site_url() . $url;
$post->file = $v; $post->file = $v;
$post->lastMod = strtotime(date('Y-m-d H:i:s', filemtime($v)));
$post->md = $url; $post->md = $url;
// Get the contents and convert it to HTML // Get the contents and convert it to HTML
@ -989,10 +995,11 @@ function get_static_sub_post($static, $sub_static)
$post->url = site_url() . $static . "/" . $url; $post->url = site_url() . $static . "/" . $url;
$post->file = $v; $post->file = $v;
$post->md = $url;
$post->parent = $static;
$post->lastMod = strtotime(date('Y-m-d H:i:s', filemtime($v)));
$post->md = $url;
$post->parent = $static;
// Get the contents and convert it to HTML // Get the contents and convert it to HTML
$content = file_get_contents($v); $content = file_get_contents($v);
@ -1140,7 +1147,7 @@ function get_categorycount($var)
if (stripos($v['dirname'], '/' . $var . '/') !== false) { if (stripos($v['dirname'], '/' . $var . '/') !== false) {
$tmp[] = $v; $tmp[] = $v;
} }
} }
return count($tmp); return count($tmp);
@ -1158,7 +1165,7 @@ function get_typecount($var)
if (stripos($v['dirname'], '/' . $var) !== false) { if (stripos($v['dirname'], '/' . $var) !== false) {
$tmp[] = $v; $tmp[] = $v;
} }
} }
return count($tmp); return count($tmp);
@ -1177,7 +1184,7 @@ function get_draftcount($var)
if (stripos($v['dirname'], '/' . $var . '/') !== false) { if (stripos($v['dirname'], '/' . $var . '/') !== false) {
$tmp[] = $v; $tmp[] = $v;
} }
} }
return count($tmp); return count($tmp);
} }
@ -1194,11 +1201,11 @@ function get_scheduledcount($var)
if (stripos($v['dirname'], '/' . $var . '/') !== false) { if (stripos($v['dirname'], '/' . $var . '/') !== false) {
$tmp[] = $v; $tmp[] = $v;
} }
} }
return count($tmp); return count($tmp);
} }
// Return tag count. Matching $var and $str provided. // Return tag count. Matching $var and $str provided.
@ -1368,7 +1375,7 @@ function popular_posts($custom = null, $count = null)
if ($i++ >= $count) if ($i++ >= $count)
break; break;
} }
} }
} }
@ -1450,7 +1457,7 @@ function archive_list($custom = null)
foreach ($posts as $index => $v) { foreach ($posts as $index => $v) {
$arr = explode('_', pathinfo($v, PATHINFO_FILENAME)); $arr = explode('_', pathinfo($v, PATHINFO_FILENAME));
$date = $arr[0]; $date = $arr[0];
$data = explode('-', $date); $data = explode('-', $date);
$col[] = $data; $col[] = $data;


Loading…
Cancel
Save