|
|

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