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