|
|

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