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