|
|

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