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