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