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