|
|

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