|
|

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