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