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