|
|

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