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