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