|
|

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