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