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