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