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