viewing source for "fancy-archives-ui.php"

last commit

commit 7780b7260c3088044dd3a52b28f15424a4e9f7e2 Author: root <root@a04a6e75-5819-0410-a511-8dafea38c924> Date: Thu Feb 8 00:05:13 2007 +0000
Added option to display pages with posts Modified everything to newest version number

source code

001: <?php
002: /*
003: Fancy Archives ver 0.5
004: Copyright 2006 Andrew Rader
005: 
006: This file is part of Fancy Archives
007: 
008:     Fancy Archives is free software; you can redistribute it and/or modify
009:     it under the terms of the GNU General Public License as published by
010:     the Free Software Foundation; either version 2 of the License, or
011:     (at your option) any later version.
012: 
013:     Fancy Archives is distributed in the hope that it will be useful,
014:     but WITHOUT ANY WARRANTY; without even the implied warranty of
015:     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016:     GNU General Public License for more details.
017: 
018:     You should have received a copy of the GNU General Public License
019:     along with Fancy Archives; if not, write to the Free Software
020:     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
021: */
022: 
023: 	check_admin_referer();
024: 
025: 	if( isset($_POST['info_update']) ) {
026: 		if( isset($_POST['expand-current-year']) ) {
027: 			fanarc::enable_expand_current_year();
028: 		}
029: 		else {
030: 			fanarc::disable_expand_current_year();
031: 		}
032: 
033: 		if( isset($_POST['show-year-count']) ) {
034: 			fanarc::enable_show_year_count();
035: 		}
036: 		else {
037: 			fanarc::disable_show_year_count();
038: 		}
039: 
040: 		if( isset($_POST['show-months']) ) {
041: 			fanarc::enable_show_months();
042: 		}
043: 		else {
044: 			fanarc::disable_show_months();
045: 		}
046: 
047: 		if( isset($_POST['expand-current-month']) ) {
048: 			fanarc::enable_expand_current_month();
049: 		}
050: 		else {
051: 			fanarc::disable_expand_current_month();
052: 		}
053: 
054: 		if( isset($_POST['show-month-count']) ) {
055: 			fanarc::enable_show_month_count();
056: 		}
057: 		else {
058: 			fanarc::disable_show_month_count();
059: 		}
060: 
061: 		if( isset($_POST['expand-months']) ) {
062: 			fanarc::enable_expand_months();
063: 		}
064: 		else {
065: 			fanarc::disable_expand_months();
066: 		}
067: 
068: 		if( isset($_POST['show-comment-count']) ) {
069: 			fanarc::enable_show_comment_count();
070: 		}
071: 		else {
072: 			fanarc::disable_show_comment_count();
073: 		}
074: 
075:         if( isset($_POST['show-pages']) ) {
076:             fanarc::enable_show_pages();
077:         }
078:         else {
079:             fanarc::disable_show_pages();
080:         }
081: 
082: 		if( isset($_POST['show-post-title']) ) {
083: 			fanarc::enable_show_post_title();
084: 		}
085: 		else {
086: 			fanarc::disable_show_post_title();
087: 		}
088: 
089: 		fanarc::set_post_title_length( $_POST['post-title-length'] );
090: 
091: 		if( isset($_POST['show-post-title-ellipsis']) ) {
092: 			fanarc::enable_show_post_title_ellipsis();
093: 		}
094: 		else {
095: 			fanarc::disable_show_post_title_ellipsis();
096: 		}
097: 
098: 		if( isset($_POST['show-post-date']) ) {
099: 			fanarc::enable_show_post_date();
100: 		}
101: 		else {
102: 			fanarc::disable_show_post_date();
103: 		}
104: 
105: 		fanarc::set_post_date_format( trim(stripslashes($_POST['post-date-format'])) );
106: 
107: 		if( isset($_POST['show-post-number']) ) {
108: 			fanarc::enable_show_post_number();
109: 		}
110: 		else {
111: 			fanarc::disable_show_post_number();
112: 		}
113: 	}
114: ?>
115: <div class=wrap>
116:  <form method="post">
117:   <h2>Fancy Archives Options</h2>
118:   <fieldset name="Fancy Archives Options">
119:    <legend><?php _e('Display Options:'); ?></legend>
120:    <ul style="list-style-type: none;">
121:     <li>
122:      <input type="checkbox" name="expand-current-year" <?php if(fanarc::get_expand_current_year()) echo 'checked'; ?> id="expand-current-year"></input> <label for="expand-current-year">Leave Current Year Expanded by Default</label>
123:     </li>
124:     <li>
125:      <input type="checkbox" name="show-year-count" <?php if(fanarc::get_show_year_count()) echo 'checked'; ?> id="show-year-count"></input> <label for="show-year-count">Show Post Count in Year Links</label>
126:     </li>
127:     <li>
128:      <input type="checkbox" name="show-months" <?php if(fanarc::get_show_months()) echo 'checked'; ?> id="show-months"></input> <label for="show-months">Show Month Link</label>
129:      <ul>
130:       <li>
131:        <input type="checkbox" name="show-month-count" <?php if(fanarc::get_show_month_count()) echo 'checked'; ?> id="show-month-count"></input> <label for="show-month-count">Show Post Count in Month Links</label>
132:       </li>
133:       <li>
134:        <input type="checkbox" name="expand-months" <?php if(fanarc::get_expand_months()) echo 'checked'; ?> id="expand-months"></input> <label for="expand-months">Month Links should expand to show Posts</label>
135:        <ul>
136:         <li>
137:          <input type="checkbox" name="expand-current-month" <?php if(fanarc::get_expand_current_month()) echo 'checked'; ?> id="expand-current-month"></input> <label for="expand-current-month">Leave Current Month Expanded by Default</label>
138:         </li>
139:        </ul>
140:       </li>
141:      </ul>
142:     </li>
143:    </ul>
144:    <b>Note</b>: Note, Posts are only shown if either the Month links are set to expand, or if Month links are disabled.
145:    <ul style="list-style-type: none;">
146:     <li>
147:      <input type="checkbox" name="show-pages" <?php if(fanarc::get_show_pages()) echo 'checked'; ?> id="show-pages"></input> <label for="show-pages">Show Pages together with Posts</label>
148:     </li>
149:     <li>
150:      <input type="checkbox" name="show-post-number" <?php if(fanarc::get_show_post_number()) echo 'checked'; ?> id="show-post-number"></input> <label for="show-post-number">Show Post Number in Post Links</label>
151:     </li>
152:     <li>
153:      <input type="checkbox" name="show-post-title" <?php if(fanarc::get_show_post_title()) echo 'checked'; ?> id="show-post-title"></input> <label for="show-post-title">Show Post Title in Post Links</label>
154:      <ul>
155:       <li>
156:        <label for="post-title-length">Limit Title Length <small>( 0 for full title )</small>:</label>
157:        <input type="text" name="post-title-length" id="post-title-length" value="<?php echo fanarc::get_post_title_length(); ?>"></input>
158:       </li>
159:       <li>
160:        <input type="checkbox" name="show-post-title-ellipsis" <?php if(fanarc::get_show_post_title_ellipsis()) echo 'checked'; ?> id="show-post-title-ellipsis"></input> <label for="show-post-title-ellipsis">Show Ellipsis in Shortened Titles</label>
161:       </li>
162:      </ul>
163:     </li>
164:     <li>
165:      <input type="checkbox" name="show-post-date" <?php if(fanarc::get_show_post_date()) echo 'checked'; ?> id="show-post-date"></input> <label for="show-post-date">Show Post Date in Post Links</label>
166: <?php if( fanarc::get_show_post_date() ) : ?>
167:      <ul>
168:       <li>
169: 		 <input name="post-date-format" id="post-date-format" value="<?php echo fanarc::get_post_date_format(); ?>"> Format (<a href="http://codex.wordpress.org/Formatting_Date_and_Time">Formatting Docs)</a></input>
170: 		</li>
171:      </ul>
172: <?php endif ?>
173:     </li>
174:     <li>
175:      <input type="checkbox" name="show-comment-count" <?php if(fanarc::get_show_comment_count()) echo 'checked'; ?> id="show-comment-count"></input> <label for="show-comment-count">Show Comment Count in Post Links</label>
176:     </li>
177:    </ul>
178:   </fieldset>
179:   <div class="submit">
180:    <input type="submit" name="info_update" value="<?php _e('Update options', 'Fancy Archives'); ?> &raquo;" />
181:   </div>
182:  </form>
183: </div>