|
|

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