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