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