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