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