|
|

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