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