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