|
|

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