|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////! c6 m: h+ Y5 D' `# M8 d9 D9 g
// Theme Option
' h' P7 I% X- e3 W////////////////////////////////////////////////////////////////////////////////2 D+ _- _ E, m- [5 Z0 _6 Q
3 o; M) [9 j _+ q$ L
$themename = "Zenx";. L+ L1 n1 E" Y/ m; i ~
$shortname = str_replace(' ', '_', strtolower($themename));9 {7 o9 A6 z$ A+ L
8 I- T/ {. W; \* Afunction get_theme_option($option), {' a p. ?5 W* g8 c0 v
{
3 U6 P9 f0 Q& o9 N) s global $shortname;
5 Y% e3 D/ Q. b4 b' l* J return stripslashes(get_option($shortname . '_' . $option));1 g$ |. V! _' l% n- W; t
}: O" N8 P3 \& ]* v, w1 g' y
4 ~1 i5 Q) Y7 D5 O
function get_theme_settings($option)
6 ]3 O A; s2 E- T6 c{9 A7 ]" |5 H, J" N O
return stripslashes(get_option($option));
- G$ D5 {# i& z3 |8 \}8 t5 x+ w% m2 A( q
$wp_dropdown_rd_admin = $wpdb->get_results("SELECT $wpdb->term_taxonomy.term_id,name,description,count FROM $wpdb->term_taxonomy LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id WHERE parent > -1 AND taxonomy = 'category' AND count != '0' GROUP BY $wpdb->terms.name ORDER by $wpdb->terms.name ASC");0 |/ K9 H" o1 G5 s' ?# P8 H
$wp_getcat = array();
3 y! C0 O& @* G# m- D# U- Y, \foreach ($wp_dropdown_rd_admin as $category_list) {8 |2 I# j$ G& v
$wp_getcat[$category_list->term_id] = $category_list->name;
" v0 c* c5 d# p}6 j6 q9 ^4 X4 P2 A0 S2 F
$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
2 F+ ^5 `% m1 L5 k$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");
& Q5 p9 b. d8 T O1 E% q1 W7 W$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");( V( h4 S J( S/ n0 p9 v
+ q Y3 b6 b$ ~2 |( d% F$options = array (( i. q; t5 Z2 p. {9 e7 n* t& l
+ j1 c# _0 L8 m5 }9 _$ i
! d3 y% x+ x* V* x3 H. A0 y' C array( "name" => "Blog Header Settings",8 t+ T: ` s4 w) ]
"type" => "heading",% B5 H$ x6 \1 e% S% k9 ^
),
! L. K9 c. j/ F/ L( C
$ W; q; m9 j& b0 b array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
6 O, m( M6 k& H! C8 h/ h "id" => $shortname."_header_logo_activate",4 J e& w. |) B- Y9 V7 ~8 |/ x2 \
"type" => "select",
: N! e% A. o) }7 z9 a; t) q "std" => "No",
( y6 C! S$ i% S; } "options" => array("No", "Yes")),: L. c& P6 [/ H6 F8 S: y# G
6 d# a) x6 O6 Q3 v! M- B6 h array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",' ^* E+ H$ {9 M2 w. i: `) \
"id" => $shortname."_logo_url",9 K+ H! a" ~4 ]$ B, \0 E& T# Q- c
"type" => "text",6 [( Z# S; Q) ^" J
"box" => "social",0 v+ Q( \' b& y: E# q0 l+ L
"std" => "",
8 M7 O, f; H0 u+ p7 c6 Y ),
7 W, N* Y2 x% h, c: q& w: x ( T. g; w% }! u+ j" w3 T1 K) Z$ \
array( "name" => "Insert Header Banner HTML Code (Header)
* F, T Q8 H" \8 t/ `# D) K <br /><em>*Recommended Size 468 x 60</em>5 Q# M' a1 |* @. R) _
<br /><em>*leave blank if not use</em>",5 |7 L# a8 b. `
"id" => $shortname."_header_banner",
3 _. x. y x6 Q" b4 w4 N "type" => "textarea",
1 Q$ l; w* T* U x& s! \ "std" => "", T2 ~7 J% N' {; Q2 {* C
),
7 o# Q& c. i7 x7 U3 M) M; z$ V
' ?) s6 a1 Y+ X9 ^ array( "name" => "</div></div>",6 E5 v6 {' E" S% j) e+ _' I8 n
"type" => "close",
- o* P% a! P: l ),, a6 j) Z$ V( k, Y
. l0 b) s7 T9 g9 N8 B1 i% H- X3 `( g
6 a" j& |9 [' O" } array( "name" => "Header Navigation Settings",8 S* B7 {# Y1 W
"type" => "heading",! I& Z$ o" Z4 i/ ~' Z- L# n: P
),
- \' k3 u/ Y+ B9 B) w* r
7 ^& {6 O5 P9 l2 M) J" B1 C array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
1 b6 n, l/ |! S <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
" N! Y# i& y, B9 g: q* h- N5 @) {8 P# ?8 G <em>*Enter the page post ID number only</em><br />% v/ E. z, H# W2 t) |# z1 O
<em>*separate by comma</em><br />
- }" A; V9 A1 Q* m <em>*Exclude pages which you don't want to show on the header navigation</em>",
4 o7 z4 I. I, n "id" => $shortname."_header_page_navigation",5 A; V8 U7 ?6 I5 j {
"type" => "text"," {, x2 Y. l4 x. A, B5 }. A
"std" => "",) [0 `7 l/ m1 e
),3 H, Y' g4 U) e2 r8 B. d& v
7 e2 }, X% _( T) N, w! i array( "name" => "</div></div>",
' {0 n& {+ U, C "type" => "close",
+ j0 C% n# q( f( C K- _ ),; z+ [) n7 ^- }; ]) ?
3 ]) B& D4 {, A; c# t8 h( z0 y2 B! } N0 Z( T1 o2 m0 ?- g
array( "name" => "Post Auto Thumbnails Settings",
& A! [- |, ]# J$ S6 e "type" => "heading",- b: M5 `9 Y. k& G
),. c# c; a8 B/ g, H% ^) v' A
: S. r) n& x3 C8 @8 Q
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",5 r, A8 d, u- i; h5 M8 G( i: U+ |
"id" => $shortname."_timthumb_activate",% b; A5 N: D, X' p: L3 @
"type" => "select",% U \( j/ r- y. s& d& C
"std" => "No",# U) D# q+ x3 t2 |
"options" => array("No", "Yes")),+ _0 c- ]1 e' G" i' [
% D, J; E$ R9 \% E" } array( "name" => "If Timthumb is enabled, Please choose its cropping method",- b& S. w- N& A9 @9 K) E
"id" => $shortname."_timthumb_cropping",
. N7 D8 @, S3 [- n. W4 N' O' ]' S "type" => "select",* i* D. [8 `' w2 \$ j- i8 b& \* [
"std" => "",
- N. T1 y* m. D* x. v3 E "options" => $crop_position),
3 C- s; {* C4 J+ V9 G9 {6 U2 s X8 L: N5 z5 B! c- C0 I# R1 N
array( "name" => "Insert Width Of Thumbnail Image<br />3 Q5 _. G: {2 _5 E* q
<em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />! G) o' O( e3 b4 {! |
<em>*Leave Blank To Use Default: 250</em><br />",
/ W; @: v& t+ ]8 T "id" => $shortname."_thumb_width",
: ]) Q0 L0 F# U7 K' }: ^' i "type" => "text",
: _; b( z! `) a! }+ } "std" => "",
6 q: M9 z' ~" C! y7 U ),( O0 J+ {( d1 a- J/ d$ {- t
1 ^" [* r7 H! V; u: K
array( "name" => "Insert Height Of Thumbnail Image<br />
( d1 |2 L+ d& Q' N7 S <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />& Q; S f4 |; s* a$ x! W1 q" v
<em>*Leave Blank To Use Default: 200</em><br />",. |' b8 C2 o) h' H
"id" => $shortname."_thumb_height",
: ^$ E/ U6 A [. h) | "type" => "text",
& k# E1 j( B: P1 E8 a. U! ?% n "std" => "",* H d* j- d( `& q6 i8 u
),
M2 x; O1 f% F1 |) C) x2 k+ P, s! L: {/ [' @
array( "name" => "</div></div>",
1 D% |3 k( t$ h. ~* i "type" => "close",. ?( F( A# I1 I/ ^1 M
),) b* Z5 u0 C. T) ?
- U3 P. H% Y" X% d' K4 f array( "name" => "Featured Content Slider Settings",% ~$ ]) Z. T( C& ~' W) ^& ?4 f
"type" => "heading",8 I+ |' F" {+ z
),
5 S" x y3 ]2 ~, l' }% g3 T% ^/ T& J) a
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
* ~' L) ?4 c$ X: j. ? "id" => $shortname."_featured_activate",
* k8 D7 b# `9 u9 S$ f, j4 f2 l "type" => "select",& w' j m6 O) I
"std" => "No",
7 Q% ]$ N; x5 ^ "options" => array("No", "Yes")),4 D& N1 q( _- n
4 @+ C: V0 \ Q1 F
$ l, ]# B; T- O2 K array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",
/ B( m7 r+ `. H7 l "id" => $shortname."_featured_category",
- w: O# s" K! j/ f' B5 Q7 v "type" => "select",* A+ k3 V' _8 u, }4 C* Z
"std" => "Choose a category:",
1 y; w8 E9 j: ]' d/ ~# Z "options" => $wp_getcat),2 o7 O# S) l. {# P6 S
( C7 U6 v2 z6 U" _ array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
1 S# p6 G0 ^, F0 s "id" => $shortname."_featured_number",
) Z0 \$ W; T4 r "type" => "select",
0 H* _( ?4 @" I: @8 ?0 ~. ~ "std" => "Number of post:",- J. [6 k# q5 ^$ T* t0 K5 j, e
"options" => $number_entries),
8 v/ q+ u: J, \ p6 w! e( e+ ]$ _% E% y: L
array( "name" => "</div></div>",3 r4 T; e7 y/ P& u) K4 M
"type" => "close",
# v5 F0 X+ [5 ` _! i( l0 @ ),# n& S8 a0 {4 y& M
; N( b }8 H! K# m4 f4 H* f array( "name" => "Featured Category Settings",2 A8 {7 F1 _8 l0 ^3 n# ]
"type" => "heading",
4 @, a# I+ I5 [ ),) j6 ]2 s2 V$ T! C8 _! }
9 ]4 S6 `4 [' R }: O- U
array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
9 v, J ]' ~! e3 B "id" => $shortname."_featured_category_activate",
: q) N4 M, Z+ {. |" \# q8 T K$ V "type" => "select",
7 V Q4 q% L# h( z0 }. I; @8 J "std" => "No",0 w9 [% m" X/ A* P# o
"options" => array("No", "Yes")),) O6 n- {9 ~' L( I% Z- q
; K! n9 I- u. N! [! D3 {
array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
8 T3 k9 x; Y( ?: } "id" => $shortname."_featured_category_id1",+ y& L6 A! w8 b/ N
"type" => "select",( }- f7 R$ D! y7 g5 G4 {
"std" => "Choose a category:",( O6 S8 ^2 B, v5 T; g+ c
"options" => $wp_getcat),
' O, Y4 ?4 y2 z, W/ ?/ ~/ y
; ]$ ~8 ]( S! G8 X- z array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",) s# n. Y0 P2 k. e3 E7 f
"id" => $shortname."_featured_number1",& }8 I1 L2 j) S b
"type" => "select",
: z" l$ V% X) m, X) I: y- c) Q1 J "std" => "Number of post:",
! e' K# E& S& Y8 z "options" => $number_entries),7 x: k* N5 u P$ J; ?
6 I5 j# B/ O* k; @( `* T; [ array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",, V: Y( V% O7 }
"id" => $shortname."_featured_category_id2",
8 N V1 ?0 x3 B+ t "type" => "select",7 J: y( Q, k0 ^" a$ F" \
"std" => "Choose a category:",
* X! V5 w4 E* O' c! ~2 S5 F9 L$ M: _ "options" => $wp_getcat),
& z4 T7 ?. I( E
" L9 V9 b4 _. y" X# j- T3 V8 y" w/ V( @ array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
+ V3 e/ s# w$ p( R "id" => $shortname."_featured_number2",
) c) ]; X% M# [" M% Q+ ] "type" => "select",
- L' d9 Q% v, A, y "std" => "Number of post:",
. @' U Z$ l0 F- ~! u3 C "options" => $number_entries),
" C* R+ s: j& W" A7 g( | : `; u% G1 x! t- M$ u
/ j% g1 V6 E3 ~# x. W2 F' }' f array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",
6 Q! [* V% f, l( k0 r- c H "id" => $shortname."_featured_category_id3",7 m! K, i5 u, [. D. M+ K
"type" => "select",! i5 c- ^4 v5 M0 z6 W& X
"std" => "Choose a category:",) m% V, V6 s% l2 g4 \
"options" => $wp_getcat),
( p8 `. U8 C$ C
. k6 X' u6 D& n" U( ^8 |/ O array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",$ W A. B# T. Y) U3 p4 X7 x# m
"id" => $shortname."_featured_number3",
+ X; i" l, s- l& e# A5 D' z "type" => "select",/ [4 Y( F0 i( y" r. e- O4 B: f
"std" => "Number of post:",
" X2 e6 l7 k! d& w: y( n, C "options" => $number_entries),
" e2 F: M9 l( m' H% h$ ?/ c; J
0 ?+ _: ~5 H/ q6 Z! h& i) I* D0 G" G3 r9 ]; K/ V: W" P' T
array( "name" => "</div></div>",
# F& ]# r6 @1 y! y. \' X# s( x" J "type" => "close",- n. Z: w' s" R" q& O8 R x: v
),
+ T: T: B/ }$ Z7 {" A$ }
5 B& ?3 S) C2 A% |
$ l, e3 Q9 ~5 p& V0 i3 d array( "name" => "Google Adsense & Analytics Settings",
. p5 g+ x- [$ }4 l: T "type" => "heading",
" t+ A1 L1 |: W" p l2 Q$ D9 ]$ u ),0 I$ W! W6 F9 n# J, M
2 R; E# ^# F/ d" w: _
array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",% P; P4 V- y9 |0 P0 S3 r, j
"id" => $shortname."_adsense_loop_activate", L6 q5 J2 v" k" H4 Y
"type" => "select",
8 g1 D9 z- a+ C$ k7 ` "std" => "Disable",! t7 A8 { U0 q* I# {& v) ~2 q8 ^
"options" => array("Disable", "Enable")),
7 M- l. a E$ i* j: B
/ K S4 l$ b X, o% o* Z0 Q array( "name" => "Insert Google Adsense Code For Loops Here<br />
! {; C; @# r' ]) G. M <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
! N* Q: X4 v, M5 b2 Q "id" => $shortname."_adsense_loop",
' y L# n3 R6 d/ r6 X5 k* m "type" => "textarea",5 f3 G8 i8 W( d, u4 b2 O V/ E" i
"std" => "",. y: S) J |! u4 _4 m' B
),3 G& c- R L' N6 F! y( v/ t
. O7 b1 e+ J; M% A% S% ]
array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
7 n2 N4 H! d) t% J# k5 d% L "id" => $shortname."_adsense_single_activate",6 v, R* Z/ o$ T+ }3 I8 X/ C; M0 R
"type" => "select",; B5 ]! a( n( @) i; ~% Y
"std" => "Disable",. L. \0 Z% T/ a7 A, e1 k/ r0 O. V' p
"options" => array("Disable", "Enable")),5 V3 s9 n ` s) z R5 e
- ~$ c, N) O# M1 z
array( "name" => "Insert Google Adsense Code For Single Page Here<br />
" J8 C L3 Z8 v* Q <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
* u W: u7 Z: Z8 y& {) E "id" => $shortname."_adsense_single",' G5 I% _0 x) D l& ?
"type" => "textarea",9 N1 k; X. n E- O* e9 B- q
"std" => "",4 Z8 b4 c( D+ j% H: D; `# w, P
),7 w/ S1 j1 L# q- T
/ _) n. ?/ j- P9 w8 u; K/ h5 {! N3 I5 T# ]
array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",9 @9 n& |" C) s$ M
"id" => $shortname."_google_analytics",
! E/ s3 O% @: P# W% _ "type" => "textarea",% e& @6 @- v( K
"std" => "",0 A) Y a+ S% F' @5 h
),
0 e3 t: {! O3 r* H
: P% Q) | u: y5 j! {8 W array( "name" => "</div></div>",
+ a4 {! t2 z$ `6 o4 H4 L "type" => "close",
' r% N9 x9 S8 B* K6 x ),# `) J) U* J8 N9 O+ S" F& P
2 X' r" u: ~, C* ~! Y* o
, m) _& k9 Z4 j9 K. j array( "name" => "AddThis Social Bookmarking Settings",
; I# o% K5 M, Y1 A- Y M, m) L "type" => "heading",, G* {& V, \; R# M3 l8 \3 `
),
5 j5 o7 g. h1 Y- I
, O/ c) c. s9 F. m8 u- X' V3 `& R; I8 p array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>! k3 z8 N- e( W: B* V0 S. p
<br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",
5 Z5 q' `1 P1 E "id" => $shortname."_addthis",0 I+ S" @+ K" R: e: j# N+ {
"type" => "text",
3 T, M/ |5 O/ x! ~' l "box" => "social",
, n2 {7 e2 @) e0 Z "std" => "",
% i! o: m# V6 ] ),
1 Q+ @8 _( z0 ], B2 q, k
+ g$ w0 M9 i( v5 J; z array( "name" => "</div></div>",
) s5 d! Z$ Y9 e& V6 J8 `2 P# w "type" => "close",
: `/ C; g& Z J+ P. a0 B# t" b! z2 [ ),
, P; f* P1 d4 k. w# x- j. I " z0 ]3 B' z4 v. h. u
6 a1 Q8 q& A3 Z$ Y - c2 U! x% b7 h" R/ c! C1 ^
array( "name" => "YouTube Video Settings",0 ]! Y5 T0 I% z$ G
"type" => "heading",% K; J" e. v( z& G- Y
),( M7 ]2 @" u8 C; x3 H: R, h; e
* X/ F) a. x4 v9 p2 \! M# n
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
" n) K6 L- j/ m% S L1 w# ? "id" => $shortname."_emvideo_activate",
3 L# j2 H8 c* ] "type" => "select",
# r* G/ Z. H" ^9 z$ G( Z) t "std" => "No",& U9 a4 D$ E* g+ ~1 ~, B+ V! t4 B; e
"options" => array("No", "Yes")),
$ a$ q, {# z1 C8 P1 h& X3 |
( f, P9 D/ ^" \% ^ h2 [/ B array( "name" => "Insert YouTube Video Unique Code<br /><em>*You can find videos to embed on <a href=\"http://www.youtube.com\" target=\"_blank\">YouTube</a> site.</em><br /><em>i.e. Youtube - http://www.youtube.com/watch?v=<span class=\"redbold\">Hr0Wv5DJhuk</span></em><br /><em>*Only Insert The Red Bolded Code Inside Below Setting Box.</em>"," e- J' m& B$ X, A, x
"id" => $shortname."_emvideo",: i1 T4 I& e) X- q. ] Z
"std" => "",
' H$ P7 ^+ H. p! l+ Z "type" => "text"),+ r% W2 Q* F- S- J/ k" w( \
" m/ a: B' v+ b3 e# a# Q array( "name" => "</div></div>",
9 L7 d0 r+ H5 W# v* v5 a "type" => "close",
) G2 t3 x6 Y% i& ], b+ _ ),
( {4 }+ E* i9 h1 |6 s8 N
; Q* Z0 c. x9 M/ k7 M2 Q2 { array( "name" => "Twitter Settings",! }& T4 h: Z- @! K' m3 X$ c+ [
"type" => "heading",
7 @, i2 P; J0 @5 L% D ),0 B" u, F* `; E5 a8 L, z5 k8 A
2 u8 K( `* k# _! D% n
array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",$ `: u! O7 M3 I: K# ` v
"id" => $shortname."_twitter_activate",$ K4 C% a4 |- ^4 z7 m9 E/ F
"type" => "select",
- l( B% n/ Y* h7 F "std" => "No",
$ W; g3 E, P* K- O2 i5 i2 G "options" => array("No", "Yes")),0 X# N+ P+ }9 w
4 k8 e) x+ V7 o1 d* |3 u array( "name" => "Insert Your Twitter ID here* E+ h6 m' C# G/ P
<br /><em>*leave blank if not necessary</em>! v8 `% C% x$ r! l: R9 t
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",( ?" H- D. _! [
"id" => $shortname."_twitter",# `3 j: ?4 T' I: g) ^* g; z
"type" => "text",
$ a; {. u9 \6 E& U) }' ^ "box" => "social",6 m+ S, c: \9 z; r1 t6 O
"std" => "",. ~0 v3 V& L& G2 \2 h# c9 z6 t; i
),, k6 o9 ]: }: i# f; p
$ C' l1 a: X- T3 l array( "name" => "Enter Twitter Feed Count here
8 ]+ u& @* a" \/ B( u <br /><em>*leave blank if not necessary</em>4 D8 u1 b/ \3 w/ w3 e7 q
<br /><em>*Enter How Many Twitter Feed To Display</em>",
6 d! u: T( \; f/ N: H3 X "id" => $shortname."_twitter_count",) K- `, ~& m D3 ~- \. M
"type" => "text",9 A0 z8 b6 {: E8 K+ `* i
"box" => "social",
0 ?) a/ K" B7 [% x$ Y+ A "std" => "",
. @ Y9 z& K" ~* f6 k/ C' i* j ),, k, Z' t' G$ y0 n9 P. l
& Y4 k: A0 w! J0 x array( "name" => "</div></div>",
G$ \. @% ?; p+ a2 U6 i8 b G "type" => "close",4 h% `# _* D1 Q& c5 T8 ]1 `
),+ b. B5 Q" z2 H7 R6 j$ e' q) d
# C! W! C. A! P4 |1 J4 h. p
3 _* U4 @6 \0 U( p4 L- m/ w array( "name" => "125 x 125 Banners Advertisement Settings",
; G* t5 D$ z5 X5 t2 I8 b, j+ p "type" => "heading",! @9 C+ v3 K: K, ^
),
( C1 @* A, ?+ p. A
# [! I4 [: h$ d- x. u- M! S* s array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",9 Z8 ^/ I u$ [- d# V. H' B
"id" => $shortname."_sponsor_activate",
# d' W: V. Z% B! Y/ I "type" => "select",
2 Z: d9 M( r, P( ] "std" => "No",+ W/ O( A) E v9 K
"options" => array("No", "Yes")),
8 e& p* L- H/ W) H, l1 d5 h ! Y( M- W) ]2 w+ K$ w+ M) i5 ]6 o
! o! o1 @* v% T* k" M7 |! A1 m
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
3 m5 [/ e5 q5 ? "id" => $shortname."_sponsor_banner_one",
, t( ^" [9 J" ^. N "type" => "textarea",( r5 ]! o4 z: t. B$ X4 e/ f
"std" => "",2 y( y5 ]. r6 H' H; k
), 9 `, M; z/ y# J+ h8 t8 o
, V$ f# K# p( j, E- E array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>"," J* C" V5 j; d# i6 g+ t
"id" => $shortname."_sponsor_banner_two",
# D+ L( h; {* a) [ "type" => "textarea",
% _) P) i9 p. u "std" => "",7 }, S+ [$ D3 B3 A" Q, ]
),
6 x& H. x6 D9 q. n5 _3 `: Q5 R
# Q# v5 R0 k. b3 h. M( k, I array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",
/ j. j7 h- G' ]' a9 ^9 { "id" => $shortname."_sponsor_banner_three",
7 ^. D/ g& s9 w7 X) y* `3 Z0 C "type" => "textarea",; ~4 C: {5 W! ^ ~7 R
"std" => "",
$ @# ?' x( k( w% z% i: O! _2 c ),
V6 Z+ `* b# P, {' ^8 | ?$ B, F( [( g M0 L2 Q, A3 ?% |
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
9 P/ j- Z" y1 a ] "id" => $shortname."_sponsor_banner_four",. i i! ?) ]5 m$ ~2 x2 V7 W# V
"type" => "textarea",
9 _' c; s) e& R, ~0 q "std" => "",& H% P; y" k- D
),
0 \3 `0 Q+ v0 p- K% I
# j/ Q; |+ O2 m; V2 N array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",, T" }7 X9 L1 H: D4 `
"id" => $shortname."_sponsor_banner_five",! O7 p( i; s' y: B" I; j, B+ r0 u
"type" => "textarea",6 g9 A( u- h7 v, f2 Y t* q
"std" => "",8 c1 X- d1 l: Q
),9 l8 R& S. O J, }% L+ ]
, w( ~6 f/ b. R! E$ v# a% o. ~/ G
array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",
, p( W$ H8 g2 u3 ?. r "id" => $shortname."_sponsor_banner_six",
; E" g b% x% j: o "type" => "textarea",
: Y: Y, m- P; A$ Y "std" => "",: H5 U$ O# @( U6 \; S) U
),
2 p A& s- m* t0 n& u) s: W" r4 Q+ I1 e9 X. U0 S0 |
array( "name" => "</div></div>",
5 B+ |( n' h8 R' P7 v "type" => "close",5 h% ^4 q; {# a9 v% @7 Z
),: t# t$ Z/ }$ u' m2 z! T
1 P( Q7 q5 _( M# E7 h1 _' H7 r
. h' ?$ \8 |# N+ M5 \3 L8 G+ P* t3 f$ b! }* |
);1 M. N( ]' g7 w) t
0 B9 v+ s4 }( |. S; V
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {
" j5 T$ y" j3 G1 W% _1 ?% q
1 V0 A L9 o0 [" M: _+ G0 ^) W' n, j2 secho "<div id=\"admin-options\"> ";
9 o) J- L! q0 O' t9 l
- w1 d% \& r- B$ g* Vglobal $themename, $shortname, $options;: U1 |& k/ s6 \$ W3 ?# J2 H
if ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';7 t8 u2 [0 S) g) L" u5 K: E V
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';# G( Z& H, | @) ]* S
?> O" i! W+ ]( ? G% J
% X8 K+ B* f9 N- y<h4><?php echo "$themename"; ?> Theme Options</h4>
2 z4 W# o" N5 o" g; t! {3 f" | h4 u
<div class="annouce">- T# Q# g) G$ M4 s) r+ b0 m
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
8 S1 K1 ?' P" |' g- l2 V& d<p>Don't Forget to <a href="http://feedburner.google.com/fb/a/mailverify?uri=MagPress&loc=en_US" title="MagPress Newsletter" target="_blank" rel="nofollow"><b>Subscribe Our Free NewsLetter</b></a> In Order To Receive Theme's Updates and Fixes.</p>
; ^/ y( `# n5 x f: W</div>5 Z) L& x2 S, ?: z2 z1 l
: F6 B$ y2 O3 C) v" v4 c
<form action="" method="post">
0 }% N. z8 f, ~. y- g5 {' _% P% `; n* O3 [# ?
<?php foreach ($options as $value) { ?>
0 t7 ^# j! O& A- J% A* ~
' y: U/ O m& q8 n<?php switch ( $value['type'] ) { case 'heading': ?>% e2 z' g, q8 X2 j3 V5 g
6 {% h/ g/ ?" T4 R! \
<div class="get-option">
4 ?5 e1 w3 \/ U- E1 z- T2 Q. J5 q. V$ \
<h2><?php echo $value['name']; ?></h2>
4 j) v% v3 k" ]5 Q/ W+ t5 N6 Y2 L# [
y' {3 f' Q$ o7 q+ ?; b( |<div class="option-save">
7 W6 D( ~3 S5 r
5 e- V5 x- d, |: C, A y- K<?php* B8 q5 k, U, q _9 d* D# k+ k" u
break;
# u+ F# k! I, C) G# v, lcase 'text':, Z8 T+ \8 R8 E/ \( W
?>& S; m8 B' r1 x0 i3 p
! O; o! ~) E7 {<div class="description"><?php echo $value['name']; ?></div>
$ `% }% X8 X+ g$ k0 d: B<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
- `" Y5 x0 P8 Q& j; T- E) K! e4 ]% u# D
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>& t: ^9 \8 Q! i8 p# k+ |1 t# |
/ N, ~" w2 t" p( t<?php: _$ L1 c9 \2 _, A& n3 B3 U
break;
2 R0 s; s' T( \9 D0 \! Hcase 'select':" z# ?' S* `& a, e4 S
?>
4 r; n8 |# r% _# O2 e4 M7 Z
2 F8 l6 k6 R4 \7 n$ T$ L$ K<div class="description"><?php echo $value['name']; ?></div>
8 I5 G, R: k1 L9 D! }) _7 T% e3 T<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">3 w n2 t: l# E' y& ~6 E, y
<?php foreach ($value['options'] as $option) { ?>1 F0 @" n& J8 p' c" F0 T5 Q* P2 E7 o
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>4 {: O: y/ Q3 a+ T6 M4 g' |7 ^
<?php } ?>
9 [/ `" z5 x4 J+ C9 L8 a- \</select>9 D( `$ ?5 H% u& H- P( s
</p>. {! d' K* f; a+ @( W: G" D, \
) g* N: w: z) X
<?php& d8 L2 b* K; Z1 T/ P: u
break;7 }$ F6 J! B5 f3 V8 I/ a
case 'textarea':1 I3 ]0 \- w4 \9 X9 }
$valuex = $value['id'];
7 V& ^+ U/ z, ^. }$valuey = stripslashes($valuex);$ b: }6 A$ I% h
$video_code = get_settings($valuey);5 A7 H+ c' M" g$ ~( Y
?>
9 J+ k7 a3 K8 \9 T
: `7 s; n, m. P2 e<div class="description"><?php echo $value['name']; ?></div>
' ?# ]+ N' a7 p<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
! E4 [' ~: J1 u4 s7 `6 B* \0 I% }% x/ S1 L) w" V1 T: _/ k
else { echo $value['std']; } ?></textarea></p>$ n c3 ?9 ]: z, K
; [! R1 q- R& t, h T2 E5 O<?php/ j7 f% g- d* K
break;( K1 K/ [0 @* K1 V$ w" O
case 'close':- o# B w) S" s/ O, f' ~
?>
m' p$ j& q8 Z: d- ]. O& B' E/ {! x$ r1 D+ Z
<div class="clearfix"></div>
- O: E+ j6 W3 Y, [2 S! U7 h0 I# y</div><!-- OPTION SAVE END -->3 C% G8 o* G% j8 w$ @+ X* L$ | J7 y4 g
, t* H& h" U4 y<div class="clearfix"></div>( V; B( \7 x4 ~# n+ k( G( B
</div><!-- GET OPTION END -->9 l5 p9 W- X' |. }& g1 X8 j* y8 J
5 K# o2 {4 j* ?& I$ l<?php
/ A. D* g/ r$ ?( Z- v% `' |! `8 ubreak;
6 L! S& ~ s3 Wdefault;
5 `+ F/ @' R! s7 [?>7 e! S" a( o( g6 H% b; N
4 N- R; Q6 W- ^
+ J: z6 k( L$ ]5 j; ^
<?php' i: h# f8 x0 x! X. T6 X/ B& D
break; } ?>
4 i! E; U9 H6 N0 ?. W, s1 T4 x i6 ]* I4 \" i# B4 u0 e7 E
<?php } ?>
/ o3 J! @" q8 ^# I* g# ^% q$ _5 |3 F, i) I3 v0 o
<p class="save-p">8 s3 N& _) {. o$ h- b O# d
<input name="save" type="submit" class="sbutton" value="Save Options" />
3 Z* }# K& K( k<input type="hidden" name="action" value="save" />
9 k) n, ~4 b+ M7 M3 `</p>
, a# ^1 h2 @$ u7 J</form>
/ Q0 h. n6 {4 z9 s- X$ a& V, }8 q* g! f, ]& r0 `1 J2 x n1 Z* s1 _
<form method="post">0 B7 J8 ^" q6 o) n
<p class="save-p">" l: L0 l- S/ p* R& a% y4 n& R
<input name="reset" type="submit" class="sbutton" value="Reset Options" />: M0 b3 X: g+ K" D
<input type="hidden" name="action" value="reset" />
7 Z. r, v& g6 v) J( I" n) g</p>4 [+ }, ]8 X" r( ]
</form>1 r8 \7 X6 L, o$ V( `- }
6 C$ z! Z: @/ _: t</div><!-- ADMIN OPTIONS END -->& a' |/ Y( Y4 ?! Y) {1 n& f5 c! F" ?
" D$ l4 B- q1 Y4 l
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }$ V# q' J) B8 _+ t, Q4 U) c4 `
) P* W' ^7 ~* U, D0 Yfunction mytheme_admin_register() {
) C; t! D2 I6 z9 k# {9 Rglobal $themename, $shortname, $options;
$ g' S; K3 }0 e0 L9 w3 ^if ( $_GET['page'] == basename(__FILE__) ) { z, D" v# c. b, d& }$ A
if ( 'save' == $_REQUEST['action'] ) {
4 W1 X7 M7 _, {' |; k5 Cforeach ($options as $value) {
5 D" D0 a" ?: n6 Yupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }
3 y. R) \+ c3 R2 Q O& Y) qforeach ($options as $value) {
: D9 l/ {! S" Q0 X7 \: G2 |if( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }3 L+ F2 b, v) n% m& O3 t* k
header("Location: themes.php?page=functions.php&saved=true");
0 Q7 ^$ @) W; ]" `die;; W b) D: M9 M+ i1 A. g) a$ y3 P
} else if( 'reset' == $_REQUEST['action'] ) {5 g8 k' |( o# d. ?& X$ T6 G
foreach ($options as $value) {3 A. U" F; @) m& `3 @7 R0 K
delete_option( $value['id'] ); }$ u2 i; y! T$ v
header("Location: themes.php?page=functions.php&reset=true");* |7 w( C0 w$ ^$ ~9 Y# |
die;
A" T4 l5 ^0 N. k8 g" j. X, Y}
3 ?& g9 ]5 @- I}
& I v* L! y- g+ T2 P. z& Yadd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
( t0 x; v6 P8 T* I' D) x6 n}* j% o1 d0 ~* N0 W; M
$ [# W: p- g/ m7 C. dfunction mytheme_admin_head() { ?>
2 G2 n$ H. c. x$ M7 h! d* l3 L7 [<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />
7 X6 g6 U$ W- M<?php }
# B6 _2 S! ~' J; @6 ?5 h |
|