|
|

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