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