|
|

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