|
|

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