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