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