|
|

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