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