|
|

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