|
|

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