|
|

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