|
|

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