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