|
|

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