|
|

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