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