|
|

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