|
|

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