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