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