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