|
|

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