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