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