|
|

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