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