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