|
|

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