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