|
|

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