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