|
|

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