|
|

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