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