|
|

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