|
|

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