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