|
|
楼主 |
发表于 2013-1-17 17:37:25
|
显示全部楼层
////////////////////////////////////////////////////////////////////////////////
6 U! X' a0 ?* {( m; ~9 m// Theme Option
$ W7 R+ w+ t/ e! T+ Y////////////////////////////////////////////////////////////////////////////////2 w) `( K. Q5 h' V6 s7 s
1 {, u @& j" P/ [# `; L% g/ _
$themename = "Zenx";; I1 ?3 Z* J8 N: M9 S: c! o6 a
$shortname = str_replace(' ', '_', strtolower($themename));6 O' E/ @! U9 r, y; t
' g& o" z4 g: Xfunction get_theme_option($option)
+ @$ \! |" g5 Z$ V% i% ~{' q5 X2 u' z0 ?; _* g# w
global $shortname;
- w9 N+ p) }: q" l* {/ I* z return stripslashes(get_option($shortname . '_' . $option));
7 z% l5 v& g: I1 h}9 R7 O0 Y; E( w, ]+ l8 V& @+ B; k
6 ^# t& E0 C% `% R/ t
function get_theme_settings($option)
1 O. F9 C' j! R/ `) W{" P/ e- J8 V0 x3 I
return stripslashes(get_option($option));
, C3 H8 J. H! M' l- G}
3 I2 M1 a) V, p$ @0 n A$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 o0 O: @0 P& F% W2 Y- z
$wp_getcat = array();0 E( ^ ?) q9 V% t/ m6 |$ B
foreach ($wp_dropdown_rd_admin as $category_list) {
o! @4 _# I1 H: T$wp_getcat[$category_list->term_id] = $category_list->name;% d. O; s# o2 o% g
}
2 c2 k3 b) w' J$category_bulk_list = array_unshift($wp_getcat, "Choose a category:");
: J# r4 n8 I7 J) Y7 l) \1 C7 F e$number_entries = array("Number of post:","1","2","3","4","5","6","7","8","9","10");, E! v* O/ O" |4 y
$crop_position = array("Choose Crop Position","middle","middleleft","middleright","topcenter","topleft","topright","bottomcenter","bottomleft","bottomright");. b- W6 q1 |2 w) p
1 P2 U6 o3 @( L' O
$options = array (2 o3 P; I& h. E7 k3 x! j
. c3 B& W$ K( F) v1 p) \6 r+ Q% D3 r% I7 ]+ J! r, k2 d* N4 C
array( "name" => "Blog Header Settings",
, @% X* _( j9 G9 ^7 e "type" => "heading",
5 o! N9 ^$ Y% l9 o4 }; D% l ),
" i& J, }" R) {! ?8 e( f0 }$ C1 [- q1 u$ b+ t. h5 P" @
array( "name" => "Use Custom Logo On The Blog Header?<br /><em>*Disable by default, Choose Yes to enable it.</em>",: E" p N" `& ?
"id" => $shortname."_header_logo_activate",/ \5 U' a8 q4 |0 [8 w/ A0 U" A
"type" => "select",
" F$ t1 t/ D* o "std" => "No",
& U. e9 N6 z. a0 |( c "options" => array("No", "Yes")),
) S- J, F7 u* j1 F- n9 F" {( J. r y9 S- p9 H8 k
array( "name" => "Insert The Full URL Location Of Your Logo Here <br /><em>*leave blank if not use</em>",/ }; u' ]* }0 `4 ]$ W/ h" G6 R
"id" => $shortname."_logo_url",* d @5 u! P N |
"type" => "text",/ o# E/ b1 E) i! L" P
"box" => "social",# m( t9 c) W' [ t
"std" => "",& i# e0 U: r0 K; i( n% e* w1 D
),9 W; ]- D( c: I6 V
% H! p# e% B1 |5 o
array( "name" => "Insert Header Banner HTML Code (Header)
7 E5 _5 C' v# S C$ ~+ q* y; F5 l <br /><em>*Recommended Size 468 x 60</em>
0 f( P o; L3 @! W9 P K <br /><em>*leave blank if not use</em>",8 h( L0 d( V5 B% G# ]
"id" => $shortname."_header_banner",- q1 K) u8 F! O
"type" => "textarea",
' i3 c: ^9 p% M$ x( M! Q# F "std" => "",
0 d! |* u, D( e6 Y c3 U# w ),
$ _- M/ Z: u6 q( m/ R1 t# T
) T) [' h \, b' V array( "name" => "</div></div>",
: g2 s9 v/ m1 R0 L2 D "type" => "close",
. P; c7 U- ?$ U0 n5 P ),1 t, k$ v3 O+ x# {0 K
/ H5 E" z- b6 W4 w
1 r" T [6 H' g |1 w( j& r5 q
array( "name" => "Header Navigation Settings", [# S. F. M$ f2 e. T
"type" => "heading",
7 w) u, x; }5 ]3 Y# X ),
. Y6 W/ v& L7 K" ~" D1 g0 r" A% J" w( D6 I2 J+ l
array( "name" => "Insert Page ID To Exclude On Header Navigation<br />
+ @; d# R; M: O9 r9 x6 z6 W4 Y <em>i.e ../wp-admin/page.php?action=edit&post=<span class=\"redbold\">123</span></em><br />
1 T+ ^* \7 }& ?2 y0 A! o' F$ A <em>*Enter the page post ID number only</em><br />& |: `) t9 [+ a- Y/ R6 r+ @
<em>*separate by comma</em><br />
% H9 J. i, Z) O <em>*Exclude pages which you don't want to show on the header navigation</em>",
, O7 _( Q2 j0 n9 `$ g4 r$ A: @0 q3 l J "id" => $shortname."_header_page_navigation",& N0 A. w! w% m0 |. v% t! v% \
"type" => "text",/ L4 a2 J2 |5 n' v9 s
"std" => "",
J' |8 n# v" t6 D/ [* U ),
$ L% u# G) B" B+ H
: u# r/ R* d0 B) n ]" C1 [$ C array( "name" => "</div></div>",
* y& ]; n# u+ Y "type" => "close",9 a& {1 v j$ O& c: u
),9 ]0 V; t! B8 {2 x. M4 r
( S2 h4 a: V& P, ]& X, t/ k0 d) e% v
$ y* k$ B A8 A/ n2 r array( "name" => "Post Auto Thumbnails Settings",0 m" t$ s( u6 v2 u% ~
"type" => "heading",
, S* c: x _8 c( i ),8 T- O+ f" i7 K$ m2 P! Y/ e' E3 X
; k6 p: g/ } o; Q0 _" Y! C; F% M
array( "name" => "Use <strong>Timthumb Script</strong> For Auto Thumbnails?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
/ h9 U1 J V9 E) M7 I) y: G ?- m "id" => $shortname."_timthumb_activate",2 y$ V0 b: @. D: ^
"type" => "select", M: I0 C8 `! L1 Y
"std" => "No",; X! c& K- |" e% U- n
"options" => array("No", "Yes")),
$ k- }+ i8 Z+ @; ] z4 W0 k: D / ?, }1 k! Z* |6 D Q* _, g
array( "name" => "If Timthumb is enabled, Please choose its cropping method",; Y' ^) H0 j! m6 y' k$ R i; G
"id" => $shortname."_timthumb_cropping",
, d2 F" b2 [/ g( g8 v1 m "type" => "select",9 z& v% r: \& {" ?% m. s- r
"std" => "",
4 P" I+ ]- l+ A" J0 O I; \ "options" => $crop_position),: I# v: ^! h" s) x
( r! m8 e6 _) e
array( "name" => "Insert Width Of Thumbnail Image<br />
& r+ b) L, ]; {+ L <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
+ Q1 g5 Q" {% }/ c: k8 m <em>*Leave Blank To Use Default: 250</em><br />",& X3 L9 o1 L8 Q) v
"id" => $shortname."_thumb_width",
& O; r" o" c6 s, L4 E& A) m. b; B "type" => "text",8 G3 c; r z$ p p
"std" => "",
1 C7 c) `/ l- a0 `7 U% g ),0 ~7 I+ q J6 O, G7 ?
3 y0 }3 l5 j( F2 g. r
array( "name" => "Insert Height Of Thumbnail Image<br />
! \7 m& ? u1 I- H( V <em>i.e. <span class=\"redbold\">88, 100, 150, etc</span></em><br />
2 [/ ?7 ^2 g( H4 ^' ^ <em>*Leave Blank To Use Default: 200</em><br />",( x& w$ n. U! ]( ]- e
"id" => $shortname."_thumb_height",
1 f' X/ a. G: r2 \' O; f "type" => "text",) m, G: S5 U, T8 U3 g
"std" => "",
/ t1 C+ Q& k8 h' X( O ),1 e; I1 ~5 n2 ~% b3 K9 h1 v) k
- T5 p5 z( W$ S
array( "name" => "</div></div>",
) q) x: G! R3 ~6 f "type" => "close",. Q6 _, Y3 b" S/ z) r$ Z. n a
),# E5 J. @! X" m' \
" x1 L. ?9 D1 }9 R array( "name" => "Featured Content Slider Settings",
. J+ ^! ~1 L+ N3 U "type" => "heading",
4 S9 V L- o2 n$ B. _* D% D! J5 ^ ),6 O( k: g8 m( l ~' B
9 e1 v+ ^# b3 J' S
array( "name" => "Enable <strong>Featured Content Slider</strong> On Homepage?<br /><em>*Disable by default, Choose Yes to enable it.</em>",9 w7 {5 a ~2 `3 K! a$ j3 e6 v
"id" => $shortname."_featured_activate",
% n- u% Q9 m. c! n7 F5 b! @( L) g "type" => "select",! v ?8 V- E0 T- Y# j* w
"std" => "No",
0 H+ m8 ~% u8 a, e/ v( o "options" => array("No", "Yes")),4 g: q% e+ {4 i" Z
. `8 Z; o; F g8 q3 w$ W4 p/ o6 W' I4 v, x; @5 p; k
array( "name" => "Choose Which <strong>Category</strong> To Put On The Featured Slider?",8 V [) C/ n# i$ r6 X( O5 t2 N& Y
"id" => $shortname."_featured_category",
8 i) S" R/ Z9 X$ @8 d "type" => "select",( w7 ]( F6 M# m8 H6 w# m
"std" => "Choose a category:",
% S: Y: P+ R2 {: l6 I "options" => $wp_getcat),- o, z* W* `* D7 O3 P
. ?- X( R% B$ [4 F0 A' h array( "name" => "Choose How Many <strong>Post</strong> To Show On The Featured Slider?",
" p/ K! [1 l) n. @- o$ O# t9 e "id" => $shortname."_featured_number", }. ? v' G4 P. Y* Q/ u9 m
"type" => "select",
% o2 a" ?0 Y8 T" ?" o$ T) a "std" => "Number of post:",
' b1 Q0 ]2 U6 I1 I5 F% K" v8 f1 c "options" => $number_entries),
' x- d% M _1 W) l* I; ?7 R' {! D
array( "name" => "</div></div>",
& }( z" D7 W% v7 w n+ V "type" => "close",5 [5 E+ S" ` H/ \0 k+ q
),
' B- j4 p& H1 N$ { / N* Z$ x; m, }+ _+ v
array( "name" => "Featured Category Settings",4 q5 \/ |3 B8 z5 G3 H4 c
"type" => "heading",! @0 w9 `. u! D& Y# s( e
),/ J* c" M. @9 G( ^9 k& y( O0 u
; M1 B j+ u/ w, d2 T4 A array( "name" => "Enable <strong>Featured Category Showcase On Sidebar</strong>?<br /><em>*Disable by default, Choose Yes to enable it.</em>",
& e. s2 ]0 y+ v T4 J, w "id" => $shortname."_featured_category_activate",3 h7 G s# z. ?% Q0 Q8 b& h9 W
"type" => "select",
0 i% [7 w- d _- i" K3 m6 E7 a. _) { "std" => "No",' W' S7 Q% j2 g% O+ P R
"options" => array("No", "Yes")),
( Q- T0 [2 Q, R4 ^3 D
0 e ^" ]( ]8 b array( "name" => "Choose Category To Feature On 1st Block?<br /><em>*Leave it as default if not use.</em>",
# H3 o, [1 M) |/ s: V8 M "id" => $shortname."_featured_category_id1",
# V8 U; `4 A* S4 `7 @ "type" => "select",
6 v. u' I6 F: C0 a, R: b "std" => "Choose a category:",
% [6 b/ q/ M( A, M; q& B "options" => $wp_getcat),$ ~8 `$ c% d9 N: b& b& H, ] X
8 G1 E U, \0 h" z array( "name" => "Choose How Many <strong>Post</strong> To Display On 1st Block?<br /><em>*Leave it as default if not use.</em>",
+ c- }$ p+ R( F" @$ |/ Q9 g4 A2 } "id" => $shortname."_featured_number1",
4 ?, |0 J8 K5 r8 L "type" => "select",2 R0 q% U" o/ J' E4 t9 w) o
"std" => "Number of post:",
, |4 W% {; _0 {: L+ I "options" => $number_entries),5 w2 W' j( n1 W: \' y p0 ^( H
" g* M9 }( K# L( ~; _& @
array( "name" => "Choose Category To Feature On 2nd Block?<br /><em>*Leave it as default if not use.</em>",) h- | h$ s8 N, n0 c; {
"id" => $shortname."_featured_category_id2",7 @6 Z) S: h+ b* o3 l: ?
"type" => "select",9 m/ Z) A% u C
"std" => "Choose a category:",
0 W1 Y D+ _2 o5 r6 x) m "options" => $wp_getcat),
, g1 i3 j' @( _! q, V2 V
& c+ k& X% C# h" D7 e# r: k: F8 C array( "name" => "Choose How Many <strong>Post</strong> To Display On 2nd Block?<br /><em>*Leave it as default if not use.</em>",
% P2 j/ l I6 X- [/ N "id" => $shortname."_featured_number2",9 J9 m8 s! _) G: V3 `% v
"type" => "select",
( K' r# j- ^7 B7 C9 c$ L" F "std" => "Number of post:",
$ Y4 w6 g: B9 b3 V4 T "options" => $number_entries),% V- I) G" ^9 Y" q" X0 B6 P
3 v- c. k1 C( j% @* m
7 Z n3 H0 o% g" `
array( "name" => "Choose Category To Feature On 3rd Block?<br /><em>*Leave it as default if not use.</em>",% u( v; F1 e+ r/ Y0 E, t
"id" => $shortname."_featured_category_id3",
* m x: b! F, b* z& P$ h "type" => "select",
4 Z& Z' ]- y' e* ?. w- `% X "std" => "Choose a category:",
* t4 o$ u1 N# z+ i% ~/ O$ e3 H% r( C "options" => $wp_getcat),
% \5 i8 R2 ]8 B 8 L' r# k0 @$ _5 b
array( "name" => "Choose How Many <strong>Post</strong> To Display On 3rd Block?<br /><em>*Leave it as default if not use.</em>",4 {; y: a+ @- T, U( v, \6 u
"id" => $shortname."_featured_number3",
" Z ]9 |# ]4 u" s6 b "type" => "select",
% m( ~# @5 U) n7 C "std" => "Number of post:",
: T$ B2 l6 K: r "options" => $number_entries),
: j6 B' p4 ?% m6 | b' c7 ~2 J, F# m+ _# I. _" G& ]# e2 P
% ^. ^8 X/ [' ^8 g+ F/ A6 H4 `
array( "name" => "</div></div>",
% E9 n- z! ~5 ]+ p "type" => "close",4 Q, ?6 z$ E. Y& v
),/ A/ g( i3 L! p j6 Z) ~9 @
5 ]- j% u: B" s7 ?" _- r+ H
& g3 K5 A% s. V8 ^9 q6 r$ U array( "name" => "Google Adsense & Analytics Settings",
( o8 g1 {+ K" c! p4 |4 |! Y "type" => "heading",
( A6 v5 C/ J7 l. v ),- A* \5 W2 W( e6 W; M
1 f2 \: Z& F( R. [$ J/ {6 } array( "name" => "Enable Google Adsense Loops Within Posts<br /><em>*default are disable, you can activate it by choosing enable</em>",4 i% p+ B: ]; e3 p* W
"id" => $shortname."_adsense_loop_activate",9 |9 y- B8 K9 Y, t4 e& w
"type" => "select",, Z% E+ n+ V" F; ~$ r; E. L; A0 ~3 d: T
"std" => "Disable",& E& p7 ^5 C$ n" b
"options" => array("Disable", "Enable")),+ {' v d3 g1 A
; y4 u m- Q [% R
array( "name" => "Insert Google Adsense Code For Loops Here<br />0 ]3 f7 z. ^; H' ?
<em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",# w) U8 A( p3 y. k+ @& M7 q& K0 c
"id" => $shortname."_adsense_loop",3 w+ O, O6 X) j) b4 Q' m
"type" => "textarea",! V! D3 H4 j3 W! t. w
"std" => "",! y4 z' @$ u4 w$ Z
),
% e' q; y+ E+ E1 F
5 f5 q4 J7 H" o$ g( l array( "name" => "Enable Google Adsense On Single Page<br /><em>*default are disable, you can activate it by choosing enable</em>",
; [0 e2 P; D3 ~# x "id" => $shortname."_adsense_single_activate",1 x+ |) Z& H. V3 Y- G
"type" => "select",; b$ Z2 \2 q$ k+ ]% `
"std" => "Disable",
5 |9 C. z9 H: B0 ~ L+ x2 A "options" => array("Disable", "Enable")),
9 Q6 z) _" Q+ {. F' p9 V6 V! J, b' ?* Y1 K5 |' w( B9 w Z9 L
array( "name" => "Insert Google Adsense Code For Single Page Here<br />
9 A2 @( U+ w% W8 M' C <em>*Copy & Paste Your Google Code Or Affiliate Network Banner Code Here</em>",
; j8 M8 P5 S3 P$ S "id" => $shortname."_adsense_single",) d% S# @+ `: w( M
"type" => "textarea", y7 S, U+ l; R8 } s3 w
"std" => "",. w3 v9 Q" Z3 ]& s0 c" x
),
7 A, m. E8 Y# E W- x4 Y% R$ G. M) n2 h* }% Y. s7 T# a# b
7 v. F! b! o% t7 |, w array( "name" => "Insert Google Analytics code <br /><em>*optional - leave it blank if not using</em>",1 `- Q) u: Q5 D/ _
"id" => $shortname."_google_analytics",
0 x7 q. ]* P8 w& |4 [- ~# G5 ~0 e "type" => "textarea",
. F" n/ m( q: ^) n" D2 Z$ ~ "std" => "",
8 E& D* T2 n9 u, o( @5 F ),; c& e M& k2 b& Z/ P+ g
0 _7 F: i4 B q: I- w7 e0 v array( "name" => "</div></div>",
0 w. r L" k6 T, _0 y "type" => "close",8 B5 p3 P! F9 H% c) m% N9 ?
),% \! J8 q* v% D' t" g- y) C7 k+ V
7 m/ t" ^6 x6 @$ h . C4 H9 @) p0 j4 F8 y" @5 H8 `
array( "name" => "AddThis Social Bookmarking Settings",) _: d& b$ ?, |7 m& d, q
"type" => "heading",
4 }0 a; k' [8 G1 L/ R8 C ),
* P- o# K5 C# R( Q$ K0 J
, X6 B) D v E3 G- Q array( "name" => "Insert you AddThis ID here (Only For Tracking Purpose) <br /><em>*leave blank if not necessary</em>
7 }/ t) L& K9 M) V& P5 H% a" W <br /><em>*Get a Free AddThis ID <a href=\"http://www.addthis.com\" target=\"_blank\">here</a> if you don't have one</em>",$ k3 V9 e+ [4 u1 S
"id" => $shortname."_addthis",
" L) E' t0 q' M* X T- x8 } "type" => "text",6 t q# b$ e/ f( Z: Q. K3 {
"box" => "social",
/ P1 x; e$ S* n" l, U, O "std" => ""," B2 U; j& e4 o1 f
),7 y8 i4 N) ]# q& C
; e$ a; q" q, Y array( "name" => "</div></div>",0 \2 M1 v1 O0 j# ?5 D9 b9 G R
"type" => "close",* Z k8 w. ?. ^
),
( D+ q2 j* Y5 o f) \5 [! j
! \% c* R' \0 t/ z2 J+ j
5 u+ @' d2 o& J- d9 n4 \ * K! _: T$ p( |- I7 o1 G2 x
array( "name" => "YouTube Video Settings",# s* u8 q K# t8 J
"type" => "heading",$ G' H4 [2 v; j3 P5 Z
),
5 b% \# C1 X) v5 v/ C- W; h3 f4 E: j/ b8 _9 `
array( "name" => "Enable <strong>YouTube Video</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",! a* f+ k6 |2 E4 i3 h" y
"id" => $shortname."_emvideo_activate",
) l- X% [" n8 Q3 a "type" => "select",
* v! i) _1 n, q9 `/ G# [ "std" => "No",
7 W6 _% |1 }2 e X" _. I o "options" => array("No", "Yes")),7 b5 c( j5 c" ]; |
7 y; q( H& j: X8 z9 e
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>",
( t3 X1 B* S9 \+ k "id" => $shortname."_emvideo",
% P; v5 B/ I5 F; T' t) L "std" => "",
. m2 ^9 T$ } G/ D "type" => "text"),1 i& d0 o4 b- X; U# R$ i% w( @+ T
Q- ~. m/ p) P" }7 E8 `8 m array( "name" => "</div></div>",
* C! B. _( z% ]& J. T2 @0 T! V "type" => "close",' l% @* t! u* K/ i4 Y
),3 g# k9 a9 v+ b9 g/ O, v' T
6 ]8 c3 {* h& G; o; Q8 q
array( "name" => "Twitter Settings",# w, @0 Z. A, f; ]2 D3 `2 p; }
"type" => "heading",- w9 i7 W1 _8 e* b' q! I( V
),
* z8 ] ?2 i2 U7 n: T; f7 P( O F
" i3 d% l7 _+ Q- L( m array( "name" => "Enable <strong>Twitter</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",- h4 V+ J0 s/ B1 e' Z
"id" => $shortname."_twitter_activate",
9 \" A; {5 l4 l* E9 J- ^ "type" => "select",
) o) l' o5 k4 U h "std" => "No",4 a5 F# R `: I6 ]( Y
"options" => array("No", "Yes")),
! D& T! R% B! y! c2 v; k p9 F
: i/ {, r' M; f9 f% z) X) a- } array( "name" => "Insert Your Twitter ID here
3 M1 d% M) d2 l <br /><em>*leave blank if not necessary</em>6 W2 `$ C! W. x2 h
<br /><em>*Register Twitter for free <a href=\"http://www.twitter.com\" target=\"_blank\">here</a> if you don't have one</em>",
- j! Q& {+ h2 Q) h( H( i "id" => $shortname."_twitter",
0 H; f: t# t' K6 }7 x; L "type" => "text",% L6 s9 C, |! A: J8 m
"box" => "social",: Z+ U/ ^- u* }6 T5 }( D$ m
"std" => "",
2 c4 B6 G) d5 `$ N7 m, l ),1 V c- V g8 H0 d! ]9 W6 U+ F
" m% j- V3 m( W' x. ~
array( "name" => "Enter Twitter Feed Count here1 `. ?9 w. Y9 A7 A
<br /><em>*leave blank if not necessary</em>/ t2 e" L1 u: w( j" I8 S- l
<br /><em>*Enter How Many Twitter Feed To Display</em>",: r' l* B8 Y9 Y1 F7 E# |
"id" => $shortname."_twitter_count",
. }/ N) N: [. i x5 f- q "type" => "text",% {. \3 {$ O3 p( Z' x4 c3 Y6 s
"box" => "social",
% ~, ~( @/ \) z, \4 } "std" => "",. E2 _$ H! ~# l: ^. Z
),$ z/ u% ^4 M6 z$ K* J. } J
. o# M* P1 L5 c( H3 |. A9 R6 L7 ` array( "name" => "</div></div>",( N8 P1 V: Q6 K% Y( Z" C' D- q
"type" => "close",
5 B6 Q+ g$ J7 T& b L ),
, G$ T' ~% `1 c8 }- B) R
* H/ X- L+ @4 M" q. W; ^! \5 G3 [* B+ y9 X3 S) N0 h6 t x% N
array( "name" => "125 x 125 Banners Advertisement Settings",
( x7 M) h2 {6 g "type" => "heading",2 g7 v6 T( j2 P" R Q
),- t1 X) t, G. _) k
o' W" L9 H3 J+ k" ~; _2 N' m
array( "name" => "Enable <strong>125 x 125 Banners</strong> On Sidebar?<br /><em>*Disable by default, Choose Yes to enable it.</em>",/ n/ P8 r# a9 d. I+ c8 }1 P1 }' y
"id" => $shortname."_sponsor_activate",. _3 X2 K3 x2 j9 P. f& A! Q
"type" => "select",6 \& w8 Q9 {) @4 h9 g% ^
"std" => "No",/ V3 d d# m! z9 ~ {9 h
"options" => array("No", "Yes"))," S6 K! _9 t8 p0 l* w2 s
- G* V* R8 o2 E* L' G1 V7 P
9 x8 v8 T; C0 I+ B" C3 f' z
array( "name" => "Insert Sponsor Banner One HTML Code<br /><em>*leave blank if not use</em>",
6 u6 W/ U7 i; `/ e8 u "id" => $shortname."_sponsor_banner_one",
$ x$ V+ F9 ~5 N$ @9 q7 Q "type" => "textarea",
8 d: h5 ]' f F9 S8 \: k "std" => "",
9 G8 ?& X. ~$ M ),
2 N& Z6 p; @# ]: X# T2 a: O2 k0 P) H
array( "name" => "Insert Sponsor Banner Two HTML Code<br /><em>*leave blank if not use</em>",
/ P$ n; }; W. J7 m "id" => $shortname."_sponsor_banner_two",; N. }+ S! l4 L( v" P& j
"type" => "textarea",
* a( y# ~3 m9 ^" R; _9 } "std" => "",
4 ^$ E y- e n% g# Z ),
1 ]" S- o+ }3 z; b' m9 W
) u9 D* ]' t; @- l9 v% ~4 a' l array( "name" => "Insert Sponsor Banner Three HTML Code<br /><em>*leave blank if not use</em>",, U2 a' @8 c# B/ O
"id" => $shortname."_sponsor_banner_three",3 I1 K* D8 |2 X1 c: k
"type" => "textarea",# u# H2 p& F1 O, _' B v
"std" => "",
+ [ v7 V9 a# q! l9 `0 K- w( T ),
( d. j2 }$ j# g; Z k2 f+ I f( Q& S( R" p5 g j3 K! K
array( "name" => "Insert Sponsor Banner Four HTML Code<br /><em>*leave blank if not use</em>",
5 D/ ?2 U' P* ?7 L "id" => $shortname."_sponsor_banner_four",
( z( a! b' M' o. H "type" => "textarea",
) D2 W" y I C& R$ P0 H "std" => "",
3 ^! k8 z; f; V; B' y ),
) ~. d: M1 a% t: C" G+ O
6 v$ `! a7 M+ u array( "name" => "Insert Sponsor Banner Five HTML Code<br /><em>*leave blank if not use</em>",& @: S* z$ r K" X
"id" => $shortname."_sponsor_banner_five",4 H- a" C$ j* Q# h9 f1 y1 ]
"type" => "textarea",
1 B b* b: b5 ~8 V- `, H; P "std" => "",
: @' v0 l" L3 e3 G1 ?$ L7 r+ K- r ),8 h% d* s% c1 s: \
# D3 i3 M* m. F. d: S array( "name" => "Insert Sponsor Banner Six HTML Code<br /><em>*leave blank if not use</em>",8 m: k6 A# b3 D! k$ J* d, B+ {! ^
"id" => $shortname."_sponsor_banner_six",8 d5 m6 @$ O3 `/ V V$ |3 V
"type" => "textarea",/ D; K7 d! F$ c* s( \
"std" => "",
$ A9 V, j9 b1 R$ H( b b \ ),
, l, ^+ p9 W9 k& x w6 ]1 P5 V( d, J2 }' v
array( "name" => "</div></div>",( H4 W% v- ~( O ?8 f/ B6 ~
"type" => "close",
% K, j5 f) F+ [4 h* }- O& e1 o/ m ),3 |5 \6 l: O ^
9 i5 B. M% }3 R& z5 y& a% c
1 V2 q f2 C. ^3 u+ C
2 m5 u. }2 @. D1 s" a: D);; t9 t* {. D, m) A
; U5 F; q% I8 Q- |8 E- c7 o
function mytheme_admin_panel(){ if ((function_exists("check_theme_footer") || function_exists("check_theme_header"))) {4 F ~( B* E' g! H
* T- Y! l$ P# m) Iecho "<div id=\"admin-options\"> ";
0 K, m, X4 E. F7 [$ } [$ y0 p0 r# L2 d/ I6 O
global $themename, $shortname, $options;
& o. f& [+ d. ^6 L1 Dif ( $_REQUEST['saved'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings saved.</strong></div>';9 a/ j0 {. |- F# `5 U+ _
if ( $_REQUEST['reset'] ) echo '<div id="update-option" class="updated fade"><strong>'.$themename.' settings reset.</strong></div>';/ v# j( r. S; {$ d' m8 J3 s* C
?>3 C) ?; [/ t% H
( I+ s1 f3 ~$ Q" \7 C
<h4><?php echo "$themename"; ?> Theme Options</h4>3 u: _7 C% P/ `) k6 t: {
7 F% v) L0 C; y( t# M7 _5 x7 O<div class="annouce">" r2 I: u: p& o0 E2 Y* K
<h1>Thank You Using Our <?php echo "$themename"; ?> WordPress Theme</h1>
+ J- n" D7 `0 X* e. q6 \& s<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>2 n- \* n* ]% w1 c- W- ~
</div>; R: W+ C+ ^; F" i8 s
?: y* G, B) {- A
<form action="" method="post">
! r+ A6 A+ l/ E& S6 D; |' e8 ]8 |3 \8 F/ u
<?php foreach ($options as $value) { ?>
9 l1 P! w9 Y V5 I6 m+ ?! }2 x- R- p ~
<?php switch ( $value['type'] ) { case 'heading': ?>
: _7 H5 S- ?, B8 q. ]4 l( Q1 `( K) o5 h/ m. S* m4 |. d$ l
<div class="get-option">
' w& m- T& q/ I! H' z$ B% e+ F0 \0 r1 ~- ^5 Z
<h2><?php echo $value['name']; ?></h2>& X8 p N* n! |0 p9 N8 y" w
/ G/ p" A j7 C6 T' f: {2 k& m
<div class="option-save">& w. ^" X c0 U7 s- ^0 W1 w
& k1 i7 L5 h& R* i c2 I9 ?
<?php& Q' }( c0 C- U" R7 V2 y' M V
break;7 `, O+ A; F! D6 d/ g) E
case 'text':% B1 ]8 H' @. u! @. C# @2 ~
?>
4 T6 `1 O6 b+ R5 L
, d. S; o* F$ ]" k5 I- A! e<div class="description"><?php echo $value['name']; ?></div>3 k/ Q. j. C5 V
<p><input name="<?php echo $value['id']; ?>" class="myfield" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (
1 T8 i# m+ ^6 R& f! ]0 I1 N3 F5 q/ t3 N! A
get_settings( $value['id'] ) != "") { echo get_settings( $value['id'] ); } else { echo $value['std']; } ?>" /></p>- E( d0 k2 I+ U+ S( W6 n) D
h3 Z" A+ z: L7 l6 E
<?php8 }7 Y7 L, J/ A* f" S/ V
break;
( o$ h! [3 @! u& Pcase 'select':# `( b) [% r! l+ s9 x3 j
?>
4 L7 I3 C" h9 ?8 q# J/ C/ U% d) L( Z" @
<div class="description"><?php echo $value['name']; ?></div>" F# b/ H( N+ ?
<p><select name="<?php echo $value['id']; ?>" class="myselect" id="<?php echo $value['id']; ?>">
3 V+ o! z7 h+ u7 t<?php foreach ($value['options'] as $option) { ?>& W. v8 {) N% G- r& t
<option<?php if ( get_settings( $value['id'] ) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option>! r8 d. D- m# Q: M
<?php } ?>
5 D4 w1 Y e" i6 u2 y" z5 W</select>0 t5 H6 g/ e9 Q% M$ l) J
</p>8 ]6 y4 T* a9 J7 Y# Y# {2 v
$ |) R7 ]* U3 y<?php! m5 Z4 Q& j% C; ^; ~/ l
break;, w0 j# c% ]2 H" q2 t+ u
case 'textarea':
- I# M4 Z0 f. P5 D- w( ^1 p0 S$valuex = $value['id'];3 k6 H( K* D, ?
$valuey = stripslashes($valuex);
u. A" |0 p, E; N+ F" d- T! T$video_code = get_settings($valuey);
0 t! i5 L! f: s" B* p% G3 p?>' l/ @6 g1 Q: C& B) v9 O* l7 [
& E; f/ L3 G4 u7 F/ q% S
<div class="description"><?php echo $value['name']; ?></div>
( X: W. Q; _3 t |<p><textarea name="<?php echo $valuey; ?>" class="mytext" cols="40%" rows="8" /><?php if ( get_settings($valuey) != "") { echo stripslashes($video_code); }
5 O8 ]% ?6 B6 a8 c( J/ {) H7 K1 N% K' C+ O! J' R( O- u+ B& p% j
else { echo $value['std']; } ?></textarea></p>5 b" y* t( J* v* B* k; V: m# [
0 O; {& I$ s5 h' ^
<?php
; e4 a7 F( z/ S" N; gbreak;
' x4 w o9 D; p' rcase 'close':7 g% K K; e. E; i2 _6 G
?>( `3 E" Q2 }/ g. `
( k" F6 F3 u9 V
<div class="clearfix"></div>( k9 r( @+ ]$ M6 W
</div><!-- OPTION SAVE END -->+ a5 `8 T5 k' a0 p, x
* z' `, v0 {/ J4 d: t9 u8 s; r
<div class="clearfix"></div>
% h0 e, G7 O, }, E- A8 \</div><!-- GET OPTION END -->
( a1 T4 T8 l( _4 ]2 ?3 Z
4 H/ X7 {/ S4 Q8 A, m( Y* ]<?php
* V1 E9 r3 a1 |7 n7 J/ dbreak;) ]. t* |6 d% C- o+ v
default; n5 J2 ]" a5 c" ~
?>
5 j+ _; M- K/ a. A
! w" g2 ?5 a7 W0 |5 f" K; B0 u. W- J; M2 S3 ~+ k, q4 ]8 }% i
<?php/ w* m) A4 I, g$ F
break; } ?>
% f8 f- q5 j f$ L' n
" y" m" y2 P& f! M( e2 r" h<?php } ?>
$ h. Q2 S9 ^/ E1 D T% r
4 M4 O8 H/ ?& U% c- @. A2 U4 N<p class="save-p">
7 f+ L4 `$ W- g0 D$ f+ d<input name="save" type="submit" class="sbutton" value="Save Options" />
+ t+ w1 j Z. V3 j: ~. q/ O- y<input type="hidden" name="action" value="save" />4 ^% C* Z4 a. ~) f* t1 Z8 M) ?6 Q+ E R/ h
</p>
" }. s9 Z: H4 f6 b</form>
# R0 u4 S* c2 b9 H% m/ N! e. ?% u, l6 S8 B& O, i' h+ d7 I
<form method="post">
! ~% b& U; v3 K' @" c) V7 y7 s<p class="save-p">
, J1 r* c2 w0 W: }' S$ c6 W<input name="reset" type="submit" class="sbutton" value="Reset Options" /> F/ p3 l8 {! _: P% M' P _
<input type="hidden" name="action" value="reset" />
+ Y) N+ t' |& o( x: b: i</p>9 I2 K5 e. }2 ~5 B& l2 Q' F
</form>
' @, Z. Y: s) @4 X8 p; U
* l2 q4 e6 |" F; y& y9 Q</div><!-- ADMIN OPTIONS END -->- N9 ~5 f$ [# y8 q4 I, b/ f$ ]' ~
# M( J6 k* g [/ i
<?php } else { echo ("Well, You Done It..You Just Modified Some Codes!"); } }
& J- i7 G/ ?6 S4 H
/ @2 j7 ]; A& t9 I0 U. sfunction mytheme_admin_register() {
; M6 a g t7 I4 eglobal $themename, $shortname, $options;3 e% Y& X9 |6 z
if ( $_GET['page'] == basename(__FILE__) ) {
& Y6 t a5 ?( J" s& l4 {/ ^if ( 'save' == $_REQUEST['action'] ) {- }' O8 A7 ^' e1 F
foreach ($options as $value) {
0 M& {& M9 A# g# Qupdate_option( $value['id'], $_REQUEST[ $value['id'] ] ); }: k/ ~8 ^: |' {( O0 M
foreach ($options as $value) {
% \/ D- x" a% Jif( isset( $_REQUEST[ $value['id'] ] ) ) { update_option( $value['id'], $_REQUEST[ $value['id'] ] ); } else { delete_option( $value['id'] ); } }
1 u. ^/ s1 i1 `header("Location: themes.php?page=functions.php&saved=true");
' x+ T7 ^% ]+ \2 k% e; ]- Kdie;, f' x& h/ p, a7 ~, }! Y
} else if( 'reset' == $_REQUEST['action'] ) {7 I& K! }4 }# h8 B
foreach ($options as $value) {* t6 M, W: P1 z% S- j! `
delete_option( $value['id'] ); }
1 q; s* S# I! B: N' I2 k1 yheader("Location: themes.php?page=functions.php&reset=true");
! \5 z7 E1 a1 s7 n* K' t$ Y# xdie;
9 \' e+ ^- P: S( t8 U: \' P7 {}
/ q. s: f. ~' q0 k8 Q}
; |3 E" j- @1 h9 ] G9 w9 ^, d* radd_theme_page($themename." Options", "Theme Options", 'edit_themes', basename(__FILE__), 'mytheme_admin_panel');
- v3 D2 P3 u2 Z k& X}$ y4 f% O) y2 I# w: A1 ]1 _
& d/ o* l2 Q; i5 H! z
function mytheme_admin_head() { ?>
X2 y, [! f( H. K6 f, ?8 m! a<link href="<?php bloginfo('template_directory'); ?>/css/admin-panel.css" rel="stylesheet" type="text/css" />9 E$ |) E& q: C3 m& h7 F
<?php }
" Y( v! s+ K/ ~9 y1 @" @ |
|