|
|

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