|
|

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