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