|
|

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