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