|
|

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