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